Page 1 of 1

Monitoring Memory

Posted: Wed Jun 29, 2016 10:56 am
by Bryan
we are using nagios core to monitor our servers.
we had most of the servers as redhat 6, and we are trying to monitor currently on redhat 7.
we use check_byssh method for monitoring services.
Issue is when i was trying to monitor memory it used to give me syntax error.


Remote command execution failed: /usr/local/nagios/libexec/check_mem_lin.sh: line 54: ((: <= 300 : syntax error: operand expected (error token is "<= 300 ")


and the command i used was check_byssh_mem_lin!600!300

Is there any change in command difference in version 6 to 7? Or how should i try and solve this. Please suggest.\

Thank you in Advance.

Re: Monitoring Memory

Posted: Wed Jun 29, 2016 12:59 pm
by tgriep
It could be that you need to install some packages on the new servers that the plugin uses but without seeing the plugin, it is hard to guess.
Can you post the check_mem_lin.sh script so we can view it?

Re: Monitoring Memory

Posted: Thu Jun 30, 2016 2:48 am
by rhassing
Why not use snmp to check the memory usage?
That's always the same and should be working without problems.

Code: Select all

Memory Statistics

Total Swap Size: .1.3.6.1.4.1.2021.4.3.0
Available Swap Space: .1.3.6.1.4.1.2021.4.4.0
Total RAM in machine: .1.3.6.1.4.1.2021.4.5.0
Total RAM used: .1.3.6.1.4.1.2021.4.6.0
Total RAM Free: .1.3.6.1.4.1.2021.4.11.0
Total RAM Shared: .1.3.6.1.4.1.2021.4.13.0
Total RAM Buffered: .1.3.6.1.4.1.2021.4.14.0
Total Cached Memory: .1.3.6.1.4.1.2021.4.15.0

Re: Monitoring Memory

Posted: Thu Jun 30, 2016 10:02 am
by rkennedy
Thanks @rhassing!

Are you able to run check_mem_lin.sh without running it through NRPE? Does it return the expected result?

Re: Monitoring Memory

Posted: Thu Jun 30, 2016 10:28 am
by Bryan
Thank you for your help i got the issue solved.

There is a slight difference in file check_mem_lin for redhat 6 and redhat 7.

Had made changes in that line and it worked fine.

Re: Monitoring Memory

Posted: Thu Jun 30, 2016 10:59 am
by rkennedy
Ah - got it! Glad you were able to get it figured out. Going to close this one out.