Wes Hardaker wrote:
If people want files to be read, the must properly set SNMPCONFPATH.
If they didn't include some directory in that path its probably
intentional.  It'd be like your shell deciding to never let you wipe
out the PATH variable with something of your choosing and always
appending whatever you said.

I decided to RTFM, and I see that for the -C option, the man page says:

***
-C Do not read any configuration files except the ones optionally specified by the -c option. *Note that this behaviour also covers the persistent configuration files.* This may result in dynamically-assigned values being reset following an agent restart, unless the relevant persistent config files are explicitly loaded using the -c option.
***


I would expect defining SNMPCONFPATH to result in the behaviour as -C with -c but I have not verified that it actually does.

If I define persistentDir (with the netsnmp_ds_register_premib() change so it actually works) as c:\Program Files\Net-SNMP\snmp\persist and SNMPCONFPATH to:

c:\Program Files\Net-SNMP\etc\snmp;c:\Program Files\Net-SNMP\snmp\persist

then everything works as expected!  I also tested this with Linux.

Ok, so I should have read the man pages. But to me, the persistent folder is completely different to the user config folders. This is why I though something was broken when SNMPCONFPATH was set. To me it is like changing your PATH results in your TERM variable from being wiped out.

From what I have read in the FAQ and the persistent snmpd.conf file itself, NOTHING should be manually put in the persistent snmpd.conf file except for createUser. I understand that this isn't just another configuration file. It's a special file that has nothing to do with user configuration, other than the createUser token, which isn't really a configuration option. It's a temporary 'command' that the agent is supposed to execute, and then purge.

The testing I did today was with 5.2.1. A new enviornment variable was added months ago to main called SNMP_PERSISTENT_DIR which we could use instead of the persistentDir snmp.conf token. Changing the token to use netsnmp_ds_register_premib() works, but you mentioned it could still cause issues. Using SNMP_PERSISTENT_DIR is perfectly fine with me.

The question now is shouldn't we always load the persistent file, even if the user defined SNMPCONFPATH?

BTW, snmp_config states:

***
Additionally, the above default search path can be overridden by setting the environment variable SNMPCONFPATH to a colon-separated list of directories to search for.


Finally, applications that store persistent data will also look in the /var/net-snmp directory for configuration files there.
***


I read this as the persistent data will be read even if SNMPCONFPATH is set, but the -C -c option says otherwise.

Alex


------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to