Ahoy. List newbie here.
I've run into the exact same problem the user over at http://www.manucorp.com/archives/php-bugs/200504/msg00325.php seems to have encountered (running php with snmp enabled as module). After googling, searching the lists for quite some time (turned up nothing, though I didn't actually read every archived mail) and groking the sources, I've got a couple of questions.
1) What's the reasoning behind these comments from snmplib/snmp_logging.c (line 1070 and what follows)
/*
* We've got to be able to log messages *somewhere*!
* If you don't want stderr logging, then enable something else.
*/when running snmpapp? Wouldn't it be nicer to log to syslog with user.info or some such by default?
For the next question, we need to look at the output a bit (this is from running a PHP-script btw. The regular apps don't seem to be so troublesome).
--%<--%<--%<---
No log handling enabled - turning on stderr logging
Cannot rename /var/net-snmp/snmpapp.conf to /var/net-snmp/snmpapp.0.conf
Cannot unlink /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
--%<--%<--%<--
2) Why on earth is it trying to write to a file it should damn well KNOW it can't write to? It really shouldn't be so stupid as to try to overwrite the global config EVER. This is even more confusing when I, after having tried to run php as root, finds that it is a: stored with root's umask (good thing, possibly) of 077 and b: contains something along the lines of 'STOP STOP STOP don't edit this file or you'll bring the world to an immediate end' followed by the immensely clarifying line (verbatim);
Only "createUser" tokens should be placed here by snmpapp administrators.
which brings us back to the question in point; Why on earth is it trying to write there?
3) How do I turn snmpapp logging off (yes, completely)? man-pages are silent, as are the FAQ, README's (all of them) and the sources aren't exactly helpful about config file options either. Redirecting to a file would help, as I could then point the garbage to /dev/null, where it belongs.
Incidentally, a search on google for +"read_config_store open failure" turns up quite a lot of hits, some which returns to net-snmp-users@ but none with satisfactory answers.
To sum it up; Why does it have to log? Why does it have to try (and fail) to write a file located in a directory where users have no business writing anything at all?
-- Andreas Ericsson [EMAIL PROTECTED] OP5 AB www.op5.se Lead Developer
------------------------------------------------------- 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 [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
