Opened 3 years ago

Last modified 3 years ago

#961 new patch

plugin iostat_ios: do not show all partitions, just disk stats

Reported by: zmi Owned by: nobody
Priority: normal Milestone: Munin 1.4.7
Component: plugins Version: 1.4.5
Severity: normal Keywords: disks partitions iostat_ios
Cc:

Description

I have the following /proc/diskstats:

202 16 xvdb 7529323 9133 348021328 390817272 32072730 1602793 1613058733 953527164 0 151403872 1344330356
202 17 xvdb1 7529266 8938 348019312 390813388 32072730 1602793 1613058733 953527164 0 151402828 1344327996
202 32 xvdc 163055 3774 6336353 6071248 77897 1691 2963888 3889168 0 5009036 9960340
202 33 xvdc1 159552 3170 6294423 5600960 3830 96 119770 128760 0 3238732 5729660
202 34 xvdc2 3446 409 39914 466392 74067 1595 2844118 3760408 0 1836220 4226788
202 64 xvde 2128420 11668129 110371602 33099244 2160364 11356861 108726720 105595244 0 13650324 138967608
202 65 xvde1 2128362 11667934 110369578 33096352 2160364 11356861 108726720 105595244 0 13649252 138964720
202 0 xvda 20750942 88561 223116567 298474484 30015835 46676045 623531907 1140761336 0 76927864 1439208808
202 1 xvda1 20350309 84356 197243219 273739308 29135118 46646847 605879768 1092810904 0 70734376 1366525140
202 2 xvda2 400579 4023 25871460 24731580 880717 29198 17652139 47950432 0 18503740 72681348

and when you want to display that many values in a single rrd graph, you can't see anything. So I patched iostat_ios to only show full disks and filter partitions:
(this is for iostat_ios.in 3297 2010-01-09 00:07:11Z bldewolf)

102a103,107

if(defined($minor)) {

return 0 if ($minor % 16 != 0); # show only full disks, not individual partitions
# partitions have minor values plus 1,2 etc.
# disks have 0,16,32,48,64,...

}

Could you please insert that upstream? We only used virtualized servers, and they get a separate "disk" for everything, because some disks reside on a RAID-6, some on RAID-10 and so on.
Maybe there are people interested in individual partition output, so it could be enhanced to only filter out partitions when there are 2 or less disks, but as soon as 3 or more disks are found, show only full disks.

Another not-nice thing, but I can't solve it as I don't know how to sort in perl:
If you look at the output of our /proc/disksstat above, you see that xvda is the last disk. It would be great if somewhere around line 128 the "$parts" would be sorted by the 3rd field "name".

Change History (2)

comment:1 Changed 3 years ago by zmi

Sorry, that got mangled... :-( trying to correct:

I have the following /proc/diskstats:

 202   16 xvdb 7529323 9133 348021328 390817272 32072730 1602793 1613058733 953527164 0 151403872 1344330356
 202   17 xvdb1 7529266 8938 348019312 390813388 32072730 1602793 1613058733 953527164 0 151402828 1344327996
 202   32 xvdc 163055 3774 6336353 6071248 77897 1691 2963888 3889168 0 5009036 9960340
 202   33 xvdc1 159552 3170 6294423 5600960 3830 96 119770 128760 0 3238732 5729660
 202   34 xvdc2 3446 409 39914 466392 74067 1595 2844118 3760408 0 1836220 4226788
 202   64 xvde 2128420 11668129 110371602 33099244 2160364 11356861 108726720 105595244 0 13650324 138967608
 202   65 xvde1 2128362 11667934 110369578 33096352 2160364 11356861 108726720 105595244 0 13649252 138964720
 202    0 xvda 20750942 88561 223116567 298474484 30015835 46676045 623531907 1140761336 0 76927864 1439208808
 202    1 xvda1 20350309 84356 197243219 273739308 29135118 46646847 605879768 1092810904 0 70734376 1366525140
 202    2 xvda2 400579 4023 25871460 24731580 880717 29198 17652139 47950432 0 18503740 72681348

and when you want to display that many values in a single rrd graph, you can't see anything. So I patched iostat_ios to only show full disks and filter partitions: (this is for iostat_ios.in 3297 2010-01-09 00:07:11Z bldewolf)

102a103,107
>     if(defined($minor)) {
>         return 0 if ($minor % 16 != 0); # show only full disks, not individual partitions
>         # partitions have minor values plus 1,2 etc.
>         # disks have 0,16,32,48,64,...
>        }

Could you please insert that upstream? We only used virtualized servers, and they get a separate "disk" for everything, because some disks reside on a RAID-6, some on RAID-10 and so on. Maybe there are people interested in individual partition output, so it could be enhanced to only filter out partitions when there are 2 or less disks, but as soon as 3 or more disks are found, show only full disks.

Another not-nice thing, but I can't solve it as I don't know how to sort in perl: If you look at the output of our /proc/disksstat above, you see that xvda is the last disk. It would be great if somewhere around line 128 the "$parts" would be sorted by the 3rd field "name".

comment:2 Changed 3 years ago by zmi

Another patch: Major 253 needs filtering, at least on a SLES (SUSE Linux Enterprise Server) 11 SP1

101a102
>         return 0 if ($major == 253); # LVM2 devices (kernel 2.6.32.13-0.5-xen in SLES 11 SP1)

Major 253 are LVM devices here.

Note: See TracTickets for help on using tickets.