Linux extended iostat template and scripts

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

Moderators: Developers, Moderators

mcfuzz
Posts: 3
Joined: Sat Sep 29, 2012 4:59 am

Re: Linux extended iostat template and scripts

Post by mcfuzz »

fher98 wrote:Install version 1.4 of the iostats.. and after running

snmpwalk -v1 -c public MYSERVER .1.3.6.1.3.1.2

I get nothing... just a new line.

Help please.
Rising from the dead for I have the same issue...

Running Debian 6.0.6 on both the client and host; it was working before a reinstall and now, when I query the machine I want to monitor, I get no response when using -v1, and this when using -v2c:

root@cacti:~# snmpwalk -v2c -c xxxxx abc .1.3.6.1.3.1.2
iso.3.6.1.3.1.2 = No Such Instance currently exists at this OID


Any ideas? This is not the only machine I have the same issue on... others seem to work fine (and they all use the same snmpd.conf file since they are identically built os-wise).
ambermehra
Posts: 2
Joined: Wed Apr 13, 2011 11:25 am

Re: Linux extended iostat template and scripts

Post by ambermehra »

Hey ,

I solved issue on my RHEL4.0 Box "SNMPv2-SMI::experimental.1.2 = No Such Instance currently exists at this OID"
It happens due to SE linux restriction, and it block snmp things so just disable SE linux on host or allow snmp on SE linux policy

I did stopped and worked fine for me. 8)

#setenforce 0


Thanks
Amber
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: Linux extended iostat template and scripts

Post by JJX »

A few additions I had to make:


1) If you want to show the filesystem insteam of dm-X named , you can run the iostat with -N parameter:

cd /tmp && iostat -N -xkd 30 2 | sed 's/,/\./g' > io.tmp && mv io.tmp iostat.cache

If /tmp/iostat.cache doesn't appear correctly syntax-ed, you can apply something like that:

cd /tmp && iostat -N -xkd 30 2 | sed '/VG00/ { N; s/\n//; s/ \{5,\}/ /; }' | sed 's/,/\./g' > io.tmp && mv io.tmp iostat.cache

(this can be applied for RedHat Volume groups)

