Bug 165110 - snmptrapd doesn't seem to read snmpd.conf config file
Summary: snmptrapd doesn't seem to read snmpd.conf config file
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-snmp
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jan Safranek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-08-04 13:48 UTC by Bastien Nocera
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-06-13 13:44:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Bastien Nocera 2005-08-04 13:48:28 UTC
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 13:50:55 UTC
Ignore the mention of the script in step 1. above.

Comment 2 Radek Vokál 2005-08-18 12:55:51 UTC
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 14:43:56 UTC
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 19:33:43 UTC
REOPENED status has been deprecated. ASSIGNED with keyword of Reopened is preferred.

Comment 5 Jan Safranek 2007-06-13 13:44:42 UTC
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.