Page 1 of 1

How to look for exact string using check_http plugin

Posted: Tue Jul 10, 2018 2:38 pm
by Sampath.Basireddy
Hello There,

We are using check_http plugin to monitor an URL and a string within the website.

Basically it is the state of an application which writes to the page.

Code: Select all

Different States:
Running
Running as standby
Running as suspended
The string am looking at is "Running", but when the string(state) changes to "Running in standby" the check still succeeds since "Running" string is still present.

Is there a way to look for the exact string with conditions to look for no more/no less?

Any help is greatly appreciated.

Thanks in advance.

Re: How to look for exact string using check_http plugin

Posted: Tue Jul 10, 2018 3:06 pm
by scottwilkerson
There is no way to do different states with check_http directly, but you could make a plugin and use check http inside to make multiple calls and return the output that you want and the exit code you want for each

Nagios plugin development guidelines
https://nagios-plugins.org/doc/guidelines.html