Memory Usage Linux

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.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: Memory Usage Linux

Post by ofadl »

this is what I got when I ran those commands on the server im trying to monitor

/usr/lib/nagios/plugins/check_mem.sh: /bin/ksh: bad interpreter: No such file or directory
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Memory Usage Linux

Post by abrist »

AH, looks like you are missing the ksh shell. What distro is running on the remote host?
If rhel/centos, try:

Code: Select all

yum install ksh
If debian/ubuntu try:

Code: Select all

apt-get install ksh
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: Memory Usage Linux

Post by ofadl »

the su nagios command, it asks for a password, what password am i suppose to be putting in?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Memory Usage Linux

Post by slansing »

When you set nagios up, did you somehow add a password to the Nagios user..? There should not be one, if you:

Code: Select all

su nagios
From root it should just switch.

Can you remove the password? If not, please run:

Code: Select all

grep nagios /etc/passwd
And share the output.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: Memory Usage Linux

Post by ofadl »

this is what i got from running the command grep nagios/etc/passwd on the remote client:

nagios:x:106:109::/var/lib/nagios:/bin/false
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Memory Usage Linux

Post by slansing »

To remove the password please follow this guide:

http://www.cyberciti.biz/faq/linux-dele ... -password/

Then verify you have a shell installed as Andy pointed out.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: Memory Usage Linux

Post by ofadl »

alright, i deleted the password, and verified the ksh is installed
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: Memory Usage Linux

Post by ofadl »

ok, so i just ran the command:
/usr/lib/nagios/plugins/check_mem.sh 85 95

and got the following output:

/usr/lib/nagios/plugins/check_mem.sh[60]: /usr/bin/bc: not found [No such file or directory]
/usr/lib/nagios/plugins/check_mem.sh[61]: /usr/bin/bc: not found [No such file or directory]
/usr/lib/nagios/plugins/check_mem.sh[72]: bc: not found [No such file or directory]
/usr/lib/nagios/plugins/check_mem.sh[72]: [: argument expected
/usr/lib/nagios/plugins/check_mem.sh[75]: bc: not found [No such file or directory]
/usr/lib/nagios/plugins/check_mem.sh[75]: [: argument expected
/usr/lib/nagios/plugins/check_mem.sh[78]: bc: not found [No such file or directory]
/usr/lib/nagios/plugins/check_mem.sh[78]: [: argument expected
Unable to determine memory usage.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: Memory Usage Linux

Post by ofadl »

ok so i installed bc, and when i ran the command :

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

it returned:

OK - Memory usage is 10.800% (222736)

but problem is now, its still giving me the unknown error on the nagios website
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Memory Usage Linux

Post by slansing »

Can you share your current service configuration for this check_mem service in Nagios?
Locked