Mapping disk usage

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

Moderators: Moderators, Developers

Post Reply
Author
Message
steveeq1

Mapping disk usage

#1 Post by steveeq1 » Mon Nov 15, 2004 8:08 pm

I need to trend the amount of IO that is coming in and out of the disks on my server (so I can know if I am banging the hell out of my disks). There does not seem to be a standard SNMP OID for this type of statistic, but i want to incorporate it into Cacti.

Was wondering if anyone out there does trending for disk io. Does anyone know the best way of grabbing the information from the server? I was thinking about:
A) Somehow creating my own SNMP OID and funnelling info from iostat into it
B) Getting a iostat number from a script that runs via ssh

This is a rather common request to get (I would imagine), so I was wondering if anyone found an elegant approach.

dent
Posts: 6
Joined: Tue Mar 16, 2004 3:03 pm

is iostat reliable?

#2 Post by dent » Tue Nov 16, 2004 12:15 pm

This sounds like a good idea; one comment on iostat however - at least on Solaris, the first output from iostat is meaningless. So to get anything meaningful from it, you have to run it continuously with an interval, and ignore the first line. I don't know if linux' iostat works the same way or not.

In any case, my point is that if you were to try to tie a script that ran iostat to a custom OID in SNMP (certainly doable), you'd have to account for this odd behavor somehow. (You can't just grab the "instantaneous IO load" in one shot.)

Another issue is how representative do you want the data - do you really only want a single 5-second average (for example) every 5 minutes? I guess this is always the problem with data collection - how much sampling is "enough" in order to characterize the real IO load?

Is there some other way to get the info - sar perhaps?

steveeq1

Mapping disk usage

#3 Post by steveeq1 » Tue Nov 16, 2004 4:53 pm

> Is there some other way to get the info - sar perhaps?
I am not sure, I'm new to the whole SNMP thing. I just know of iostat. SNMP doesn't have a way to measure disk io does it? Is there any way to have a script run and feed it to a SNMP OID value?

dent
Posts: 6
Joined: Tue Mar 16, 2004 3:03 pm

I am an idiot

#4 Post by dent » Tue Nov 16, 2004 5:39 pm

I just checked into this again, and I realize now that I am an idiot. That whole strange behavior I just described is for vmstat, not iostat.

So yes, with net-snmp on your server you can associate a "script" like this:

Code: Select all

iostat -xtc | grep "sd0"
with an OID and then snmpget it from elsewhere. Whenever you do the 'get', it will run the script I believe. (The relevant directive for the snmpd.conf file is 'exec' -- the man page says that the results of running the script will wind up in "1.3.6.1.4.1.2021.8.1.101".)

Sorry for confusing everything!

tman
Cacti User
Posts: 97
Joined: Thu Oct 14, 2004 4:14 pm

#5 Post by tman » Wed Nov 24, 2004 9:00 am

dent, can you elaborate on the steps to get this working. I'm really keen to get some diskio stats out of Solaris, but I'm not a Solaris expert.

How do you 'associate' the script and link it to the SNMP get command. I assume to schedule the script via cron, but then what? If I can get the results into an OID, I should be able to poll and graph it in Cacti :-)

Cheers

zanaguara
Cacti User
Posts: 60
Joined: Tue Nov 16, 2004 10:33 am
Location: Spain

Re: I am an idiot

#6 Post by zanaguara » Fri Dec 03, 2004 3:56 am

dent wrote: So yes, with net-snmp on your server you can associate a "script" like this:

Code: Select all

iostat -xtc | grep "sd0"
Sorry for confusing everything!
Be careful, at least in Solaris.

From the iostat man page:

"The first line of output is for all time since boot; each subsequent line is for the prior interval only."

zanaguara
Cacti User
Posts: 60
Joined: Tue Nov 16, 2004 10:33 am
Location: Spain

Solaris monitoring

#7 Post by zanaguara » Fri Dec 03, 2004 4:03 am

tman wrote: I'm really keen to get some diskio stats out of Solaris, but I'm not a Solaris expert.
I'm developing input data methods, data queries and templates for Solaris monitoring.

