Monitoring web service

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
eddie
Posts: 1
Joined: Tue Mar 05, 2013 5:37 am

Monitoring web service

Post by eddie »

Hi there,
I am new to Nagios so I am probably asking basic questions. I have web service which returns XML that I want to monitor. The XML returns if the services I am monitoring are available or not so I basically need Nagios to fetch the XML from web service and read through it and fin if any monitoring tags are set to FALSE which means the service is down.

This is an example of the XML tag I would like to interpret, the status would change from TRUE or FALSE if the service is unavailable.
<check name="Service1" status="TRUE" description="Test if Service 1 is available" priority="1">

Anybody done anything like this or know of documentation on how to implement in Nagios XI

Thank's
eddie
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Monitoring web service

Post by sreinhardt »

Probably the easiest way to do this would be the Website URL wizard. This way, you can either create one check to search for False in general, then be notified to look at the page, or create individual checks looking for <check name="Service1" status="TRUE" description="Test if Service 1 is available" priority="1"> as a whole, and if not found alert. If you choose to look for false in general, you will want to complete the wizard then modify the check within CCM to invert the regex, so that when false is found, it alerts instead of normally the check works that if the string is not found it alerts.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring web service

Post by abrist »

You could use the website url monitoring wizard and search for a "FALSE" string. I assume you have a url that returns the XML?
If you need more control over the check, you could create a custom service check with the check_http plugin (the same one the wizard uses).
http://nagiosplugins.org/man/check_http

Otherwise you could write a custom script to wget the xml, parse it for certain strings and then return the proper exit code.
http://nagiosplug.sourceforge.net/devel ... lines.html
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked