nagios-plugins
nagios-plugins copied to clipboard
check_service not show more than one line
Hi!
The first thing is thanks for this great work with the plugins.
Using the check_services to monitor nfs service on CentOS 6.5, this only show one service, when if you execute "service nfs status" the SO show 4 processes.
So if the 4 th is UP an one of the others is down, Nagios not show an CRITICAL.
Reviewing your code, I´ve show:
elif [ -f /etc/init.d/$SERVICE ] || [ -d /etc/init.d ]; then SERVICETOOL="/etc/init.d/$SERVICE status | tail -1" LISTTOOL="ls -1 /etc/init.d/" if [ $USERNAME ]; then SERVICETOOL="sudo -u $USERNAME /etc/init.d/$SERVICE status | tail -1" LISTTOOL="sudo -u $USERNAME ls -1 /etc/init.d/" fi
If I putt the tail to 10 (for instance) it works.