Upgraded: snmpdiskio 0.9.6 (Disk I/O statistics on Linux)

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
calbear
Posts: 5
Joined: Tue Jul 29, 2008 8:54 pm

Post by calbear »

calbear wrote:
super-hornet wrote:I have both scripts of this one and "ucd/net snmp Device (Disk) I/O templates - Updated - v2"
{ http://forums.cacti.net/viewtopic.php?t ... sc&start=0 }

running on the same system. When I compare the graph on both, it looks like this script is in reverse to the "ucd/net snmp Device (Disk) I/O templates - Updated - v2". The read become write and write become read.

Which one is correct, i cannot confirm.

SH
I'm pretty sure originally it was wrong. I have a machine running apache web server with awstats processing logs at a certain time of day. Originally cacti was reporting it was reading from disk all the time and when awstats kicks in, writes spike. That didn't make sense at all. Most of what the web server is reading should be in file system cache so it doesn't need to actually read from disk but it should be writing to disk all the time for apache logs. And when awstats kicks in, it should be reading the logs from disk far much more than writing processed data to disk.
I also have a machine running mysql (primarily innodb) continuously, and originally cacti was reporting disk reads throughout the entire time while writes were minimal. But that machine has enough memory to hold the entire database so it shouldn't be reading from disk that much. On the other hands, all db writes require disk write. Plus:

.1.3.6.1.4.1.2021.13.15.1.1.3 = UCD-DISKIO-MIB::diskIONRead
.1.3.6.1.4.1.2021.13.15.1.1.4 = UCD-DISKIO-MIB::diskIONWritten

So reads and writes were certainly reversed.
super-hornet
Cacti User
Posts: 175
Joined: Sun May 27, 2007 5:42 pm

Post by super-hornet »

I think the quick cure/walkaround this problem is to modify our snmpd.conf to have the read and write value reverse.

Sadly net-snmp.5.4.1 that I have for my RHELv4 cannot return the disk IO data using ucd-net. That is why I use this script.

But for openSUSE 10.2 and above, it can return the disk IO using ucd-net...thus I can use the other script.

I just download net-snmp-5.4.1.1-1.src.rpm. I going to compile it in RHELv4 and install it. I hope this new snmp can report back the disk IO without using this script bash file.

SH
super-hornet
Cacti User
Posts: 175
Joined: Sun May 27, 2007 5:42 pm

Post by super-hornet »

I tried the latest net-snmp-5.4.1.1-1 rpm but still the same. Looks like for RHEL, I need to compile the net-snmp manually from the source code using the correct parameters.

Too lazy to do that, I modify the snmpdiskio script in such a way that the content of function
hdOutBlocks & hdInBlocks swapped. That should solve the Read => Write and Write => Read problem. :)

SH
calbear
Posts: 5
Joined: Tue Jul 29, 2008 8:54 pm

Post by calbear »

super-hornet wrote:I tried the latest net-snmp-5.4.1.1-1 rpm but still the same. Looks like for RHEL, I need to compile the net-snmp manually from the source code using the correct parameters.

Too lazy to do that, I modify the snmpdiskio script in such a way that the content of function
hdOutBlocks & hdInBlocks swapped. That should solve the Read => Write and Write => Read problem. :)

SH

Yeah, that's the right way to do it, since snmpdiskio is not part of a major linux distribution...
prakashk
Posts: 6
Joined: Wed Sep 03, 2008 3:33 am

Post by prakashk »

Hi Can you please post more detail im not able to find two cacti templets


skion wrote:
elgoretto wrote:Ok I've reinstalled a brand new 0.8.7b cacti, and my contribution to partition.xml is still valid.
With this method, you can get rid of the snmpio script (no need to maintain it anymore) and no need to have a specific snmp.conf setup (but you still need to add diskIO feature at net-snmp compilation time).
Thanks elgoretto, this works like a charm!

