-1

I built Net-SNMP 5.7.2 from source and installed it. When I run snmpget --version and snmpd --version it displays the correct version.

However only because of the fact that I am experiencing some SNMP related errors at the moment, I checked my /var/log/syslog for any entries. Surprisingly it has the following:

Apr 11 23:07:00 ubuntu snmpd[4281]: Received TERM or STOP signal... shutting down...
Apr 11 23:09:58 ubuntu snmpd[4401]: iquerySecName has not been configured - internal queries will fail
Apr 11 23:09:58 ubuntu snmpd[4401]: /etc/snmp/snmpd.conf: line 77: Error: No address associated with hostname
Apr 11 23:09:58 ubuntu snmpd[4401]: /etc/snmp/snmpd.conf: line 91: Error: bad SUBTREE object id
Apr 11 23:09:58 ubuntu snmpd[4401]: /etc/snmp/snmp.conf: line 6: Warning: Unknown token: com2sec.
Apr 11 23:09:58 ubuntu snmpd[4401]: net-snmp: 2 error(s) in config file(s)
Apr 11 23:09:58 ubuntu snmpd[4401]: NET-SNMP version 5.4.3

I double checked what PID the daemon it currently running at and it is indeed 4401.

I did not build SNMP version 5.4.3. I'm confused. It is also telling me there are errors in my configuration too, perhaps this is why I am having such problems at the moment because my configuration file is for that of a later version.

Any ideas?

uncle-junky
  • 723
  • 1
  • 8
  • 33

1 Answers1

0

Hazarding a guess: you didn't remove the original package that came with Ubuntu; you left the locations for the manually compiled version at /usr/local, which (possibly?) come before the ones that came with the OS in the PATH; that would explain the correct version on the command line. The startup scripts use the hardcoded PATH to the old ones?

Edit the init script to point at the new demon :)

tink
  • 14,342
  • 4
  • 46
  • 50
  • What would you recommend? – uncle-junky Apr 12 '13 at 00:13
  • Since my answer was just a guess: can you confirm that my assumptions were correct? If they were, edit the init script to reflect the desired path. – tink Apr 12 '13 at 00:15
  • "...you left the locations for the manually compiled version at /usr/local". Yes I did. "...edit the init script to reflect the desired path" But I left the default /usr/local path when I complied it. What use would editing the init script? Btw, you are talking about `/etc/init.d/snmpd`, yes? – uncle-junky Apr 12 '13 at 00:24
  • Actully, looking in the /etc/init.d/snmpd script I can see that the daemon is referenced at `/usr/sbin/snmpd`. Checking this with the `--version` flag does give the old version. Damn. – uncle-junky Apr 12 '13 at 00:27
  • So my guesswork and the suggestion to edit the init script are sound. Sweet. – tink Apr 12 '13 at 00:35
  • Yeah, 'points coming your way. The init script is full of the /usr/sbin directory, I need to put in the /usr/local/sbin. Wouldn't it be easier to just sym link the snmpd executable from /usr/local/sbin/ to /usr/sbin? How would I do that? – uncle-junky Apr 12 '13 at 00:40
  • You could do that, just need to kill the existing executables you're about to replace. Once done it's as easy as "ln -s /usr/local/sbin/snmpd /usr/sbin/snmpd" (and so forth). – tink Apr 12 '13 at 00:43
  • The symlink didn't work. I'm getting it running with starting it directly and not through the init script. Thanks for the help. – uncle-junky Apr 12 '13 at 00:50