UDP port for monitor

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Vigneshwar.A
Posts: 25
Joined: Fri May 12, 2017 2:02 am

UDP port for monitor

Post by Vigneshwar.A »

Hello Team,

I need to monitor UDP port 1162 in nagios, so for that am using the below script,
https://exchange.nagios.org/directory/P ... rt/details

when i tried in nagios server putty session its giving an output stating that its working fine but when i configured the same in GUI its giving critical, so kindly help us to resolve the issue. PFA info

Putty Output:
[root@xxxxx libexec]# /usr/local/nagios/libexec/check_udp_port -H xxxxx -p 1162 -s "health-trap"
OK: health-trap listening on port 1162: 1162/udp open|filtered health-trap

Nagios Command:
$USER1$/check_udp_port -H $HOSTADDRESS$ -p $ARG1$ -s $ARG2$

Nagios Version: 5.4.12
OS: Red Hat Enterprise Linux Server release 7.3
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: UDP port for monitor

Post by npolovenko »

Hello, @Vigneshwar.A. You need to add the following line to the /etc/sudoers:
NAGIOSXI ALL = NOPASSWD:/usr/local/nagios/libexec/check_udp_port *
And the command definition should be:
sudo $USER1$/check_udp_port -H $HOSTNAME$ -p $ARG1$ -s $ARG2$
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Vigneshwar.A
Posts: 25
Joined: Fri May 12, 2017 2:02 am

Re: UDP port for monitor

Post by Vigneshwar.A »

Hello,

As per your concern i have made entries in /etc/sudoers file and command has been created.

When we checked in nagios CCM back-end the UDP Port service by giving run check command its working but in front end its still showing critical alert. PFB SS
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: UDP port for monitor

Post by npolovenko »

@Vigneshwar.A, What are the permissions on the plugin?
ls -l /usr/local/nagios/libexec/check_udp_port
Please sign in to the console as the nagios user, run the plugin and show me the output.
su - nagios
/usr/local/nagios/etc/libexec/check_udp_port -H replace_with_ip_address -p 1162 -s "health-trap"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Vigneshwar.A
Posts: 25
Joined: Fri May 12, 2017 2:02 am

Re: UDP port for monitor

Post by Vigneshwar.A »

Hi Npolovenko,

check_udp_port plugin has 777 permission to execute. PFB output

[root@xxxxxxxxx libexec]# ls -ltr|grep -i check_udp_port
-rwxrwxrwx. 1 root nagios 1615 Sep 25 12:27 check_udp_port
---------------------
Nagios user output:
[nagios@xxxxxxxx ~]$ ls -ltr /usr/local/nagios/libexec/check_udp_port
-rwxrwxrwx. 1 root nagios 1615 Sep 25 12:27 /usr/local/nagios/libexec/check_udp_port

[nagios@xxxxxxxx libexec]$ ./check_udp_port -H xxxxxxxxxxx -p 1162 -s "health-trap"
You requested a scan type which requires root privileges.
QUITTING!
CRITICAL:
[nagios@xxxxxxx libexec]$
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: UDP port for monitor

Post by npolovenko »

@Vigneshwar.A, What about running the command with sudo as the nagios user?
[nagios@xxxxxxxx libexec]$ sudo /usr/local/nagios/check_udp_port -H xxxxxxxxxxx -p 1162 -s "health-trap"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Vigneshwar.A
Posts: 25
Joined: Fri May 12, 2017 2:02 am

Re: UDP port for monitor

Post by Vigneshwar.A »

Hi,

PFB output for the command.

[nagios@XXXXX ~]$ sudo /usr/local/nagios/libexec/check_udp_port -H XXXXXX -p 1162 -s "health-trap"
OK: health-trap listening on port 1162: 1162/udp open|filtered health-trap
[nagios@XXXXX ~]$
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: UDP port for monitor

Post by lmiltchev »

It seems like now you can run the plugin as nagios user, so the check should also work for you in the GUI. Let us know if your issue has been resolved.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Vigneshwar.A
Posts: 25
Joined: Fri May 12, 2017 2:02 am

Re: UDP port for monitor

Post by Vigneshwar.A »

lmiltchev wrote:It seems like now you can run the plugin as nagios user, so the check should also work for you in the GUI. Let us know if your issue has been resolved.
Still am facing same issue, backend CCM UDP Port service is working but in frontend GUI still its showing CRITICAL ;)
PFA SS
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: UDP port for monitor

Post by lmiltchev »

Have you applied configuration after making the changes to your configs, e.g. adding sudo to the "check_udp_port" command? Try going to the CCM > Tools > Config File Management > Delete Files > Write Configs > Verify Files > Apply Configuration (in this exact order).

Another reason for the issue could be multiple nagios processes running on this machine. Perhaps, there is an old nagios process running that is "stuck" and it's still reporting "Critical".

To check for multiple instances of nagios, run:

Code: Select all

ps -ef | head -1 && ps -ef | grep bin/nagios
To kill the process run:

Code: Select all

service nagios stop
killall nagios
service nagios start
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked