Monitoring Multiple Services w/ One call to fetch data

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
williamt
Posts: 3
Joined: Sun Apr 27, 2014 2:26 pm

Monitoring Multiple Services w/ One call to fetch data

Post by williamt »

I'm trying to monitor some wireless devices. I'm currently evaluating using this plugin https://github.com/zmousm/ubnt-nagios-p ... 24_http.py
I'm not super happy with the way this plugin is written and may write one from scratch.

What I would like to know if possible, is whether I can make one call to the device to poll information and have it display over multiple services.
That way I'm not making several requests to the host over and over to get information.
For instance I would like to monitor signal strength, noise, speed, etc. But have them displayed as separate services. That way if one of them
is in warning or critical state, it will be very easy to see which one is having a problem.

Is something like this possible?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Monitoring Multiple Services w/ One call to fetch data

Post by tmcdonald »

That depends on what you mean by "one call" but basically the answer is no. No matter how you look at it, you're going to have to make multiple SNMP get requests if you want multiple values returned. So that right there constitutes more than one call. And even if you could get all that back in one go, Nagios does not have a way to separate out data from one service check into multiple services. The best you could do is write a wrapper script, have one active service call that script, and that script then makes the appropriate SNMP calls and sends the results passively to Nagios where other passive services will pick it up.
Former Nagios employee
williamt
Posts: 3
Joined: Sun Apr 27, 2014 2:26 pm

Re: Monitoring Multiple Services w/ One call to fetch data

Post by williamt »

Yes I wanted to make one call that returns multiple data items to monitor as separate services.
Perhaps the passive approach may work for me though. Do you know of any resources or example
monitors that use this approach?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Monitoring Multiple Services w/ One call to fetch data

Post by tmcdonald »

Not off the top of my head, no. Most people just create the multiple services and have them take care of their own checking.
Former Nagios employee
williamt
Posts: 3
Joined: Sun Apr 27, 2014 2:26 pm

Re: Monitoring Multiple Services w/ One call to fetch data

Post by williamt »

Hmmm okay I'll hunt around. If I need to monitor 15 data items or so I didn't want to make that many calls. Especially
since all the data gets returned with one call. It returns a JSON result set with everything I need. Seems silly to
call multiple times. But maybe that's the only way to do it.

I guess I could always have something that fetched the data and wrote it down to a file and then had individual services
that read from that file. Perhaps that would work okay.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Monitoring Multiple Services w/ One call to fetch data

Post by slansing »

I mean, you could push the data on the system to a output file, and then create a plugin to read that updated file every so often and update one service with all the information cleanly formatted. You could also set up a passive check with NCPA, or NSCA to read the file every 5 minutes or so and push all the information back up, whether updated or not.
Locked