UCD-SNMP-MIB::ucdavis.54.3.1.1.19.115.111.99.107.101.116.115.95.112.105.112.101.115.95.102.105.108.101.115 = STRING: "files:2624 pipes:0 tcp:527 udp:19 unix:60"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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}
}