For the record, what i did was:
- import the two cacti templates from the original post
- copy elgoretto's partitions file to /usr/share/cacti/resource/snmp_queries/partition.xml
- in cacti, add the SNMP disk statistics data query to the hosts you want
- in cacti, add some graphs
- voila, nothing else needed
prakashk
Posts: 6
Joined: Wed Sep 03, 2008 3:33 am

Post by prakashk »

super-hornet wrote:I tried the latest net-snmp-5.4.1.1-1 rpm but still the same. Looks like for RHEL, I need to compile the net-snmp manually from the source code using the correct parameters.

Too lazy to do that, I modify the snmpdiskio script in such a way that the content of function
hdOutBlocks & hdInBlocks swapped. That should solve the Read => Write and Write => Read problem. :)

SH
can you post the modified script stuck for RHEL 4.0
glen
Posts: 9
Joined: Sun Oct 05, 2008 10:46 am

Post by glen »

has anyone got it work with net-snmpd 5.4.1.2 ?

default 'exec' line does nothing, but 'extend' results something, but the numbers are different: (.4 not .101 expected)

Code: Select all

$ snmpwalk -v1 -c sw localhost .1.3.6.1.4.1.2021.54.4
UCD-SNMP-MIB::ucdavis.54.4.1.2.5.104.100.78.117.109.1 = STRING: "29"
$ snmpwalk -v1 -c sw localhost .1.3.6.1.4.1.2021.55.4
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.1 = STRING: "1"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.2 = STRING: "2"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.3 = STRING: "3"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.4 = STRING: "4"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.5 = STRING: "5"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.6 = STRING: "6"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.7 = STRING: "7"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.8 = STRING: "8"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.9 = STRING: "9"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.10 = STRING: "10"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.11 = STRING: "11"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.12 = STRING: "12"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.13 = STRING: "13"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.14 = STRING: "14"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.15 = STRING: "15"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.16 = STRING: "16"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.17 = STRING: "17"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.18 = STRING: "18"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.19 = STRING: "19"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.20 = STRING: "20"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.21 = STRING: "21"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.22 = STRING: "22"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.23 = STRING: "23"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.24 = STRING: "24"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.25 = STRING: "25"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.26 = STRING: "26"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.27 = STRING: "27"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.28 = STRING: "28"
UCD-SNMP-MIB::ucdavis.55.4.1.2.7.104.100.73.110.100.101.120.29 = STRING: "29"
$ snmpwalk -v1 -c sw localhost .1.3.6.1.4.1.2021.56.4
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.1 = STRING: "ram0"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.2 = STRING: "ram1"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.3 = STRING: "ram2"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.4 = STRING: "ram3"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.5 = STRING: "ram4"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.6 = STRING: "ram5"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.7 = STRING: "ram6"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.8 = STRING: "ram7"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.9 = STRING: "ram8"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.10 = STRING: "ram9"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.11 = STRING: "ram10"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.12 = STRING: "ram11"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.13 = STRING: "ram12"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.14 = STRING: "ram13"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.15 = STRING: "ram14"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.16 = STRING: "ram15"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.17 = STRING: "sda"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.18 = STRING: "sda1"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.19 = STRING: "sda2"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.20 = STRING: "sdb"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.21 = STRING: "sdc"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.22 = STRING: "sdd"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.23 = STRING: "sde"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.24 = STRING: "sdf"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.25 = STRING: "dm-0"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.26 = STRING: "dm-1"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.27 = STRING: "dm-2"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.28 = STRING: "dm-3"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.29 = STRING: "dm-4"
glen
Posts: 9
Joined: Sun Oct 05, 2008 10:46 am

Post by glen »

nevermind about net-snmp 5.4 problem, i found that i can use diskio :)

but about the reversed stats, why not just modify partition.xml to have:

Code: Select all

        <hdOutBlocks>
            <name>Bytes Read</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.2021.13.15.1.1.3</oid>
        </hdOutBlocks>

        <hdInBlocks>
            <name>Bytes Written</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.2021.13.15.1.1.4</oid>
        </hdInBlocks>
alinux
Cacti User
Posts: 56
Joined: Mon Jul 16, 2007 10:02 am

Post by alinux »

Hi
I downloaded the script and did the installation as described in the read me file on CentOS with kernel 2.6

If I execute the commands in the snmpd file manually it works just fine

/usr/local/bin/snmpdiskio hdNum
24

However the graph is not returning any data, a verbose query shows :

+ Running data query [10].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/local/apache2/htdocs/cacti/resource/snmp_queries/partition.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.2021.55.101'
+ No SNMP data returned
+ Found data query XML file at '/usr/local/apache2/htdocs/cacti/resource/snmp_queries/partition.xml'
+ Found data query XML file at '/usr/local/apache2/htdocs/cacti/resource/snmp_queries/partition.xml'
+ Found data query XML file at '/usr/local/apache2/htdocs/cacti/resource/snmp_queries/partition.xml'
alinux
Cacti User
Posts: 56
Joined: Mon Jul 16, 2007 10:02 am

Post by alinux »

Adding to the above a test snmpwalk from the cacti server to the target server shows :

snmpwalk -c string host .1.3.6.1.4.1.2021.55.101
UCD-SNMP-MIB::ucdavis.55.101.1 = STRING: "1"
UCD-SNMP-MIB::ucdavis.55.101.2 = STRING: "2"
UCD-SNMP-MIB::ucdavis.55.101.3 = STRING: "3"
UCD-SNMP-MIB::ucdavis.55.101.4 = STRING: "4"
UCD-SNMP-MIB::ucdavis.55.101.5 = STRING: "5"
UCD-SNMP-MIB::ucdavis.55.101.6 = STRING: "6"
UCD-SNMP-MIB::ucdavis.55.101.7 = STRING: "7"
UCD-SNMP-MIB::ucdavis.55.101.8 = STRING: "8"
UCD-SNMP-MIB::ucdavis.55.101.9 = STRING: "9"
UCD-SNMP-MIB::ucdavis.55.101.10 = STRING: "10"
UCD-SNMP-MIB::ucdavis.55.101.11 = STRING: "11"
UCD-SNMP-MIB::ucdavis.55.101.12 = STRING: "12"
UCD-SNMP-MIB::ucdavis.55.101.13 = STRING: "13"
UCD-SNMP-MIB::ucdavis.55.101.14 = STRING: "14"
UCD-SNMP-MIB::ucdavis.55.101.15 = STRING: "15"
UCD-SNMP-MIB::ucdavis.55.101.16 = STRING: "16"
UCD-SNMP-MIB::ucdavis.55.101.17 = STRING: "17"
UCD-SNMP-MIB::ucdavis.55.101.18 = STRING: "18"
UCD-SNMP-MIB::ucdavis.55.101.19 = STRING: "19"
UCD-SNMP-MIB::ucdavis.55.101.20 = STRING: "20"
UCD-SNMP-MIB::ucdavis.55.101.21 = STRING: "21"
UCD-SNMP-MIB::ucdavis.55.101.22 = STRING: "22"
UCD-SNMP-MIB::ucdavis.55.101.23 = STRING: "23"
UCD-SNMP-MIB::ucdavis.55.101.24 = STRING: "24"
alinux
Cacti User
Posts: 56
Joined: Mon Jul 16, 2007 10:02 am

Post by alinux »

I did implement it successfully however I need to get it to work on Solaris any help on this please when I run the script on the solaris system I get:

bash-3.00# /usr/local/bin/snmpdiskio
Usage: /usr/local/bin/snmpdiskio <hdNum|hdIndex|hdDescr|hdInBlocks|hdOutBlocks>
bash-3.00# /usr/local/bin/snmpdiskio hdNum
awk: can't open /proc/partitions
jones
Posts: 11
Joined: Sun Feb 12, 2006 10:42 am

Post by jones »

Works fine on net-snmp 5.3

Tried 5.5 and it doesn't work:

+ Running data query [10].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/partition.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.2021.55.101'
+ No SNMP data returned
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/partition.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/partition.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/partition.xml'

Anyone get this working on net-snmp 5.5?

