]> git.pld-linux.org Git - packages/cacti-template-snmpdiskio.git/commitdiff
- update to 0.9.6 from this post: http://forums.cacti.net/viewtopic.php?p=124793...
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 5 Oct 2008 13:04:59 +0000 (13:04 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    snmpdiskio-0.9.6.patch -> 1.1

snmpdiskio-0.9.6.patch [new file with mode: 0644]

diff --git a/snmpdiskio-0.9.6.patch b/snmpdiskio-0.9.6.patch
new file mode 100644 (file)
index 0000000..670f47b
--- /dev/null
@@ -0,0 +1,61 @@
+--- ./snmpdiskio       2008-10-05 16:00:39.870799390 +0300
++++ 0.9.6/snmpdiskio   2008-10-05 16:01:46.636993902 +0300
+@@ -1,7 +1,21 @@
+-#!/bin/sh
+-# $Id$
++#!/bin/bash
++# $Id$
++# snmpdiskio v0.9.6 (c) 2008 Dieter Verlaeckt <dieter.verlaeckt@gmail.com>
++# snmpdiskio v0.9.5 (c) 2007 Pablo Destefanis <pdestefanis@gmail.com>
+ # snmpdiskio v0.9.4 (c) 2006 Mikael Fridh <mikael@meanstreak.se>
++# Fields in /proc/partitions (kernel 2.4)
++# major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq
++
++# Fields in /proc/diskstats (kernel 2.6) for disks (i.e. hda)
++# major minor name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq
++
++# Fields in /proc/diskstats (kernel 2.6) for partitions (i.e. hda1)
++# major minor name rio rsect wio wsect
++
++# InBlocks = sectors written to disk
++# OutBlocks = sectors read from disk
++
+ # Set default procfile for kernel 2.4
+ PROCFILE="/proc/partitions"
+ MODE="linux24"
+@@ -32,19 +46,27 @@
+       fi
+ }
+-hdInBlocks()
++hdInBlocks()
+ {
+-      awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && $10 ~ /[0-9]+/ { printf "%.0f\n", $10 * 512 }
+-            $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && $10 !~ /[0-9]+/ { printf "%.0f\n", $5 * 512 } ' $PROCFILE
++        if [ "$MODE" = "linux26" ]; then
++                awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && NF == 7 { printf "%.0f\n", $7 * 512 }
++                      $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && NF == 14 { printf "%.0f\n", $10 * 512 } ' $PROCFILE
++        else
++                awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && NF == 15 { printf "%.0f\n", $11 * 512 } ' $PROCFILE
++        fi
+ }
+-hdOutBlocks()
++hdOutBlocks()
+ {
+-      awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && $8 ~ /[0-9]+/ { printf "%.0f\n", $8 * 512 }
+-            $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && $8 !~ /[0-9]+/ { printf "%.0f\n", $7 * 512 } ' $PROCFILE
++        if [ "$MODE" = "linux26" ]; then
++                awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && NF == 7 { printf "%.0f\n", $5 * 512 }
++                      $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && NF == 14 { printf "%.0f\n", $6 * 512 } ' $PROCFILE
++        else
++                awk ' $1 ~ /[0-9]+/ && $2 ~ /[0-9]+/ && NF == 15 { printf "%.0f\n", $7 * 512 } ' $PROCFILE
++        fi
+ }
+-usage()
++usage()
+ {
+       cat <<-EOUSAGE
+ Usage: $0 <hdNum|hdIndex|hdDescr|hdInBlocks|hdOutBlocks>
This page took 0.074108 seconds and 4 git commands to generate.