Skip to content

Commit

Permalink
add more availability endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Sep 23, 2024
1 parent 4ab4d9c commit f7b38bb
Show file tree
Hide file tree
Showing 5 changed files with 971 additions and 49 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ next:
ex.: /hosts/<name>/cmd/note
and /services/<host>/<service>/cmd/note
- add new endpoint /system/cmd/log
- add more availability endpoint ex. /hostgroup/.../availability
- add support for simple calculations in columns

3.18 Tue Sep 10 22:30:40 CEST 2024
Expand Down
173 changes: 173 additions & 0 deletions docs/documentation/rest.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,46 @@ see https://www.naemon.io/documentation/usersguide/livestatus.html#hostgroups fo
lists hostgroups for given name.
alias for /hostgroups?name=<name>

=== GET /hostgroups/<name>/availability

list availability for this hostgroup.

Optional arguments:

* type - both | hosts | services
* timeperiod - last24hours | lastmonth | thismonth | ...
* start - unix timestamp
* end - unix timestamp
* withdowntimes - 0/1 wheter downtimes should count as outages
* includesoftstates - 0/1 wheter soft states should be used as well

[options="header"]
|===========================================
|Attribute | Type | Unit | Description
|host | | | host name
|scheduled_time_down | number | s | total seconds in state down (during downtimes)
|scheduled_time_down_percent | number | % | time down in percent of total time (during downtimes)
|scheduled_time_indeterminate | number | s | total seconds unknown (during downtimes)
|scheduled_time_indeterminate_percent | number | % | time unknown in percent of total time (during downtimes)
|scheduled_time_unreachable | number | s | total seconds in state unreachable (during downtimes)
|scheduled_time_unreachable_percent | number | % | time unreachable in percent of total time (during downtimes)
|scheduled_time_up | number | s | total seconds in state up (during downtimes)
|scheduled_time_up_percent | number | % | time up in percent of total time (during downtimes)
|time_down | number | s | total seconds in state down
|time_down_percent | number | % | time down in percent of total time
|time_indeterminate_nodata | number | s | total seconds without any data
|time_indeterminate_nodata_percent | number | % | time without any data in percent of total time
|time_indeterminate_notrunning | number | s | total seconds during core not running
|time_indeterminate_notrunning_percent | number | % | time during core not running in percent of total time
|time_indeterminate_outside_timeperiod | number | s | total seconds outside the given timeperiod
|time_indeterminate_outside_timeperiod_percent | number | % | time outside the given timeperiod in percent of total time
|time_unreachable | number | s | total seconds in state unreachable
|time_unreachable_percent | number | % | time unreachable in percent of total time
|time_up | number | s | total seconds in state up
|time_up_percent | number | % | time up in percent of total time
|===========================================


=== POST /hostgroups/<name>/cmd/...

external commands are documented in detail on a separate commands page.
Expand Down Expand Up @@ -1299,6 +1339,49 @@ Optional arguments:
lists services for given host.
alias for /services?host_name=<name>

=== GET /hosts/availability

list availability for all hosts.

Optional arguments:

* type - both | hosts | services
* timeperiod - last24hours | lastmonth | thismonth | ...
* start - unix timestamp
* end - unix timestamp
* withdowntimes - 0/1 wheter downtimes should count as outages
* includesoftstates - 0/1 wheter soft states should be used as well

supports hostgroup filter, ex. GET /hosts/availability?hostgroup=foo


[options="header"]
|===========================================
|Attribute | Type | Unit | Description
|host | | | host name
|scheduled_time_down | number | s | total seconds in state down (during downtimes)
|scheduled_time_down_percent | number | % | time down in percent of total time (during downtimes)
|scheduled_time_indeterminate | number | s | total seconds unknown (during downtimes)
|scheduled_time_indeterminate_percent | number | % | time unknown in percent of total time (during downtimes)
|scheduled_time_unreachable | number | s | total seconds in state unreachable (during downtimes)
|scheduled_time_unreachable_percent | number | % | time unreachable in percent of total time (during downtimes)
|scheduled_time_up | number | s | total seconds in state up (during downtimes)
|scheduled_time_up_percent | number | % | time up in percent of total time (during downtimes)
|time_down | number | s | total seconds in state down
|time_down_percent | number | % | time down in percent of total time
|time_indeterminate_nodata | number | s | total seconds without any data
|time_indeterminate_nodata_percent | number | % | time without any data in percent of total time
|time_indeterminate_notrunning | number | s | total seconds during core not running
|time_indeterminate_notrunning_percent | number | % | time during core not running in percent of total time
|time_indeterminate_outside_timeperiod | number | s | total seconds outside the given timeperiod
|time_indeterminate_outside_timeperiod_percent | number | % | time outside the given timeperiod in percent of total time
|time_unreachable | number | s | total seconds in state unreachable
|time_unreachable_percent | number | % | time unreachable in percent of total time
|time_up | number | s | total seconds in state up
|time_up_percent | number | % | time up in percent of total time
|===========================================


=== GET /hosts/outages

