Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu Jun 27, 2019 5:43 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 111 posts ]  Go to page 1, 2, 3, 4, 5 ... 8  Next
Author Message
 Post subject: Upgraded: snmpdiskio 0.9.6 (Disk I/O statistics on Linux)
PostPosted: Wed Mar 29, 2006 7:50 am 
Offline

Joined: Sun Mar 19, 2006 10:39 am
Posts: 25
Location: Uppsala, Sweden
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 <[email protected]>
# 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.


Attachments:
snmpdiskio-0.9.4.tar.gz [6.06 KiB]
Downloaded 14868 times


Last edited by mikaelf on Thu Feb 07, 2008 9:03 am, edited 18 times in total.
Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 29, 2006 1:22 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22376
Location: Muenster, Germany
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

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 29, 2006 3:48 pm 
Offline

Joined: Sun Mar 19, 2006 10:39 am
Posts: 25
Location: Uppsala, Sweden
of course! edited post, dependency workaround activated


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 30, 2006 4:42 pm 
Offline

Joined: Mon Mar 13, 2006 9:32 am
Posts: 5
Let me be the first to say: I love you! :D


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 1:22 am 
Offline

Joined: Sun Mar 19, 2006 10:39 am
Posts: 25
Location: Uppsala, Sweden
Did it work as expected or is there something else I should know about? :oops:


Top
 Profile  
 
 Post subject: sample graphs?
PostPosted: Fri Mar 31, 2006 1:31 am 
Offline

Joined: Thu Apr 25, 2002 11:48 pm
Posts: 49
can someone post some sample graphs? thanks.


-ec


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 2:27 am 
Offline

Joined: Sun Mar 19, 2006 10:39 am
Posts: 25
Location: Uppsala, Sweden
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.


Attachments:
sdc.png
sdc.png [ 29.11 KiB | Viewed 109980 times ]
sdb.png
sdb.png [ 30.5 KiB | Viewed 109980 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 2:35 am 
Offline

Joined: Sun Mar 19, 2006 10:39 am
Posts: 25
Location: Uppsala, Sweden
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...


Attachments:
aggregated.png
aggregated.png [ 32.51 KiB | Viewed 109977 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 2:51 am 
Offline

Joined: Mon Mar 13, 2006 9:32 am
Posts: 5
mikaelf wrote:
Did it work as expected or is there something else I should know about? :oops:


It works perfectly :lol:

Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 7:03 am 
Offline
Cacti Guru User
User avatar

Joined: Fri Sep 19, 2003 8:36 am
Posts: 2326
Location: Sophia-Antipolis, France
Many thanks for this template :D

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 ?

_________________

HOWTOs :
Templates :


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 7:33 am 
Offline

Joined: Sun Mar 19, 2006 10:39 am
Posts: 25
Location: Uppsala, Sweden
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


Attachments:
hdsnmp-0.9.1-kernel26.patch [1.08 KiB]
Downloaded 1913 times
Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 8:23 am 
Offline
Cacti Guru User
User avatar

Joined: Fri Sep 19, 2003 8:36 am
Posts: 2326
Location: Sophia-Antipolis, France
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 ?

_________________

HOWTOs :
Templates :


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 9:31 am 
Offline

Joined: Sun Mar 19, 2006 10:39 am
Posts: 25
Location: Uppsala, Sweden
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:
[[email protected] hdsnmp-0.9.1]$ uname -r
2.6.8-1.528.2.10smp
[[email protected] hdsnmp-0.9.1]$ ./hdsnmp.sh hdNum
24
[[email protected] 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
[[email protected] 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
[[email protected] 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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 11:16 am 
Offline

Joined: Sun Mar 19, 2006 10:39 am
Posts: 25
Location: Uppsala, Sweden
I made a version which should support both 2.4 and 2.6.

Renamed to the more appropriate name: snmpdiskio


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 03, 2006 7:48 am 
Offline
Cacti Guru User
User avatar

Joined: Fri Sep 19, 2003 8:36 am
Posts: 2326
Location: Sophia-Antipolis, France
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.

_________________

HOWTOs :
Templates :


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 111 posts ]  Go to page 1, 2, 3, 4, 5 ... 8  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group