# SNMP not showing mounted partitions/disk space

## planet-admin

I have net-snmp installed, and would like to monitor free disk space using it. I have successfully implemented this on many machines, however, I have one machine which refuses to show free disk space and mounted partitions. The dsktable doesn't seem to exist.

Here are relevant configs:

```

Calculating dependencies... done!

[ebuild   R   ] net-analyzer/net-snmp-5.4.1-r1  USE="diskio ipv6 perl python ssl tcpd -X -doc -elf -lm_sensors -mfd-rewrites -minimal -rpm (-selinux) -sendmail -smux" 0 kB

```

Part of the snmpd.conf:

```
disk  / 500000
```

Output:

```

ad snmp # snmpwalk -v2c -c community 192.168.1.120 1.3.6.1.4.1.2021.9.1.100.1

UCD-SNMP-MIB::dskErrorFlag.1 = No Such Instance currently exists at this OID

```

Any ideas?

Thanks,

Michael

----------

## vad3r

Why don't you use the names instead the OID's?

```
snmpwalk -v2c -c public 127.0.0.1 dskTable.dskEntry

UCD-SNMP-MIB::dskIndex.1 = INTEGER: 1

UCD-SNMP-MIB::dskPath.1 = STRING: /

UCD-SNMP-MIB::dskDevice.1 = STRING: /dev/sda3

UCD-SNMP-MIB::dskMinimum.1 = INTEGER: 100

UCD-SNMP-MIB::dskMinPercent.1 = INTEGER: -1

UCD-SNMP-MIB::dskTotal.1 = INTEGER: 987932

UCD-SNMP-MIB::dskAvail.1 = INTEGER: 340736

UCD-SNMP-MIB::dskUsed.1 = INTEGER: 647196

UCD-SNMP-MIB::dskPercent.1 = INTEGER: 66

UCD-SNMP-MIB::dskPercentNode.1 = INTEGER: 100

UCD-SNMP-MIB::dskErrorFlag.1 = INTEGER: noError(0)

UCD-SNMP-MIB::dskErrorMsg.1 = STRING: 
```

----------

## planet-admin

Even using the names instead of the OID's, I get basically the same thing.

I think this is a deeper issue.

Michael

----------

## vad3r

The OID you supplied doesn't retrun data on my laptop either. I think your OID may be wrong.

----------

## planet-admin

 *vad3r wrote:*   

> The OID you supplied doesn't retrun data on my laptop either. I think your OID may be wrong.

 

I'm using the same OID on at least 20 different servers when I have disk / 500000 in the snmpd.conf

That is not the issue either, but thanks.

Michael

----------

## vad3r

Well, ok. I'm concerned about the 100 in your OID cause if you use 1.3.6.1.4.1.2021.9.1 you should get your disk table:

```
deathstar ~ # snmpwalk -v2c -c public 127.0.0.1 1.3.6.1.4.1.2021.9.1

UCD-SNMP-MIB::dskIndex.1 = INTEGER: 1

UCD-SNMP-MIB::dskPath.1 = STRING: /

UCD-SNMP-MIB::dskDevice.1 = STRING: /dev/sda3

UCD-SNMP-MIB::dskMinimum.1 = INTEGER: 100

UCD-SNMP-MIB::dskMinPercent.1 = INTEGER: -1

UCD-SNMP-MIB::dskTotal.1 = INTEGER: 987932

UCD-SNMP-MIB::dskAvail.1 = INTEGER: 340732

UCD-SNMP-MIB::dskUsed.1 = INTEGER: 647200

UCD-SNMP-MIB::dskPercent.1 = INTEGER: 66

UCD-SNMP-MIB::dskPercentNode.1 = INTEGER: 100

UCD-SNMP-MIB::dskErrorFlag.1 = INTEGER: noError(0)

UCD-SNMP-MIB::dskErrorMsg.1 = STRING: 

```

The 100 doesn't make sense... at least to me

----------

## planet-admin

```
gsc@ad ~ $ snmpwalk -v2c -c community 127.0.0.1 1.3.6.1.4.1.2021.9.1

UCD-SNMP-MIB::dskEntry = No Such Object available on this agent at this OID
```

As you can see, using the same OID you just used, I get that

Michael

----------

## vad3r

Hmmmm, this is strange. Can you post your complete config?

----------

## jagland

Hi Michael

I seem to be getting the same problem as you.  So far I've identified two of my Gentoo systems which have the same SNMP config both have NET-SNMP 5.4.1 but have different kernels, the one with the earlier kernel works fine (2.6.22-gentoo-r :Cool:  but the box with a slightly later kernel (2.6.23-gentoo-r3) doesn't.  It may not be related to kernel but some other package that is newer.

Here's my SNMP config - which is the same on both systems.  (I've replaced the sensitive bits!)

```
syslocation  "Server Room"

syscontact  "Me <me@mydomain.com>"

sysservices 79

rouser  public noauth

rocommunity  public 10.10.10.10

proc

disk / 15%

disk /usr/backup 15%
```

I've noticed that I have another server with an almost identical SNMP configuration with kernel 2.6.24-gentoo-r3 and the same version of NET-SNMP that works fine.

What kernel and NET-SNMP version are you using?  

Cheers

Jon

----------

## matto

I see this also. Here is what I believe is the key difference between a working system and a broken one:

(working)

```

$ mount | grep ' / '

/dev/sda3 on / type ext3 (rw,noatime)

$ snmpwalk -v2c -c secret localhost dskTable.dskEntry.dskPath

UCD-SNMP-MIB::dskPath.1 = STRING: /

```

(broken)

```

$ mount | grep ' / '

/dev/mapper/ddf1_4035305a8680c32720202020202020208aa4e6683a354a451 on / type ext3 (rw,noatime)

$ snmpwalk -v2c -c secret localhost dskTable.dskEntry.dskPath

UCD-SNMP-MIB::dskPath = No Such Instance currently exists at this OID

```

I think something is busted when trying to monitor filesystems mounted on anything but simple devices.

----------

## matto

the problem turns out to be in the 'configure' script for the net-snmp ebuild. It is confused by the existence of the file '/etc/filesystems', and tries to look there for a list of mounted filesystems instead of '/etc/fstab'. Renaming '/etc/filesystems' before emerging net-snmp fixes the problem.

Someone should probably tell the maintainer of the net-snmp ebuild that the configure script needs a patch.

----------

