Monitoring Memory

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
Bryan
Posts: 16
Joined: Wed Apr 13, 2016 11:44 am

Monitoring Memory

Post 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.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Monitoring Memory

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Monitoring Memory

Post 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
Rob Hassing
Image
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitoring Memory

Post by rkennedy »

Thanks @rhassing!

Are you able to run check_mem_lin.sh without running it through NRPE? Does it return the expected result?
Former Nagios Employee
Bryan
Posts: 16
Joined: Wed Apr 13, 2016 11:44 am

Re: Monitoring Memory

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitoring Memory

Post by rkennedy »

Ah - got it! Glad you were able to get it figured out. Going to close this one out.
Former Nagios Employee
Locked