LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   nagios show incorrect info (https://www.linuxquestions.org/questions/linux-server-73/nagios-show-incorrect-info-4175484766/)

hesisaboury 11-16-2013 03:17 AM

nagios show incorrect info
 
hello,
i have this script in my server
num=$(lsof | grep peykasa-mail-monitor.jar | wc -l)

if [[ "$num" == "2" ]]
then
echo "MailMonitor is UP"
exit 0
elif [[ "$num" == "0" ]]
then
echo "MailMonitor is DOWN"
exit 2
else
echo "UNKOWN"
exit 1
fi

when i run this in server it shows "MailMonitor is UP" but nagios show "MailMonitor is DOWN" ,, i also checked by check_nrpe ..

any suggestion..

hesisaboury 11-16-2013 05:03 AM

Hi
i figured out that user nagios doe not see the process i'm looking for ,, but no how can i monitor for this process , this process is run by root and is in background ...

hesisaboury 11-16-2013 05:17 AM

Thank U ALL
solved by adding user nagios to visudo
nagios ALL=(ALL) NOPASSWD:/usr/lib/nagios/plugins/check_mailmonitor.sh

now nagios can see this process


All times are GMT -5. The time now is 05:32 PM.