Custom Query (1566 matches)
Results (508 - 510 of 1566)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #1898 | wontfix | JSON output is empty in rare cases (smartctl-nc) | ||
| Description |
I received a report from a user that basically indicates the JSON output from smartctl is completely empty. No opening/closing brackets or any other text is output to the command line. Example command: smartctl-nc --device={DeviceType} --info --get=security --json pd{PhysicalDeviceNum}
This is on Windows 11. I've reviewed the smartctl code, but can't find any clues. This is also a very isolated case and the first time I have seen it, so it may be some system configuration problem, but am hoping someone could point me in the right direction in diagnosing this. Also, the non-JSON commands output without issue. This is strictly JSON related. |
|||
| #766 | fixed | JSON output mode for smartctl reports | ||
| Description |
More and more command line programs now have an option to output information as a single big JSON string. It makes it super easy for anybody to integrate another program or even simple scripts. Pretty much any programming/scripting language can read JSON very easily with only a few lines of code. A good example of one program that does this (of many now) is "exiftool". Adding "-json" to the command arguments will have it output all information in a big JSON string (with pretty print so its not just one long line). For example, the command... exiftool -json /usr/sbin/smartctl Will output: [{
"SourceFile": "/usr/sbin/smartctl",
"ExifToolVersion": 9.74,
"FileName": "smartctl",
"Directory": "/usr/sbin",
"FileSize": "620 kB",
"FileModifyDate": "2014:12:21 05:29:41+10:00",
"FileAccessDate": "2016:11:11 08:02:52+10:00",
"FileInodeChangeDate": "2015:04:15 00:36:10+10:00",
"FilePermissions": "rwxr-xr-x",
"FileType": "ELF executable",
"MIMEType": "application/octet-stream",
"CPUArchitecture": "64 bit",
"CPUByteOrder": "Little endian",
"ObjectFileType": "Shared object file",
"CPUType": "AMD x86-64"
}]
This is a much simpler method of effectively giving the same functionality requested in ticket "#501 make smartctl into a library". And would be usable to a much wider audience, much more easily. I recommend this for any command line program that outputs any kind of information these days. In fact, considering that JSON is quite human readable anyway, I'd even suggest making it the first output format for any new program before bothering to create your own custom ASCII layout. In a lot of cases, the JSON would be all you really need. And anyone else can easily make their own scripts to generate a nicer looking ASCII output if they like. Much easier than doing it in reverse, i.e. writing custom code to parsing an ASCII table. |
|||
| #1896 | duplicate | KINGSTON SA400M8240G | ||
