Script is running file locally but not remotely
Posted: Fri Sep 28, 2018 5:39 am
Hi Team,
On our Linux server we are using check_mem script to monitor the memory usage of it. Th script out is correct when we execute the script with commands locally on that server but when we execute it remotely it always shows critical status irrespective of the thresholds mentioned.
Script executed locally on remote server:
$ ./check_mem -w 80 -c 90
Memory: OK Total: 3832 MB - Used: 973 MB - 25% used|TOTAL=4018626560;;;; USED=1018564608;;;; CACHE=1315745792;;;; BUFFER=304615424;;;;
Same script executed remotely from Nagios server:
[nagios@nagios libexec]$ ./check_nrpe -H remoteserverhostname -c check_mem -a '-w 80 -c 90'
Memory: CRITICAL Total: 3832 MB - Used: 964 MB - 25% used!|TOTAL=4018626560;;;; USED=1009909760;;;; CACHE=1342291968;;;; BUFFER=304766976;;;;
[nagios@nagios libexec]$ ./check_nrpe -H remoteserverhostname -c check_mem -a '-w 20 -c 90'
Memory: CRITICAL Total: 3832 MB - Used: 964 MB - 25% used!|TOTAL=4018626560;;;; USED=1009917952;;;; CACHE=1342410752;;;; BUFFER=304766976;;;;
Command entries in Nrpe.cfg file:
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 80 -c 90
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
command[check_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$
command[check_cpu_custom]=/usr/local/nagios/libexec/cpu_ent $ARG1$
command[check_swap]=/usr/local/nagios/libexec/check_swap $ARG1$
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
command[check_init_service]=/usr/local/nagios/libexec/check_init_service $ARG1$
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats $ARG1$
command[check_mem]=/usr/local/nagios/libexec/check_mem $ARG1$
command[check_open_files]=/usr/local/nagios/libexec/check_open_files $ARG1$
command[check_yum]=/usr/local/nagios/libexec/check_yum
command[check_services]=/usr/local/nagios/libexec/check_services -p $ARG1$
command[check_test1]=/usr/local/nagios/libexec/check_test1 $ARG1$
command[check_services]=/usr/local/nagios/libexec/check_services -p $ARG1$
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
Kindly let us know what could be the issue and how to resolve it?
On our Linux server we are using check_mem script to monitor the memory usage of it. Th script out is correct when we execute the script with commands locally on that server but when we execute it remotely it always shows critical status irrespective of the thresholds mentioned.
Script executed locally on remote server:
$ ./check_mem -w 80 -c 90
Memory: OK Total: 3832 MB - Used: 973 MB - 25% used|TOTAL=4018626560;;;; USED=1018564608;;;; CACHE=1315745792;;;; BUFFER=304615424;;;;
Same script executed remotely from Nagios server:
[nagios@nagios libexec]$ ./check_nrpe -H remoteserverhostname -c check_mem -a '-w 80 -c 90'
Memory: CRITICAL Total: 3832 MB - Used: 964 MB - 25% used!|TOTAL=4018626560;;;; USED=1009909760;;;; CACHE=1342291968;;;; BUFFER=304766976;;;;
[nagios@nagios libexec]$ ./check_nrpe -H remoteserverhostname -c check_mem -a '-w 20 -c 90'
Memory: CRITICAL Total: 3832 MB - Used: 964 MB - 25% used!|TOTAL=4018626560;;;; USED=1009917952;;;; CACHE=1342410752;;;; BUFFER=304766976;;;;
Command entries in Nrpe.cfg file:
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 80 -c 90
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
command[check_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$
command[check_cpu_custom]=/usr/local/nagios/libexec/cpu_ent $ARG1$
command[check_swap]=/usr/local/nagios/libexec/check_swap $ARG1$
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
command[check_init_service]=/usr/local/nagios/libexec/check_init_service $ARG1$
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats $ARG1$
command[check_mem]=/usr/local/nagios/libexec/check_mem $ARG1$
command[check_open_files]=/usr/local/nagios/libexec/check_open_files $ARG1$
command[check_yum]=/usr/local/nagios/libexec/check_yum
command[check_services]=/usr/local/nagios/libexec/check_services -p $ARG1$
command[check_test1]=/usr/local/nagios/libexec/check_test1 $ARG1$
command[check_services]=/usr/local/nagios/libexec/check_services -p $ARG1$
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
Kindly let us know what could be the issue and how to resolve it?