Re: Starting an agent without using .conf files - SNMP

This is a discussion on Re: Starting an agent without using .conf files - SNMP ; --===============0241073159==
Content-Type: multipart/alternative; boundary="0-967833959-1201016258=:40937"
Content-Transfer-Encoding: 8bit
--0-967833959-1201016258=:40937
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
What I mean is that I want it to be able to run independently of any config files. I only want to have to link the librarys and ...

What I mean is that I want it to be able to run independently of any config files. I only want to have to link the librarys and not have any files being read from anything other than what I want it to use. And the netsnmp_config function seems to allow me to do that.

Dave Shield wrote: On 22/01/2008, Leif Pit**** wrote:
> Is it possible to set the community string, port, and SNMP version without
> using the .conf files from the code itself?

What do you mean by "setting the community string and SNMP version"
of the agent? A command-line client needs to specify a particular single
version/community for a given request - but that's not true for the agent.
An SNMP agent will typically accept requests using a variety of versions,
community strings and SNMPv3 usernames.

Note that you can enbed *any* snmpd.conf directive directly within the code,
using the statement:

netsnmp_config( "rocommunity public" );

Alternatively, you could call the relevant config parsing routine yourself:

What I mean is that I want it to be able to run independently of any config files. I only want to have to link the librarys and not have any files being read from anything other than what I want it to use. And the netsnmp_config function seems to allow me to do that.

Dave Shield <D.T.Shield@liverpool.ac.uk> wrote:

On 22/01/2008, Leif Pit**** wrote:> Is it possible to set the community string, port, and SNMP version without> using the .conf files from the code itself?

What do you mean by "setting the community string and SNMP version"of the agent? A command-line client needs to specify a particular singleversion/community for a given request - but that's not true for the agent.An SNMP agent will typically accept requests using a variety of versions,community strings and
SNMPv3 usernames.

Note that you can enbed *any* snmpd.conf directive directly within the code,using the statement:

netsnmp_config( "rocommunity public" );

Alternatively, you could call the relevant config parsing routine yourself: