RE: SNMP SET of sysLocation and sysContact
Doroubo Doroubo <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Dave, I am running a script to run my application upon boot-up. My script contains the following: ================================ #!/bin/bash export ZSNMPPATH=/zsnmp/sbin export MIBDIRS=/zsnmp/share/snmp/mibs export SNMPCONFPATH=/zsnmp/share/snmp:. export ZSNMPCONFPATH=/zsnmp/share/snmp export MIBS=+ZANDAR-ARM-MIB ./zsnmp_agent& ================================ The zsnmp_agent, which is my application (a subagent) calls via system call "/zsnmp/sbin/snmpd -x tcp:localhost:4030" to start snmpd. This resets the syslocation/syscontact that was already saved in /var/net-snmp/snmpd.conf. I find this weird. When I just call "/zsnmp/sbin/snmpd -x tcp:localhost:4030", it doesn' affect my saved values. Another solution that I was able to think of is setting the persistent file. I added the line on my script "export SNMP_PERSISTENT_FILE=/zsnmp/share/snmpd.conf". This solved my problem but the file get's bigger and bigger everytime I change syslocation and syscontact. Is there a way to tell the agent to truncate the file instead before writing the new values. Thanks!!! Regards, Ed > Date: Tue, 13 Jul 2010 11:03:30 +0100 > Subject: Re: SNMP SET of sysLocation and sysContact > From: [email protected] > To: [email protected] > CC: [email protected] > > On 13 July 2010 10:45, Doroubo Doroubo <[email protected]> wrote: > > Yes, that's what I'm doing (killall snmpd). > > What is the *exact* command you are running? > > > > How do you terminate properly? > > What environment are you using? > ( It's impossible to tell you about the official command for > stopping or starting services, if you haven't given us any > information about operating system, distribution, etc.) > > > > I tried snmp stop but when I check the running processes, I can see snmpd > > running. > > Well, under Fedora, the standard way to stop the agent would be > > service snmpd stop > > (note "snmpd", rather than "snmp") > Other distibutions may well use different commands. I BELIEVE I AM USING DEBIAN. RIGHT NOW, WHETHER I USE SNMP STOP/RESTART OR THE KILLALL METHOD TO SHUTDOWN MY AGENT, IT GETS SAVED IN /VAR/NET-SNMP/SNMPD.CONF. THIS MAYBE NOT AN ISSUE AT ALL. > > > > > I can see that /var/net-snmp/snmpd.conf updates everytime I set syslocation > > and syscontact. The problem now is when I restart the machine (power off > > then power on). The values in /var/net-snmp/snmpd.conf resets. > > Hmmm.... that doesn't sound right. > Something must be re-setting this file.... YES, IT WAS THE EXPORT PART ON MY SCRIPT, THEN CALLING "/zsnmp/sbin/snmpd -x tcp:localhost:4030" RESETS MY SAVED VALUES IN /VAR/NET-SNMP/SNMPD.CONF. > > That's probably what is causing your problems. > But it's worth verifying this: > > run the agent > change the location/contact values > run GET on these, to check it has the new values > shut down the agent (but don't power off) > restart the agent > run GET on location/contact > > what values do you get? > The default ones, or your new versions? > > > Dave _________________________________________________________________ Hotmail: Trusted email with Microsoft’s powerful SPAM protection. https://signup.live.com/signup.aspx?id=60969 ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ 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