Mapping disk usage
Moderators: Developers, Moderators
Mapping disk usage
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.
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.
is iostat reliable?
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?
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?
Mapping disk usage
> 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?
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?
I am an idiot
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:
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!
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!
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
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
Re: I am an idiot
Be careful, at least in Solaris.dent wrote: So yes, with net-snmp on your server you can associate a "script" like this:
Sorry for confusing everything!Code: Select all
iostat -xtc | grep "sd0"
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."
Solaris monitoring
I'm developing input data methods, data queries and templates for Solaris monitoring.tman wrote: I'm really keen to get some diskio stats out of Solaris, but I'm not a Solaris expert.
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
Re: Solaris monitoring
zanaguara wrote:I'm developing input data methods, data queries and templates for Solaris monitoring.tman wrote: I'm really keen to get some diskio stats out of Solaris, but I'm not a Solaris expert.
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 3196 times
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
Hi
Thanks in advance...
Regards,
Frédéric Mangeant
Could please post here your data & graph templates ?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
Thanks in advance...
Regards,
Frédéric Mangeant
Here they are
fmangeant wrote:HiCould please post here your data & graph templates ?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
Thanks in advance...
Regards,
Frédéric Mangeant
- Attachments
-
- cacti_diskio.zip
- (10.84 KiB) Downloaded 2751 times
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
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
Who is online
Users browsing this forum: No registered users and 5 guests