Passive Network Sensor External Application

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.
tubosunedward
Posts: 7
Joined: Fri Aug 02, 2013 5:15 pm

Passive Network Sensor External Application

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Passive Network Sensor External Application

Post 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.
tubosunedward
Posts: 7
Joined: Fri Aug 02, 2013 5:15 pm

Re: Passive Network Sensor External Application

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Passive Network Sensor External Application

Post by abrist »

Could you post a copy of the script in code wraps?
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.
tubosunedward
Posts: 7
Joined: Fri Aug 02, 2013 5:15 pm

Re: Passive Network Sensor External Application

Post by tubosunedward »

Kindly find the script attached.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Passive Network Sensor External Application

Post 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.
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.
tubosunedward
Posts: 7
Joined: Fri Aug 02, 2013 5:15 pm

Re: Passive Network Sensor External Application

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Passive Network Sensor External Application

Post 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.
tubosunedward
Posts: 7
Joined: Fri Aug 02, 2013 5:15 pm

Re: Passive Network Sensor External Application

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Passive Network Sensor External Application

Post 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.
Locked