Page 1 of 1
Linux snmp doesn't work
Posted: Mon Apr 01, 2019 8:13 am
by Frédéric GRANAT
Hi,
I run the following command on my linux server : free
Here's the result :
total used free shared buff/cache available
Mem: 6104452 2833076 531460 1548 2739916 2972096
Swap: 0 0 0
That server is monitored using linux snmp wizard.
At the same time the service Memory usage displays the following alert :
Physical memory: 91%used(5436MB/5961MB) (>90%) : CRITICAL
According to free command : no memory overload, according to Nagios check : memory overload : How do you explain that ?
Re: Linux snmp doesn't work
Posted: Mon Apr 01, 2019 12:48 pm
by npolovenko
Hello, [user]Frédéric GRANAT[/user]. Can you check what version of Linux SNMP wizard you're running? Go to the Admin menu in XI, then click on Manage Config Wizards in the left column and search for the "Linux SNMP" wizard.
Also, which command is used in the service check? Does it say -m Physical or -m Memory?
Re: Linux snmp doesn't work
Posted: Tue Apr 02, 2019 2:11 am
by Frédéric GRANAT
Hi,
Can you check what version of Linux SNMP wizard you're running
=> Linux snmp 1.5.2
Also, which command is used in the service check? Does it say -m Physical or -m Memory?
=>$ARG1$ = -C ro --v2c -m Physical -w 80 -c 90 -f
Remark : Monitored server is a virtual machine
I've tried : $ARG1$ = -C ro --v2c -m Memory -w 80 -c 90 -f
And NagiosXI gives : Memory buffers: 3%used(189MB/5961MB) (<80%) : OK
By the same time the command "free" gives :
total used free shared buff/cache available
Mem: 6104452 2832204 516812 1544 2755436 2972972
Swap: 0 0 0
So Nagios check seems not better to be good (it reports 189 Mb used whereas free reports 2832204 Kb used )
Re: Linux snmp doesn't work
Posted: Tue Apr 02, 2019 2:14 pm
by npolovenko
[user]Frédéric GRANAT[/user], The command you ran shows just the buffer value. I confirmed with atop command and values match:
Untitled.png
The most likely reason why the following command reported that memory is overloaded is that it included cached memory in the total used memory amount.
/usr/local/nagios/libexec/check_snmp_storage.pl -H 192.168.3.3 -C 209ijvfwer0df92jd --v2c -m "Physical" -T pl -w 10 -c 5 -f
We do have an NRPE based plugin that has an option of excluding cached memory. Is using the NRPE an option in your environment?
Re: Linux snmp doesn't work
Posted: Thu Apr 04, 2019 4:10 am
by Frédéric GRANAT
Hi,
Thanks,
Cached memory shouldn't be taken into account but I don't want to install nrpe on my server.
What other solution do you propose ?
Re: Linux snmp doesn't work
Posted: Thu Apr 04, 2019 11:20 am
by npolovenko
[user]Frédéric GRANAT[/user], There's another plugin you can try. It doesn't include cached memory in the used result:
Code: Select all
/usr/local/nagios/libexec/check_snmp_mem.pl -H 192.168.3.3 -C 209ijvfwer0df92jd --v2c -w 80,80 -c 90,90
PS: Keep in mind that it won't 100% match with the free command output because it doesn't include buffers or reclaimable.
Re: Linux snmp doesn't work
Posted: Fri Apr 05, 2019 3:15 am
by Frédéric GRANAT
Hi,
Thanks I tested it and it's better :
Free gives
total used free shared buff/cache available
Mem: 6104452 2302864 1678496 1524 2123092 3502332
That means 37% used
And the check gives 44% used
Do you think it will be more precise with the first pluggin you adviced me to user (the one that use nrpe) ?
Re: Linux snmp doesn't work
Posted: Fri Apr 05, 2019 11:02 am
by npolovenko
[user]Frédéric GRANAT[/user], The precision is relative. The issue is that different Linux plugins calculate memory in different ways by including or not including cached memory, buffer and so on. You can certainly try the NRPE plugin:
https://support.nagios.com/kb/article/m ... s-774.html
But keep in mind that you'd need to install the nrpe agent to use it.
https://support.nagios.com/kb/article.php?id=8
Some users would rather use only SNMP in their environment, but some are ok deploying the agent.
Re: Linux snmp doesn't work
Posted: Tue Apr 09, 2019 2:37 am
by Frédéric GRANAT
Hi,
Thanks,
You can close the post.
Frederic
Re: Linux snmp doesn't work
Posted: Tue Apr 09, 2019 1:49 pm
by npolovenko
[user]Frédéric GRANAT[/user], You're welcome. Closing the thread as resolved.