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
gpetme
Posts: 22
Joined: Wed Mar 28, 2007 5:48 pm

Post by gpetme »

Try converting it to UNIX format using the unix2dos command. Then verify bash is in the default location on your system:

# grep bash /etc/shells
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Chaosratt wrote:Getting an error on this as installed by the current directions in the first post.
Everything works without error except for the snmpdiskio script:

Code: Select all

pandora:/usr/local/bin # ./snmpdiskio
bash: ./snmpdiskio: /bin/bash^M: bad interpreter: No such file or directory
Please run a dos2unix on file snmpdiskio. Where's your bash located?
Reinhard
Chaosratt
Posts: 34
Joined: Sun Oct 28, 2007 3:31 am
Location: St. Pete, FL
Contact:

Post by Chaosratt »

gandalf wrote:
Chaosratt wrote:Getting an error on this as installed by the current directions in the first post.
Everything works without error except for the snmpdiskio script:

Code: Select all

pandora:/usr/local/bin # ./snmpdiskio
bash: ./snmpdiskio: /bin/bash^M: bad interpreter: No such file or directory
Please run a dos2unix on file snmpdiskio. Where's your bash located?
Reinhard

Ok, thats solved that issue, now a new one. I see in the above posts that I am not alone in snmp walking the .55 OID and not getting any data.

Code: Select all

pandora:/usr/local/bin # ./snmpdiskio hdNum
21


pandora:/usr/local/bin # snmpwalk -c secret -v 1 localhost .1.3.6.1.4.1.2021.55
pandora:/usr/local/bin #

+ Running data query [14].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/home/xaos/public_html/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 '/home/xaos/public_html/cacti/resource/snmp_queries/partition.xml'
+ Found data query XML file at '/home/xaos/public_html/cacti/resource/snmp_queries/partition.xml'
+ Found data query XML file at '/home/xaos/public_html/cacti/resource/snmp_queries/partition.xml'

User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

You will have to configure your target's snmpd.conf to answer those snmp requests. Find some basic hints at the first link of my signature. reading the SNMP chapter of Frederic Mangeant
Reinhard
Findarato
Posts: 29
Joined: Wed Feb 06, 2008 2:56 pm

Post by Findarato »

elgoretto wrote:I don't know if this is really useful, but I made a version of the partition.xml file which is "net-snmp diskio enabled" compliant. I just corrected the OIDs.
It seems to work with my Cacti 0.8.6j on Gentoo.

Code: Select all

<interface>
        <name>Get SNMP Partitions</name>
        <description>Queries a host for a list of monitorable partitions</description>
        <oid_index>.1.3.6.1.4.1.2021.13.15</oid_index>
        <index_order>hdDescr:hdName:hdIndex</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>

        <fields>
                <hdIndex>
                        <name>Index</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.2021.13.15.1.1.1</oid>
                </hdIndex>
                <hdDescr>
                        <name>Description</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.2021.13.15.1.1.2</oid>
                </hdDescr>
                <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.3</oid>
                </hdInBlocks>
                <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.4</oid>
                </hdOutBlocks>
        </fields>
</interface>
I tried to keep a pure net-snmp setup, because at first I didn't manage to get the snmpdiskio shellscript working (maybe some wrong execute rights after all).
That worked wonders for my problems
elgoretto
Posts: 5
Joined: Mon Sep 03, 2007 8:34 am

Post by elgoretto »

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).
Attachments
partition.xml
(1.07 KiB) Downloaded 1681 times
skion
Posts: 3
Joined: Tue Nov 29, 2005 6:57 am

Post by skion »

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
- Skion
five0.4tluv
Posts: 18
Joined: Wed Mar 19, 2008 2:42 pm

question about the verbose query

Post by five0.4tluv »

should I see the hdInBlocks, hdOutBlocks data return. mine stops at