EDIT: nevermind, forgot to configure with:

--with-mib-modules="ucd-snmp/diskio"
wallb
Posts: 5
Joined: Mon Nov 23, 2009 8:07 am

Debian Lenny 64 bits

Post by wallb »

I have this problem when running on a Debian Lenny 64 bits :
> snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.2021.55
UCD-SNMP-MIB::ucdavis.55 = No Such Object available on this agent at this OID
I restart the snmp deamon, my snmpdiskio works fine.
Any idea ?
Regards
winampus
Posts: 1
Joined: Thu Mar 18, 2010 8:09 pm

Some updates...

Post by winampus »

Hello guys...
For those who have quite some machines/disk to monitor and using LVM.... You might be interested in this. I have added some changes to the last version of snmpdiskio found here to translate the dm-X devices into some human readable name which means something....
Code is below and the support is only for 2.6 kernel....
Feel free to add some more changes. Feedback is always welcome.

Code: Select all

#!/bin/bash
# $Id: snmpdiskio,v 1.5 2008/01/31 21:19:50 dverlaeckt Exp $
# snmpdiskio v0.9.7 (c) 2010 Alex R. <alex@capeno.com>
# snmpdiskio v0.9.6 (c) 2008 Dieter Verlaeckt <dieter.verlaeckt@gmail.com>
# snmpdiskio v0.9.5 (c) 2007 Pablo Destefanis <pdestefanis@gmail.com>
# snmpdiskio v0.9.4 (c) 2006 Mikael Fridh <mikael@meanstreak.se>

# Fri Mar 19 2010 Alex R. <alex@capeno.com>
# - Added replacement of dm devices to actual LVM vg-lv_name for more meaning name instead of dm-X

# Fields in /proc/partitions (kernel 2.4)
# major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq

# Fields in /proc/diskstats (kernel 2.6) for disks (i.e. hda)
# major minor name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq

# Fields in /proc/diskstats (kernel 2.6) for partitions (i.e. hda1)
# major minor name rio rsect wio wsect

# InBlocks = sectors written to disk
# OutBlocks = sectors read from disk

# Set default procfile for kernel 2.4
PROCFILE="/proc/partitions"
MODE="linux24"

# Probably kernel 2.6:
if [ -f /proc/diskstats ]; then
    PROCFILE=/proc/diskstats
    MODE="linux26"
fi


function hdNum()
{
        awk ' BEGIN { num=0 } $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ { num++ } END { print num } ' $PROCFILE
}

function hdIndex()
{
        awk ' BEGIN { num=0 } $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ { num++; print num } ' $PROCFILE
}

function hdDescr()
{
        if [ "$MODE" = "linux26" ]; then
#                awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ { printf "%s\n", $3 }' $PROCFILE
		loop=0
		for DEV in $(awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ { printf "%s\n", $3 }' $PROCFILE); do
			let loop++
			ARR[$loop]=$DEV
		done
		HDNUM=$loop
		for (( loop=1; loop<=$HDNUM; loop++ )); do
			if [[ ${ARR[$loop]} == dm-* ]]; then
				ARR[$loop]=$(/sbin/dmsetup ls | grep " "${ARR[$loop]:3}")" | awk '{ print $1 }')
			fi
			HDDESCR="$HDDESCR${ARR[$loop]} "
		done
		echo $HDDESCR | sed 's/ /\n/g'
        else
                awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ { printf "%s\n", $4 }' $PROCFILE
        fi
}

function hdInBlocks()
{
        if [ "$MODE" = "linux26" ]; then
                awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && NF == 7 { printf "%.0f\n", $7 * 512 }
                      $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && NF == 14 { printf "%.0f\n", $10 * 512 } ' $PROCFILE
        else
                awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && NF == 15 { printf "%.0f\n", $11 * 512 } ' $PROCFILE
        fi
}

function hdOutBlocks()
{
        if [ "$MODE" = "linux26" ]; then
                awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && NF == 7 { printf "%.0f\n", $5 * 512 }
                      $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && NF == 14 { printf "%.0f\n", $6 * 512 } ' $PROCFILE
        else
                awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && NF == 15 { printf "%.0f\n", $7 * 512 } ' $PROCFILE
        fi
}

function usage()
{
        cat <<-EOUSAGE
Usage: $0 <hdNum|hdIndex|hdDescr|hdInBlocks|hdOutBlocks>
EOUSAGE
}

if [ 1 -ne $# ]; then
        usage
        exit 1
fi

case $1 in
        hdNum|hdIndex|hdDescr|hdInBlocks|hdOutBlocks)
                $1
        ;;
        'hdNum')
                hdNum
        ;;
        'hdIndex')
                hdIndex
        ;;
        'hdDescr')
                hdDescr
        ;;
        'hdInBlocks')
                hdInBlocks
        ;;
        'hdOutBlocks')
                hdOutBlocks
        ;;
        *)
                usage
                exit 1
        ;;
