Skip to content

Commit ae95bce

Browse files
authored
Merge branch 'master' into fork/add-csv-export-menu
2 parents bd3de50 + c08bfb9 commit ae95bce

17 files changed

Lines changed: 269 additions & 33 deletions

File tree

MANIFEST

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,6 +2540,8 @@ t/900-javascript_syntax.t
25402540
t/900-javascript_utils.t
25412541
t/ci/thruk_local.conf
25422542
t/data/800-plugins/01-css.t
2543+
t/data/agent_configs/thruk.conf
2544+
t/data/agent_configs/thruk_local.conf
25432545
t/data/blank.html
25442546
t/data/broken_config/a.conf
25452547
t/data/broken_config/b.conf

docs/documentation/rest.asciidoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,9 +1511,13 @@ hash of livestatus host statistics.
15111511
|down_and_disabled_passive | | | number of passive down hosts which have active checks disabled
15121512
|down_and_scheduled | | | number of down hosts which are in a scheduled downtime
15131513
|down_and_unhandled | | | number of unhandled down hosts
1514+
|down_hard | | | number of hard down hosts
1515+
|down_hard_unhandled | | | number of unhandled hard down hosts
1516+
|down_soft | | | number of soft down hosts
15141517
|eventhandler_disabled | | | number of hosts with eventhandlers disabled
15151518
|flapping | | | number of flapping hosts
15161519
|flapping_disabled | | | number of hosts with flapping detection disabled
1520+
|hard | | | number of hosts in hard state
15171521
|notifications_disabled | | | number of hosts with notifications disabled
15181522
|outages | | | number of network outages
15191523
|passive_checks_disabled | | | number of hosts which do not accept passive check results
@@ -1524,6 +1528,7 @@ hash of livestatus host statistics.
15241528
|plain_pending | | | number of pending hosts which are not acknowleded or in a downtime
15251529
|plain_unreachable | | | number of unreachable hosts which are not acknowleded or in a downtime
15261530
|plain_up | | | number of up hosts which are not acknowleded or in a downtime
1531+
|soft | | | number of hosts in soft state
15271532
|total | | | total number of hosts
15281533
|total_active | | | total number of active hosts
15291534
|total_passive | | | total number of passive hosts
@@ -1533,6 +1538,9 @@ hash of livestatus host statistics.
15331538
|unreachable_and_disabled_passive | | | number of passive unreachable hosts which have active checks disabled
15341539
|unreachable_and_scheduled | | | number of unreachable hosts which are in a scheduled downtime
15351540
|unreachable_and_unhandled | | | number of unhandled unreachable hosts
1541+
|unreachable_hard | | | number of unreachable hosts in hard state
1542+
|unreachable_hard_unhandled | | | number of unhandled unreachable hosts in hard state
1543+
|unreachable_soft | | | number of unreachable hosts in soft state
15361544
|up | | | number of up hosts
15371545
|up_and_disabled_active | | | number of active up hosts which have active checks disabled
15381546
|up_and_disabled_passive | | | number of passive up hosts which have active checks disabled
@@ -1993,10 +2001,14 @@ livestatus service statistics.
19932001
|critical_and_disabled_passive | | | number of passive critical services which have active checks disabled
19942002
|critical_and_scheduled | | | number of critical services which are in a scheduled downtime
19952003
|critical_and_unhandled | | | number of unhandled critical services
2004+
|critical_hard | | | number of critical services in hard state
2005+
|critical_hard_unhandled | | | number of unhandled critical services in hard state
19962006
|critical_on_down_host | | | number of unhandled critical services on down hosts
2007+
|critical_soft | | | number of critical services in soft state
19972008
|eventhandler_disabled | | | number of services with eventhandlers disabled
19982009
|flapping | | | number of flapping services
19992010
|flapping_disabled | | | number of services with flapping detection disabled
2011+
|hard | | | number of services in hard state
20002012
|notifications_disabled | | | number of services with notifications disabled
20012013
|ok | | | number of ok services
20022014
|ok_and_disabled_active | | | number of active ok services which have active checks disabled
@@ -2011,6 +2023,7 @@ livestatus service statistics.
20112023
|plain_pending | | | number of pending services which are not acknowleded or in a downtime
20122024
|plain_unknown | | | number of unknown services which are not acknowleded or in a downtime
20132025
|plain_warning | | | number of warning services which are not acknowleded or in a downtime
2026+
|soft | | | number of services in soft state
20142027
|total | | | total number of services
20152028
|total_active | | | total number of active services
20162029
|total_passive | | | total number of passive services
@@ -2020,14 +2033,20 @@ livestatus service statistics.
20202033
|unknown_and_disabled_passive | | | number of passive unknown services which have active checks disabled
20212034
|unknown_and_scheduled | | | number of unknown services which are in a scheduled downtime
20222035
|unknown_and_unhandled | | | number of unhandled unknown services
2036+
|unknown_hard | | | number of unknown services in hard state
2037+
|unknown_hard_unhandled | | | number of unhandled unknown services in hard state
20232038
|unknown_on_down_host | | | number of unhandled unknown services on down hosts
2039+
|unknown_soft | | | number of unknown services in soft state
20242040
|warning | | | number of warning services
20252041
|warning_and_ack | | | number of warning services which are acknowledged
20262042
|warning_and_disabled_active | | | number of active warning services which have active checks disabled
20272043
|warning_and_disabled_passive | | | number of passive warning services which have active checks disabled
20282044
|warning_and_scheduled | | | number of warning services which are in a scheduled downtime
20292045
|warning_and_unhandled | | | number of unhandled warning services
2046+
|warning_hard | | | number of warning services in hard state
2047+
|warning_hard_unhandled | | | number of unhandled warning services in hard state
20302048
|warning_on_down_host | | | number of unhandled warning services on down hosts
2049+
|warning_soft | | | number of warning services in soft state
20312050
|===========================================
20322051

