On regroupe les plugins munin dans un rpertoire commun toutes les machines
darcs-hash:20060420130121-72cb0-50f87f8f01382a2ddc9afec1b1b6e02890d8d32c.gz
This commit is contained in:
parent
674ee00ed0
commit
f672fa493b
23 changed files with 1451 additions and 0 deletions
55
munin/ping_
Executable file
55
munin/ping_
Executable file
|
@ -0,0 +1,55 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2004 Jimmy Olsen
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; version 2 dated June,
|
||||
# 1991.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#
|
||||
# Plugin to monitor ping times
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# ping_args - Arguments to ping (default "-c 2")
|
||||
# ping_args2 - Arguments after the host name (required for Solaris)
|
||||
# ping - Ping program to use
|
||||
# host - Host to ping
|
||||
#
|
||||
# Arguments for Solaris:
|
||||
# ping_args -s
|
||||
# ping_args2 56 2
|
||||
#
|
||||
#%# family=manual
|
||||
|
||||
file_host=`basename $0 | sed 's/^ping_//g'`
|
||||
host=${host:-${file_host:-www.google.com}}
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
echo host_name $host
|
||||
echo graph_title Ping times from sila
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel seconds'
|
||||
echo 'graph_category network'
|
||||
echo 'graph_info This graph shows ping RTT statistics.'
|
||||
echo "ping.label $host"
|
||||
echo "ping.info Ping RTT statistics for $host."
|
||||
echo 'ping.draw LINE2'
|
||||
echo 'packetloss.label packet loss'
|
||||
echo 'packetloss.graph no'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
${ping:-ping} ${ping_args:-'-c 2'} ${host} ${ping_args2} | perl -n -e 'print "ping.value ", $1 / 1000, "\n" if m@min/avg/max.*\s\d+(?:\.\d+)?/(\d+(?:\.\d+)?)/\d+(?:\.\d+)?@; print "packetloss.value $1\n" if /(\d+)% packet loss/;'
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue