Page 1 of 1

Website URL Monitor Questions

Posted: Wed Jun 27, 2018 3:06 pm
by vornado
Hello.

I understand that with a Website URL Monitor, you can specify a string to search for in the content of the web page. So, for example, if it is configured to search for the word 'True' and a match is found, the status will be OK. If not, it will be 'Warning' or 'Critical'? (I haven't tested this yet)

Is it possible to do something a little more complex? We would like to be able to look for a return code in the page such as 2000, 3000, 4000, etc., and perhaps get OK for 2000, Warning for 3000 or Critical for 4000.

I'm not sure it matters, but the page we're monitoring currently returns XML:

Code: Select all

<LOGINRESULT>
        <SUCCESS>true/false</SUCCESS>
        <RETURNCODE>2000/3000/4000</RETURNCODE>
        <RETURNMSG>message</RETURNMSG>
</LOGINRESULT>
SUCCESS is true or false
RETURNCODE is 2000, 3000 or 4000
RETURNMSG is one of the following:

Code: Select all

RETURNCODE: 2000   RETURNMSG: "Success" (User found in DB as well as logged into blue)                
RETURNCODE: 3000   RETURNMSG: "Failed to get user from EPMCOMM" (Failed to find user in database)
RETURNCODE: 4000   RETURNMSG: "Failed to get Process ID"  (Failed to login to blue)
Thank you.

Steve

Re: Website URL Monitor Questions

Posted: Thu Jun 28, 2018 8:12 am
by scottwilkerson
vornado wrote:Is it possible to do something a little more complex?
Yes absolutely, but I don't know of a plugin that does this out of the box.

Enter the power of Nagios. You (or someone on your staff) can create your own plugins that do exactly what you accomplish, written in any language that can be run from the Linux command line

Here are the Nagios Plugin Development Guidelines

Code: Select all

https://nagios-plugins.org/doc/guidelines.html