Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hello all,
i want to Perform an SNMP set request in SNMP agent. return 0 if the connect succeeded.
here is what i did :
LIST = 'ypcat hosts|| sort | awk '{print $2}''
for Devices in $LIST
do
Errorcount=`snmpget -v1 -c privator $Devices snmpInBadCommunityNames.O |awk '{print $4}' `
if [ Errorcount > 0 ]; then
Devices=$Errorcount
echo $Devices
# line added
echo "$sysdate $Devices" >> /tmp/hosthistory.txtfi
donebut the answer is wrong cause i'm getting an errorcount.

Repost in programming. Nails and a few others like that stuff.
Playing to the angels
Les Paul (1915-2009)

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |