Hi,
We have some network devices for which when we try to poll the memory values via OID, it is giving values other than % so how can we configure in nagios and use warning and critical threshold?
example below, the first value is for memory.
snmpwalk -v 2c -c 'limacharlie@1979' 10.150.1.122 1.3.6.1.2.1.25.2.3.1.6
HOST-RESOURCES-MIB::hrStorageUsed.1 = INTEGER: 3369888
HOST-RESOURCES-MIB::hrStorageUsed.3 = INTEGER: 3369888
HOST-RESOURCES-MIB::hrStorageUsed.6 = INTEGER: 148684
HOST-RESOURCES-MIB::hrStorageUsed.7 = INTEGER: 860436
HOST-RESOURCES-MIB::hrStorageUsed.10 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.31 = INTEGER: 440056
HOST-RESOURCES-MIB::hrStorageUsed.36 = INTEGER: 7907
HOST-RESOURCES-MIB::hrStorageUsed.38 = INTEGER: 154
HOST-RESOURCES-MIB::hrStorageUsed.39 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.55 = INTEGER: 4595
HOST-RESOURCES-MIB::hrStorageUsed.56 = INTEGER: 9053
HOST-RESOURCES-MIB::hrStorageUsed.57 = INTEGER: 177
HOST-RESOURCES-MIB::hrStorageUsed.58 = INTEGER: 2976
HOST-RESOURCES-MIB::hrStorageUsed.59 = INTEGER: 332959
HOST-RESOURCES-MIB::hrStorageUsed.60 = INTEGER: 557
HOST-RESOURCES-MIB::hrStorageUsed.61 = INTEGER: 565
HOST-RESOURCES-MIB::hrStorageUsed.62 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.63 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.64 = INTEGER: 0
screenshot from SNMPwalk wizard
How to monitor the memory value which is in bytes or kb/mb
-
pratikmehta003
- Posts: 105
- Joined: Thu Apr 09, 2020 7:35 am
How to monitor the memory value which is in bytes or kb/mb
You do not have the required permissions to view the files attached to this post.
-
pratikmehta003
- Posts: 105
- Joined: Thu Apr 09, 2020 7:35 am
Re: How to monitor the memory value which is in bytes or kb/
if any other info needed, let me know..
Re: How to monitor the memory value which is in bytes or kb/
Hi,
There are a few ways you can go:
1) Find out the total memory, then using that you can set critical and warning levels.
2) Create your own command. Go to the CCM and in the left-hand menu choose Commands, _Commands. Select the + Add New box: From Available plugins choose "check_snmp_mem.pl" You can see an explanation of the plugin using the -h option:
Thanks
There are a few ways you can go:
1) Find out the total memory, then using that you can set critical and warning levels.
2) Create your own command. Go to the CCM and in the left-hand menu choose Commands, _Commands. Select the + Add New box: From Available plugins choose "check_snmp_mem.pl" You can see an explanation of the plugin using the -h option:
Code: Select all
[root@gs-cent8-23-82 libexec]# ./check_snmp_mem.pl -h
SNMP Memory Monitor for Nagios version 1.1
(c)2004-2006 to my cat Ratoune - Author: Patrick Proy
Usage: ./check_snmp_mem.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] -w <warn level> -c <crit level> [-I|-N|-E] [-f] [-m] [-t <timeout>] [-V]
-v, --verbose
print extra debugging information (including interface list on the system)
-h, --help
print this help message
-H, --hostname=HOST
name or IP address of host to check
-C, --community=COMMUNITY NAME
community name for the host's SNMP agent (implies SNMP v1 or v2c with option)
-2, --v2c
Use snmp v2c
-l, --login=LOGIN ; -x, --passwd=PASSWD
Login and auth password for snmpv3 authentication
If no priv password exists, implies AuthNoPriv
-X, --privpass=PASSWD
Priv password for snmpv3 (AuthPriv protocol)
-L, --protocols=<authproto>,<privproto>
<authproto> : Authentication protocol (md5|sha : default md5)
<privproto> : Priv protocole (des|aes : default des)
-P, --port=PORT
SNMP port (Default 161)
-w, --warn=INTEGER | INT,INT
warning level for memory in percent (0 for no checks)
Default (-N switch) : comma separated level for Real Memory and Swap
-I switch : warning level
-c, --crit=INTEGER | INT,INT
critical level for memory in percent (0 for no checks)
Default (-N switch) : comma separated level for Real Memory and Swap
-I switch : critical level
-N, --netsnmp (default)
check linux memory & swap provided by Net SNMP
-m, --memcache
include cached memory in used memory (only with Net-SNMP)
-I, --cisco
check cisco memory (sum of all memory pools)
-E, --hp
check HP proccurve memory
-f, --perfdata
Performance data output
-t, --timeout=INTEGER
timeout for SNMP in seconds (Default: 5)
-V, --version
prints version number
[root@gs-cent8-23-82 libexec]#
You do not have the required permissions to view the files attached to this post.
-
pratikmehta003
- Posts: 105
- Joined: Thu Apr 09, 2020 7:35 am
Re: How to monitor the memory value which is in bytes or kb/
Hi, the screenshot I gave is what it shows for total memory. So how can I use that for warning and critical. The value doesn't come in percentage.
The second option via writing a command I will check but if first option works then I would like to use that.
The second option via writing a command I will check but if first option works then I would like to use that.
Re: How to monitor the memory value which is in bytes or kb/
Hi,
1.3.6.1.2.1.25.2.3.1.6 is for hrStorageUsed.
Take a look at 1.3.6.1.2.1.25.2.3.1.5, it is hrStorageSize
So depending on how you are using warning and critical setpoints you can calculate values for 1.3.6.1.2.1.25.2.3.1.6.
An example:
if hrStorageSize = 4000000, and you want a warning when it gets to 80% used, then .8 x 4000000 = 3200000.
So you would set your warning value to 3200000.
You will need to verify with the hardware vendor that those are the correct OIDs to use for what
you are trying to measure and alert on.
Thanks
1.3.6.1.2.1.25.2.3.1.6 is for hrStorageUsed.
Take a look at 1.3.6.1.2.1.25.2.3.1.5, it is hrStorageSize
So depending on how you are using warning and critical setpoints you can calculate values for 1.3.6.1.2.1.25.2.3.1.6.
An example:
if hrStorageSize = 4000000, and you want a warning when it gets to 80% used, then .8 x 4000000 = 3200000.
So you would set your warning value to 3200000.
You will need to verify with the hardware vendor that those are the correct OIDs to use for what
you are trying to measure and alert on.
Thanks
Re: How to monitor the memory value which is in bytes or kb/
In addition to what @gsmith posted.
Try this one against it:
Taken from here:
https://support.nagios.com/kb/article/d ... s-770.html
https://support.nagios.com/kb/category.php?id=186
That should output in percent and auto-convert the thresholds. Generally, if the remote system supports hrStorage you can run the Linux SNMP Wizard against it.
Try this one against it:
Code: Select all
/usr/local/nagios/libexec/check_snmp_storage_wizard.pl -H 10.150.1.122 -C 'limacharlie@1979' --v2c -m "^/$" -T pl -w 10 -c 5 -fhttps://support.nagios.com/kb/article/d ... s-770.html
https://support.nagios.com/kb/category.php?id=186
That should output in percent and auto-convert the thresholds. Generally, if the remote system supports hrStorage you can run the Linux SNMP Wizard against it.
-
pratikmehta003
- Posts: 105
- Joined: Thu Apr 09, 2020 7:35 am
Re: How to monitor the memory value which is in bytes or kb/
Hi,
Thanks for both information, let me check this.
Thanks for both information, let me check this.
Re: How to monitor the memory value which is in bytes or kb/
Hi,
Sounds good. We'll keep this open until we hear back from you.
Thanks
Sounds good. We'll keep this open until we hear back from you.
Thanks