date +%F,%R snmp() { echo "######################################################################" echo $1 snmpget -v2c -c community $1 .1.3.6.1.4.1.2021.10.1.3.1 | cut -d":" -f4 snmpget -v2c -c community $1 .1.3.6.1.4.1.2021.11.11.0 | cut -d":" -f4 used_swap=`snmpget -v2c -c community $1 .1.3.6.1.4.1.2021.4.3.0 | cut -d" " -f4` avail_swap=`snmpget -v2c -c community $1 .1.3.6.1.4.1.2021.4.4.0 | cut -d" " -f4` c=`echo "scale=5;$avail_swap/$used_swap*100" |bc |cut -c 1-5` echo $c% ram_tot=`snmpget -v2c -c community $1 .1.3.6.1.4.1.2021.4.5.0 | cut -d" " -f4` ram_used=`snmpget -v2c -c community $1 .1.3.6.1.4.1.2021.4.6.0 | cut -d" " -f4` d=`echo "scale=5;$ram_used/$ram_tot*100" |bc |cut -c 1-5` echo $d% snmpget -v2c -c community $1 .1.3.6.1.4.1.2021.4.14.0 | cut -d":" -f4 snmpget -v2c -c community $1 .1.3.6.1.4.1.2021.4.15.0 | cut -d":" -f4 x=`snmpwalk -v2c -c community $1 .1.3.6.1.4.1.2021.54.3.1.1 | cut -d'"' -f2` echo $x | cut -d" " -f1 echo $x | cut -d" " -f2 echo $x | cut -d" " -f3 #echo ${array} }