Re: running snmpd

This is a discussion on Re: running snmpd within the SNMP Users forums, part of the Networking and Network Related category; 2008/4/28 Jelena Savic <JSavic@evertz.com>: > >> Is there a way that i can ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-28-2008
Dave Shield
 
Posts: n/a
Default Re: running snmpd

2008/4/28 Jelena Savic <JSavic@evertz.com>:
> >> Is there a way that i can notify my process when snmpd is
> >> ready without arbitrarily sleeping for some time before
> >> starting up the second process?

>
> >$ snmpgetnext [valid creds] -t 10 -r 60 .1.3
> >
> > ...will wait up to ten minutes for a valid response, retrying every ten seconds.
> > Check the return code - 0 means the agent is up, anything else means abort.


> How do i check the return code of snmpgetnext?


Either

snmpgetnext .... > /dev/null 2>&1 && echo Server is up

or

if snmpgetnext .... > /dev/null 2>&1
then
echo Server is up
fi

(They both work in effectively the same manner, but the second format
makes it simpler to run multiple commands).

The "> /dev/null 2>&1" is simply to throw away any output,
assuming that you're *just* interested in the success/failure of the request.

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757...un.com/javaone
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:00 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0