Page 1 of 1
Nagios3 make service check serialized?
Posted: Tue Jul 30, 2013 8:16 am
by soulliss
Hi all!
I have service "check_iperf" that connects to remote host and use iperf to measure bandwith etc. I have around 50 hosts and so this service should be checked one by one. Since in nagios3 all service checks and host checks are parallelized by default I have a problem with this specific service
Does anyone know a way to make this certain service check in serialized way?
I tried with setting "parallelize_check 0" in service definition but it doesnt seem to work.
Thx!
Re: Nagios3 make service check serialized?
Posted: Tue Jul 30, 2013 10:23 am
by yancy
soulliss,
Just so I understand, you need all hosts to be check one by one in a linear fashion? So it would check the first one, and not check the 2nd one until the first one has finished?
Can you explain why this is important for use with check_iperf?
-Yancy
Re: Nagios3 make service check serialized?
Posted: Wed Jul 31, 2013 1:33 am
by soulliss
HI yancy,
cause check_iperf script from nagios server connects to remote server that runs iperf server daemon. Link to my remote locations is 2Mb, my central location (nagios) is 10Mb, as I need to check 50 remote location every check should be run separately. Also I am using in check_iperf script "lock file", so It can be run more then once at the same time.
Only this service check should checked in linear fashion, everything else stays in parallel.
Thx!
Re: Nagios3 make service check serialized?
Posted: Wed Jul 31, 2013 10:27 am
by yancy
soulliss,
What about writing a simple shell script to connect to each remote location one at a time.
-Yancy
Re: Nagios3 make service check serialized?
Posted: Thu Aug 01, 2013 5:30 am
by soulliss
I could put all in one script but how do I return output into nagios for every host?
Re: Nagios3 make service check serialized?
Posted: Thu Aug 01, 2013 11:55 am
by yancy
soulliss,
http://nagios.sourceforge.net/docs/3_0/pluginapi.html
as defined in the guidelines, everything included after the | goes to long output. you could put the results of each host here. the warning and critical values could be dependent on one host or any number of hosts.
Another option would be to have the client send back data as a passive check. That would allow you to keep each host as a separate host in Nagios. Is it the amount of data being returned that is the issue over the slow connection, or is it the time it takes to run the check over the connection?
I'm still looking into a true serialize option but haven't found anything yet.
-Yancy
Re: Nagios3 make service check serialized?
Posted: Fri Aug 02, 2013 5:47 am
by soulliss
Yea I was thinking of making one script to check them all and then forward results through mail or something. But I would really like to check it as every other service using nagios so I can log it, graph it etc.
Problem is that iperf checks download and upload. Download connect from random port on server to port 5001 on host, upload goes other way around. Host connect to server port 5001. It means only one connection from host to server. Even if I do NAT or similar, the link would be bottleneck for multiple host check in the same time.
Making host send passive check would require puting script on every host, scheduling it individualy etc. This way I only run iperf as a daemon on every host, and configuring everything else from nagios server.
I am also googleing some way of making it serialized but still no luck

Thx for trying to help Yancy
- soulliss
Re: Nagios3 make service check serialized?
Posted: Fri Aug 02, 2013 9:55 am
by yancy
soulliss,
Check this out:
http://old.nagios.org/developerinfo/ext ... and_id=115
So in you're script you could pass the service and host results directly to nagios.cmd. That way you would have results run in a serial fasion from a script, and return individual results for each host and service.
(note: you would need to disable active checks for the hosts you're manually pushing results to via nagios.cmd)
-Yancy