20332052

lib/Thruk/Backend/Provider/Livestatus.pm

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,13 +1216,19 @@ $Thruk::Backend::Provider::Livestatus::stats_columns->{'host_stats'} = [
12161216
'down_and_disabled_active' => { -isa => { -and => [ 'state' => 1, 'check_type' => 0, 'active_checks_enabled' => 0 ]}},
12171217
'down_and_disabled_passive' => { -isa => { -and => [ 'state' => 1, 'check_type' => 1, 'active_checks_enabled' => 0 ]}},
12181218
'down_and_unhandled' => { -isa => { -and => [ 'state' => 1, 'active_checks_enabled' => 1, 'acknowledged' => 0, 'scheduled_downtime_depth' => 0 ]}},
1219+
'down_soft' => { -isa => { -and => [ 'state' => 1, 'state_type' => 0 ]}},
1220+
'down_hard' => { -isa => { -and => [ 'state' => 1, 'state_type' => 1 ]}},
1221+
'down_hard_unhandled' => { -isa => { -and => [ 'state' => 1, 'state_type' => 1, 'active_checks_enabled' => 1, 'acknowledged' => 0, 'scheduled_downtime_depth' => 0 ]}},
12191222
'unreachable' => { -isa => { -and => [ 'state' => 2 ]}},
12201223
'plain_unreachable' => { -isa => { -and => [ 'state' => 2, 'scheduled_downtime_depth' => 0, 'acknowledged' => 0 ]}},
12211224
'unreachable_and_ack' => { -isa => { -and => [ 'state' => 2, 'acknowledged' => 1 ]}},
12221225
'unreachable_and_scheduled' => { -isa => { -and => [ 'state' => 2, 'scheduled_downtime_depth' => { '>' => 0 } ]}},
12231226
'unreachable_and_disabled_active' => { -isa => { -and => [ 'state' => 2, 'check_type' => 0, 'active_checks_enabled' => 0 ]}},
12241227
'unreachable_and_disabled_passive' => { -isa => { -and => [ 'state' => 2, 'check_type' => 1, 'active_checks_enabled' => 0 ]}},
12251228
'unreachable_and_unhandled' => { -isa => { -and => [ 'state' => 2, 'active_checks_enabled' => 1, 'acknowledged' => 0, 'scheduled_downtime_depth' => 0 ]}},
1229+
'unreachable_soft' => { -isa => { -and => [ 'state' => 2, 'state_type' => 0 ]}},
1230+
'unreachable_hard' => { -isa => { -and => [ 'state' => 2, 'state_type' => 1 ]}},
1231+
'unreachable_hard_unhandled' => { -isa => { -and => [ 'state' => 2, 'state_type' => 1, 'active_checks_enabled' => 1, 'acknowledged' => 0, 'scheduled_downtime_depth' => 0 ]}},
12261232
'flapping' => { -isa => { -and => [ 'is_flapping' => 1 ]}},
12271233
'flapping_disabled' => { -isa => { -and => [ 'flap_detection_enabled' => 0 ]}},
12281234
'notifications_disabled' => { -isa => { -and => [ 'notifications_enabled' => 0 ]}},
@@ -1231,6 +1237,8 @@ $Thruk::Backend::Provider::Livestatus::stats_columns->{'host_stats'} = [
12311237
'active_checks_disabled_passive' => { -isa => { -and => [ 'check_type' => 1, 'active_checks_enabled' => 0 ]}},
12321238
'passive_checks_disabled' => { -isa => { -and => [ 'accept_passive_checks' => 0 ]}},
12331239
'outages' => { -isa => { -and => [ 'state' => 1, 'childs' => {'!=' => undef } ]}},
1240+
'soft' => { -isa => { -and => [ 'state_type' => 0 ]}},
1241+
'hard' => { -isa => { -and => [ 'state_type' => 1 ]}},
12341242
];
12351243
sub get_host_stats {
12361244
my($self, %options) = @_;
@@ -1436,6 +1444,9 @@ $Thruk::Backend::Provider::Livestatus::stats_columns->{'service_stats'} = [
14361444
'warning_and_ack' => { -isa => { -and => [ 'state' => 1, 'acknowledged' => 1 ]}},
14371445
'warning_on_down_host' => { -isa => { -and => [ 'state' => 1, 'host_state' => { '!=' => 0 } ]}},
14381446
'warning_and_unhandled' => { -isa => { -and => [ 'state' => 1, 'acknowledged' => 0, 'scheduled_downtime_depth' => 0, 'host_state' => 0, 'host_acknowledged' => 0, 'host_scheduled_downtime_depth' => 0 ]}},
1447+
'warning_soft' => { -isa => { -and => [ 'state' => 1, 'state_type' => 0 ]}},
1448+
'warning_hard' => { -isa => { -and => [ 'state' => 1, 'state_type' => 1 ]}},
1449+
'warning_hard_unhandled' => { -isa => { -and => [ 'state' => 1, 'state_type' => 1, 'acknowledged' => 0, 'scheduled_downtime_depth' => 0, 'host_state' => 0, 'host_acknowledged' => 0, 'host_scheduled_downtime_depth' => 0 ]}},
14391450
'critical' => { -isa => { -and => [ 'state' => 2 ]}},
14401451
'plain_critical' => { -isa => { -and => [ 'state' => 2, 'scheduled_downtime_depth' => 0, 'acknowledged' => 0 ]}},
14411452
'critical_and_scheduled' => { -isa => { -and => [ 'state' => 2, 'scheduled_downtime_depth' => { '>' => 0 } ]}},
@@ -1444,6 +1455,9 @@ $Thruk::Backend::Provider::Livestatus::stats_columns->{'service_stats'} = [
14441455
'critical_and_ack' => { -isa => { -and => [ 'state' => 2, 'acknowledged' => 1 ]}},
14451456
'critical_on_down_host' => { -isa => { -and => [ 'state' => 2, 'host_state' => { '!=' => 0 } ]}},
14461457
'critical_and_unhandled' => { -isa => { -and => [ 'state' => 2, 'acknowledged' => 0, 'scheduled_downtime_depth' => 0, 'host_state' => 0, 'host_acknowledged' => 0, 'host_scheduled_downtime_depth' => 0 ]}},
1458+
'critical_soft' => { -isa => { -and => [ 'state' => 2, 'state_type' => 0 ]}},
1459+
'critical_hard' => { -isa => { -and => [ 'state' => 2, 'state_type' => 1 ]}},
1460+
'critical_hard_unhandled' => { -isa => { -and => [ 'state' => 2, 'state_type' => 1, 'acknowledged' => 0, 'scheduled_downtime_depth' => 0, 'host_state' => 0, 'host_acknowledged' => 0, 'host_scheduled_downtime_depth' => 0 ]}},
14471461
'unknown' => { -isa => { -and => [ 'state' => 3 ]}},
14481462
'plain_unknown' => { -isa => { -and => [ 'state' => 3, 'scheduled_downtime_depth' => 0, 'acknowledged' => 0 ]}},
14491463
'unknown_and_scheduled' => { -isa => { -and => [ 'state' => 3, 'scheduled_downtime_depth' => { '>' => 0 } ]}},
@@ -1452,11 +1466,16 @@ $Thruk::Backend::Provider::Livestatus::stats_columns->{'service_stats'} = [
14521466
'unknown_and_ack' => { -isa => { -and => [ 'state' => 3, 'acknowledged' => 1 ]}},
14531467
'unknown_on_down_host' => { -isa => { -and => [ 'state' => 3, 'host_state' => { '!=' => 0 } ]}},
14541468
'unknown_and_unhandled' => { -isa => { -and => [ 'state' => 3, 'acknowledged' => 0, 'scheduled_downtime_depth' => 0, 'host_state' => 0, 'host_acknowledged' => 0, 'host_scheduled_downtime_depth' => 0 ]}},
1469+
'unknown_soft' => { -isa => { -and => [ 'state' => 3, 'state_type' => 0 ]}},
1470+
'unknown_hard' => { -isa => { -and => [ 'state' => 3, 'state_type' => 1 ]}},
1471+
'unknown_hard_unhandled' => { -isa => { -and => [ 'state' => 3, 'state_type' => 1, 'acknowledged' => 0, 'scheduled_downtime_depth' => 0, 'host_state' => 0, 'host_acknowledged' => 0, 'host_scheduled_downtime_depth' => 0 ]}},
14551472
'flapping' => { -isa => { -and => [ 'is_flapping' => 1 ]}},
14561473
'flapping_disabled' => { -isa => { -and => [ 'flap_detection_enabled' => 0 ]}},
14571474
'notifications_disabled' => { -isa => { -and => [ 'notifications_enabled' => 0 ]}},
14581475
'eventhandler_disabled' => { -isa => { -and => [ 'event_handler_enabled' => 0 ]}},
14591476
'passive_checks_disabled' => { -isa => { -and => [ 'accept_passive_checks' => 0 ]}},
1477+
'soft' => { -isa => { -and => [ 'state_type' => 0 ]}},
1478+
'hard' => { -isa => { -and => [ 'state_type' => 1 ]}},
14601479
];
14611480
sub get_service_stats {
14621481
my($self, %options) = @_;

lib/Thruk/Controller/Rest/V1/docs.pm

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,24 @@ __DATA__
13491349
"type": "",
13501350
"unit": ""
13511351
},
1352+
{
1353+
"description": "number of hard down hosts",
1354+
"name": "down_hard",
1355+
"type": "",
1356+
"unit": ""
1357+
},
1358+
{
1359+
"description": "number of unhandled hard down hosts",
1360+
"name": "down_hard_unhandled",
1361+
"type": "",
1362+
"unit": ""
1363+
},
1364+
{
1365+
"description": "number of soft down hosts",
1366+
"name": "down_soft",
1367+
"type": "",
1368+
"unit": ""
1369+
},
13521370
{
13531371
"description": "number of hosts with eventhandlers disabled",
13541372
"name": "eventhandler_disabled",
@@ -1367,6 +1385,12 @@ __DATA__
13671385
"type": "",
13681386
"unit": ""
13691387
},
1388+
{
1389+
"description": "number of hosts in hard state",
1390+
"name": "hard",
1391+
"type": "",
1392+
"unit": ""
1393+
},
13701394
{
13711395
"description": "number of hosts with notifications disabled",
13721396
"name": "notifications_disabled",
@@ -1427,6 +1451,12 @@ __DATA__
14271451
"type": "",
14281452
"unit": ""
14291453
},
1454+
{
1455+
"description": "number of hosts in soft state",
1456+
"name": "soft",
1457+
"type": "",
1458+
"unit": ""
1459+
},
14301460
{
14311461
"description": "total number of hosts",
14321462
"name": "total",
@@ -1481,6 +1511,24 @@ __DATA__
14811511
"type": "",
14821512
"unit": ""
14831513
},
1514+
{
1515+
"description": "number of unreachable hosts in hard state",
1516+
"name": "unreachable_hard",
1517+
"type": "",
1518+
"unit": ""
1519+
},
1520+
{
1521+
"description": "number of unhandled unreachable hosts in hard state",
1522+
"name": "unreachable_hard_unhandled",
1523+
"type": "",
1524+
"unit": ""
1525+
},
1526+
{
1527+
"description": "number of unreachable hosts in soft state",
1528+
"name": "unreachable_soft",
1529+
"type": "",
1530+
"unit": ""
1531+
},
14841532
{
14851533
"description": "number of up hosts",
14861534
"name": "up",
@@ -2465,12 +2513,30 @@ __DATA__
24652513
"type": "",
24662514
"unit": ""
24672515
},
2516+
{
2517+
"description": "number of critical services in hard state",
2518+
"name": "critical_hard",
2519+
"type": "",
2520+
"unit": ""
2521+
},
2522+
{
2523+
"description": "number of unhandled critical services in hard state",
2524+
"name": "critical_hard_unhandled",
2525+
"type": "",
2526+
"unit": ""
2527+
},
24682528
{
24692529
"description": "number of unhandled critical services on down hosts",
24702530
"name": "critical_on_down_host",
24712531
"type": "",
24722532
"unit": ""
24732533
},
2534+
{
2535+
"description": "number of critical services in soft state",
2536+
"name": "critical_soft",
2537+
"type": "",
2538+
"unit": ""
2539+
},
24742540
{
24752541
"description": "number of services with eventhandlers disabled",
24762542
"name": "eventhandler_disabled",
@@ -2489,6 +2555,12 @@ __DATA__
24892555
"type": "",
24902556
"unit": ""
24912557
},
2558+
{
2559+
"description": "number of services in hard state",
2560+
"name": "hard",
2561+
"type": "",
2562+
"unit": ""
2563+
},
24922564
{
24932565
"description": "number of services with notifications disabled",
24942566
"name": "notifications_disabled",
@@ -2573,6 +2645,12 @@ __DATA__
25732645
"type": "",
25742646
"unit": ""
25752647
},
2648+
{
2649+
"description": "number of services in soft state",
2650+
"name": "soft",
2651+
"type": "",
2652+
"unit": ""
2653+
},
25762654
{
25772655
"description": "total number of services",
25782656
"name": "total",
@@ -2627,12 +2705,30 @@ __DATA__
26272705
"type": "",
26282706
"unit": ""
26292707
},
2708+
{
2709+
"description": "number of unknown services in hard state",
2710+
"name": "unknown_hard",
2711+
"type": "",
2712+
"unit": ""
2713+
},
2714+
{
2715+
"description": "number of unhandled unknown services in hard state",
2716+
"name": "unknown_hard_unhandled",
2717+
"type": "",
2718+
"unit": ""
2719+
},
26302720
{
26312721
"description": "number of unhandled unknown services on down hosts",
26322722
"name": "unknown_on_down_host",
26332723
"type": "",
26342724
"unit": ""
26352725
},
2726+
{
2727+
"description": "number of unknown services in soft state",
2728+
"name": "unknown_soft",
2729+
"type": "",
2730+
"unit": ""
2731+
},
26362732
{
26372733
"description": "number of warning services",
26382734
"name": "warning",
@@ -2669,11 +2765,29 @@ __DATA__
26692765
"type": "",
26702766
"unit": ""
26712767
},
2768+
{
2769+
"description": "number of warning services in hard state",
2770+
"name": "warning_hard",
2771+
"type": "",
2772+
"unit": ""
2773+
},
2774+
{
2775+
"description": "number of unhandled warning services in hard state",
2776+
"name": "warning_hard_unhandled",
2777+
"type": "",
2778+
"unit": ""
2779+
},
26722780
{
26732781
"description": "number of unhandled warning services on down hosts",
26742782
"name": "warning_on_down_host",
26752783
"type": "",
26762784
"unit": ""
2785+
},
2786+
{
2787+
"description": "number of warning services in soft state",
2788+
"name": "warning_soft",
2789+
"type": "",
2790+
"unit": ""
26772791
}
26782792
]
26792793
}

0 commit comments

Comments
 (0)