MRTG - Cisco Online Users ========================= Public domain ******************************************************************************** ### /usr/local/mrtg-2/etc/cisco-online.sh #!/bin/bash # $1 = E1 Channels (8 * 30 = 240) # $2 = Router IP # $3 = SNMP Community /usr/bin/snmpwalk -c $3 -v 2c $2 ifOperStatus > online.tmp ONLINE=$(/usr/bin/tail -n $1 online.tmp | /usr/bin/grep up | /usr/bin/wc -l) UPTIME=$(uptime | sed -e 's,\,.*,,' -e 's,.*up ,,') HOSTNAME=$(hostname) /usr/bin/rm online.tmp echo $ONLINE echo $ONLINE echo $UPTIME echo $HOSTNAME ******************************************************************************** ### /usr/local/mrtg-2/etc/cisco-online.cfg workdir: /var/www/htdocs/mrtg Target[online1]: `/usr/local/mrtg-2/etc/cisco-online.sh 240 192.168.1.21 public` Options[online1]: gauge, nopercent, integer Title[online1]: Online User statistics AS5300-1 PageTop[online1]: