Nagios TCP Connection Monitor

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
gr0mit
Posts: 2
Joined: Tue Mar 31, 2015 7:08 pm

Nagios TCP Connection Monitor

Post by gr0mit »

Is there a way to monitor established TCP connections to an NRPE client?
I have about 40 TCP connections to the same port from remote logging agents, and would like to get an alert if one of these connections drops.
Also the name of the remote host that disconnected would be good.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios TCP Connection Monitor

Post by ssax »

You would need to write your own custom script.

You could base it off of the following post:

http://serverfault.com/questions/402449 ... onnections

You could modify it to create a temp file after each run with the full netstat output.
The next time it runs, run a diff on the temp file and the new netstat output and use awk or some other method to grab the IP that is missing.
Run a DNS query on the IP to grab the hostname and return that with an error code.
Locked