Page 1 of 2

Linux SNMP Memory Check - Reported Memory is incorrect

Posted: Fri Jun 28, 2019 10:38 am
by dslaughter
https://www.linuxatemyram.com/

check_snmp_storage_wizard.pl reports incorrect free memory. I searched and there a lot of posts reporting this. Is this bug going to be fixed?

I've found a plugin that reports memory correctly - check_snmp_mem.pl. I use the snmp wizard so I need to remove the broken plugin and replace it with the plugin that reports memory correctly. What it the proper way to do this? I can edit the config.xml of the plugin but is that the correct way to do it? It seems like I should be able to do this in CCM.

Wrong
check_snmp_storage_wizard.pl
Physical memory: 34%used(1272MB/3789MB) (<50%) : OK

Correct
check_snmp_mem.pl
Ram : 18%, Swap : 0% : ; OK

Re: Linux SNMP Memory Check - Reported Memory is incorrect

Posted: Fri Jun 28, 2019 12:47 pm
by cdienger
Thanks for the suggestion. I'll look into updating the wizard.

Re: Linux SNMP Memory Check - Reported Memory is incorrect

Posted: Fri Jun 28, 2019 1:27 pm
by cdienger
An updated wizard is attached. Please test and let me know your thoughts.

Re: Linux SNMP Memory Check - Reported Memory is incorrect

Posted: Fri Jun 28, 2019 3:24 pm
by dslaughter
I installed the update and performed a test. I'm getting configuration verification failed.

Nagios Core 4.4.3
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-01-15
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Template 'xiwizard_linuxsnmp_mem' specified in service definition could not be not found (config file '/usr/local/nagios/etc/services/noc-1.cfg', starting on line 32)
Error processing object config files!


***> One or more problems was encountered while processing the config files...

define service {
host_name noc-1
service_description / Disk Usage
use xiwizard_linuxsnmp_mem
check_command check_xi_service_snmp_linux_storage! -C $4me --v2c -m "^/$" -w 80 -c 95 -f
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux_snmp
register 1
}

define service {
host_name noc-1
service_description /home Disk Usage
use xiwizard_linuxsnmp_mem
check_command check_xi_service_snmp_linux_storage! -C $4me --v2c -m "^/home$" -w 80 -c 95 -f
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux_snmp
register 1
}

define service {
host_name noc-1
service_description cache.py
use xiwizard_linuxsnmp_process
check_command check_xi_service_snmp_linux_process! -C $4me --v2c -r -n cache.py
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux_snmp
register 1
}

define service {
host_name noc-1
service_description CPU Usage
use xiwizard_linuxsnmp_load
check_command check_xi_service_snmp_linux_load! -C $4me --v2c -w 80 -c 90 -f
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux_snmp
register 1
}

define service {
host_name noc-1
service_description Memory Usage
use xiwizard_linuxsnmp_storage
check_command check_xi_service_snmp_linux_mem! -C $4me --v2c -w 80,80 -c 90,80
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux_snmp
register 1
}

Re: Linux SNMP Memory Check - Reported Memory is incorrect

Posted: Fri Jun 28, 2019 3:41 pm
by cdienger
Updated and attached.

Re: Linux SNMP Memory Check - Reported Memory is incorrect

Posted: Fri Jun 28, 2019 4:14 pm
by dslaughter
I did a quick test but got the same error. I may have bungled the update. I've got to wait til tomorrow before I can look at this again. Thank you for your help. I'll send an update tomorrow to let you know how it went.

Re: Linux SNMP Memory Check - Reported Memory is incorrect

Posted: Sat Jun 29, 2019 9:21 am
by dslaughter
I downloaded the file again to make sure I was using the correct one. I got configuration verification failed again. Command output was the same.

Re: Linux SNMP Memory Check - Reported Memory is incorrect

Posted: Mon Jul 01, 2019 9:28 am
by cdienger
Those may be from the previous config. Try restoring to a good config(Admin > Monitoring Config > Config Snapshots) and make sure that that can apply before running the wizard again.

Re: Linux SNMP Memory Check - Reported Memory is incorrect

Posted: Tue Jul 02, 2019 10:47 am
by dslaughter
Sorry for the late reply,

I restored the snapshot but when I used the linux-snmp wizard it just setup the original memory check. I've got some time later today to try this again. I'll restore a snapshot, downlod the updated wizard again and then give it another go.

Re: Linux SNMP Memory Check - Reported Memory is incorrect

Posted: Tue Jul 02, 2019 4:42 pm
by cdienger
Let me know your results and I'll try the same on a clean system. It's possible that through my testing I have configs in place that another system may not.