<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: [Nagios-users] check_snmp_storage ..... ERROR : Unknown storage /var</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>>> 1) Are you sure that "/var" is a seperate partition? Run<BR>
>> df<BR>
>> And look at the "mounted on" column<BR>
><BR>
>The df command display  the following<BR>
><BR>
>[root@vps libexec]# df<BR>
>Filesystem           1K-blocks      Used Available Use% Mounted on<BR>
>vzfs                   1048576    338374    710202  33% /<BR>
><BR>
>do i need to manually mount the  the /home or /var partion ??<BR>
<BR>
>> snmpwalk 127.0.01 -v2c -C public hrStorageDescr<BR>
><BR>
><BR>
>this command gives me the following output :<BR>
><BR>
>[root@vps libexec]# snmpwalk  127.0.0.1  -v1 -c public hrStorageDescr<BR>
>HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Memory Buffers<BR>
>HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: Real Memory<BR>
>HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Swap Space<BR>
>HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: /<BR>
<BR>
<BR>
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.<BR>
<BR>
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.<BR>
<BR>
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.<BR>
<BR>
(unless you're using quotas, which net-snmp probably doesn't support)<BR>
<BR>
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<BR>
<BR>
1) add a file /usr/local/bin/checkSpaceOnVar.sh<BR>
with content<BR>
#!/bin/bash<BR>
sudo /usr/bin/du -sch /var<BR>
<BR>
2) Set sudoers to allow the snmpd user to run "/usr/bin/du -sch var"<BR>
3) Add a line to snmpd.[local.]conf along the lines of<BR>
exec checkSpaceOnVar /usr/local/bin/checkSpaceOnVar.sh<BR>
<BR>
Then monitor the .1.3.6.1.4.1.2021.8 oid. You may be better off with<BR>
1) NRPE<BR>
2) check_by_ssh<BR>
3) moving /var onto it's own partitions (there are benefits to doing this outside of monitoring the system)</FONT>
</P>

<br/><font face="Times New Roman" size="3"><a href="http://www.bbc.co.uk">http://www.bbc.co.uk</a><br/>This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.<br/>If you have received it in error, please delete it from your system.<br/>Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.<br/>Please note that the BBC monitors e-mails sent or received.<br/>Further communication will signify your consent to this.</font></BODY>
</HTML>