原始文件:
-add SNMP SNMP_Linepage active 10.15.254.1 ifUti_linepage_88 szx_public 161 2 20 600 0 0 0 szx_nujiang_7609A
-add SNMP SNMP_Linepage active 10.15.254.1 ifUti_linepage_127 szx_public 161 2 20 600 0 0 0 szx_diqing_7609A
-add SNMP SNMP_Linepage active 10.15.254.1 ifUti_linepage_76 szx_public 161 2 20 600 0 0 0 szx_banna_7609A
-add SNMP SNMP_Linepage active 10.15.254.1 ifUti_linepage_118 szx_public 161 2 20 600 0 0 0 szx_dehong_7609A
-add SNMP SNMP_Linepage active 10.15.254.1 ifUti_linepage_94 szx_public 161 2 20 600 0 0 0 szx_baoshan_7609A
将值填入下面的URL
cat shell.sh
#!/bin/bash
export m="_161"
#rm -i *.hejun
cat shell.log | awk '{print $5}'>>chipfat.hejun
sed 's/\./_/g' chipfat.hejun>>chipfat.log
for z in `cat chipfat.log`
do
echo "http://20.1.1.241:9500/ISMserver?Profile=SNMP_Linepage&Monitor=snmp&Location=ALL&DatalogDirectory=SNMP_$z">>chip.hejun
done
for i in `cat shell.log | awk '{print $6}'`
do
echo "_$i$m&Granular=day&Printable=false&TZUse=WST&Zoom=1.0&SnapTo=maximum&View=ImageWrapper&ScaleFactor=1.0&GoodPercentFailed=90&GoodPercentMarginal=99&Date=&Action=71&Value=oidNames&ReportView=Line&Measurand=">>if.hejun
done
for j in `cat shell.log | awk '{print $5}'`
do
echo "$j&Description=">>ip.hejun
done
for k in `cat shell.log | awk '{print $15}'`
do
echo "$k&SelectedLegendBox=-1&MMValuesCount=&ReportColour=White&HighestValue=">>or.hejun
done
cat -n chip.hejun>a.hejun
cat -n if.hejun>b.hejun
cat -n ip.hejun>c.hejun
cat -n or.hejun>d.hejun
join a.hejun b.hejun>mid1.hejun
join mid1.hejun c.hejun >mid2.hejun
join mid2.hejun d.hejun>mid.hejun
#cat mid.hejun | awk '{print $2$3$4}'>fina.log
cat mid.hejun | awk '{print $1" "$2$3$4$5$6}'>fina.log
rm *.hejun
-bash-3.00$
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22775238/viewspace-620230/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22775238/viewspace-620230/