Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Upgraded: snmpdiskio 0.9.6 (Disk I/O statistics on Linux)
Goto page 1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
mikaelf



Joined: 19 Mar 2006
Posts: 12
Location: Uppsala, Sweden

PostPosted: Wed Mar 29, 2006 7:50 am    Post subject: Upgraded: snmpdiskio 0.9.6 (Disk I/O statistics on Linux) Reply with quote

Update: v0.9.6

Get snmpdiskio v0.9.6 from this post: http://forums.cacti.net/viewtopic.php?p=124793#124793

Thanks to Pablo & Dieter!

Get the tarball below w/ README but replace the snmpdiskio shellscript with the one from the above post.

Description:
This tarball contains instructions, templates and a small shellscript which will give you disk i/o statistics (Read/Write bytes) in Cacti!
Reason for this is the lack of disk i/o support in NET-SNMP on linux.
It works for me, let me know if it does for you!
Tested on Redhat Enterprise 3 w/ Linux 2.4.
It requires that you have disk statistics in /proc/partitions

Update: v0.9.4

    New version which should support both 2.4 and 2.6.
    Renamed to the more appropriate name snmpdiskio


Upgrade 0.9.1 to 0.9.2:

    Change all "hdsnmp.sh" to "snmpdiskio" in snmpd.conf
    Copy snmpdiskio to /usr/local/bin/
    No changes have been made in Cacti templates! The only thing changed since 0.9.1 is v2.4/v2.6 auto-detection in the script snmpdiskio (formerly hdsnmp.sh)


Sorry I broke 0.9.2 on 2.4 kernels, I'll get back with a fixed one soon.

Upgrade 0.9.2 to 0.9.4:

    Copy snmpdiskio to /usr/local/bin/
    No changes have been made in Cacti templates! The only thing changed since 0.9.2 is v2.4/v2.6 auto-detection in the script snmpdiskio

Code:

# $Id: README,v 1.2 2006/03/31 15:57:44 mikaelf Exp $
# snmpdiskio 0.9.4 (c) 2006 Mikael Fridh <mikael@meanstreak.se>
# Disk I/O statistics for Cacti created due to
# the flaky disk i/o support in net-snmp

1. ABOUT
2. INSTALLATION
2a. INSTALLATION: SNMP
2b. INSTALLATION: Cacti
3. USAGE
4. BLURB

1. ABOUT
========
This set of simple scripts and Cacti templates gives you disk I/O support.
Currently net-snmp has flaky or no support for disk I/O at all.
This version: 0.9.4, gives you only one thing: Disk I/O (bytes/sec).

snmpdiskio 0.9.4 has been tested on:
* Linux 2.4 with /proc/partitions iostats patch (included by default in Redhat, possibly other distributions as well)
* Linux 2.6 (/proc/diskstats)
* Net-snmp 5.0.9
* Cacti 0.8.6g
* Cacti 0.8.6h
Report any problems or feedback: what works/doesn't work etc in this thread.

2. INSTALLATION
===============
The installation is in two parts. One for the SNMP configuration on the
monitored host. The other is for the addition to Cacti. The addition to Cacti
need only be done once.

2a. INSTALLATION: SNMP
======================
* Put the following lines in snmpd.conf:
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

* Install the script snmpdiskio on the machine to be monitored:
install -m 0755 -o root -g root -p -v snmpdiskio /usr/local/bin/

2b. INSTALLATION: Cacti
=======================
* Import the XML templates from `cacti_graph_template_disk_io_bytessec.xml`.
* Import the data query template from `cacti_data_query_snmp_disk_statistics.xml`.
* Copy the `partition.xml` file to cacti/resource/snmp_queries/partition.xml.

3. USAGE
========
In Cacti: Add the Data Query to your Host Templates.
For any Device already configured in Cacti you need to add the Data Query
manually.

After that you just click "New Graph", choose your Device, select the
partitions you want graphs created for and click Create.



snmpdiskio-0.9.4.tar.gz
 Description:

Download
 Filename:  snmpdiskio-0.9.4.tar.gz
 Filesize:  6.06 KB
 Downloaded:  5030 Time(s)



Last edited by mikaelf on Thu Feb 07, 2008 9:03 am; edited 18 times in total
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 11223
Location: Muenster, Germany

PostPosted: Wed Mar 29, 2006 1:22 pm    Post subject: Reply with quote

Thanks for your addon. Would it be possible for you to post the tar.gz as an attachment to your topic? So the contents would not rely on external links
cheers
Reinhard
Back to top
mikaelf



Joined: 19 Mar 2006
Posts: 12
Location: Uppsala, Sweden

PostPosted: Wed Mar 29, 2006 3:48 pm    Post subject: Reply with quote

of course! edited post, dependency workaround activated
Back to top
lnxflocki



Joined: 13 Mar 2006
Posts: 5

PostPosted: Thu Mar 30, 2006 4:42 pm    Post subject: Reply with quote

Let me be the first to say: I love you!
Back to top
mikaelf



Joined: 19 Mar 2006
Posts: 12
Location: Uppsala, Sweden

PostPosted: Fri Mar 31, 2006 1:22 am    Post subject: Reply with quote

Did it work as expected or is there something else I should know about?
Back to top
eyechart



Joined: 25 Apr 2002
Posts: 49

PostPosted: Fri Mar 31, 2006 1:31 am    Post subject: sample graphs? Reply with quote

can someone post some sample graphs? thanks.


-ec
Back to top
mikaelf



Joined: 19 Mar 2006
Posts: 12
Location: Uppsala, Sweden

PostPosted: Fri Mar 31, 2006 2:27 am    Post subject: Reply with quote

Sample graphs.

As you can see sdb and sdc's I/O are similar, that's because they're Physical Volumes in the same Volume Group in LVM.



sdc.png
 Description:
 Filesize:  29.11 KB
 Viewed:  36355 Time(s)

sdc.png



sdb.png
 Description:
 Filesize:  30.5 KB
 Viewed:  36355 Time(s)

sdb.png


Back to top
mikaelf



Joined: 19 Mar 2006
Posts: 12
Location: Uppsala, Sweden

PostPosted: Fri Mar 31, 2006 2:35 am    Post subject: Reply with quote

Here's an extra one I like to have. An aggregate graph of all data sources (sdb, sdc in this case) on that host.

Is there a way to automatically create this sort of graph???
I did this one manually and with my Cacti skills if I have another host with 3 physical devices I would have to create a new graph template with 6 data sources...



aggregated.png
 Description:
 Filesize:  32.51 KB
 Viewed:  36352 Time(s)

aggregated.png


Back to top
lnxflocki



Joined: 13 Mar 2006
Posts: 5

PostPosted: Fri Mar 31, 2006 2:51 am    Post subject: Reply with quote

mikaelf wrote:
Did it work as expected or is there something else I should know about?


It works perfectly

Back to top
fmangeant
Cacti Guru User


Joined: 19 Sep 2003
Posts: 2324
Location: Sophia-Antipolis, France

PostPosted: Fri Mar 31, 2006 7:03 am    Post subject: Reply with quote

Many thanks for this template

I've tested it on :
- RedHat AS 2.1 with kernel 2.4.9-e.27smp : works
- RedHat 7.2 with kernel 2.4.20-24.7smp : works
- CentOS 4.3 with kernel 2.6.9-34.EL : doesn't work

Do you know if the "/proc/partitions iostats patch" has been ported to the 2.6 kernel ?
Back to top
mikaelf



Joined: 19 Mar 2006
Posts: 12
Location: Uppsala, Sweden

PostPosted: Fri Mar 31, 2006 7:33 am    Post subject: Reply with quote

fmangeant wrote:

- CentOS 4.3 with kernel 2.6.9-34.EL : doesn't work

Do you know if the "/proc/partitions iostats patch" has been ported to the 2.6 kernel ?


