check_snmp_storage ..... ERROR : Unknown storage /var
Paul Weaver
paul.weaver at bbc.co.uk
Wed Aug 20 09:37:47 CEST 2008
>> 1) Are you sure that "/var" is a seperate partition? Run
>> df
>> And look at the "mounted on" column
>
>The df command display the following
>
>[root at vps libexec]# df
>Filesystem 1K-blocks Used Available Use% Mounted on
>vzfs 1048576 338374 710202 33% /
>
>do i need to manually mount the the /home or /var partion ??
>> snmpwalk 127.0.01 -v2c -C public hrStorageDescr
>
>
>this command gives me the following output :
>
>[root at vps libexec]# snmpwalk 127.0.0.1 -v1 -c public hrStorageDescr
>HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Memory Buffers
>HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: Real Memory
>HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Swap Space
>HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: /
SNMP is working fine. Your /var directory is part of your root file system -- if one fills up, the other will. If you wanted to monitor the space available in /var, you'd monitor the space available on "/" -- it's the same figure.
If you need to know the space used, that's a heavyweight operation -- you need to sum all the sizes of the files in /var -- and even then you have hard links confusing the issue. You can do this by running "du -sch /var" as root, but see how long it takes to run, and realise that while it runs other operations to your disk will slow down.
The reason you can see space used/available on a partition (/ in your case), is the kernel keeps a track of this seperatly in a very small index of the partition.
(unless you're using quotas, which net-snmp probably doesn't support)
If you really need to get the disk space used, you could configure snmpd to run a command on polling of a given mib. Normally snmp commands should return instantly, but there's no technical reason why you couldn't
1) add a file /usr/local/bin/checkSpaceOnVar.sh
with content
#!/bin/bash
sudo /usr/bin/du -sch /var
2) Set sudoers to allow the snmpd user to run "/usr/bin/du -sch var"
3) Add a line to snmpd.[local.]conf along the lines of
exec checkSpaceOnVar /usr/local/bin/checkSpaceOnVar.sh
Then monitor the .1.3.6.1.4.1.2021.8 oid. You may be better off with
1) NRPE
2) check_by_ssh
3) moving /var onto it's own partitions (there are benefits to doing this outside of monitoring the system)
http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080820/0b706f99/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list