What plugin is suitable for monitor multiple port status

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

What plugin is suitable for monitor multiple port status

Postby junqian1992 » Tue Dec 04, 2018 1:42 am

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.
Regards,
JQ
junqian1992
 
Posts: 41
Joined: Wed Nov 15, 2017 4:57 am

Re: What plugin is suitable for monitor multiple port status

Postby mcapra » Tue Dec 04, 2018 10:11 am

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.


check_multi is one way to work around that constraint.

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
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3462
Joined: Thu May 05, 2016 3:54 pm

Re: What plugin is suitable for monitor multiple port status

Postby lmiltchev » Tue Dec 04, 2018 3:16 pm

Thanks Matt!

@junqian1992, let us know if the solutions, posted by @mcapra worked for you.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 11239
Joined: Mon May 23, 2011 12:15 pm

Re: What plugin is suitable for monitor multiple port status

Postby junqian1992 » Wed Dec 05, 2018 9:05 pm

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:
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


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 :
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


i have try to reinstall perl also encountered same error.
Regards,
JQ
junqian1992
 
Posts: 41
Joined: Wed Nov 15, 2017 4:57 am

Re: What plugin is suitable for monitor multiple port status

Postby lmiltchev » Thu Dec 06, 2018 10:14 am

It seems like you are missing the perl-Nagios-Plugin. On RHEL/CentOS you can install it by running:

Code: Select all
yum install perl-Nagios-Plugin -y


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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 11239
Joined: Mon May 23, 2011 12:15 pm


Return to Nagios Core

Who is online

Users browsing this forum: RIDS_I2MP and 25 guests