Page 1 of 1

Notification of Service as a Warning

Posted: Mon Jul 21, 2025 1:40 pm
by gregbeyer
Hello, we would like to change how certain services are notified. At present all notified service checks notify with subject line including "CRITICAL" along with the check name and host. But some check failures, aren't really "CRITICAL" per se. They're good to know about, and we still want push notification to email, but "WARNING" is more appropriate in the email subject line for particular checks.

Have I fixed this by simply changing, in Service Management / Alert Settings, selecting Warning and un-selecting Critical? Or, as I suspect, does this merely mean alert on Warning? And since my service check results are either OK or not (CRITICAL), will I miss what I want to be notified of?

Thanks for clarifying.

Re: Notification of Service as a Warning

Posted: Mon Jul 21, 2025 8:00 pm
by kg2857
You can use the negate plugin to change from critical to warning.

Re: Notification of Service as a Warning

Posted: Wed Jul 23, 2025 10:06 am
by gregbeyer
Very interesting, thanks for that! I read the documentation a https://assets.nagios.com/downloads/nag ... n-2024.pdf
Negate can change a critical to OK or an OK to critical -- so switch between the two ends of the spectrum so to speak. But not seeing how to change a critical to warning -- the intermediate condition.

Something else I came across in researching a solution is event handlers. Wonder if I could clone, then create a special event handler only to be used for these service checks that should be warn, instead of critical? Maybe xi_service_event_handler or xi_service_notification_handler. Then manipulate or hard code servicestate=$SERVICESTATE$ or servicestatetype=$SERVICESTATETYPE$ to get what I want. But would I mess up the email notification in doing this? Can't find documentation on these so far, so kinda feeling in the dark.

Re: Notification of Service as a Warning

Posted: Wed Jul 23, 2025 9:25 pm
by kg2857
Check again...
-o, --ok=STATUS
-w, --warning=STATUS
-c, --critical=STATUS
-u, --unknown=STATUS
STATUS can be 'OK', 'WARNING', 'CRITICAL' or 'UNKNOWN' without single
quotes. Numeric values are accepted. If nothing is specified, permutes
OK and CRITICAL.