Yeah things have changed in 2.6 as it's now using /proc/diskstats.
And in that file it has different fields for disks and partitions.

http://www.linux-m32r.org/lxr/http/source/Documentation/iostats.txt

I was meaning to make this thing support 2.6 and create a ./configure && make install procedure which determines what version you're on but I haven't yet

Here's a patch for your 2.6 machines which I just created after reading your post. Thanks for the feedback!
Apply with
Code:
patch /usr/local/bin/hdsnmp.sh hdsnmp-0.9.1-kernel26.patch



hdsnmp-0.9.1-kernel26.patch
 Description:

Download
 Filename:  hdsnmp-0.9.1-kernel26.patch
 Filesize:  1.08 KB
 Downloaded:  863 Time(s)

Back to top
fmangeant
Cacti Guru User


Joined: 19 Sep 2003
Posts: 2324
Location: Sophia-Antipolis, France

PostPosted: Fri Mar 31, 2006 8:23 am    Post subject: Reply with quote

mikaelf wrote:
I was meaning to make this thing support 2.6 and create a ./configure && make install procedure which determines what version you're on but I haven't yet

Maybe the data source could include a parameter which value would be "2.4" or "2.6" ? So this template can be used to graph 2.4 and 2.6 servers.

What do you think about it ?
Back to top
mikaelf



Joined: 19 Mar 2006
Posts: 12
Location: Uppsala, Sweden

PostPosted: Fri Mar 31, 2006 9:31 am    Post subject: Reply with quote

fmangeant wrote:

Maybe the data source could include a parameter which value would be "2.4" or "2.6" ? So this template can be used to graph 2.4 and 2.6 servers.


There's no difference in the Cacti-side graph templates. The templates works on both 2.4 and 2.6 hosts.
All that's needed is the patch for hdsnmp 0.9.1 on 2.6 hosts to make it output the same things as it does on 2.4 hosts!

Can you get it to work?

try executing hdsnmp.sh on your 2.6 host and see if it gives you ok output...

Note that with the kernel26 patch it ONLY works on 2.6
Without the patch (0.9.1) it ONLY works on 2.4!
Maybe I'll make it portable later.. or maybe someone else beats me to it?

Code:
[mikaelf@bass hdsnmp-0.9.1]$ uname -r
2.6.8-1.528.2.10smp
[mikaelf@bass hdsnmp-0.9.1]$ ./hdsnmp.sh hdNum
24
[mikaelf@bass hdsnmp-0.9.1]$ ./hdsnmp.sh hdDescr
ram0
ram1
ram2
ram3
ram4
ram5
ram6
ram7
ram8
ram9
ram10
ram11
ram12
ram13
ram14
ram15
hda
sda
sda1
sda2
dm-0
dm-1
fd0
md0
[mikaelf@bass hdsnmp-0.9.1]$ ./hdsnmp.sh hdInBlocks
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2076695548928
2084864
1898603652096
0
0
0
0
[mikaelf@bass hdsnmp-0.9.1]$ ./hdsnmp.sh hdOutBlocks
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
20789522944
3712000
2076630708224
0
0
0
0
Back to top
mikaelf



Joined: 19 Mar 2006
Posts: 12
Location: Uppsala, Sweden

PostPosted: Fri Mar 31, 2006 11:16 am    Post subject: Reply with quote

I made a version which should support both 2.4 and 2.6.

Renamed to the more appropriate name: snmpdiskio
Back to top
fmangeant
Cacti Guru User


Joined: 19 Sep 2003
Posts: 2324
Location: Sophia-Antipolis, France

PostPosted: Mon Apr 03, 2006 7:48 am    Post subject: Reply with quote

Hi

thanks for this 2.4 / 2.6 compatible version.

Do I need to re-import the templates, or copying the script is enough ?

Thanks in advance.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page 1, 2, 3, 4, 5, 6  Next
Page 1 of 6

 



Powered by phpBB © 2001, 2005 phpBB Group