Computing.Net > Forums > Solaris > shell scripting

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

shell scripting

Reply to Message Icon

Name: howdy
Date: October 21, 2009 at 08:09:41 Pacific
OS: UNIX
CPU/Ram: 3.192 GHz / 2045 MB
Product: Intel / Product8
Subcategory: Software Problems
Comment:

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.txt

fi
done

but the answer is wrong cause i'm getting an errorcount.



Sponsored Link
Ads by Google

Response Number 1
Name: jefro
Date: October 22, 2009 at 17:52:24 Pacific
Reply:

Repost in programming. Nails and a few others like that stuff.

Playing to the angels
Les Paul (1915-2009)


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: shell scripting

Need shell script code www.computing.net/answers/solaris/need-shell-script-code/3390.html

Shell script www.computing.net/answers/solaris/shell-script/3242.html

shell script www.computing.net/answers/solaris/shell-script/4427.html