Hi all,
I want to monitor all the port on the server by using nrpe.
The check_listen_tcp_udp can check the port status, but if the server exist many port is very hard to configure since i need to configure many plugin command on the nrpe.conf.
can recommend what plugin is suitable for me to monitor port range ? like tcp 5000 to 5200 port. if one port down it will critical.
Thank you.
What plugin is suitable for monitor multiple port status
-
- Posts: 41
- Joined: Wed Nov 15, 2017 4:57 am
Re: What plugin is suitable for monitor multiple port status
check_multi is one way to work around that constraint.junqian1992 wrote:The check_listen_tcp_udp can check the port status, but if the server exist many port is very hard to configure since i need to configure many plugin command on the nrpe.conf.
This plugin can check a TCP port range:
https://github.com/gavincarr/nagios-of- ... _tcp_range
You could create a check_udp subroutine that looks almost identical to the check_tcp subroutine, with the protocol set to UDP instead of assuming a default. Call that on line 45 with an "and" conditional.
Docs for that Perl module:
https://perldoc.perl.org/IO/Socket/INET.html
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: What plugin is suitable for monitor multiple port status
Thanks Matt!
@junqian1992, let us know if the solutions, posted by @mcapra worked for you.
@junqian1992, let us know if the solutions, posted by @mcapra worked for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 41
- Joined: Wed Nov 15, 2017 4:57 am
Re: What plugin is suitable for monitor multiple port status
Hi,
@mcapra Thanks for your suggestion.
Last night i try to run the check_multi on my server is working, but my server is more than 300++ port, i only monitor 100 port it cause the CPU high load, the check command is using check_listening_tcp_udp.
example:
each open_port*.cmd got 20 check command, and i set it running every 5min.
and the TCP port range plugin unable to run it, it show :
i have try to reinstall perl also encountered same error.
@mcapra Thanks for your suggestion.
Last night i try to run the check_multi on my server is working, but my server is more than 300++ port, i only monitor 100 port it cause the CPU high load, the check command is using check_listening_tcp_udp.
example:
Code: Select all
#command[check_open_port_status2]=/usr/lib64/nagios/plugins/check_multi -f /usr/lib64/nagios/plugins/openport/open_port2.cmd
#command[check_open_port_status3]=/usr/lib64/nagios/plugins/check_multi -f /usr/lib64/nagios/plugins/openport/open_port3.cmd
#command[check_open_port_status4]=/usr/lib64/nagios/plugins/check_multi -f /usr/lib64/nagios/plugins/openport/open_port4.cmd
#command[check_open_port_status5]=/usr/lib64/nagios/plugins/check_multi -f /usr/lib64/nagios/plugins/openport/open_port5.cmd
#command[check_open_port_status6]=/usr/lib64/nagios/plugins/check_multi -f /usr/lib64/nagios/plugins/openport/open_port6.cmd
and the TCP port range plugin unable to run it, it show :
Code: Select all
Can't locate Nagios/Plugin/Getopt.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./check_tcp_range lineke/Getopt.pm
[root@nagios-serverxxxx libexec]# find / -name Getopt.pm
/usr/local/share/perl5/Nagios/Monitoring/Plugin/Getopt.pm
/usr/share/autoconf/Autom4te/Getopt.pm
/usr/share/automake-1.13/Automake/Getopt.pm
Regards,
JQ
JQ
Re: What plugin is suitable for monitor multiple port status
It seems like you are missing the perl-Nagios-Plugin. On RHEL/CentOS you can install it by running:
Note: The package is provided by the epel repo. If you don't have it enabled, you should do so before running the command above.
Code: Select all
yum install perl-Nagios-Plugin -y
Be sure to check out our Knowledgebase for helpful articles and solutions!