#!/bin/sh # # mrtg-ping-cfg { ping | loss } <"Title of page"> # # This creates the mrtg.cfg configurations to do pings to devices. # Makes use of mrt-ping-probe by Peter W. Osel (see below) # # leewm@sgp.hp.com # Hewlett Packard Singapore # IT Site Infrastructure Services # modifed by "Molchanov Alexander " # location of mrtg ping probe PING_PROBE=/usr/bin/mrtg-ping-probe if [ $# -ne 3 ] then head -n 11 $0 exit fi if [ $1 == "ping" ] ; then target="$2.ping" MaxBytes=5000 AbsMax=10000 Unscaled="" YLegend="Round Trip Time" ShortLegend="ms" Legend1="Maximum Round Trip Time in Milli Second" Legend2="Minimum Round Trip Time in Milli Second" Legend3="Maximal 5 Minute Maximum Round Trip Time" Legend4="Maximal 5 Minute Minimum Round Trip Time" LegendI=" Max:" LegendO=" Min:" PageTop="

$3

Actually we are measuring the ping time between our web server and $2." elif [ $1 == "loss" ] ; then target="$2.loss" PING_PROBE="$PING_PROBE -p loss/loss" MaxBytes=100 AbsMax=101 Unscaled="Unscaled[$target]: dwmy" YLegend="% Packet Loss" ShortLegend="%" Legend1="% Packet Loss" Legend2="% Packet Loss" Legend3="Maximal 5 Minute % Packet Loss" Legend4="Maximal 5 Minute % Packet Loss" LegendI=" % loss:" LegendO=" % loss:" PageTop="

$3

Actually we are packet loss between our web server and $2." else echo "enter first argument 'ping' or 'loss'" >&2 head -n 11 $0 exit fi cat <