Page 1 of 1

Setup Nagios Alerting for multiple specific strings

Posted: Fri Feb 24, 2012 3:17 pm
by cmort
I am evaluating NAgios XI to replace our current monitoring solution. That solution allows us to set URL content check looking for certain failure message strings and if the string. i.e. "central connetivity failure = yes" is present generate a failure e-mail, the text would normaly read "central connectivity failure = no" indicating a no problem exists. I would like know if I can configure Nagio XI to alert only when the specified text is present.
I know that I can configure Nagios to instead look for the normal state and if it changes I get my alert, but I need the ability to look for and alert on serveral different [possible text string vatiables that would indicate specific issues and help to uderstand the area of failure rather than just knowing that something failed.

Thank You

Re: Setup Nagios Alerting for multiple specific strings

Posted: Fri Feb 24, 2012 3:44 pm
by scottwilkerson
Yep, you can run the web url wizard check the box for "URL Content Regular Expression Match" and place your string in the "Regular Expression To Expect:" field You can also name the service in the "Service Name:" field.

Then once the host service is created (you can also create the services in the Core Config Manager) you need to edit the service
Configure -> Core Config Manager -> Services -> Modify Service
In the $ARG1$ field add --invert-regex
Save
Apply Configuration

What this will do is make it critical if the string is found

Re: Setup Nagios Alerting for multiple specific strings

Posted: Wed Mar 07, 2012 11:17 am
by cmort
Scott, thank you for the reaply.
OK , so now is it possible to modify the alert message sent from Nagios to include the expression found or not found is? This would be desireable so that the recipient will know what may have failed for a monitoring job that includes multiple arguments.

Thank You

Re: Setup Nagios Alerting for multiple specific strings

Posted: Wed Mar 07, 2012 1:01 pm
by scottwilkerson
I think the easiest way to do this would be to make the "service description" match what you are testing for. Then in the notification messages the %service% macro will be replaced with the service description