Page 1 of 1

trouble with memory usage on a linux server

Posted: Mon Jul 01, 2013 9:21 am
by ofadl
Hey everyone,

So i recently set up a memory usage check, thanks to the nagios support forum team, and now for some reason on one of my servers im getting a weird error message on the website. Im getting this on the website:

AWK=/bin/awk

then when i try to run the check_mem.sh on the nagios machine with :

/usr/lib/nagios/plugins/check_nrpe -H 10.100.50.43 -c check_mem

i get this as output:

AWK=/bin/awk
BC=/usr/bin/bc
CRITICAL_STATE=2
CRITLEVEL=95
ENV='(null)/.kshrc'
FCEDIT=/bin/ed
FREE=/usr/bin/free
GREP=/bin/grep
HEAD=/usr/bin/head
HISTCMD=0
IFS=$' \t\n'
JOBMAX=0
KSH_VERSION=.sh.version
LANG=en_US.UTF-8
LINENO=48
MAILCHECK=600
NRPE_MULTILINESUPPORT=1
NRPE_PROGRAMVERSION=2.12
OK_STATE=0
OPTIND=1
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PPID=9794
PS2='> '
PS3='#? '
PS4='+ '
PWD=/
RANDOM=27890
SECONDS=0.003
namespace sh
{
file=/usr/lib/nagios/plugins/check_mem.sh
lineno=0
match=([0]=)
math=''
stats=()
subshell=0
version='Version JM 93u 2011-02-08'
}
SHELL=/bin/sh
SHLVL=1
TAIL=/usr/bin/tail
TERM=xterm
TMOUT=0
UNKNOWN_STATE=3
WARNING_STATE=1
WARNLEVEL=85
Unable to determine memory usage.

Re: trouble with memory usage on a linux server

Posted: Mon Jul 01, 2013 10:44 am
by abrist
What happens when you run it locally? On the remote system run:

Code: Select all

/usr/lib/nagios/plugins/check_mem.sh

Re: trouble with memory usage on a linux server

Posted: Mon Jul 01, 2013 11:09 am
by ofadl
get pretty much the same script, with the addition of this:

(standard_in) 2: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
/usr/lib/nagios/plugins/check_mem.sh[72]: [: argument expected
(standard_in) 1: syntax error
/usr/lib/nagios/plugins/check_mem.sh[75]: [: argument expected
(standard_in) 1: syntax error
/usr/lib/nagios/plugins/check_mem.sh[78]: [: argument expected
Unable to determine memory usage.

Re: trouble with memory usage on a linux server

Posted: Mon Jul 01, 2013 2:06 pm
by lmiltchev
Run the following command and show the output:

Code: Select all

/usr/lib/nagios/plugins/check_mem.sh -h

Re: trouble with memory usage on a linux server

Posted: Mon Jul 01, 2013 2:17 pm
by ofadl
i fixed it, it was a problem on the server itself, thanks for the help though

Re: trouble with memory usage on a linux server

Posted: Mon Jul 01, 2013 2:19 pm
by abrist
No problem, have a good week.