[munin/uptime_switch] on récupère l'uptime des switchs

darcs-hash:20090526111227-bd074-9ba606ef1a9bd6b93d25ab79db23853ceaba6f9e.gz
parent b935fef4
#!/bin/sh
#
# Plugin to measure uptime. Especially the average and max values on the
# bigger graphs (yearly) can be interesting.
#
# Contributed by Antoine Durand-Gasselin
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo "host_name uptime.switchs.crans.org"
echo 'graph_title Uptime'
echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel uptime in days'
for i in multiprise \
`host -l adm.crans.org | sed -ne 's/\(bat[a-u]-[0-9]\).*$/\1/p'`; do
echo "$i.label uptime $i"; done
exit 0
fi
for i in multiprise \
`host -l adm.crans.org | sed -ne 's/\(bat[a-u]-[0-9]\).*$/\1/p'`; do
(snmpget -O v -v 1 -c public $i sysUpTimeInstance 2> /dev/null || true) | \
perl -nle "{ /[0-9]+/; print sprintf(\"$i.value %.2f\", ($& / 8640000));}"&
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment