From 8d8f8da5e13b4b83553ff3a09e7a150ad5f3f029 Mon Sep 17 00:00:00 2001 From: Roland Kool Date: Wed, 4 May 2016 15:11:56 +0200 Subject: [PATCH] Add various nagios grok patterns This adds new grok patterns to match the following external commands: DISABLE_HOST_SVC_CHECKS ENABLE_HOST_SVC_CHECKS SCHEDULE_SVC_DOWNTIME SCHEDULE_HOST_SVC_DOWNTIME SCHEDULE_FORCED_SVC_CHECK SCHEDULE_SVC_CHECK SCHEDULE_FORCED_HOST_CHECK SCHEDULE_HOST_CHECK SCHEDULE_FORCED_HOST_SVC_CHECKS SCHEDULE_HOST_SVC_CHECKS ACKNOWLEDGE_SVC_PROBLEM ACKNOWLEDGE_HOST_PROBLEM Change-Id: I7351fd755670f7aeee9182584cd5cddf6bdc5323 --- patterns/nagios | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/patterns/nagios b/patterns/nagios index 1539c8cd..97694dbf 100644 --- a/patterns/nagios +++ b/patterns/nagios @@ -53,16 +53,28 @@ NAGIOS_EC_DISABLE_SVC_CHECK DISABLE_SVC_CHECK NAGIOS_EC_ENABLE_SVC_CHECK ENABLE_SVC_CHECK NAGIOS_EC_DISABLE_HOST_CHECK DISABLE_HOST_CHECK NAGIOS_EC_ENABLE_HOST_CHECK ENABLE_HOST_CHECK +NAGIOS_EC_DISABLE_HOST_SVC_CHECKS DISABLE_HOST_SVC_CHECKS +NAGIOS_EC_ENABLE_HOST_SVC_CHECKS ENABLE_HOST_SVC_CHECKS NAGIOS_EC_PROCESS_SERVICE_CHECK_RESULT PROCESS_SERVICE_CHECK_RESULT NAGIOS_EC_PROCESS_HOST_CHECK_RESULT PROCESS_HOST_CHECK_RESULT -NAGIOS_EC_SCHEDULE_SERVICE_DOWNTIME SCHEDULE_SERVICE_DOWNTIME +NAGIOS_EC_SCHEDULE_SVC_DOWNTIME SCHEDULE_SVC_DOWNTIME NAGIOS_EC_SCHEDULE_HOST_DOWNTIME SCHEDULE_HOST_DOWNTIME +NAGIOS_EC_SCHEDULE_HOST_SVC_DOWNTIME SCHEDULE_HOST_SVC_DOWNTIME NAGIOS_EC_DISABLE_HOST_SVC_NOTIFICATIONS DISABLE_HOST_SVC_NOTIFICATIONS NAGIOS_EC_ENABLE_HOST_SVC_NOTIFICATIONS ENABLE_HOST_SVC_NOTIFICATIONS NAGIOS_EC_DISABLE_HOST_NOTIFICATIONS DISABLE_HOST_NOTIFICATIONS NAGIOS_EC_ENABLE_HOST_NOTIFICATIONS ENABLE_HOST_NOTIFICATIONS NAGIOS_EC_DISABLE_SVC_NOTIFICATIONS DISABLE_SVC_NOTIFICATIONS NAGIOS_EC_ENABLE_SVC_NOTIFICATIONS ENABLE_SVC_NOTIFICATIONS +NAGIOS_EC_SCHEDULE_FORCED_SVC_CHECK SCHEDULE_FORCED_SVC_CHECK +NAGIOS_EC_SCHEDULE_SVC_CHECK SCHEDULE_SVC_CHECK +NAGIOS_EC_SCHEDULE_FORCED_HOST_CHECK SCHEDULE_FORCED_HOST_CHECK +NAGIOS_EC_SCHEDULE_HOST_CHECK SCHEDULE_HOST_CHECK +NAGIOS_EC_SCHEDULE_FORCED_HOST_SVC_CHECKS SCHEDULE_FORCED_HOST_SVC_CHECKS +NAGIOS_EC_SCHEDULE_HOST_SVC_CHECKS SCHEDULE_HOST_SVC_CHECKS +NAGIOS_EC_ACKNOWLEDGE_SVC_PROBLEM ACKNOWLEDGE_SVC_PROBLEM +NAGIOS_EC_ACKNOWLEDGE_HOST_PROBLEM ACKNOWLEDGE_HOST_PROBLEM + ############################################### ######## End external check types ############################################### @@ -98,10 +110,12 @@ NAGIOS_TIMEPERIOD_TRANSITION %{NAGIOS_TYPE_TIMEPERIOD_TRANSITION:nagios_type}: % #Disable host & service check NAGIOS_EC_LINE_DISABLE_SVC_CHECK %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_DISABLE_SVC_CHECK:nagios_command};%{DATA:nagios_hostname};%{DATA:nagios_service} NAGIOS_EC_LINE_DISABLE_HOST_CHECK %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_DISABLE_HOST_CHECK:nagios_command};%{DATA:nagios_hostname} +NAGIOS_EC_LINE_DISABLE_HOST_SVC_CHECKS %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_DISABLE_HOST_SVC_CHECKS:nagios_command};%{DATA:nagios_hostname} #Enable host & service check NAGIOS_EC_LINE_ENABLE_SVC_CHECK %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_ENABLE_SVC_CHECK:nagios_command};%{DATA:nagios_hostname};%{DATA:nagios_service} NAGIOS_EC_LINE_ENABLE_HOST_CHECK %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_ENABLE_HOST_CHECK:nagios_command};%{DATA:nagios_hostname} +NAGIOS_EC_LINE_ENABLE_HOST_SVC_CHECKS %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_ENABLE_HOST_SVC_CHECKS:nagios_command};%{DATA:nagios_hostname} #Process host & service check NAGIOS_EC_LINE_PROCESS_SERVICE_CHECK_RESULT %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_PROCESS_SERVICE_CHECK_RESULT:nagios_command};%{DATA:nagios_hostname};%{DATA:nagios_service};%{DATA:nagios_state};%{GREEDYDATA:nagios_check_result} @@ -118,7 +132,21 @@ NAGIOS_EC_LINE_ENABLE_HOST_NOTIFICATIONS %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_t NAGIOS_EC_LINE_ENABLE_SVC_NOTIFICATIONS %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_ENABLE_SVC_NOTIFICATIONS:nagios_command};%{DATA:nagios_hostname};%{GREEDYDATA:nagios_service} #Schedule host & service downtime -NAGIOS_EC_LINE_SCHEDULE_HOST_DOWNTIME %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_SCHEDULE_HOST_DOWNTIME:nagios_command};%{DATA:nagios_hostname};%{NUMBER:nagios_start_time};%{NUMBER:nagios_end_time};%{NUMBER:nagios_fixed};%{NUMBER:nagios_trigger_id};%{NUMBER:nagios_duration};%{DATA:author};%{DATA:comment} +NAGIOS_EC_LINE_SCHEDULE_HOST_DOWNTIME %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_SCHEDULE_HOST_DOWNTIME:nagios_command};%{DATA:nagios_hostname};%{NUMBER:nagios_start_time};%{NUMBER:nagios_end_time};%{NUMBER:nagios_fixed};%{NUMBER:nagios_trigger_id};%{NUMBER:nagios_duration};%{DATA:nagios_author};%{GREEDYDATA:nagios_comment} +NAGIOS_EC_LINE_SCHEDULE_HOST_SVC_DOWNTIME %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_SCHEDULE_HOST_SVC_DOWNTIME:nagios_command};%{DATA:nagios_hostname};%{NUMBER:nagios_start_time};%{NUMBER:nagios_end_time};%{NUMBER:nagios_fixed};%{NUMBER:nagios_trigger_id};%{NUMBER:nagios_duration};%{DATA:nagios_author};%{GREEDYDATA:nagios_comment} +NAGIOS_EC_LINE_SCHEDULE_SVC_DOWNTIME %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_SCHEDULE_SVC_DOWNTIME:nagios_command};%{DATA:nagios_hostname};%{DATA:nagios_service};%{NUMBER:nagios_start_time};%{NUMBER:nagios_end_time};%{NUMBER:nagios_fixed};%{NUMBER:nagios_trigger_id};%{NUMBER:nagios_duration};%{DATA:nagios_author};%{GREEDYDATA:nagios_comment} + +#Scheduled checks +NAGIOS_EC_LINE_SCHEDULE_FORCED_SVC_CHECK %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_SCHEDULE_FORCED_SVC_CHECK:nagios_command};%{DATA:nagios_hostname};%{DATA:nagios_service};%{NUMBER:nagios_start_time} +NAGIOS_EC_LINE_SCHEDULE_SVC_CHECK %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_SCHEDULE_SVC_CHECK:nagios_command};%{DATA:nagios_hostname};%{DATA:nagios_service};%{NUMBER:nagios_start_time} +NAGIOS_EC_LINE_SCHEDULE_FORCED_HOST_CHECK %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_SCHEDULE_FORCED_HOST_CHECK:nagios_command};%{DATA:nagios_hostname};%{NUMBER:nagios_start_time} +NAGIOS_EC_LINE_SCHEDULE_HOST_CHECK %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_SCHEDULE_HOST_CHECK:nagios_command};%{DATA:nagios_hostname};%{NUMBER:nagios_start_time} +NAGIOS_EC_LINE_SCHEDULE_FORCED_HOST_SVC_CHECKS %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_SCHEDULE_FORCED_HOST_SVC_CHECKS:nagios_command};%{DATA:nagios_hostname};%{NUMBER:nagios_start_time} +NAGIOS_EC_LINE_SCHEDULE_HOST_SVC_CHECKS %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_SCHEDULE_HOST_SVC_CHECKS:nagios_command};%{DATA:nagios_hostname};%{NUMBER:nagios_start_time} + +#Acknowledgements +NAGIOS_EC_LINE_ACKNOWLEDGE_HOST_PROBLEM %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_ACKNOWLEDGE_HOST_PROBLEM:nagios_command};%{DATA:nagios_hostname};%{NUMBER};%{NUMBER};%{NUMBER};%{DATA:nagios_author};%{GREEDYDATA:nagios_comment} +NAGIOS_EC_LINE_ACKNOWLEDGE_SVC_PROBLEM %{NAGIOS_TYPE_EXTERNAL_COMMAND:nagios_type}: %{NAGIOS_EC_ACKNOWLEDGE_SVC_PROBLEM:nagios_command};%{DATA:nagios_hostname};%{DATA:nagios_service};%{NUMBER};%{NUMBER};%{NUMBER};%{DATA:nagios_author};%{GREEDYDATA:nagios_comment} #End matching line -NAGIOSLOGLINE %{NAGIOSTIME} (?:%{NAGIOS_WARNING}|%{NAGIOS_CURRENT_SERVICE_STATE}|%{NAGIOS_CURRENT_HOST_STATE}|%{NAGIOS_SERVICE_NOTIFICATION}|%{NAGIOS_HOST_NOTIFICATION}|%{NAGIOS_SERVICE_ALERT}|%{NAGIOS_HOST_ALERT}|%{NAGIOS_SERVICE_FLAPPING_ALERT}|%{NAGIOS_HOST_FLAPPING_ALERT}|%{NAGIOS_SERVICE_DOWNTIME_ALERT}|%{NAGIOS_HOST_DOWNTIME_ALERT}|%{NAGIOS_PASSIVE_SERVICE_CHECK}|%{NAGIOS_PASSIVE_HOST_CHECK}|%{NAGIOS_SERVICE_EVENT_HANDLER}|%{NAGIOS_HOST_EVENT_HANDLER}|%{NAGIOS_TIMEPERIOD_TRANSITION}|%{NAGIOS_EC_LINE_DISABLE_SVC_CHECK}|%{NAGIOS_EC_LINE_ENABLE_SVC_CHECK}|%{NAGIOS_EC_LINE_DISABLE_HOST_CHECK}|%{NAGIOS_EC_LINE_ENABLE_HOST_CHECK}|%{NAGIOS_EC_LINE_PROCESS_HOST_CHECK_RESULT}|%{NAGIOS_EC_LINE_PROCESS_SERVICE_CHECK_RESULT}|%{NAGIOS_EC_LINE_SCHEDULE_HOST_DOWNTIME}|%{NAGIOS_EC_LINE_DISABLE_HOST_SVC_NOTIFICATIONS}|%{NAGIOS_EC_LINE_ENABLE_HOST_SVC_NOTIFICATIONS}|%{NAGIOS_EC_LINE_DISABLE_HOST_NOTIFICATIONS}|%{NAGIOS_EC_LINE_ENABLE_HOST_NOTIFICATIONS}|%{NAGIOS_EC_LINE_DISABLE_SVC_NOTIFICATIONS}|%{NAGIOS_EC_LINE_ENABLE_SVC_NOTIFICATIONS}) +NAGIOSLOGLINE %{NAGIOSTIME} (?:%{NAGIOS_WARNING}|%{NAGIOS_CURRENT_SERVICE_STATE}|%{NAGIOS_CURRENT_HOST_STATE}|%{NAGIOS_SERVICE_NOTIFICATION}|%{NAGIOS_HOST_NOTIFICATION}|%{NAGIOS_SERVICE_ALERT}|%{NAGIOS_HOST_ALERT}|%{NAGIOS_SERVICE_FLAPPING_ALERT}|%{NAGIOS_HOST_FLAPPING_ALERT}|%{NAGIOS_SERVICE_DOWNTIME_ALERT}|%{NAGIOS_HOST_DOWNTIME_ALERT}|%{NAGIOS_PASSIVE_SERVICE_CHECK}|%{NAGIOS_PASSIVE_HOST_CHECK}|%{NAGIOS_SERVICE_EVENT_HANDLER}|%{NAGIOS_HOST_EVENT_HANDLER}|%{NAGIOS_TIMEPERIOD_TRANSITION}|%{NAGIOS_EC_LINE_DISABLE_SVC_CHECK}|%{NAGIOS_EC_LINE_ENABLE_SVC_CHECK}|%{NAGIOS_EC_LINE_DISABLE_HOST_CHECK}|%{NAGIOS_EC_LINE_ENABLE_HOST_CHECK}|%{NAGIOS_EC_LINE_DISABLE_HOST_SVC_CHECKS}|%{NAGIOS_EC_LINE_ENABLE_HOST_SVC_CHECKS}|%{NAGIOS_EC_LINE_PROCESS_HOST_CHECK_RESULT}|%{NAGIOS_EC_LINE_PROCESS_SERVICE_CHECK_RESULT}|%{NAGIOS_EC_LINE_SCHEDULE_HOST_DOWNTIME}|%{NAGIOS_EC_LINE_SCHEDULE_HOST_SVC_DOWNTIME}|%{NAGIOS_EC_LINE_SCHEDULE_SVC_DOWNTIME}|%{NAGIOS_EC_LINE_SCHEDULE_FORCED_SVC_CHECK}|%{NAGIOS_EC_LINE_SCHEDULE_SVC_CHECK}|%{NAGIOS_EC_LINE_SCHEDULE_FORCED_HOST_CHECK}|%{NAGIOS_EC_LINE_SCHEDULE_HOST_CHECK}|%{NAGIOS_EC_LINE_SCHEDULE_FORCED_HOST_SVC_CHECKS}|%{NAGIOS_EC_LINE_SCHEDULE_HOST_SVC_CHECKS}|%{NAGIOS_EC_LINE_DISABLE_HOST_SVC_NOTIFICATIONS}|%{NAGIOS_EC_LINE_ENABLE_HOST_SVC_NOTIFICATIONS}|%{NAGIOS_EC_LINE_DISABLE_HOST_NOTIFICATIONS}|%{NAGIOS_EC_LINE_ENABLE_HOST_NOTIFICATIONS}|%{NAGIOS_EC_LINE_DISABLE_SVC_NOTIFICATIONS}|%{NAGIOS_EC_LINE_ENABLE_SVC_NOTIFICATIONS}|%{NAGIOS_EC_LINE_ACKNOWLEDGE_HOST_PROBLEM}|%{NAGIOS_EC_LINE_ACKNOWLEDGE_SVC_PROBLEM})