[mrtg] Re: Script again
Paul C. Williamson
pwilliamson at mandtbank.com
Wed Jan 9 20:38:54 MET 2002
Just make the script output the numbers in the requested format for MRTG...
in (green)
out (blue)
uptime
system name
HTH
Paul
>>> "John Paul Martin" <jpmartin at wtaccess.net> 01/09/02 01:33PM >>>
Let me attempt again.
Here is the script:
#!/bin/sh
AP="ipaddress"
COMMUNITY="password"
x="1"
while [ $x -le 3 ]
do
snmpset ${AP} ${COMMUNITY} enterprises.762.2.5.5.$x i 50 > /dev/null
x=$(( $x + 1 ))
done
x="1"
while [ $x -le 3 ]
do
snmpset ${AP} ${COMMUNITY} enterprises.762.2.5.4.$x i 3 > /dev/null
x=$(( $x + 1 ))
done
HOSTS=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.1.0 | cut -d ' ' -f 3`
echo ${HOSTS} hosts currently connected.
x="1"
while [ $x -le ${HOSTS} ]
do
host=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.3.${x} | cut -d
'"' -f 2`
echo
echo ==============================================
echo
echo Host${x}: ${host}
echo
snmpset ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.27.${x} i 1500 >
/dev/null
snmpset ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.26.${x} i 25 > /dev/null
snmpset ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.25.${x} i 88 > /dev/null
date=`date`
echo Begin Link Test ${date}
echo
sleep 10
lsignalcur=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.32.${x} |
cut -d ' ' -f 3`
lnoisecur=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.33.${x} |
cut -d ' ' -f 3`
lsnrcur=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.35.${x} | cut -d
' ' -f 3`
rsignalcur=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.44.${x} |
cut -d ' ' -f 3`
rnoisecur=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.45.${x} |
cut -d ' ' -f 3`
rsnrcur=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.47.${x} | cut -d
' ' -f 3`
lsignalmax=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.40.${x} |
cut -d ' ' -f 3`
lnoisemax=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.41.${x} |
cut -d ' ' -f 3`
lsnrmax=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.43.${x} | cut -d
' ' -f 3`
rsignalmax=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.52.${x} |
cut -d ' ' -f 3`
rnoisemax=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.53.${x} |
cut -d ' ' -f 3`
rsnrmax=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.55.${x} | cut -d
' ' -f 3`
lsignalmin=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.36.${x} |
cut -d ' ' -f 3`
lnoisemin=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.37.${x} |
cut -d ' ' -f 3`
lsnrmin=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.39.${x} | cut -d
' ' -f 3`
rsignalmin=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.48.${x} |
cut -d ' ' -f 3`
rnoisemin=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.49.${x} |
cut -d ' ' -f 3`
rsnrmin=`snmpget ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.51.${x} | cut -d
' ' -f 3`
printf "\t\tLocal Stats\n\n"
printf "Min: Signal: ${lsignalmin} \tNoise: ${lnoisemin} \tSNR:
${lsnrmin} \n"
printf "Max: Signal: ${lsignalmax} \tNoise: ${lnoisemax} \tSNR:
${lsnrmax} \n"
printf "Cur: Signal: ${lsignalcur} \tNoise: ${lnoisecur} \tSNR:
${lsnrcur} \n"
echo
printf "\t\tRemote Stats\n\n"
printf "Min: Signal: ${rsignalmin} \tNoise: ${rnoisemin} \tSNR:
${rsnrmin} \n"
printf "Max: Signal: ${rsignalmax} \tNoise: ${rnoisemax} \tSNR:
${rsnrmax} \n"
printf "Cur: Signal: ${rsignalcur} \tNoise: ${rnoisecur} \tSNR:
${rsnrcur} \n"
date=`date`
echo
echo End Link Test ${date}
snmpset ${AP} ${COMMUNITY} enterprises.762.2.5.2.1.25.${x} i 0 > /dev/null
x=$(( $x + 1 ))
done
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the mrtg
mailing list