trouble with memory usage on a linux server

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

trouble with memory usage on a linux server

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: trouble with memory usage on a linux server

Post by abrist »

What happens when you run it locally? On the remote system run:

Code: Select all

/usr/lib/nagios/plugins/check_mem.sh
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: trouble with memory usage on a linux server

Post 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.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: trouble with memory usage on a linux server

Post by lmiltchev »

Run the following command and show the output:

Code: Select all

/usr/lib/nagios/plugins/check_mem.sh -h
Be sure to check out our Knowledgebase for helpful articles and solutions!
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: trouble with memory usage on a linux server

Post by ofadl »

i fixed it, it was a problem on the server itself, thanks for the help though
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: trouble with memory usage on a linux server

Post by abrist »

No problem, have a good week.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked