No, I tried to avoid that one at the start -- the file is called pgsnmpd.yaml
(in honor of the agent, which is called, predictably and unpronounceably,
pgsnmpd). Here are the command line options I've got right now; I'm not
married to these specific options, and can change them to some other letter or
option if it will make things work better:

usage: pgsnmpd [-s] [-b] [-c FILE ] [-x address ] [-g] [-C "Connect String"]
   -s : run as AgentX sub-agent of an existing snmpd process
   -b : run in the background
   -c : configuration file name
   -g : use syslog
   -C : libpq connect strings
   -Q : custom query configuration file
   -x : address:port of a network interface
   -V : display version strings

Some of these I want to have passed through to net-snmp; others, such as -C
and -Q, for instance, net-snmp should ignore. I guess this question extends to
all command line options, then: how do I pass only a subset of the command
line to net-snmp when calling init_snmp()?

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

On Sat, Oct 17, 2009 at 02:54:24AM -0400, Steve Stetka wrote:
>    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: eggyk...@gmail.com
>    > To: net-snmp-users@lists.sourceforge.net
>    > 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. Sign up now.

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to