RE: Agent command line options

Steve Stetka <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
I think snmp looks for a file called bla.conf where bla is the name of your subagent...is this the name of your file u r reading into your custom function?  I could be wrong cuz I'm a newbie but if this is the case then try renaming the file to something elsse.

Steve

> Date: Fri, 16 Oct 2009 11:32:45 -0600
> From: [email protected]
> To: [email protected]
> Subject: Agent command line options
> 
> I'm writing an agent which takes a few command line switches, including a YAML
> configuration file. My agent initializes itself like this:
> 
> init_agent("some string");
> init_mibs();
> init_snmp("some string");
> 
> init_mibs() is my own function that registers the MIBs this agent will
> support.
> 
> The problem is that my agent needs some special configuration, so I've given
> it a command line switch (-Q, to be specific, which I've picked mostly
> randomly, trying to not break anything); the user should follow that switch
> with the name of a YAML file providing the necessary configuration.
> 
> All this works fine. init_mibs() calls the stuff I need it to call to read the
> YAML file and claim some OIDs. But then, init_snmp() gets called, which ends
> up calling Net-SNMP's read_config(), which tries to re-read my YAML config
> file, and spits out lots of errors about unknown tokens and invalid blank
> lines and things.
> 
> How can I pass this config file to my agent without read_config() trying to
> parse it as an snmpd config file? Thanks.
> 
> --
> Joshua Tolley / eggyknap
> End Point Corporation
> http://www.endpoint.com
 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141665/direct/01/

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.