Code: Select all
PERCENTUSED=$(swapinfo -m | grep memory | sed 's/'%'//' | awk ' { print $5 }')Code: Select all
su - nagios
/usr/local/nagios/libexec/check_mem -w 80 -c 90Code: Select all
PERCENTUSED=$(swapinfo -m | grep memory | sed 's/'%'//' | awk ' { print $5 }')Code: Select all
su - nagios
/usr/local/nagios/libexec/check_mem -w 80 -c 90Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <remote ip> -c check_mem -a '-w 80 -c 90'Code: Select all
su - nagios
/usr/local/nagios/libexec/check_mem -w 80 -c 90I don't see it anywhere... You showed us the command run as "root":We have shared the output with nagios user only and yes nagios user is able to run this plugin and getting output with percentage details. no problem in doing this on server with nagios user also.
Am I missing something?HSOLMANDEV:/usr/local/nagios/libexec #./check_mem -w 80 -c 90
OK - System Memory is at 10% |memory=10;90;80;00;80
HSOLMANDEV:/usr/local/nagios/libexec #
HSOLMANDEV:/usr/local/nagios/libexec #/usr/local/nagios/libexec/check_mem -w 80 -c 90
OK - System Memory is at 10% |memory=10;90;80;00;80
HSOLMANDEV:/usr/local/nagios/libexec #
Code: Select all
nagios ALL=NOPASSWD: /usr/sbin/swapinfo *Code: Select all
su - nagios
sudo /usr/local/nagios/libexec/check_mem -w 80 -c 90Code: Select all
command[check_mem]=sudo /usr/local/nagios/libexec/check_mem $ARG1$Code: Select all
nagios ALL=NOPASSWD: /usr/sbin/swapinfo *