Where should I put snmpd.conf?

Anthony M. Rasat anthony.rasat at gmail.com
Mon Dec 7 12:14:31 UTC 2009


On Mon, Dec 7, 2009 at 4:45 PM, Werner Schram <wrschram at gmail.com> wrote:
> Anthony M. Rasat wrote:
>>
>> I have a Ubuntu 9.04 server (AMD64) and a Debian Etch AMD64.
>>
>> When I tried to reconfigure /etc/snmp/snmpd.conf then reload by command
>> "/etc/init.d/snmpd reload" apparently changes did not take place. Confused,
>> I tried "/etc/init.d/snmpd restart". Also did not work. But when I tried
>> "/usr/bin/snmpd -c /etc/snmp/snmpd.conf" everything works.
>>
>> This also happens with Debian Etch.
>>
>> Where should I supposed to put snmpd.conf? Scratching my head here.
>>
>> PS: I tried "/etc/init.d/snmpd stop" then "ps -A|grep snmpd" show nothing
>> and then "/etc/init.d/snmpd start" then ps show "snmpd". Now I know the
>> command works. I also checked inside file "/etc/init.d/snmpd" to see how it
>> works. Well, I see it does looking for "/etc/snmp" directory. Hmm...
>>
>
> I just tried to reproduce your problem, but on my system I can update
> /etc/snmp/snmpd.conf and use '/etc/init.d/snmpd reload' to reload the
> config. You noted that you started /usr/bin/snmpd, I assume that this is a
> writing error? snmpd should be in /usr/sbin. I ask this to make sure you
> don't have multiple snmpd executables arround.
>
> Which version of snmpd are you using (/usr/sbin/snmpd --version)?
>
> Werner
>

My bad. It was /usr/sbin/snmpd not /usr/bin/snmpd.
However I found the root of the problem. It lies inside file
/etc/default/snmpd line 12:

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'

Apparently, by default, snmpd supposed to listen on localhost
interface, not physical interface. Thus, my modification :

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid'

So, it is not about where I should I put snmpd.conf but whole another
reason why it did not work.

Thanks to Werner Schram for his response.

-- 
Regards,

Anthony M. Rasat.-




More information about the ubuntu-users mailing list