I am trying to graph disk utilization of some large filesystems (20TB+). As I understand it, as of version 5.6, netsnmp is unable to handle this out of the box. So I have an idea to do it with snmpd's "extend" clause by invoking a shell script to do "df -k" or the like.
I imagine the output of the script would look something like this:
Code: Select all
# df -k | tail +2
/dev/md/dsk/d0 53957990 5739325 47679086 11% /
/devices 0 0 0 0% /devices
ctfs 0 0 0 0% /system/contract
proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
swap 16690560 1616 16688944 1% /etc/svc/volatile
objfs 0 0 0 0% /system/object
sharefs 0 0 0 0% /etc/dfs/sharetab
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
53957990 5739325 47679086 11% /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
53957990 5739325 47679086 11% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd 0 0 0 0% /dev/fd
swap 16689160 216 16688944 1% /tmp
swap 16689040 96 16688944 1% /var/run
macdata2 15061745664 11131043894 3930638063 74% /macdata2
macdata1 20082327552 10527551399 9554715596 53% /macdata1
macdata3 15061745664 3709858909 11351861901 25% /macdata3
macdata4 20082327552 3961614389 16069684006 20% /macdata4
macdata4/MCIS_Dump 20082327552 51019986 16069684006 1% /macdata4/MCIS_Dump
Code: Select all
# cat /usr/local/share/snmp/snmpd.conf | grep extend
extend disk_utilization /usr/local/bin/disk_utilization.sh
Code: Select all
$ snmpwalk -v2c -c secret fileserver NET-SNMP-AGENT-MIB::nsExtensions
NET-SNMP-EXTEND-MIB::nsExtendNumEntries.0 = INTEGER: 1
NET-SNMP-EXTEND-MIB::nsExtendCommand."zfs_utilization" = STRING: /usr/local/bin/disk_utilization.sh
NET-SNMP-EXTEND-MIB::nsExtendArgs."zfs_utilization" = STRING:
NET-SNMP-EXTEND-MIB::nsExtendInput."zfs_utilization" = STRING:
NET-SNMP-EXTEND-MIB::nsExtendCacheTime."zfs_utilization" = INTEGER: 5
NET-SNMP-EXTEND-MIB::nsExtendExecType."zfs_utilization" = INTEGER: exec(1)
NET-SNMP-EXTEND-MIB::nsExtendRunType."zfs_utilization" = INTEGER: run-on-read(1)
NET-SNMP-EXTEND-MIB::nsExtendStorage."zfs_utilization" = INTEGER: permanent(4)
NET-SNMP-EXTEND-MIB::nsExtendStatus."zfs_utilization" = INTEGER: active(1)
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."zfs_utilization" = STRING: Filesystem kbytes used avail capacity Mounted on
NET-SNMP-EXTEND-MIB::nsExtendOutputFull."zfs_utilization" = STRING: Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d0 53957990 5739325 47679086 11% /
/devices 0 0 0 0% /devices
ctfs 0 0 0 0% /system/contract
proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
swap 16690200 1616 16688584 1% /etc/svc/volatile
objfs 0 0 0 0% /system/object
sharefs 0 0 0 0% /etc/dfs/sharetab
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1 53957990 5739325 47679086 11% /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1 53957990 5739325 47679086 11% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd 0 0 0 0% /dev/fd
swap 16688800 216 16688584 1% /tmp
swap 16688680 96 16688584 1% /var/run
zfsdata2 15061745664 11131043894 3930638063 74% /zfsdata2
zfsdata1 20082327552 10527551399 9554715596 53% /zfsdata1
zfsdata3 15061745664 3709858909 11351861901 25% /zfsdata3
zfsdata4 20082327552 3961614389 16069684006 20% /zfsdata4
zfsdata4/temp 20082327552 51019986 16069684006 1% /zfsdata4/temp
NET-SNMP-EXTEND-MIB::nsExtendOutNumLines."zfs_utilization" = INTEGER: 19
NET-SNMP-EXTEND-MIB::nsExtendResult."zfs_utilization" = INTEGER: 0
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".1 = STRING: Filesystem kbytes used avail capacity Mounted on
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".2 = STRING: /dev/md/dsk/d0 53957990 5739325 47679086 11% /
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".3 = STRING: /devices 0 0 0 0% /devices
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".4 = STRING: ctfs 0 0 0 0% /system/contract
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".5 = STRING: proc 0 0 0 0% /proc
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".6 = STRING: mnttab 0 0 0 0% /etc/mnttab
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".7 = STRING: swap 16690200 1616 16688584 1% /etc/svc/volatile
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".8 = STRING: objfs 0 0 0 0% /system/object
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".9 = STRING: sharefs 0 0 0 0% /etc/dfs/sharetab
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".10 = STRING: /platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1 53957990 5739325 47679086 11% /platform/sun4u-us3/lib/libc_psr.so.1
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".11 = STRING: /platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1 53957990 5739325 47679086 11% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".12 = STRING: fd 0 0 0 0% /dev/fd
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".13 = STRING: swap 16688800 216 16688584 1% /tmp
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".14 = STRING: swap 16688680 96 16688584 1% /var/run
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".15 = STRING: zfsdata2 15061745664 11131043894 3930638063 74% /zfsdata2
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".16 = STRING: zfsdata1 20082327552 10527551399 9554715596 53% /zfsdata1
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".17 = STRING: zfsdata3 15061745664 3709858909 11351861901 25% /zfsdata3
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".18 = STRING: zfsdata4 20082327552 3961614389 16069684006 20% /zfsdata4
NET-SNMP-EXTEND-MIB::nsExtendOutLine."zfs_utilization".19 = STRING: zfsdata4/temp 20082327552 51019986 16069684006 1% /zfsdata4/temp
$