Re: UDP port for monitor
Posted: Fri Oct 05, 2018 2:01 pm
Can you attach your current check_udp_port file
Support for Nagios products and services
https://support.nagios.com/forum/
Code: Select all
su nagios -c '/usr/local/nagios/libexec/check_udp_port -H xxxxxxxx -p 1162 -s "health-trap"'hi scottwilkerson,scottwilkerson wrote:We've tested this with the same setup you have without error so the | isn't the problem, Lets go back to just the attached file for the plugin then run the following and return the resultsCode: Select all
su nagios -c '/usr/local/nagios/libexec/check_udp_port -H xxxxxxxx -p 1162 -s "health-trap"'
Code: Select all
nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_udp_port
nagios ALL=NOPASSWD: /usr/bin/nmap Code: Select all
result=`/usr/bin/nmap -sU -p $port -P0 $host`Code: Select all
result=`sudo /usr/bin/nmap -sU -p $port -P0 $host`Code: Select all
su nagios -c '/usr/local/nagios/libexec/check_udp_port -H xx.xxx.xxx.xx -p 1162 -s "health-trap"'Hi tgriep,tgriep wrote:Try this, edit the /etc/sudoers file and add the following entriesSave the file and edit the check_udp_port script and change this line fromCode: Select all
nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_udp_port nagios ALL=NOPASSWD: /usr/bin/nmaptoCode: Select all
result=`/usr/bin/nmap -sU -p $port -P0 $host`Save it out and run this test again to see if it allows nmap to run as root in the script.Code: Select all
result=`sudo /usr/bin/nmap -sU -p $port -P0 $host`Code: Select all
su nagios -c '/usr/local/nagios/libexec/check_udp_port -H xx.xxx.xxx.xx -p 1162 -s "health-trap"'
Code: Select all
$USER1$=LC_ALL=C /usr/local/nagios/libexecCode: Select all
$USER1$=/usr/local/nagios/libexecHi lmiltchev,lmiltchev wrote:I am glad your issue has been resolved, but wonder - why did you have this:You should've had this:Code: Select all
$USER1$=LC_ALL=C /usr/local/nagios/libexecLet us know if it is OK to lock this topic. Thank you!Code: Select all
$USER1$=/usr/local/nagios/libexec