2) if your "filesystem" includes capital letters you should alter the command (line 99, iostat.pl):
if ($ostype eq 'linux') {
/^([a-z0-9\-\/]+)\s+(\d+[\.,]\d+
to
if ($ostype eq 'linux') {
/^([a-zA-Z0-9\-\/]+)\s+(\d+[\.,]\d+
cacti rulez!
HBomb
Posts: 38
Joined: Tue Sep 03, 2013 11:32 am
Location: UK

Re: Linux extended iostat template and scripts

Post by HBomb »

Works great with a few Centoses, debians and ubuntus but all of them with a 2.6 kernel.

Right now with some newer where I get no output from snmpwalk:

Code: Select all

# iostat -V
sysstat version 10.2.1

# cat iostat.cache 
Linux 3.2.0-4-amd64 (dns2-public) 	02/04/14 	_x86_64_	(8 CPU)

Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.04     2.07    0.62    1.68    13.97    96.15    95.65     0.00    1.35    2.27    1.02   0.43   0.10
and an older debian where it's working fine:

Code: Select all

# iostat -V
sysstat version 9.0.6.1

# cat /tmp/iostat.cache 
Linux 2.6.32-5-686-bigmem (mml-noc-primary) 	02/04/14 	_i686_	(8 CPU)

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
cciss/c0d0        0.02    24.64    2.74    5.59    22.82    15.35     4.58     0.03    2.84   2.87   2.39
Does anyone have an updated regex for me to use on the new box? I assume that's the only thing that's wrong, snmpwalk on anything else is perfectly fine, plus I've deployed this template on a number of machines already, I like to think im familiar with what could go wrong.
HBomb
Posts: 38
Joined: Tue Sep 03, 2013 11:32 am
Location: UK

Re: Linux extended iostat template and scripts

Post by HBomb »

Actually I think those were fine, though I think still getting nothing for utilization or disk queue size. Heh never mind, works a treat!
wborrelli
Posts: 1
Joined: Fri Apr 11, 2014 8:47 am

Re: Linux extended iostat template and scripts

Post by wborrelli »

To aleviate some of the pain I have been feeling with iostat.pl and selinux...

http://sharadchhetri.com/2013/02/27/how ... or-centos/

edit /etc/sysconfig/selinux and find “SELINUX=enforcing” change to “SELINUX=permissive” or “SELINUX=disabled”

That will not take effect until a system restart is completed.

However, if this is a current production box, and you need the change NOW (like I did) you can do

# setenforce 0

Which will set

# getenforce
Permissive


[root@U408ORADB01 tmp]# setenforce 1
[root@U408ORADB01 tmp]# snmpwalk -v2c -c mypass localhost .1.3.6.1.3.1.2
SNMPv2-SMI::experimental.1.2 = No Such Instance currently exists at this OID
[root@U408ORADB01 tmp]# setenforce 0
[root@U408ORADB01 tmp]# snmpwalk -v2c -c mypass localhost .1.3.6.1.3.1.2
SNMPv2-SMI::experimental.1.2.1 = STRING: "sda"
SNMPv2-SMI::experimental.1.2.2 = STRING: "sdb"
SNMPv2-SMI::experimental.1.2.3 = STRING: "sdc"
SNMPv2-SMI::experimental.1.2.4 = STRING: "sde"
SNMPv2-SMI::experimental.1.2.5 = STRING: "sdd"
SNMPv2-SMI::experimental.1.2.6 = STRING: "sdf"
SNMPv2-SMI::experimental.1.2.7 = STRING: "sdh"
SNMPv2-SMI::experimental.1.2.8 = STRING: "sdg"

Hope this is more helpful than "disable selinux" and audit2allow is not currently installed in my environment.
jjriv
Posts: 4
Joined: Wed May 07, 2014 3:33 pm

Re: Linux extended iostat template and scripts

Post by jjriv »

Can someone help me get this set up? I have gotten to a point where I just don't understand the directions. I have got the cron installed and I am able to snmpwalk and get the data. And I was able to import all of the templates. But now i can't see how to create the graphs.

The docs say:
You should then be able to go to the host device you want to monitor, and add
the new data queries. Then, click on "Create Graphs for this Host", and
select the devices you want to graph.

When I go to Data Queries, I see all of the new data queries for iostat. They are already there. But when I go to Devices -> Host -> Create Graphs for this Host, I don't see where to add the new graphs? I may just be missing the obvious, but could someone help me get the graphs going? If I need to provide more info, just let me know what.

Thanks!
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Linux extended iostat template and scripts

Post by cigamit »

jjriv wrote:Can someone help me get this set up? I have gotten to a point where I just don't understand the directions. I have got the cron installed and I am able to snmpwalk and get the data. And I was able to import all of the templates. But now i can't see how to create the graphs.

The docs say:
You should then be able to go to the host device you want to monitor, and add
the new data queries. Then, click on "Create Graphs for this Host", and
select the devices you want to graph.

When I go to Data Queries, I see all of the new data queries for iostat. They are already there. But when I go to Devices -> Host -> Create Graphs for this Host, I don't see where to add the new graphs? I may just be missing the obvious, but could someone help me get the graphs going? If I need to provide more info, just let me know what.

Thanks!
Devices -> Host
Add the data query to the host at the bottom. Then go to Create Graphs.
jjriv
Posts: 4
Joined: Wed May 07, 2014 3:33 pm

Re: Linux extended iostat template and scripts

Post by jjriv »

Thanks! That did it!
jjriv
Posts: 4
Joined: Wed May 07, 2014 3:33 pm

Re: Linux extended iostat template and scripts

Post by jjriv »

I've got the graphs working, but it doesn't look write. The Y axis reads "Percent" but is showing units of "M":
Image

The data in /tmp/iostat.cache looks like this:

Code: Select all

Device:         rrqm/s   wrqm/s   r/s   w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util
sda               2.80    86.67  6.13 127.36   273.33   856.52    16.93     0.19    1.43   0.15   1.98
sda1              0.00     0.00  0.00  0.00     0.00     0.00    18.43     0.00    4.81   3.78   0.00
sda2              2.80    86.67  6.13 127.36   273.33   856.52    16.93     0.19    1.43   0.15   1.98
dm-0              0.00     0.00  7.06 212.24   265.83   848.97    10.17     0.59    2.69   0.09   2.02
dm-1              0.00     0.00  1.87  1.89     7.50     7.55     8.00     0.11   29.15   0.28   0.11

Device:         rrqm/s   wrqm/s   r/s   w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util
sda               0.00    24.10  0.00  2.87     0.00   107.87    75.26     0.00    0.44   0.23   0.07
sda1              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sda2              0.00    24.10  0.00  2.87     0.00   107.87    75.26     0.00    0.44   0.23   0.07
dm-0              0.00     0.00  0.00 26.93     0.00   107.73     8.00     0.01    0.55   0.02   0.07
dm-1              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
Did I do something wrong? Or is there a setting that needs to be tweaked? Thanks!
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Linux extended iostat template and scripts

Post by cigamit »

That would just mean that its a fraction of a percent (20m = 0.02 I believe). Which seems about right since the log you posted showed 0.07% on one of the entries.
jjriv
Posts: 4
Joined: Wed May 07, 2014 3:33 pm

Re: Linux extended iostat template and scripts

Post by jjriv »

Thanks! I figured that was it but wasn't sure. Thanks for the feedback.
BooosesThaSnipper
Posts: 1
Joined: Tue Aug 19, 2014 4:56 am

Re: Linux extended iostat template and scripts

Post by BooosesThaSnipper »

HBomb wrote:Works great with a few Centoses, debians and ubuntus but all of them with a 2.6 kernel.

Right now with some newer where I get no output from snmpwalk:

Code: Select all

# iostat -V
sysstat version 10.2.1

# cat iostat.cache 
Linux 3.2.0-4-amd64 (dns2-public) 	02/04/14 	_x86_64_	(8 CPU)

Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.04     2.07    0.62    1.68    13.97    96.15    95.65     0.00    1.35    2.27    1.02   0.43   0.10
and an older debian where it's working fine:

Code: Select all

# iostat -V
sysstat version 9.0.6.1

# cat /tmp/iostat.cache 
Linux 2.6.32-5-686-bigmem (mml-noc-primary) 	02/04/14 	_i686_	(8 CPU)

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
cciss/c0d0        0.02    24.64    2.74    5.59    22.82    15.35     4.58     0.03    2.84   2.87   2.39
Does anyone have an updated regex for me to use on the new box? I assume that's the only thing that's wrong, snmpwalk on anything else is perfectly fine, plus I've deployed this template on a number of machines already, I like to think im familiar with what could go wrong.


Hi,

I updated my scripts like this:

iostat.pl
99c99
< /^([a-z0-9\-\/]+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)/;
---
> /^([a-z0-9\-\/]+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)\s+(\d+[\.,]\d+)/;
112,115c112,113
< $stats{"$base_oid.12.$devices"} = $13; # svctm
< $stats{"$base_oid.13.$devices"} = $14; # %util
< $stats{"$base_oid.14.$devices"} = $11; # r_await
< $stats{"$base_oid.15.$devices"} = $12; # w_await
---
> $stats{"$base_oid.12.$devices"} = $11; # svctm
> $stats{"$base_oid.13.$devices"} = $12; # %util


iostat.xml
101,114d100
< <ioRAwait>
< <name>Average Wait Read</name>
< <method>walk</method>
< <source>value</source>
< <direction>output</direction>
< <oid>.1.3.6.1.3.1.14</oid>
< </ioRAwait>
< <ioWAwait>
< <name>Average Wait Write</name>
< <method>walk</method>
< <source>value</source>
< <direction>output</direction>
< <oid>.1.3.6.1.3.1.15</oid>
< </ioWAwait>
Aivanzipper
Posts: 2
Joined: Thu Sep 30, 2010 6:41 am

Re: Linux extended iostat template and scripts

Post by Aivanzipper »

Hi!

I have added AIX support. Works with Net-SNMP ONLY
Attachments
AIX iostat cacti.zip
(9.95 KiB) Downloaded 155 times
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests