From 0915b3ef56dfac3113cce55a59a5765dc94976be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:34:54 +0200 Subject: Adding upstream version 2.13.6. Signed-off-by: Daniel Baumann --- test/livestatus/README | 12 ++++++++++ test/livestatus/queries/commands/command | 4 ++++ test/livestatus/queries/commands/modattr | 4 ++++ test/livestatus/queries/comments/comment | 3 +++ test/livestatus/queries/comments/comment_short | 4 ++++ test/livestatus/queries/contacts/contacts | 3 +++ test/livestatus/queries/contacts/group | 3 +++ test/livestatus/queries/contacts/modattr | 4 ++++ test/livestatus/queries/custom/scrambled | 2 ++ test/livestatus/queries/custom/thruk_alert_history | 19 ++++++++++++++++ test/livestatus/queries/custom/thruk_comments | 7 ++++++ test/livestatus/queries/downtimes/downtime | 3 +++ test/livestatus/queries/downtimes/downtime_short | 4 ++++ test/livestatus/queries/endpoints/endpoints | 3 +++ test/livestatus/queries/hosts/bygroup | 4 ++++ test/livestatus/queries/hosts/check | 4 ++++ test/livestatus/queries/hosts/command | 4 ++++ test/livestatus/queries/hosts/comment | 4 ++++ test/livestatus/queries/hosts/contact | 4 ++++ test/livestatus/queries/hosts/customvar | 4 ++++ test/livestatus/queries/hosts/downtime | 4 ++++ test/livestatus/queries/hosts/extra | 4 ++++ test/livestatus/queries/hosts/group | 3 +++ test/livestatus/queries/hosts/host | 4 ++++ test/livestatus/queries/hosts/host_nagvis | 6 +++++ test/livestatus/queries/hosts/legacy | 4 ++++ test/livestatus/queries/hosts/modattr | 4 ++++ test/livestatus/queries/hosts/notification | 4 ++++ test/livestatus/queries/hosts/services | 4 ++++ test/livestatus/queries/hosts/state | 4 ++++ test/livestatus/queries/hosts/stats_sum | 5 +++++ test/livestatus/queries/log/alerts | 6 +++++ test/livestatus/queries/log/avail | 12 ++++++++++ test/livestatus/queries/log/avail_svc | 13 +++++++++++ test/livestatus/queries/log/class | 5 +++++ test/livestatus/queries/log/localhost_disk | 7 ++++++ test/livestatus/queries/log/log | 4 ++++ test/livestatus/queries/log/minimal | 5 +++++ test/livestatus/queries/log/trend | 26 ++++++++++++++++++++++ test/livestatus/queries/services/bygroup | 4 ++++ test/livestatus/queries/services/byhostgroup | 4 ++++ test/livestatus/queries/services/check | 4 ++++ test/livestatus/queries/services/command | 4 ++++ test/livestatus/queries/services/comment | 4 ++++ test/livestatus/queries/services/contact | 4 ++++ test/livestatus/queries/services/customvar | 4 ++++ test/livestatus/queries/services/downtime | 4 ++++ test/livestatus/queries/services/extra | 4 ++++ test/livestatus/queries/services/group | 3 +++ test/livestatus/queries/services/legacy | 4 ++++ test/livestatus/queries/services/modattr | 4 ++++ test/livestatus/queries/services/notification | 4 ++++ test/livestatus/queries/services/services | 3 +++ test/livestatus/queries/services/state | 4 ++++ test/livestatus/queries/special/services | 5 +++++ test/livestatus/queries/statehist/duration | 5 +++++ test/livestatus/queries/statehist/statehist | 5 +++++ test/livestatus/queries/statehist/statehist_disk | 6 +++++ test/livestatus/queries/statehist/sum | 9 ++++++++ test/livestatus/queries/status/checks | 4 ++++ test/livestatus/queries/status/custom | 4 ++++ test/livestatus/queries/status/livestatus | 4 ++++ test/livestatus/queries/status/program | 4 ++++ test/livestatus/queries/status/status | 3 +++ test/livestatus/queries/timeperiods/timeperiod | 3 +++ test/livestatus/run_queries | 26 ++++++++++++++++++++++ 66 files changed, 359 insertions(+) create mode 100644 test/livestatus/README create mode 100644 test/livestatus/queries/commands/command create mode 100644 test/livestatus/queries/commands/modattr create mode 100644 test/livestatus/queries/comments/comment create mode 100644 test/livestatus/queries/comments/comment_short create mode 100644 test/livestatus/queries/contacts/contacts create mode 100644 test/livestatus/queries/contacts/group create mode 100644 test/livestatus/queries/contacts/modattr create mode 100644 test/livestatus/queries/custom/scrambled create mode 100644 test/livestatus/queries/custom/thruk_alert_history create mode 100644 test/livestatus/queries/custom/thruk_comments create mode 100644 test/livestatus/queries/downtimes/downtime create mode 100644 test/livestatus/queries/downtimes/downtime_short create mode 100644 test/livestatus/queries/endpoints/endpoints create mode 100644 test/livestatus/queries/hosts/bygroup create mode 100644 test/livestatus/queries/hosts/check create mode 100644 test/livestatus/queries/hosts/command create mode 100644 test/livestatus/queries/hosts/comment create mode 100644 test/livestatus/queries/hosts/contact create mode 100644 test/livestatus/queries/hosts/customvar create mode 100644 test/livestatus/queries/hosts/downtime create mode 100644 test/livestatus/queries/hosts/extra create mode 100644 test/livestatus/queries/hosts/group create mode 100644 test/livestatus/queries/hosts/host create mode 100644 test/livestatus/queries/hosts/host_nagvis create mode 100644 test/livestatus/queries/hosts/legacy create mode 100644 test/livestatus/queries/hosts/modattr create mode 100644 test/livestatus/queries/hosts/notification create mode 100644 test/livestatus/queries/hosts/services create mode 100644 test/livestatus/queries/hosts/state create mode 100644 test/livestatus/queries/hosts/stats_sum create mode 100644 test/livestatus/queries/log/alerts create mode 100644 test/livestatus/queries/log/avail create mode 100644 test/livestatus/queries/log/avail_svc create mode 100644 test/livestatus/queries/log/class create mode 100644 test/livestatus/queries/log/localhost_disk create mode 100644 test/livestatus/queries/log/log create mode 100644 test/livestatus/queries/log/minimal create mode 100644 test/livestatus/queries/log/trend create mode 100644 test/livestatus/queries/services/bygroup create mode 100644 test/livestatus/queries/services/byhostgroup create mode 100644 test/livestatus/queries/services/check create mode 100644 test/livestatus/queries/services/command create mode 100644 test/livestatus/queries/services/comment create mode 100644 test/livestatus/queries/services/contact create mode 100644 test/livestatus/queries/services/customvar create mode 100644 test/livestatus/queries/services/downtime create mode 100644 test/livestatus/queries/services/extra create mode 100644 test/livestatus/queries/services/group create mode 100644 test/livestatus/queries/services/legacy create mode 100644 test/livestatus/queries/services/modattr create mode 100644 test/livestatus/queries/services/notification create mode 100644 test/livestatus/queries/services/services create mode 100644 test/livestatus/queries/services/state create mode 100644 test/livestatus/queries/special/services create mode 100644 test/livestatus/queries/statehist/duration create mode 100644 test/livestatus/queries/statehist/statehist create mode 100644 test/livestatus/queries/statehist/statehist_disk create mode 100644 test/livestatus/queries/statehist/sum create mode 100644 test/livestatus/queries/status/checks create mode 100644 test/livestatus/queries/status/custom create mode 100644 test/livestatus/queries/status/livestatus create mode 100644 test/livestatus/queries/status/program create mode 100644 test/livestatus/queries/status/status create mode 100644 test/livestatus/queries/timeperiods/timeperiod create mode 100755 test/livestatus/run_queries (limited to 'test/livestatus') diff --git a/test/livestatus/README b/test/livestatus/README new file mode 100644 index 0000000..0c839e0 --- /dev/null +++ b/test/livestatus/README @@ -0,0 +1,12 @@ +Compat Livestatus Component Query Tests +======================================= + +Collection of queries used for execution +on the livestatus socket. + + +$ ./run_queries host/services + +or + +$ ./run_queries diff --git a/test/livestatus/queries/commands/command b/test/livestatus/queries/commands/command new file mode 100644 index 0000000..2e87152 --- /dev/null +++ b/test/livestatus/queries/commands/command @@ -0,0 +1,4 @@ +GET commands +Columns: name line custom_variables +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/commands/modattr b/test/livestatus/queries/commands/modattr new file mode 100644 index 0000000..90aaea7 --- /dev/null +++ b/test/livestatus/queries/commands/modattr @@ -0,0 +1,4 @@ +GET commands +Columns: name modified_attributes modified_attributes_list +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/comments/comment b/test/livestatus/queries/comments/comment new file mode 100644 index 0000000..18d7db9 --- /dev/null +++ b/test/livestatus/queries/comments/comment @@ -0,0 +1,3 @@ +GET comments +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/comments/comment_short b/test/livestatus/queries/comments/comment_short new file mode 100644 index 0000000..e5c0072 --- /dev/null +++ b/test/livestatus/queries/comments/comment_short @@ -0,0 +1,4 @@ +GET comments +Columns: id type is_service host_name service_description author comment +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/contacts/contacts b/test/livestatus/queries/contacts/contacts new file mode 100644 index 0000000..a81c463 --- /dev/null +++ b/test/livestatus/queries/contacts/contacts @@ -0,0 +1,3 @@ +GET contacts +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/contacts/group b/test/livestatus/queries/contacts/group new file mode 100644 index 0000000..a15b3a5 --- /dev/null +++ b/test/livestatus/queries/contacts/group @@ -0,0 +1,3 @@ +GET contactgroups +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/contacts/modattr b/test/livestatus/queries/contacts/modattr new file mode 100644 index 0000000..8b520a0 --- /dev/null +++ b/test/livestatus/queries/contacts/modattr @@ -0,0 +1,4 @@ +GET contacts +Columns: name modified_attributes modified_attributes_list +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/custom/scrambled b/test/livestatus/queries/custom/scrambled new file mode 100644 index 0000000..01fe008 --- /dev/null +++ b/test/livestatus/queries/custom/scrambled @@ -0,0 +1,2 @@ +D + diff --git a/test/livestatus/queries/custom/thruk_alert_history b/test/livestatus/queries/custom/thruk_alert_history new file mode 100644 index 0000000..de04c46 --- /dev/null +++ b/test/livestatus/queries/custom/thruk_alert_history @@ -0,0 +1,19 @@ +GET log +Columns: class time type state host_name service_description plugin_output message options state_type contact_name +Filter: time >= 1383692400 +Filter: time <= 1383778800 +Filter: type = SERVICE ALERT +And: 1 +Filter: type = HOST ALERT +And: 1 +Filter: type = SERVICE FLAPPING ALERT +Filter: type = HOST FLAPPING ALERT +Filter: type = SERVICE DOWNTIME ALERT +Filter: type = HOST DOWNTIME ALERT +Filter: message ~ starting\.\.\. +Filter: message ~ shutting\ down\.\.\. +Or: 8 +And: 3 +OutputFormat: json +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/custom/thruk_comments b/test/livestatus/queries/custom/thruk_comments new file mode 100644 index 0000000..fc454ab --- /dev/null +++ b/test/livestatus/queries/custom/thruk_comments @@ -0,0 +1,7 @@ +GET comments +Columns: author comment entry_time entry_type expires expire_time host_name id persistent service_description source type +Filter: host_name = localhost +Filter: service_description = processes +OutputFormat: json +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/downtimes/downtime b/test/livestatus/queries/downtimes/downtime new file mode 100644 index 0000000..263dd51 --- /dev/null +++ b/test/livestatus/queries/downtimes/downtime @@ -0,0 +1,3 @@ +GET downtimes +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/downtimes/downtime_short b/test/livestatus/queries/downtimes/downtime_short new file mode 100644 index 0000000..c2e1cf5 --- /dev/null +++ b/test/livestatus/queries/downtimes/downtime_short @@ -0,0 +1,4 @@ +GET downtimes +Columns: id type is_service host_name service_description author comment start_time end_time +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/endpoints/endpoints b/test/livestatus/queries/endpoints/endpoints new file mode 100644 index 0000000..3ff4a02 --- /dev/null +++ b/test/livestatus/queries/endpoints/endpoints @@ -0,0 +1,3 @@ +GET endpoints +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/bygroup b/test/livestatus/queries/hosts/bygroup new file mode 100644 index 0000000..7485efc --- /dev/null +++ b/test/livestatus/queries/hosts/bygroup @@ -0,0 +1,4 @@ +GET hostsbygroup +Columns: hostgroup_name host_name +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/check b/test/livestatus/queries/hosts/check new file mode 100644 index 0000000..bf4c216 --- /dev/null +++ b/test/livestatus/queries/hosts/check @@ -0,0 +1,4 @@ +GET hosts +Columns: name plugin_output check_source +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/command b/test/livestatus/queries/hosts/command new file mode 100644 index 0000000..61dfe83 --- /dev/null +++ b/test/livestatus/queries/hosts/command @@ -0,0 +1,4 @@ +GET hosts +Columns: check_command check_command_expanded +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/comment b/test/livestatus/queries/hosts/comment new file mode 100644 index 0000000..1ac1e84 --- /dev/null +++ b/test/livestatus/queries/hosts/comment @@ -0,0 +1,4 @@ +GET hosts +Columns: comments comments_with_info comments_with_extra_info +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/contact b/test/livestatus/queries/hosts/contact new file mode 100644 index 0000000..9322944 --- /dev/null +++ b/test/livestatus/queries/hosts/contact @@ -0,0 +1,4 @@ +GET hosts +Columns: contacts contact_groups +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/customvar b/test/livestatus/queries/hosts/customvar new file mode 100644 index 0000000..57f2e00 --- /dev/null +++ b/test/livestatus/queries/hosts/customvar @@ -0,0 +1,4 @@ +GET hosts +Columns: name custom_variable_names custom_variable_values custom_variables cv_is_json +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/downtime b/test/livestatus/queries/hosts/downtime new file mode 100644 index 0000000..db20ae7 --- /dev/null +++ b/test/livestatus/queries/hosts/downtime @@ -0,0 +1,4 @@ +GET hosts +Columns: downtimes downtimes_with_info +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/extra b/test/livestatus/queries/hosts/extra new file mode 100644 index 0000000..d6a583a --- /dev/null +++ b/test/livestatus/queries/hosts/extra @@ -0,0 +1,4 @@ +GET hosts +Columns: name address notes notes_expanded notes_url notes_url_expanded action_url action_url_expanded icon_image icon_image_expanded icon_image_alt x_2d y_2d +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/group b/test/livestatus/queries/hosts/group new file mode 100644 index 0000000..cc60032 --- /dev/null +++ b/test/livestatus/queries/hosts/group @@ -0,0 +1,3 @@ +GET hostgroups +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/host b/test/livestatus/queries/hosts/host new file mode 100644 index 0000000..4390fa9 --- /dev/null +++ b/test/livestatus/queries/hosts/host @@ -0,0 +1,4 @@ +GET hosts +Columns: name parents childs +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/host_nagvis b/test/livestatus/queries/hosts/host_nagvis new file mode 100644 index 0000000..a09d013 --- /dev/null +++ b/test/livestatus/queries/hosts/host_nagvis @@ -0,0 +1,6 @@ +GET hosts +Columns: name alias host_name +OutputFormat:json +KeepAlive: on +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/legacy b/test/livestatus/queries/hosts/legacy new file mode 100644 index 0000000..7a94932 --- /dev/null +++ b/test/livestatus/queries/hosts/legacy @@ -0,0 +1,4 @@ +GET hosts +Columns: name notes notes_url action_url icon_image icon_image_alt +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/modattr b/test/livestatus/queries/hosts/modattr new file mode 100644 index 0000000..b34e828 --- /dev/null +++ b/test/livestatus/queries/hosts/modattr @@ -0,0 +1,4 @@ +GET hosts +Columns: name modified_attributes modified_attributes_list original_attributes +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/notification b/test/livestatus/queries/hosts/notification new file mode 100644 index 0000000..27600ce --- /dev/null +++ b/test/livestatus/queries/hosts/notification @@ -0,0 +1,4 @@ +GET hosts +Columns: name current_notification_number notification_period notification_interval notifications_enabled no_more_notifications last_notification next_notification +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/services b/test/livestatus/queries/hosts/services new file mode 100644 index 0000000..a6e10ba --- /dev/null +++ b/test/livestatus/queries/hosts/services @@ -0,0 +1,4 @@ +GET hosts +Columns: name num_services worst_service_state num_services_ok num_services_warn num_services_crit num_services_unknown num_services_pending worst_service_hard_state num_services_hard_ok num_services_hard_warn num_services_hard_crit num_services_hard_unknown services services_with_state services_with_info +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/state b/test/livestatus/queries/hosts/state new file mode 100644 index 0000000..ba59c9e --- /dev/null +++ b/test/livestatus/queries/hosts/state @@ -0,0 +1,4 @@ +GET hosts +Columns: name last_state_change last_hard_state_change last_time_up last_time_down last_time_unreachable staleness is_reachable +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/hosts/stats_sum b/test/livestatus/queries/hosts/stats_sum new file mode 100644 index 0000000..8a44ff4 --- /dev/null +++ b/test/livestatus/queries/hosts/stats_sum @@ -0,0 +1,5 @@ +GET hosts +ResponseHeader: fixed16 +Stats: latency = 3 +Stats: sum latency + diff --git a/test/livestatus/queries/log/alerts b/test/livestatus/queries/log/alerts new file mode 100644 index 0000000..8c4740a --- /dev/null +++ b/test/livestatus/queries/log/alerts @@ -0,0 +1,6 @@ +GET log +Columns: host_name service_description time lineno class type options plugin_output state state_type comment contact_name command_name +Filter: time >= 1348657741 +Filter: message ~ ALERT +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/log/avail b/test/livestatus/queries/log/avail new file mode 100644 index 0000000..b37162c --- /dev/null +++ b/test/livestatus/queries/log/avail @@ -0,0 +1,12 @@ +GET log +Columns: time type message class +Filter: type = HOST ALERT +Filter: state_type = HARD +Filter: type = INITIAL HOST STATE +Filter: state_type = HARD +Filter: type = CURRENT HOST STATE +Filter: state_type = HARD +Filter: type = HOST DOWNTIME ALERT +Or: 7 +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/log/avail_svc b/test/livestatus/queries/log/avail_svc new file mode 100644 index 0000000..9e3712b --- /dev/null +++ b/test/livestatus/queries/log/avail_svc @@ -0,0 +1,13 @@ +GET log +Columns: time type message class +Filter: type = HOST DOWNTIME ALERT +Filter: type = SERVICE ALERT +Filter: state_type = HARD +Filter: type = INITIAL SERVICE STATE +Filter: state_type = HARD +Filter: type = CURRENT SERVICE STATE +Filter: state_type = HARD +Filter: type = SERVICE DOWNTIME ALERT +Or: 8 +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/log/class b/test/livestatus/queries/log/class new file mode 100644 index 0000000..c534980 --- /dev/null +++ b/test/livestatus/queries/log/class @@ -0,0 +1,5 @@ +GET log +Filter: time >= 1348657741 +Filter: class = 1 +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/log/localhost_disk b/test/livestatus/queries/log/localhost_disk new file mode 100644 index 0000000..834047f --- /dev/null +++ b/test/livestatus/queries/log/localhost_disk @@ -0,0 +1,7 @@ +GET log +Columns: host_name service_description time lineno class type options plugin_output state state_type comment contact_name command_name +Filter: time >= 1348657741 +Filter: host_name = localhost +Filter: service_description = disk +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/log/log b/test/livestatus/queries/log/log new file mode 100644 index 0000000..f69f2f4 --- /dev/null +++ b/test/livestatus/queries/log/log @@ -0,0 +1,4 @@ +GET log +Filter: time >= 1348657741 +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/log/minimal b/test/livestatus/queries/log/minimal new file mode 100644 index 0000000..d224387 --- /dev/null +++ b/test/livestatus/queries/log/minimal @@ -0,0 +1,5 @@ +GET log +Columns: host_name service_description time lineno class type options plugin_output state state_type comment contact_name command_name +Filter: time >= 1348657741 +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/log/trend b/test/livestatus/queries/log/trend new file mode 100644 index 0000000..bd44d89 --- /dev/null +++ b/test/livestatus/queries/log/trend @@ -0,0 +1,26 @@ +GET log +Columns: time type message +Filter: host_name = localhost +Filter: type = HOST ALERT +Filter: state_type = HARD +Filter: type = INITIAL HOST STATE +Filter: state_type = HARD +Filter: type = CURRENT HOST STATE +Filter: state_type = HARD +Filter: type = HOST DOWNTIME ALERT +Or: 7 +And: 2 +Filter: host_name = localhost +Filter: type = SERVICE ALERT +Filter: state_type = HARD +Filter: type = INITIAL SERVICE STATE +Filter: state_type = HARD +Filter: type = CURRENT SERVICE STATE +Filter: state_type = HARD +Filter: type = SERVICE DOWNTIME ALERT +Or: 7 +And: 2 +Filter: class = 2 +Or: 3 +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/bygroup b/test/livestatus/queries/services/bygroup new file mode 100644 index 0000000..668e5f1 --- /dev/null +++ b/test/livestatus/queries/services/bygroup @@ -0,0 +1,4 @@ +GET servicesbygroup +Columns: servicegroup_name host_name service_description +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/byhostgroup b/test/livestatus/queries/services/byhostgroup new file mode 100644 index 0000000..ddcdbe8 --- /dev/null +++ b/test/livestatus/queries/services/byhostgroup @@ -0,0 +1,4 @@ +GET servicesbyhostgroup +Columns: hostgroup_name host_name service_description +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/check b/test/livestatus/queries/services/check new file mode 100644 index 0000000..1a8e857 --- /dev/null +++ b/test/livestatus/queries/services/check @@ -0,0 +1,4 @@ +GET services +Columns: description host_name plugin_output check_source +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/command b/test/livestatus/queries/services/command new file mode 100644 index 0000000..7bbf268 --- /dev/null +++ b/test/livestatus/queries/services/command @@ -0,0 +1,4 @@ +GET services +Columns: check_command check_command_expanded +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/comment b/test/livestatus/queries/services/comment new file mode 100644 index 0000000..d69ba67 --- /dev/null +++ b/test/livestatus/queries/services/comment @@ -0,0 +1,4 @@ +GET services +Columns: comments comments_with_info comments_with_extra_info +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/contact b/test/livestatus/queries/services/contact new file mode 100644 index 0000000..1729003 --- /dev/null +++ b/test/livestatus/queries/services/contact @@ -0,0 +1,4 @@ +GET services +Columns: contacts contact_groups +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/customvar b/test/livestatus/queries/services/customvar new file mode 100644 index 0000000..75c452c --- /dev/null +++ b/test/livestatus/queries/services/customvar @@ -0,0 +1,4 @@ +GET services +Columns: host_name service_description custom_variables cv_is_json +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/downtime b/test/livestatus/queries/services/downtime new file mode 100644 index 0000000..243c000 --- /dev/null +++ b/test/livestatus/queries/services/downtime @@ -0,0 +1,4 @@ +GET services +Columns: downtimes downtimes_with_info +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/extra b/test/livestatus/queries/services/extra new file mode 100644 index 0000000..b58976f --- /dev/null +++ b/test/livestatus/queries/services/extra @@ -0,0 +1,4 @@ +GET services +Columns: description host_name host_address notes notes_expanded notes_url notes_url_expanded action_url action_url_expanded icon_image icon_image_expanded icon_image_alt +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/group b/test/livestatus/queries/services/group new file mode 100644 index 0000000..83f4404 --- /dev/null +++ b/test/livestatus/queries/services/group @@ -0,0 +1,3 @@ +GET servicegroups +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/legacy b/test/livestatus/queries/services/legacy new file mode 100644 index 0000000..ebc0b4b --- /dev/null +++ b/test/livestatus/queries/services/legacy @@ -0,0 +1,4 @@ +GET services +Columns: host_name description notes notes_url action_url icon_image icon_image_alt +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/modattr b/test/livestatus/queries/services/modattr new file mode 100644 index 0000000..d1facd0 --- /dev/null +++ b/test/livestatus/queries/services/modattr @@ -0,0 +1,4 @@ +GET services +Columns: description modified_attributes modified_attributes_list original_attributes +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/notification b/test/livestatus/queries/services/notification new file mode 100644 index 0000000..eadcc90 --- /dev/null +++ b/test/livestatus/queries/services/notification @@ -0,0 +1,4 @@ +GET services +Columns: description current_notification_number notification_period notification_interval notifications_enabled no_more_notifications last_notification next_notification +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/services b/test/livestatus/queries/services/services new file mode 100644 index 0000000..09640fd --- /dev/null +++ b/test/livestatus/queries/services/services @@ -0,0 +1,3 @@ +GET services +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/services/state b/test/livestatus/queries/services/state new file mode 100644 index 0000000..65bf5f7 --- /dev/null +++ b/test/livestatus/queries/services/state @@ -0,0 +1,4 @@ +GET services +Columns: description host_name last_state_change last_hard_state_change last_time_ok last_time_warning last_time_critical last_time_unknown staleness is_reachable +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/special/services b/test/livestatus/queries/special/services new file mode 100644 index 0000000..94ddc91 --- /dev/null +++ b/test/livestatus/queries/special/services @@ -0,0 +1,5 @@ +GET services +Separators: 10 32 35 95 +Columns: description custom_variables +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/statehist/duration b/test/livestatus/queries/statehist/duration new file mode 100644 index 0000000..0de5bfa --- /dev/null +++ b/test/livestatus/queries/statehist/duration @@ -0,0 +1,5 @@ +GET statehist +Columns: host_name service_description state duration_ok duration_warning duration_critical duration_unknown duration_unmonitored +Filter: time >= 1348657741 +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/statehist/statehist b/test/livestatus/queries/statehist/statehist new file mode 100644 index 0000000..1ef2382 --- /dev/null +++ b/test/livestatus/queries/statehist/statehist @@ -0,0 +1,5 @@ +GET statehist +Columns: host_name service_description state duration duration_part in_downtime in_host_downtime in_notification_period is_flapping +Filter: time >= 1348657741 +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/statehist/statehist_disk b/test/livestatus/queries/statehist/statehist_disk new file mode 100644 index 0000000..33f7340 --- /dev/null +++ b/test/livestatus/queries/statehist/statehist_disk @@ -0,0 +1,6 @@ +GET statehist +Columns: host_name service_description state duration duration_part in_downtime in_host_downtime in_notification_period is_flapping +Filter: service_description = disk +Filter: time >= 1348657741 +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/statehist/sum b/test/livestatus/queries/statehist/sum new file mode 100644 index 0000000..b244adc --- /dev/null +++ b/test/livestatus/queries/statehist/sum @@ -0,0 +1,9 @@ +GET statehist +Columns: host_name service_description state duration duration_part +Filter: host_name = localhost +Filter: service_description = disk +Filter: time >= 1348657741 +Stats: sum duration +Stats: sum duration_part +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/status/checks b/test/livestatus/queries/status/checks new file mode 100644 index 0000000..32e5957 --- /dev/null +++ b/test/livestatus/queries/status/checks @@ -0,0 +1,4 @@ +GET status +Columns: accept_passive_host_checks accept_passive_service_checks execute_host_checks execute_service_checks +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/status/custom b/test/livestatus/queries/status/custom new file mode 100644 index 0000000..1c8821d --- /dev/null +++ b/test/livestatus/queries/status/custom @@ -0,0 +1,4 @@ +GET status +Columns: custom_variables +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/status/livestatus b/test/livestatus/queries/status/livestatus new file mode 100644 index 0000000..47f163c --- /dev/null +++ b/test/livestatus/queries/status/livestatus @@ -0,0 +1,4 @@ +GET status +Columns: connections connections_rate external_commands external_commands_rate livestatus_active_connections +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/status/program b/test/livestatus/queries/status/program new file mode 100644 index 0000000..64d3c17 --- /dev/null +++ b/test/livestatus/queries/status/program @@ -0,0 +1,4 @@ +GET status +Columns: nagios_pid program_start num_hosts num_services program_version +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/status/status b/test/livestatus/queries/status/status new file mode 100644 index 0000000..bf92485 --- /dev/null +++ b/test/livestatus/queries/status/status @@ -0,0 +1,3 @@ +GET status +ResponseHeader: fixed16 + diff --git a/test/livestatus/queries/timeperiods/timeperiod b/test/livestatus/queries/timeperiods/timeperiod new file mode 100644 index 0000000..e5f02ca --- /dev/null +++ b/test/livestatus/queries/timeperiods/timeperiod @@ -0,0 +1,3 @@ +GET timeperiods +ResponseHeader: fixed16 + diff --git a/test/livestatus/run_queries b/test/livestatus/run_queries new file mode 100755 index 0000000..c80aa59 --- /dev/null +++ b/test/livestatus/run_queries @@ -0,0 +1,26 @@ +#!/bin/bash + +NC=`which nc` +LOCALSTATEDIR=`icinga2 variable get LocalStateDir` +LIVESTATUSSOCKET="$LOCALSTATEDIR/run/icinga2/cmd/livestatus" +LIVESTATUSHOST="127.0.0.1" +LIVESTATUSPORT="6558" +LIVESTATUSQUERIES="./queries" + +LIVESTATUSTABLE=$1 + +echo -e "Querying Livestatus socket: $LIVESTATUSSOCKET" + +if [ -n "$LIVESTATUSTABLE" ]; then + cat "$LIVESTATUSTABLE" + (cat "$LIVESTATUSTABLE"; sleep 1) | $NC -U $LIVESTATUSSOCKET +else + + echo -e "Looking into $LIVESTATUSQUERIES\n" + for q in $(find $LIVESTATUSQUERIES -type f) + do + cat $q + (cat $q; sleep 1) | $NC -U $LIVESTATUSSOCKET + echo -e "================================\n\n" + done +fi -- cgit v1.2.3