esac

exit 0
Best regards,
Alex R.
Last edited by winampus on Wed Jan 30, 2013 6:21 am, edited 2 times in total.
megamojo
Posts: 14
Joined: Mon May 10, 2010 8:11 am

Post by megamojo »

Can anyone help me get going with this? I'm running net-snmp 5.4 which I think may be causing the problem. I posted for help in the linux/unix specific section but got no replies so I guess it's better to post to this thread. I'm including my initial post at the bottom of this.

As an update since then, I've updated to the latest snmpdiskio script in the post above me to be able to resolve LVM names, and discovered that part of my problem was pasting the script into a too narrow ssh window and getting extra junk returns. I'm now at a point where I can do a successful snmpwalk as show below, but as you can see the data comes back at .1.3.6.1.4.1.2021.xx.4 instead of 101. I've edited my partition.xml to look at .4 instead of .101 and the "Create graphs for this host" wizard seems to work just fine now, but all the graphs I try to create just come back with no data ("NaN"). The graphs do actually get created, but just have no data.

Code: Select all

user@host:~$ snmpwalk -v 2c -c string localhost .1.3.6.1.4.1.2021.56
UCD-SNMP-MIB::ucdavis.56.1.0 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.56.2.1.2.7.104.100.68.101.115.99.114 = STRING: "/usr/local/bin/snmpdiskio"
UCD-SNMP-MIB::ucdavis.56.2.1.3.7.104.100.68.101.115.99.114 = STRING: "hdDescr"
UCD-SNMP-MIB::ucdavis.56.2.1.4.7.104.100.68.101.115.99.114 = ""
UCD-SNMP-MIB::ucdavis.56.2.1.5.7.104.100.68.101.115.99.114 = INTEGER: 5
UCD-SNMP-MIB::ucdavis.56.2.1.6.7.104.100.68.101.115.99.114 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.56.2.1.7.7.104.100.68.101.115.99.114 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.56.2.1.20.7.104.100.68.101.115.99.114 = INTEGER: 4
UCD-SNMP-MIB::ucdavis.56.2.1.21.7.104.100.68.101.115.99.114 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.56.3.1.1.7.104.100.68.101.115.99.114 = STRING: "ram0"
UCD-SNMP-MIB::ucdavis.56.3.1.2.7.104.100.68.101.115.99.114 = STRING: "ram0
ram1
ram2

SNIP

sde
sde1
sdf
sdf1
md0
storagevg-videolv
storagevg-dvrlv
storagevg-winbacklv"
UCD-SNMP-MIB::ucdavis.56.3.1.3.7.104.100.68.101.115.99.114 = INTEGER: 47
UCD-SNMP-MIB::ucdavis.56.3.1.4.7.104.100.68.101.115.99.114 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.1 = STRING: "ram0"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.2 = STRING: "ram1"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.3 = STRING: "ram2"

SNIP

