Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
Your review has been submitted and is pending approval.
Perl script that checks the number of established network connections using lsof
Current Version
Last Release Date
June 3, 2009
Owner
Nagios Exchange
Compatible With
You can check the number of established network connections of a specific user or the number of network connections of a given command. Those two options can be combined. Note: This script uses lsof with sudo. Make sure your /etc/sudoers is properly configured. For example put the following line into /etc/sudoers nagios ALL=NOPASSWD: /usr/sbin/lsof Please refer to the manpages for further options. Examples of usage: /usr/local/nagios/libexec/check_connections.pl -w 200 -c 250 -C httpd Will check the number of network connections for any command containig httpd. If the number of established connections is equal to or exceeds 200 a warning is reported, if it's more or equal to 250 the an error. /usr/local/nagios/libexec/check_connections.pl -w 200 -c 250 -u apache Same as above except not commands containing httpd will be checked but any commands owned by user apache. You can also use uids instead of login names. /usr/local/nagios/libexec/check_connections.pl -w 200 -c 250 -u apache -C httpd This checks only commands containing httpd owned by user apache. Released under the LGPL, visit http://www.gnu.org/licenses/lgpl.html for details. Tested on: - Redhat Linux 7.3 (x86) - Fedora Core 4 (x86) - Gentoo Linux 2006.1 (x86) - Solaris 10 (sparc)
It works perfectly fine but facing problem by using check_connection.pl script with NRPE. It returns zero connection count. ./check_nrpe -H host-name -c command-name gives... OK - Established connections: 0 help would be appreciated, THANKS
You must be logged in to submit a review.
To:
From: