mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
This commit is contained in:
parent
2590132015
commit
fe097689f9
@ -9,10 +9,11 @@
|
|||||||
These functions are implemented:
|
These functions are implemented:
|
||||||
ops : similar to iostat r/s, w/s
|
ops : similar to iostat r/s, w/s
|
||||||
bytes : similar to iostat kr/s, kw/s
|
bytes : similar to iostat kr/s, kw/s
|
||||||
busy : similar to iostat %b, %w
|
busy : similar to iostat %b, %w (%w usually indicates 0 in Sol10,11)
|
||||||
queue : similar to iostat actv, wait
|
queue : similar to iostat actv, wait
|
||||||
latency : similar to iostat asvc_t, wsvc_t
|
latency : similar to iostat asvc_t, wsvc_t
|
||||||
|
|
||||||
|
This plugin is improved from Solaris io_busy_, io_ops_, io_bytes_ plugins.
|
||||||
Any device found in /usr/bin/kstat can be monitored.
|
Any device found in /usr/bin/kstat can be monitored.
|
||||||
|
|
||||||
Tested with Solaris 10 and 11, and it should work with Solaris 8, 9.
|
Tested with Solaris 10 and 11, and it should work with Solaris 8, 9.
|
||||||
@ -30,19 +31,26 @@
|
|||||||
By default, this plugin monitors disk devices. And also it can monitor
|
By default, this plugin monitors disk devices. And also it can monitor
|
||||||
NFS and Tape devices as much as io_* plugins with setting environments.
|
NFS and Tape devices as much as io_* plugins with setting environments.
|
||||||
|
|
||||||
|
Note that instance names of nfs (e.g. nfs1) can be changed after reboot or
|
||||||
|
remount, this plugin may not monitor nfs properly. (same as original ones)
|
||||||
|
|
||||||
=head1 ENVIRONMENT VARIABLES
|
=head1 ENVIRONMENT VARIABLES
|
||||||
|
|
||||||
env.class - kstat class. See man kstat -c option.
|
env.class - kstat class. See man kstat -c option.
|
||||||
example: env.class /disk|nfs|tape/
|
example: env.class /disk|nfs|tape/
|
||||||
default: disk
|
default: disk
|
||||||
|
|
||||||
env.module - Module name. Only used in internal graph name. If you would not
|
env.module - Module name. Only used in internal graph name.
|
||||||
to like to take over RRDs generated by io_*_sd plugins, please change it
|
|
||||||
to another name.
|
|
||||||
|
|
||||||
example: env.module something
|
example: env.module something
|
||||||
default: sd
|
default: sd
|
||||||
|
|
||||||
|
If you would not like to take over RRDs generated by io_*_sd plugins,
|
||||||
|
please change it to another name.
|
||||||
|
|
||||||
|
And also, if you would like to take over RRDs of nfs, tape devices,
|
||||||
|
please set it 'nfs' or 'tape' (and set env.class, env.module_regex).
|
||||||
|
It may be good to link like ln -s /path/to/io_disk io_nfs if necessary.
|
||||||
|
|
||||||
env.module_regex - kstat module. See man kstat -m option.
|
env.module_regex - kstat module. See man kstat -m option.
|
||||||
example: env.module_regex /^(s?sd|vdc|zvblk|dad|md|nfs|tape)$/
|
example: env.module_regex /^(s?sd|vdc|zvblk|dad|md|nfs|tape)$/
|
||||||
default: /^(s?sd|vdc|zvblk|dad|md)$/
|
default: /^(s?sd|vdc|zvblk|dad|md)$/
|
||||||
@ -187,16 +195,15 @@ do_config() {
|
|||||||
echo "graph_width $graph_width"
|
echo "graph_width $graph_width"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Get device instance names by kstat
|
||||||
kstat -p -c "$class" -m "$module_regex" -s "/^${conf_in}\$/" | sed 's/:/ /g' | awk '{ print $3 }' | \
|
kstat -p -c "$class" -m "$module_regex" -s "/^${conf_in}\$/" | sed 's/:/ /g' | awk '{ print $3 }' | \
|
||||||
while read -r dev
|
while read -r dev
|
||||||
do
|
do
|
||||||
if is_excluded "$dev" ; then
|
is_excluded "$dev" && continue
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# replace instance name to logical device name if exists
|
# Replace instance name to logical device name if exists
|
||||||
ref="name_$dev"
|
ref="name_$dev"
|
||||||
devname=${!ref:-}
|
devname=${!ref:-} # ${!varname} means indirect evaluation (similar to eval)
|
||||||
|
|
||||||
# reads and writes are necessary to calculate latency
|
# reads and writes are necessary to calculate latency
|
||||||
if [ "$func" = 'latency' ]; then
|
if [ "$func" = 'latency' ]; then
|
||||||
@ -244,12 +251,18 @@ do_getvalue() {
|
|||||||
|
|
||||||
echo "multigraph ${plugin_name}_${func}_${module}"
|
echo "multigraph ${plugin_name}_${func}_${module}"
|
||||||
|
|
||||||
|
# Get device instance names, stat names and values by kstat
|
||||||
|
|
||||||
|
# kstat output example:
|
||||||
|
# $ kstat -p -c disk -m '/^sd$/' -s '/^reads$/'
|
||||||
|
# sd:0:sd0:reads 51432610
|
||||||
|
# sd:1:sd1:reads 52671435
|
||||||
|
# ...
|
||||||
|
|
||||||
kstat -p -c "$class" -m "$module_regex" -s "$stat_regex" | sed 's/:/ /g' | awk '{ print $3,$4,$5 }' | \
|
kstat -p -c "$class" -m "$module_regex" -s "$stat_regex" | sed 's/:/ /g' | awk '{ print $3,$4,$5 }' | \
|
||||||
while read -r dev stat value
|
while read -r dev stat value
|
||||||
do
|
do
|
||||||
if is_excluded "$dev" ; then
|
is_excluded "$dev" && continue
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "${dev}_${stat}.value ${value%.*}"
|
echo "${dev}_${stat}.value ${value%.*}"
|
||||||
done
|
done
|
||||||
@ -285,7 +298,7 @@ getvalue() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# main
|
# Main
|
||||||
case ${1:-} in
|
case ${1:-} in
|
||||||
autoconf)
|
autoconf)
|
||||||
autoconf
|
autoconf
|
||||||
|
Loading…
Reference in New Issue
Block a user