In my first version I'm going to use commands like iostat, sar, etc.

I think I could have this first version in 4-5 weeks.

Regards,

zanaguara

jochs

Re: Solaris monitoring

#8 Post by jochs » Wed Jan 05, 2005 2:11 pm

zanaguara wrote:
tman wrote: I'm really keen to get some diskio stats out of Solaris, but I'm not a Solaris expert.
I'm developing input data methods, data queries and templates for Solaris monitoring.

In my first version I'm going to use commands like iostat, sar, etc.

I think I could have this first version in 4-5 weeks.

Regards,

zanaguara

I did this by using ucd-snmp that I recompiled with the ucd-diskio mib added to it. It's listed as experimental and not compiled into net-snmp by default. It provides counters of read / write transactions and bytes since boot since boot, and graphs those variables similar to the way network interfaces are graphed.

You just have to define a data template based on snmp queries in /cacti/resource/snmp_queries. attached is the xml file i created for this...

from there you need to define data sources and graph templates for it, then add the graph templates to your host templat for ucd/net-snmp host
Attachments
disk_io.xml
disk io data template for ucd-snmp
(2.22 KiB) Downloaded 3111 times

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#9 Post by fmangeant » Thu Jan 06, 2005 4:17 am

Hi
You just have to define a data template based on snmp queries in /cacti/resource/snmp_queries. attached is the xml file i created for this...

from there you need to define data sources and graph templates for it, then add the graph templates to your host templat for ucd/net-snmp host
Could please post here your data & graph templates ?
Thanks in advance...

Regards,

Frédéric Mangeant

jochs
Posts: 1
Joined: Wed Jan 05, 2005 2:22 pm

#10 Post by jochs » Fri Jan 07, 2005 11:36 am

Here they are
fmangeant wrote:Hi
You just have to define a data template based on snmp queries in /cacti/resource/snmp_queries. attached is the xml file i created for this...

from there you need to define data sources and graph templates for it, then add the graph templates to your host templat for ucd/net-snmp host
Could please post here your data & graph templates ?
Thanks in advance...

Regards,

Frédéric Mangeant
Attachments
cacti_diskio.zip
(10.84 KiB) Downloaded 2672 times

User avatar
pirx
Cacti User
Posts: 199
Joined: Tue Feb 10, 2004 10:08 am
Location: Esslingen, Germany

#11 Post by pirx » Thu Feb 10, 2005 11:10 am

Hi,

I just tried to get the diskio templates to work. I get the following debug output.

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

I have problems to do a snmpwalk on the diskio oids. snmptable is working fine.

snmpget -Ov -v1 -c mycomstring servername .1.3.6.1.4.1.2021.13.15.1.1.1
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ucdExperimental.15.1.1.1

snmptable -v 1 -c mycomstring servername UCD-DISKIO-MIB:diskIOTable
SNMP table: UCD-DISKIO-MIB::diskIOTable

diskIOIndex diskIODevice diskIONRead diskIONWritten diskIOReads diskIOWrites
1 ssd1 242527744 3775527936 570428 3570101
2 ssd2 244698624 3041034752 570436 2138971
3 md1 242442240 1225071104 569801 2069265
4 md2 244635136 1223353344 569801 2069266
5 md0 487077376 1244760576 1139602 2071624
6 md11 8192 1817649152 1 13976
7 md12 8192 1817649152 1 13976
8 md10 16384 1817657344 2 13977
....


What is wrong with the snmpwalk and the cacti template? I would love to see this working.

Ralf

User avatar
pirx
Cacti User
Posts: 199
Joined: Tue Feb 10, 2004 10:08 am
Location: Esslingen, Germany

#12 Post by pirx » Thu Feb 10, 2005 11:57 am

Ok, I found my problem.

I've to do a snmpwalk on .1.3.6.1.4.1.2021.13.15.1.1.1 to get the indexes. My second fault was, that I was not quering the solaris machine with DISKIO enabled at compile time, instead I polled a SEL 8.0, without that exp. feature...

Stupid me.

Ralf

Post Reply