Page 1 of 1

setup up to monitor a xml data feed

Posted: Mon Jun 22, 2020 9:14 am
by Darrenk
Hi

i am a newbie to nagios and i am doing some test to see if nagios will be able to monitor what we require.


the call that we need to call is the below

http://SERVERNAME:8013/vsegameserver/da ... servertime

and the required result would be the below

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<ServerTime LocalTime="2020-06-22T14:14:30" UtcTime="2020-06-22 14:14:30Z" RoundTripTime="2020-06-22T14:14:30.0585118+00:00"/>

any idea if this is possible?

Re: setup up to monitor a xml data feed

Posted: Mon Jun 22, 2020 3:42 pm
by benjaminsmith
Hi,
any idea if this is possible?
There is an XML wizard available in Nagios XI 5.7 that should work well in this application. In GUI, just go to Configure > Start Monitoring Now and type XML into the search box.

Let me know if you have any questions about any of the fields in the wizard.

Benjamin

Re: setup up to monitor a xml data feed

Posted: Tue Jun 23, 2020 12:59 am
by Darrenk
Hi Benjamin

thanks for reaching out but i do need some help with the fields

so my xml call is http://SERVERNAME:8013/vsegameserver/da ... servertime

in the second screen of setting it up i see there is a field called integer with service description,url,key and then below strings with the same

i need to know of my initial call what do i need to put there and how do i tell nagios what reply to expect when calling the url

Re: setup up to monitor a xml data feed

Posted: Tue Jun 23, 2020 2:43 am
by Darrenk
hi benjamin

i just need help setting it up i see there are two fields when you configure them , any advise how to set this up ,so nagios knows what to expect

Re: setup up to monitor a xml data feed

Posted: Tue Jun 23, 2020 5:01 am
by Darrenk
hi thanks for the answer

i need helping telling nagios what to expect when configuring the xml or the url.
both fail on verification so clearly im doing something wrong

Re: setup up to monitor a xml data feed

Posted: Tue Jun 23, 2020 4:44 pm
by benjaminsmith
Hi,

Can you post a screenshot of the settings? If you passing a valid XML URL, it may be key values that are not getting matched correctly. If you click on the ? mark, there's some information about the required format. Thank you!
xml-wizard.png

Re: setup up to monitor a xml data feed

Posted: Fri Jun 26, 2020 6:20 am
by Darrenk
hi

so what i need to establish the aim of this

i want to call the server time off our api every few minutes to see that the datafeed api is still up
so should i use an xml call or a url call

the url in question is

http://vseintegration.kironinteractive. ... servertime

which returns this information below
<ServerTime LocalTime="2020-06-26T11:16:30" UtcTime="2020-06-26 11:16:30Z" RoundTripTime="2020-06-26T11:16:30.8435462+00:00"/>

so each call we do will obviosuly have a different time stamp and if we get no response back taht is similiar to the above we would assume the feed is down and we need to get notified for this.

hope that explains the purpose and hopefully you can assist.

Re: setup up to monitor a xml data feed

Posted: Fri Jun 26, 2020 4:54 pm
by benjaminsmith
HI @Darrenk

Thanks for the details, and it looks like the XML wizard is looking for a match, so the changing dates are an issue. That said, you can use the Website Wizard and search for a specific pattern based on the page. This wizard uses the check_httmp command, so if you wanted to look a match of LocalTime, the resulting check command would like like this:

Code: Select all

check_http -H vseintegration.kironinteractive.com -r "LocalTime" -f ok -I 88.99.248.22 -u "/vsegameserver/dataservice/servertime" -p 8013
The wizard makes it easy to set this up, and we have a document with step-by-step instructions.

Monitoring Websites With Nagios XI

Let me know if that would work out for you.

Benjamin

Re: setup up to monitor a xml data feed

Posted: Thu Jul 02, 2020 1:25 am
by Darrenk
Morning Benjamin

i am trying to follow the points and apologies if im coming across as an idiot with all these questions
so i tied doing it but it fails verification when the website tries to get it working so clearly im doing something wrong?

i used your code as the expression to expect so im not sure if that was correct
Please see my screenshots, i tried following the manual but it didnt seem to have what i was looking for.

Re: setup up to monitor a xml data feed

Posted: Thu Jul 02, 2020 1:54 pm
by benjaminsmith
Hi Darrenk,

Nothing is jumping at me in the screenshots, so not 100% sure on the cause for the configuration error. Did you enter a regular expression match in the last field? If not try once more.

Then before selecting the finish button, run the following tail command from the terminal, and if it fails post the output to the thread so we can review the error messages.

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log