list of outages for all hosts.
Expand Down Expand Up @@ -1463,6 +1546,51 @@ see https://www.naemon.io/documentation/usersguide/livestatus.html#servicegroups
lists servicegroups for given name.
alias for /servicegroups?name=<name>

=== GET /servicegroups/<name>/availability

list availability for this servicegroup.

Optional arguments:

* type - both | hosts | services
* timeperiod - last24hours | lastmonth | thismonth | ...
* start - unix timestamp
* end - unix timestamp
* withdowntimes - 0/1 wheter downtimes should count as outages
* includesoftstates - 0/1 wheter soft states should be used as well

[options="header"]
|===========================================
|Attribute | Type | Unit | Description
|host | | | host name
|scheduled_time_critical | number | s | total seconds in state critical (during downtimes)
|scheduled_time_critical_percent | number | % | time critical in percent of total time (during downtimes)
|scheduled_time_indeterminate | number | s | total seconds unknown (during downtimes)
|scheduled_time_indeterminate_percent | number | % | time unknown in percent of total time (during downtimes)
|scheduled_time_ok | number | s | total seconds in state ok (during downtimes)
|scheduled_time_ok_percent | number | % | time ok in percent of total time (during downtimes)
|scheduled_time_unknown | number | s | total seconds in state unknown (during downtimes)
|scheduled_time_unknown_percent | number | % | time unknown in percent of total time (during downtimes)
|scheduled_time_warning | number | s | total seconds in state warning (during downtimes)
|scheduled_time_warning_percent | number | % | time warning in percent of total time (during downtimes)
|service | | | service description
|time_critical | number | s | total seconds in state critical
|time_critical_percent | number | % | time critical in percent of total time
|time_indeterminate_nodata | number | s | total seconds without any data
|time_indeterminate_nodata_percent | number | % | time without any data in percent of total time (during downtimes)
|time_indeterminate_notrunning | number | s | total seconds during core not running
|time_indeterminate_notrunning_percent | number | % | time during core not running in percent of total time
|time_indeterminate_outside_timeperiod | number | s | total seconds outside the given timeperiod
|time_indeterminate_outside_timeperiod_percent | number | % | time outside the given timeperiod in percent of total time
|time_ok | number | s | total seconds in state ok
|time_ok_percent | number | % | time ok in percent of total time
|time_unknown | number | s | total seconds in state unknown
|time_unknown_percent | number | % | time unknown in percent of total time
|time_warning | number | s | total seconds in state warning
|time_warning_percent | number | % | time warning in percent of total time
|===========================================


=== POST /servicegroups/<name>/cmd/...

external commands are documented in detail on a separate commands page.
Expand Down Expand Up @@ -1690,6 +1818,51 @@ Optional arguments:
|===========================================


=== GET /services/availability

list availability for all services.

Optional arguments:

* type - both | hosts | services
* timeperiod - last24hours | lastmonth | thismonth | ...
* start - unix timestamp
* end - unix timestamp
* withdowntimes - 0/1 wheter downtimes should count as outages
* includesoftstates - 0/1 wheter soft states should be used as well

[options="header"]
|===========================================
|Attribute | Type | Unit | Description
|host | | | host name
|scheduled_time_critical | number | s | total seconds in state critical (during downtimes)
|scheduled_time_critical_percent | number | % | time critical in percent of total time (during downtimes)
|scheduled_time_indeterminate | number | s | total seconds unknown (during downtimes)
|scheduled_time_indeterminate_percent | number | % | time unknown in percent of total time (during downtimes)
|scheduled_time_ok | number | s | total seconds in state ok (during downtimes)
|scheduled_time_ok_percent | number | % | time ok in percent of total time (during downtimes)
|scheduled_time_unknown | number | s | total seconds in state unknown (during downtimes)
|scheduled_time_unknown_percent | number | % | time unknown in percent of total time (during downtimes)
|scheduled_time_warning | number | s | total seconds in state warning (during downtimes)
|scheduled_time_warning_percent | number | % | time warning in percent of total time (during downtimes)
|service | | | service description
|time_critical | number | s | total seconds in state critical
|time_critical_percent | number | % | time critical in percent of total time
|time_indeterminate_nodata | number | s | total seconds without any data
|time_indeterminate_nodata_percent | number | % | time without any data in percent of total time (during downtimes)
|time_indeterminate_notrunning | number | s | total seconds during core not running
|time_indeterminate_notrunning_percent | number | % | time during core not running in percent of total time
|time_indeterminate_outside_timeperiod | number | s | total seconds outside the given timeperiod
|time_indeterminate_outside_timeperiod_percent | number | % | time outside the given timeperiod in percent of total time
|time_ok | number | s | total seconds in state ok
|time_ok_percent | number | % | time ok in percent of total time
|time_unknown | number | s | total seconds in state unknown
|time_unknown_percent | number | % | time unknown in percent of total time
|time_warning | number | s | total seconds in state warning
|time_warning_percent | number | % | time warning in percent of total time
|===========================================


=== GET /services/outages

list of outages for all services.
Expand Down
Loading

0 comments on commit f7b38bb

Please sign in to comment.