STRING: "sdc"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.37 = STRING: "sdc1"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.38 = STRING: "sdd"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.39 = STRING: "sdd1"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.40 = STRING: "sde"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.41 = STRING: "sde1"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.42 = STRING: "sdf"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.43 = STRING: "sdf1"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.44 = STRING: "md0"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.45 = STRING: "storagevg-videolv"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.46 = STRING: "storagevg-dvrlv"
UCD-SNMP-MIB::ucdavis.56.4.1.2.7.104.100.68.101.115.99.114.47 = STRING: "storagevg-winbacklv"
My initial post with some details you might want:
megamojo wrote:Hi all. I'm relatively new to cacti and the world of SNMP monitoring, but pretty comfortable working with linux in general. I'm trying to get diskio working as outlined in this thread and I'm hitting a wall of frustration. If I run these commands:

Code: Select all

/usr/local/bin/snmpdiskio hdNum
/usr/local/bin/snmpdiskio hdIndex
/usr/local/bin/snmpdiskio hdDescr
/usr/local/bin/snmpdiskio hdInBlocks
/usr/local/bin/snmpdiskio hdOutBlocks
it works exactly as it should, but when it comes to querying this via SNMP it returns no data. I've added the following to my snmpd.conf file.

Code: Select all

extend .1.3.6.1.4.1.2021.54 hdNum /usr/local/bin/snmpdiskio hdNum
extend .1.3.6.1.4.1.2021.55 hdIndex /usr/local/bin/snmpdiskio hdIndex
extend .1.3.6.1.4.1.2021.56 hdDescr /usr/local/bin/snmpdiskio hdDescr
extend .1.3.6.1.4.1.2021.57 hdInBlocks /usr/local/bin/snmpdiskio hdInBlocks
extend .1.3.6.1.4.1.2021.58 hdOutBlocks /usr/local/bin/snmpdiskio hdOutBlocks
With these lines present if I do a manual test I get:

Code: Select all

user@host:~$ snmpwalk -v 2c -c string localhost .1.3.6.1.4.1.2021.54
UCD-SNMP-MIB::ucdavis.54.1.0 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.54.2.1.2.5.104.100.78.117.109 = STRING: "/usr/local/bin/snmpdiskio"
UCD-SNMP-MIB::ucdavis.54.2.1.3.5.104.100.78.117.109 = STRING: "hdNum"
UCD-SNMP-MIB::ucdavis.54.2.1.4.5.104.100.78.117.109 = ""
UCD-SNMP-MIB::ucdavis.54.2.1.5.5.104.100.78.117.109 = INTEGER: 5
UCD-SNMP-MIB::ucdavis.54.2.1.6.5.104.100.78.117.109 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.54.2.1.7.5.104.100.78.117.109 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.54.2.1.20.5.104.100.78.117.109 = INTEGER: 4
UCD-SNMP-MIB::ucdavis.54.2.1.21.5.104.100.78.117.109 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.54.3.1.1.5.104.100.78.117.109 = STRING: "/usr/local/bin/snmpdiskio: Exec format error"
UCD-SNMP-MIB::ucdavis.54.3.1.2.5.104.100.78.117.109 = STRING: "/usr/local/bin/snmpdiskio: Exec format error"
UCD-SNMP-MIB::ucdavis.54.3.1.3.5.104.100.78.117.109 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.54.3.1.4.5.104.100.78.117.109 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.54.4.1.2.5.104.100.78.117.109.1 = STRING: "/usr/local/bin/snmpdiskio: Exec format error"
If I try to use exec as instructed in the readme instead of extend I get a message that there was nothing to be found at all, and with either extend or exec the cacti gui tells me there was nothing returned from the query.

I'm running Slackware 12.2 with SNMP version 5.4.2.1. I've re-compiled net-snmp with

Code: Select all

./configure --with-mib-modules="ucd-snmp/extensible ucd-snmp/diskio"
and that doesn't seem to have made any difference at all. I really don't have a preference on whether my diskio data comes from this script or the "native" ucd diskio MIBs, but I can't get either to work.

I've searched the forums and that thread and the thread with the updated snmpdiskio script in it and found others with the same problem, but they seem to have resolved it themselves without saying how.

Any ideas?
TIA
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest