Bug 165110 - snmptrapd doesn't seem to read snmpd.conf config file
snmptrapd doesn't seem to read snmpd.conf config file
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-snmp (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jan Safranek
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-04 09:48 EDT by Bastien Nocera
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-06-13 09:44:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bastien Nocera 2005-08-04 09:48:28 EDT
Description of problem:
snmptrapd doesn't seem to read snmpd.conf configuration file

Version-Release number of selected component (if applicable):
net-snmp-5.1.2-11

How reproducible:
Every time

Steps to Reproduce:
1. Add those lines to /etc/snmp/snmpd.conf (change the location of the script at
will):
master agentx
agentxsocket localhost:705
trap2sink localhost

2. restart both snmpd and snmptrapd
3. start stracing snmptrapd:
$ sudo strace -p `pidof snmptrapd`
Process 24579 attached - interrupt to quit
select(9, [3 5 8], NULL, NULL, {4, 615000}) = 0 (Timeout)
gettimeofday({1123163216, 854889}, NULL) = 0
gettimeofday({1123163216, 855004}, NULL) = 0
gettimeofday({1123163216, 855114}, NULL) = 0
gettimeofday({1123163216, 855222}, NULL) = 0
gettimeofday({1123163216, 855331}, NULL) = 0
gettimeofday({1123163216, 855443}, NULL) = 0
gettimeofday({1123163216, 855551}, NULL) = 0
select(9, [3 5 8], NULL, NULL, {4, 965438}) = 0 (Timeout)
gettimeofday({1123163221, 821069}, NULL) = 0
gettimeofday({1123163221, 821185}, NULL) = 0
gettimeofday({1123163221, 821294}, NULL) = 0
gettimeofday({1123163221, 821402}, NULL) = 0
gettimeofday({1123163221, 821510}, NULL) = 0
socket(PF_FILE, SOCK_STREAM, 0)         = 9
connect(9, {sa_family=AF_FILE, path="/var/agentx/master"}, 110) = -1
ECONNREFUSED (Connection refused)
close(9)                                = 0
unlink("")                              = -1 ENOENT (No such file or directory)
gettimeofday({1123163221, 869770}, NULL) = 0
gettimeofday({1123163221, 869904}, NULL) = 0
gettimeofday({1123163221, 870012}, NULL) = 0
select(9, [3 5 8], NULL, NULL, {5, 0} <unfinished ...>

  
Actual results:
Notice that it tries to connect to /var/agentx/master

Expected results:
Connect to localhost:705

Additional info:
Works on the current RHEL3 net-snmp package
Comment 1 Bastien Nocera 2005-08-04 09:50:55 EDT
Ignore the mention of the script in step 1. above.
Comment 2 Radek Vokal 2005-08-18 08:55:51 EDT
snmptrapd has never read the configuration from snmp.conf, it has different
syntax. This file should be placed in /etc/snmp/snmptrapd.conf, see appropriate
man page. 
Comment 3 Bastien Nocera 2005-08-18 10:43:56 EDT
Why does it work properly on a stock RHEL3 install then?

There's no snmptrapd.conf in a stock RHEL3:
$ rpm -ql net-snmp | grep etc
/etc/logrotate.d/snmpd
/etc/rc.d/init.d/snmpd
/etc/rc.d/init.d/snmptrapd
/etc/snmp
/etc/snmp/snmpd.conf
Comment 4 Red Hat Bugzilla 2007-02-05 14:33:43 EST
REOPENED status has been deprecated. ASSIGNED with keyword of Reopened is preferred.
Comment 5 Jan Safranek 2007-06-13 09:44:42 EDT
You are right, we do not supply any default snmptrapd.conf file in your
packages. Upstream Net-SNMP does neither. There is man page, which should help
you write your own /etc/snmp/snmptrapd.conf.

I have checked RHEL3 and snmptrapd does NOT read snmpd.conf. The situation is
the same like in RHEL4 - no default snmptrapd.conf is provided, you must write
one by yourself.

Note You need to log in before you can comment on or make changes to this bug.