Page 1 of 2
Passive Network Sensor External Application
Posted: Mon Aug 12, 2013 10:56 am
by tubosunedward
Hi,
Please I have a problem, I don't know how to integrate the passive ping network sensor I have written in perl with the nagios monitoring tool and have read so many articles without proper direction. The external program runs and works find which listens to broadcast traffic which are ARP and UDP rather than actively pinging the host.
I would be very happy if you can just give me a guideline how to integrate the program with the nagios system so the nagios tool can be used to view this services.
Edward
Re: Passive Network Sensor External Application
Posted: Mon Aug 12, 2013 11:01 am
by slansing
Have you read our development guidelines on how to integrate external scripts in the proper plugin format?:
http://nagiosplug.sourceforge.net/devel ... lines.html
I assume you are able to run the script and return valid output from the command line? Can you share the script you wrote? Other than that, the guidelines should provide what you need to integrate properly.
Re: Passive Network Sensor External Application
Posted: Mon Aug 12, 2013 12:33 pm
by tubosunedward
Thanks for your reply, I really do appreciate it. I am just having issues integrating it with nagios system to get it working, the code works well and displays the ip address of the live host which it detects by the kind of traffic passed.
The external application displays the ip address of the host that are live on the network sniffing this UDP and TCP packets rather than using active check_ping
I would be very happy if you could assist me.
Kind Regards
Edward.
Re: Passive Network Sensor External Application
Posted: Mon Aug 12, 2013 12:37 pm
by abrist
Could you post a copy of the script in code wraps?
Re: Passive Network Sensor External Application
Posted: Mon Aug 12, 2013 12:56 pm
by tubosunedward
Kindly find the script attached.
Re: Passive Network Sensor External Application
Posted: Mon Aug 12, 2013 1:49 pm
by abrist
You should read over the plugin dev. doc. There are a number of things you will have to do to fix up the script. Lines like:
Code: Select all
print "-----------------------------------"
should flat out be removed, as they will mess up your status string. I would suggest that you try to fit the output onto 1 line in the format:
Code: Select all
<status information> | <performance data>
Additionally, make sure you have some conditions for exit as the exit codes are what Nagios uses to determine the state (UP,DOWN, Critical etc) of the check.
Re: Passive Network Sensor External Application
Posted: Mon Aug 12, 2013 2:15 pm
by tubosunedward
Thanks for the reply, for passive checks how will nagios be configured to read the script... also can you suggest conditional codes I can use for this exits?
Re: Passive Network Sensor External Application
Posted: Mon Aug 12, 2013 3:04 pm
by slansing
You will need to use some sort of local way of triggering this script, then using that mode of transportation to send the data up to Nagios, a few options come to mind such as NRDS, NRDP, NSCA.
Re: Passive Network Sensor External Application
Posted: Mon Aug 12, 2013 9:48 pm
by tubosunedward
so in summary for passive checks I would need to use something like the NSCA and also ensure I edit the code to have exit codes 0,1,2,3?
Re: Passive Network Sensor External Application
Posted: Tue Aug 13, 2013 10:22 am
by slansing
Yes it must exit with a valid exit code based on warning and critical values, this way, Nagios will change the object's state. And yes, to use this plugin passively you will need to use a passive protocol, NSCA is one, but the others mentioned work fine as well.