init III
This commit is contained in:
31
Linux Monitor Interface via SNMP/mon_if.sh
Normal file
31
Linux Monitor Interface via SNMP/mon_if.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$#" -lt "3" ]
|
||||
then
|
||||
echo ""
|
||||
echo "Interfaces auflisten"
|
||||
echo "mon_if.sh <IP> <community> list"
|
||||
echo ""
|
||||
echo "Graphen starten"
|
||||
echo "mon_if.sh <IP> <community> <Intervall in Sekunden> <Anzeigedauer in Minuten> <Interface Name>"
|
||||
echo ""
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$3" == "list" ]
|
||||
then
|
||||
echo "$1 Interfaces:"
|
||||
echo ""
|
||||
snmpwalk -c$2 -v2c $1 1.3.6.1.2.1.2.2.1.2 | grep -oP "STRING: \K.*"
|
||||
echo ""
|
||||
echo ""
|
||||
exit
|
||||
fi
|
||||
|
||||
IFID=`snmpwalk -c$2 -v2c $1 1.3.6.1.2.1.2.2.1.2 | grep $5 | grep -oP "\.\K\d*"`
|
||||
./snmprtg --quiet --title "$1 Input $5 ($IFID)" --peer $1 --community $2 --interval $3 --window $4 --oid 1.3.6.1.2.1.2.2.1.10.$IFID --log 1 2>&1 >/dev/null &
|
||||
./snmprtg --quiet --title "$1 Output $5 ($IFID)" --peer $1 --community $2 --interval $3 --window $4 --oid 1.3.6.1.2.1.2.2.1.16.$IFID --log 1 2>&1 >/dev/null &
|
||||
echo ""
|
||||
echo ""
|
||||
exit
|
||||
Reference in New Issue
Block a user