Page 1 of 1

check_snmp_storage.pl memory check problem

Posted: Fri Oct 25, 2013 5:40 am
by tom_wong
Hi, we used the Linux snmp monitoring wizard as suggested in your document. However, the returned value for memory usage was not right, it only show memory buffers.

We have looked at the manual page, http://nagios.manubulon.com/snmp_storage.html

but the parameters there don't work with the version with the nagiosxi.

Say if we run

./check_snmp_storage.pl -H 127.0.0.1 -C public -m "Real Memory" -w 80% -c 90%

it returns

Unknown storage : Real Memory : ERROR

It doesn't recognise the parameter 'Real memory' as in the manual. Can you help?

Thanks

Tom

Re: check_snmp_storage.pl memory check problem

Posted: Fri Oct 25, 2013 1:55 pm
by abrist
Have you tried checking a mount point (-m) or specifying a storage type? (-q)

Code: Select all

Usage: check_snmp_storage [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] -m <name in desc_oid> [-q storagetype] -w <warn_level> -c <crit_level> [-t <timeout>] [-T pl|pu|bl|bu ] [-r -s -i -G] [-e] [-S 0|1[,1,<car>]] [-o <octet_length>] [-R <% reserved>]
By default, plugin will monitor %used on drives :
warn if %used > warn and critical if %used > crit
-v, --verbose
   print extra debugging information (and lists all storages)
-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)
-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)
-x, --passwd=PASSWD
   Password for snmpv3 authentication
-p, --port=PORT
   SNMP port (Default 161)
-m, --name=NAME
   Name in description OID (can be mounpoints '/home' or 'Swap Space'...)
   This is treated as a regexp : -m /var will match /var , /var/log, /opt/var ...
   Test it before, because there are known bugs (ex : trailling /)
   No trailing slash for mountpoints !
-q, --storagetype=[Other|Ram|VirtualMemory|FixedDisk|RemovableDisk|FloppyDisk
                    CompactDisk|RamDisk|FlashMemory|NetworkDisk]
   Also check the storage type in addition of the name
   It is possible to use regular expressions ( "FixedDisk|FloppyDisk" )
-r, --noregexp
   Do not use regexp to match NAME in description OID
-s, --sum
   Add all storages that match NAME (used space and total space)
   THEN make the tests.
-i, --index
   Parse index table instead of description table to select storage
-e, --exclude
   Select all storages except the one(s) selected by -m
   No action on storage type selection
-T, --type=TYPE
   pl : calculate percent left
   pu : calculate percent used (Default)
   bl : calculate MegaBytes left
   bu : calculate MegaBytes used
-w, --warn=INTEGER
   percent / MB of disk used to generate WARNING state
   you can add the % sign
-c, --critical=INTEGER
   percent / MB of disk used to generate CRITICAL state
   you can add the % sign
-R, --reserved=INTEGER
   % reserved blocks for superuser
   For ext2/3 filesystems, it is 5% by default
-G, --gigabyte
   output, warning & critical levels in gigabytes
-f, --perfparse
   Perfparse compatible output
-S, --short=<type>[,<where>,<cut>]
   <type>: Make the output shorter :
     0 : only print the global result except the disk in warning or critical
         ex: "< 80% : OK"
     1 : Don't print all info for every disk
         ex : "/ : 66 %used  (<  80) : OK"
   <where>: (optional) if = 1, put the OK/WARN/CRIT at the beginning
   <cut>: take the <n> first caracters or <n> last if n<0
-o, --octetlength=INTEGER
  max-size of the SNMP message, usefull in case of Too Long responses.
  Be carefull with network filters. Range 484 - 65535, default are
  usually 1472,1452,1460 or 1440.
-t, --timeout=INTEGER
   timeout for SNMP in seconds (Default: 5)
-V, --version
   prints version number
Note :
  with T=pu or T=bu : OK < warn < crit
  with T=pl ot T=bl : crit < warn < OK

  If multiple storage are selected, the worse condition will be returned
  i.e if one disk is critical, the return is critical

  example :
  Browse storage list : <script> -C <community> -H <host> -m <anything> -w 1 -c 2 -v
  the -m option allows regexp in perl format :
  Test drive C,F,G,H,I on Windows       : -m ^[CFGHI]:
  Test all mounts containing /var       : -m /var
  Test all mounts under /var            : -m ^/var
  Test only /var                        : -m /var -r
  Test all swap spaces                  : -m ^Swap
  Test all but swap spaces              : -m ^Swap -e


Re: check_snmp_storage.pl memory check problem

Posted: Tue Nov 05, 2013 10:31 am
by tom_wong
Sorry I am not too familiar with Linux mount point to get memory usage with snmp.

I tried -q but all parameters (Other|Ram|VirtualMemory|FixedDisk|RemovableDisk|FloppyDisk
CompactDisk|RamDisk|FlashMemory|NetworkDisk) end up unknow parameters message.

How come the linux snmp monitoring wizard comes with Nagios comes with wrong memory usage report?

Any body report this problem?

Thanks
Tom

Re: check_snmp_storage.pl memory check problem

Posted: Tue Nov 05, 2013 11:26 am
by abrist
tom_wong wrote:We have looked at the manual page, http://nagios.manubulon.com/snmp_storage.html
First of all, I would suggest using the built in manual for the XI provided plugin instead of the man from manubulon's site.
Additionally, the "Real Memory" name is specific to your OIDs. If the device you are checking does not include an oid with that string (as it is a regex matcher), it will not work.
-m, --name=NAME
Name in description OID (can be mounpoints '/home' or 'Swap Space'...)
This is treated as a regexp : -m /var will match /var , /var/log, /opt/var ...
Test it before, because there are known bugs (ex : trailling /)
No trailing slash for mountpoints !
tom_wong wrote:I tried -q but all parameters (Other|Ram|VirtualMemory|FixedDisk|RemovableDisk|FloppyDisk
CompactDisk|RamDisk|FlashMemory|NetworkDisk) end up unknow parameters message.
Have you snmpwalked the device you are trying check to verify that the relevant oids are available to be checked?

Re: check_snmp_storage.pl memory check problem

Posted: Tue Dec 03, 2013 4:40 am
by tom_wong
Thanks, found out check_snmp_storage.pl doesn't report memory usage for Linux properly.

We used check_snmp_mem.pl instead.

Thanks
Tom

Re: check_snmp_storage.pl memory check problem

Posted: Tue Dec 03, 2013 11:15 am
by slansing
Ah excellent!