UDP port for monitor
-
Vigneshwar.A
- Posts: 25
- Joined: Fri May 12, 2017 2:02 am
UDP port for monitor
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
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
Hello, @Vigneshwar.A. You need to add the following line to the /etc/sudoers:
And the command definition should be:NAGIOSXI ALL = NOPASSWD:/usr/local/nagios/libexec/check_udp_port *
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
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
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
@Vigneshwar.A, What are the permissions on the plugin?
Please sign in to the console as the nagios user, run the plugin and show me the output.ls -l /usr/local/nagios/libexec/check_udp_port
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
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]$
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
@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
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 ~]$
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 ~]$
Re: UDP port for monitor
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
Still am facing same issue, backend CCM UDP Port service is working but in frontend GUI still its showing CRITICALlmiltchev 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.
PFA SS
You do not have the required permissions to view the files attached to this post.
Re: UDP port for monitor
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:
To kill the process run:
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/nagiosCode: Select all
service nagios stop
killall nagios
service nagios startBe sure to check out our Knowledgebase for helpful articles and solutions!