Add 'sesutil show' subcommand to show enclosure and its contents
in a user-friendly way.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 27797 Build 25982: arc lint + arc unit
Event Timeline
Sounds like a cool feature to have. Thanks for working on it.
The man page looks good!
I wonder if it would make sense to try to stripe the trailing whitespace from the serial # etc. The json output looks a little silly:
"model": "HGST HUS726060AL4210 ", "serial": "NCGY0J9S ",
| usr.sbin/sesutil/sesutil.c | ||
|---|---|---|
| 608 | We should use humanize_number on the output size instead, so the JSON output can not humanize | |
| 644 | Ahh, the trailing whitespace is coming from this. You can just change this to: xo_emit("{:description/%-8s/%s} ", e_desc.elm_desc_str, e_desc.elm_desc_str); to skip the padding when outputing 'encoded' (json/xml etc) | |
| 657 | We want the JSON output to have the size un-humanized, so you likely want this as something like: xo_emit("{:size/%s/%zu}", size, mediasize); This will use %s (size) when printing normally, and %zu (mediasize) when printing 'encoded' (JSON etc) You'll need to change fetch_device_details to return the mediasize instead, then humanize the value into size for display. | |
| usr.sbin/sesutil/sesutil.c | ||
|---|---|---|
| 824 | In the "elements" array, we should add a 'type' field Currently, you can't programmatically tell which things are disks and which are voltage/temperature sensors: {
"enc": "ses1",
"name": "LSI SAS3x36 0601",
"id": "500304801f14633f",
"elements": [
{
"description": "Slot00 ",
"device_names": "da24 ",
"model": "HGST HUH721212AL4200 ",
"serial": "8DGNJ3DH ",
"size": "11T"
},
{
"description": "Slot01 ",
"device_names": "da25 ",
"model": "HGST HUH721212AL4200 ",
"serial": "8DGNEJHH ",
"size": "11T"
},
{
"description": "BackPlaneLM75",
"temperature": 36
},
{
"description": "ChipDie",
"temperature": 71
},
{
"description": "5V",
"voltage": 5.00
},
{
"description": "12V",
"voltage": 11.90
}
]
} | |
| usr.sbin/sesutil/sesutil.c | ||
|---|---|---|
| 608 | I've decided to left humanization to libxo(3) itself; this way we don't need to link with libutil. I've also changed it to match what's actually written on the disks. | |