+ Found item [hdDescr='sdcd1'] index: 189 [from value]
+ Found item [hdDescr='sdce'] index: 190 [from value]
+ Found item [hdDescr='sdce1'] index: 191 [from value]
+ Found item [hdDescr='sdcf'] index: 192 [from value]
+ Found item [hdDescr='sdcf1'] index: 193 [from value]
+ Found item [hdDescr='psdctl'] index: 194 [from value]
+ Found item [hdDescr='rpsdctl'] index: 195 [from value]
+ Found item [hdDescr='psv'] index: 196 [from value]
+ Found data query XML file at '/var/www/html/resource/snmp_queries/partition.xml'
+ Found data query XML file at '/var/www/html/resource/snmp_queries/partition.xml'
+ Found data query XML file at '/var/www/html/resource/snmp_queries/partition.xml'

1) SNMP - Disk Statistics (Verbose Query) Uptime Goes Backwards Success [479 Items, 283 Rows]
kharford
Cacti User
Posts: 50
Joined: Thu Jul 07, 2005 11:53 am
Location: Mass, USA

Results are reversed

Post by kharford »

I'm sorry if this is rehash of an old issue but my graphs are not showing me the correct results.

The reads and the writes seem to be reversed according to iostat

I am running CentOS, 2.6 kernel

And have installed snmpdiskio-0.9.6 with original templates.

Any ideas as to why I seem to be reverse

Any help GREATLY appreciated

Ken :roll:
kharford
Cacti User
Posts: 50
Joined: Thu Jul 07, 2005 11:53 am
Location: Mass, USA

Post by kharford »

Nevermind figuired it out

:wink:
sjordan
Posts: 16
Joined: Tue Mar 25, 2008 2:23 pm

Post by sjordan »

I have some hosts that return nothing when I run the Verbose query. I get 0 items and 0 rows. However when I log into that machine and run: ./snmpdiskio hdNum

I get a value back.

I also have this added to the snmp.conf:

Code: Select all

exec .1.3.6.1.4.1.2021.54 hdNum /usr/local/bin/snmpdiskio hdNum
exec .1.3.6.1.4.1.2021.55 hdIndex /usr/local/bin/snmpdiskio hdIndex
exec .1.3.6.1.4.1.2021.56 hdDescr /usr/local/bin/snmpdiskio hdDescr
exec .1.3.6.1.4.1.2021.57 hdInBlocks /usr/local/bin/snmpdiskio hdInBlocks
exec .1.3.6.1.4.1.2021.58 hdOutBlocks /usr/local/bin/snmpdiskio hdOutBlocks
Any idea of what would cause this? Here is what comes out of verbose query under snmp disk statistics:

Code: Select all

+ Running data query [11].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/html/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'
+ Located input field 'hdIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2021.55.101'
+ Located input field 'hdDescr' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2021.56.101'
+ Found data query XML file at '/var/www/html/resource/snmp_queries/partition.xml'
+ Found data query XML file at '/var/www/html/resource/snmp_queries/partition.xml'
+ Found data query XML file at '/var/www/html/resource/snmp_queries/partition.xml'
calbear
Posts: 5
Joined: Tue Jul 29, 2008 8:54 pm

Post by calbear »

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).
I think the I and O are reversed in this partition.xml.
Shouldn't hdInBlocks be "Bytes Read" and hdOutBlocks be "Bytes Written"?

.1.3.6.1.4.1.2021.13.15.1.1.4 = UCD-DISKIO-MIB::diskIONWritten
.1.3.6.1.4.1.2021.13.15.1.1.3 = UCD-DISKIO-MIB::diskIONRead
calbear
Posts: 5
Joined: Tue Jul 29, 2008 8:54 pm

Post by calbear »

It seems that cacti_graph_template_disk_io_bytessec.xml and cacti_data_query_snmp_disk_statistics.xml have READ and WRITE reversed too, or am I completely mistaken??
super-hornet
Cacti User
Posts: 175
Joined: Sun May 27, 2007 5:42 pm

Post by super-hornet »

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
calbear
Posts: 5
Joined: Tue Jul 29, 2008 8:54 pm

Post by calbear »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests