Commit 63c0189
authored
[inventory] Add health check information for each sled (#9434)
This is the first PR for
#9412
This PR only implements checking SMF service health for each sled. There
will be follow up PRs that deal with adding the data types to the DB.
_NB: This PR is less than 1000 lines, not ~10,000. Most of the changes
here are API JSON additions_
### Manual testing on a simulated omicron
System has two unhealthy enabled services
```console
$ pfexec svcs -Za -H -o state,fmri,zone
<...>
maintenance svc:/site/fake-service2:default global
maintenance svc:/site/fake-service:default global
<...>
$ curl -H "api-version: 11.0.0" http://[::1]:32824/inventory | jq
<...>
"health_monitor": {
"smf_services_in_maintenance": {
"ok": {
"services": [
{
"fmri": "svc:/site/fake-service2:default",
"zone": "global"
},
{
"fmri": "svc:/site/fake-service:default",
"zone": "global"
}
],
"time_of_status": "2025-12-10T08:35:10.604488858Z"
}
}
}
}
```
Disabling one of the unhealthy services should only show a single entry
```console
$ svcadm disable svc:/site/fake-service:default
$ pfexec svcs -Za -H -o state,fmri,zone
<...>
maintenance svc:/site/fake-service2:default global
disabled svc:/site/fake-service:default global
<...>
$ curl -H "api-version: 11.0.0" http://[::1]:32824/inventory | jq
<...>
"health_monitor": {
"smf_services_in_maintenance": {
"ok": {
"services": [
{
"fmri": "svc:/site/fake-service2:default",
"zone": "global"
}
],
"time_of_status": "2025-12-10T08:35:10.604488858Z"
}
}
}
}
```
Disabling the other service should not return any services
```console
$ svcadm disable svc:/site/fake-service2:default
$ pfexec svcs -Za -H -o state,fmri,zone
<...>
disabled svc:/site/fake-service2:default global
disabled svc:/site/fake-service:default global
<...>
$ curl -H "api-version: 11.0.0" http://[::1]:32824/inventory | jq
<...>
"health_monitor": {
"smf_services_in_maintenance": {
"ok": {
"services": [],
"time_of_status": "2025-12-10T08:35:10.604488858Z"
}
}
}
}
```1 parent 09b3715 commit 63c0189
File tree
35 files changed
+10096
-11
lines changed- illumos-utils
- src
- nexus
- db-queries
- src/db/datastore
- inventory
- src
- mgs-updates
- src/test_util
- reconfigurator/planning/src
- mgs_updates
- types/src
- inventory
- openapi/sled-agent
- sled-agent
- api/src
- health-monitor
- src
- src
- rack_setup
- plan
- sim
- types/versions/src
- add_health_monitor
35 files changed
+10096
-11
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| |||
300 | 301 | | |
301 | 302 | | |
302 | 303 | | |
| 304 | + | |
303 | 305 | | |
304 | 306 | | |
305 | 307 | | |
| |||
729 | 731 | | |
730 | 732 | | |
731 | 733 | | |
| 734 | + | |
732 | 735 | | |
733 | 736 | | |
734 | 737 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
0 commit comments