Problem starting net-snmp-5.7_3

Hy guys, I installed net-snmp-5.7_3 on several FreeBSD 8.1-RELEASE machines without any problem, but, when I try to start it with default config /usr/local/share/snmp/snmpd.conf (copy by snmpd.conf.sample) it gave me the following error:

Code:
snmpd -V -c ./snmpd.conf

Turning on AgentX master support.
./snmpd.conf: line 87: Error: Already have an entry for this process.
./snmpd.conf: line 89: Error: Already have an entry for this process.
./snmpd.conf: line 91: Error: Already have an entry for this process.
./snmpd.conf: line 103: Error: includeAllDisks already specified.
./snmpd.conf: line 103: Error: 	ignoring: includeAllDisks 10%
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
./snmpd.conf: line 17: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
./snmpd.conf: line 17: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
./snmpd.conf: line 17: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
./snmpd.conf: line 17: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
./snmpd.conf: line 17: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
./snmpd.conf: line 17: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
./snmpd.conf: line 17: Error: duplicate trigger name
./snmpd.conf: line 19: Error: duplicate trigger name
./snmpd.conf: line 19: Error: duplicate trigger name
duplicate table data attempted to be entered. row exists
Failed to register extend entry 'test1' - possibly duplicate name.
duplicate table data attempted to be entered. row exists
Failed to register extend entry 'test2' - possibly duplicate name.
Turning on AgentX master support.
Error opening specified endpoint "udp:192.168.0.254:161"
Server Exiting with code 1

There are no other snmpd.conf anywhere on the paths that it looking for. If I start it from [cmd=]/usr/local/etc/rc.d/snmpd start[/cmd] it gave me the following error:

Code:
Starting snmpd.
Turning on AgentX master support.
Error opening specified endpoint "udp:192.168.0.254:161"
Server Exiting with code 1
/usr/local/etc/rc.d/snmpd: WARNING: failed to start snmpd

Thank you guys for the help.
 
You probably made a typo or something in your snmpd.conf.
 
SirDice said:
You probably made a typo or something in your snmpd.conf.

Hy SirDice, here is my snmpd.conf:

Code:
agentAddress  udp:127.0.0.1:161
view   systemonly  included   .1.3.6.1.2.1.1
view   systemonly  included   .1.3.6.1.2.1.25.1
rocommunity public  default    -V systemonly
rouser   authOnlyUser

sysLocation    Sitting on the Dock of the Bay
sysContact     Me <me@example.org>
sysServices    72

proc  mountd
proc  ntalkd    4
proc  sendmail 10 1

disk       /     10000
disk       /var  5%
includeAllDisks  10%

load   12 10 5

trapsink     localhost public

iquerySecName   internalUser
rouser          internalUser
defaultMonitors          yes
linkUpDownNotifications  yes

extend    test1   /bin/echo  Hello, world!
extend-sh test2   echo Hello, world! ; echo Hi there ; exit 35

master          agentx

Thanks.
 
I see no problems here. What do you have in /etc/rc.conf regarding net-snmp?
 
SirDice said:
What does # service snmpd start do now?

It does the same error:

Code:
service snmpd start
Starting snmpd.
Turning on AgentX master support.
/usr/local/share/snmp/snmpd.conf: line 87: Error: Already have an entry for this process.
/usr/local/share/snmp/snmpd.conf: line 89: Error: Already have an entry for this process.
/usr/local/share/snmp/snmpd.conf: line 91: Error: Already have an entry for this process.
/usr/local/share/snmp/snmpd.conf: line 103: Error: includeAllDisks already specified.
/usr/local/share/snmp/snmpd.conf: line 103: Error: 	ignoring: includeAllDisks 10%
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 15: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 15: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 15: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 15: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 15: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 15: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 15: Error: duplicate trigger name
/usr/local/share/snmp/snmpd.conf: line 17: Error: duplicate trigger name
/usr/local/share/snmp/snmpd.conf: line 17: Error: duplicate trigger name
duplicate table data attempted to be entered. row exists
Failed to register extend entry 'test1' - possibly duplicate name.
duplicate table data attempted to be entered. row exists
Failed to register extend entry 'test2' - possibly duplicate name.
Turning on AgentX master support.
Error opening specified endpoint "udp:127.0.0.1:161"
Server Exiting with code 1
/usr/local/etc/rc.d/snmpd: WARNING: failed to start snmpd

Thanks.
 
Isn't it already running? It looks like it's trying to add stuff that's already there.

ps -aux | grep snmpd
 
SirDice said:
Isn't it already running? It looks like it's trying to add stuff that's already there.

ps -aux | grep snmpd

There is nothing running at all.

Code:
(root@atlantis) -~#  ps -aux | grep snmpd
root      7995  0.0  0.1  3500  1236   0  S+    5:11PM   0:00.00 grep snmpd
 
Ah.. I couldn't figure it out myself. So I just installed it and started playing with it.

Remove your /usr/local/share/snmp/snmpd.conf and run the following command:
# snmpconf -g basic_setup

Answer the questions and it'll generate a proper snmpd.conf. Copy that file to /usr/local/share/snmp/. It should start properly now.
 
SirDice said:
Ah.. I couldn't figure it out myself. So I just installed it and started playing with it.

Remove your /usr/local/share/snmp/snmpd.conf and run the following command:
# snmpconf -g basic_setup

Answer the questions and it'll generate a proper snmpd.conf. Copy that file to /usr/local/share/snmp/. It should start properly now.

Hi SirDice,

Ok, I'll try this right now.

Thx.
 
Hi Dir Dice,

I do all the steps on snmpconf, that generate the following snmpd.conf:

Code:
agentAddress  udp:161
view   systemonly  included   .1.3.6.1.2.1.1
view   systemonly  included   .1.3.6.1.2.1.25.1
rocommunity xxx  default
syslocation  "Rack de TI"
syscontact  "TI <xxx@xx.xx.xx>"
trap2sink    localhost xxx
iquerySecName   internalUser
rouser          internalUser
defaultMonitors          yes
linkUpDownNotifications  yes
proc  mountd
proc  ntalkd    4
proc  sendmail 10 1
disk  / 10000
disk  /var 5%
disk  includeAllDisks 10%
load  12 10 5

So I try to start snmp service, but still get the error:

Code:
Starting snmpd.
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 3: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 3: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 3: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 3: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 3: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 3: Error: duplicate trigger name
error on subcontainer 'mteObjectsTable' insert (-1)
/usr/local/share/snmp/snmpd.conf: line 3: Error: duplicate trigger name
/usr/local/share/snmp/snmpd.conf: line 4: Error: duplicate trigger name
/usr/local/share/snmp/snmpd.conf: line 4: Error: duplicate trigger name
/usr/local/share/snmp/snmpd.conf: line 5: Error: Already have an entry for this process.
/usr/local/share/snmp/snmpd.conf: line 6: Error: Already have an entry for this process.
/usr/local/share/snmp/snmpd.conf: line 7: Error: Already have an entry for this process.
Error opening specified endpoint "udp:161"
Server Exiting with code 1

I try to find where could be another snmpd.conf file that could be generating that problem:

Code:
find / -name snmpd.conf
/usr/local/share/snmp/snmpd.conf
/usr/src/release/picobsd/floppy.tree/etc/snmpd.conf
/usr/home/suporte/snmpd.conf
/var/net-snmp/snmpd.conf

The snmp daemon looks for snmpd.conf on /usr/local/share/snmp/ so those above doesn't make any difference, right?

Thank you.
 
Start # snmpconfig -g basic_config and don't import any snmpd.conf files it might find. Start with a clean slate.
 
SirDice said:
Start # snmpconfig -g basic_config and don't import any snmpd.conf files it might find. Start with a clean slate.

Hi Sir Dice,

I do not import anything, i just search for another snmpd.conf.

My snmpd.conf is that one created by # snmpconfig -g basic_config as you told me.

Thank you.
 
Made a typo in my last post..

Code:
root@molly:~#snmpconf -g basic_setup

The following installed configuration files were found:

   1:  ./snmpd.conf

Would you like me to read them in?  Their content will be merged with the
output files created by this session.

Valid answer examples: "all", "none","3","1,2,5"

Read in which (default = all): none
************************************************
*** Beginning basic system information setup ***
************************************************
Do you want to configure the information returned in the system MIB group (contact info, etc)? (default = y): y

Configuring: syslocation
Description:
  The [typically physical] location of the system.
    Note that setting this value here means that when trying to
    perform an snmp SET operation to the sysLocation.0 variable will make
    the agent return the "notWritable" error code.  IE, including
    this token in the snmpd.conf file will disable write access to
    the variable.
    arguments:  location_string

The location of the system: At home

Finished Output: syslocation  "At home"

Configuring: syscontact
Description:
  The contact information for the administrator
    Note that setting this value here means that when trying to
    perform an snmp SET operation to the sysContact.0 variable will make
    the agent return the "notWritable" error code.  IE, including
    this token in the snmpd.conf file will disable write access to
    the variable.
    arguments:  contact_string

The contact information: SirDice

Finished Output: syscontact  SirDice
Do you want to properly set the value of the sysServices.0 OID (if you don't know, just say no)? (default = y): y

Configuring: sysservices
Description:
  The proper value for the sysServices object.
    arguments:  sysservices_number

does this host offer physical services (eg, like a repeater) [answer 0 or 1]: 0
does this host offer datalink/subnetwork services (eg, like a bridge): 0
does this host offer internet services (eg, supports IP): 1
does this host offer end-to-end services (eg, supports TCP): 1
does this host offer application services (eg, supports SMTP): 1

Finished Output: sysservices 76
**************************************
*** BEGINNING ACCESS CONTROL SETUP ***
**************************************
Do you want to configure the agent's access control? (default = y): y
Do you want to allow SNMPv3 read-write user based access (default = y): n
Do you want to allow SNMPv3 read-only user based access (default = y): n
Do you want to allow SNMPv1/v2c read-write community access (default = y): n
Do you want to allow SNMPv1/v2c read-only community access (default = y): y

Configuring: rocommunity
Description:
  a SNMPv1/SNMPv2c read-only access community name
    arguments:  community [default|hostname|network/bits] [oid]

The community name to add read-only access for: public
The hostname or network address to accept this community name from [RETURN for all]:
The OID that this community should be restricted to [RETURN for no-restriction]:

Finished Output: rocommunity  public
Do another rocommunity line? (default = y): n
****************************************
*** Beginning trap destination setup ***
****************************************
Do you want to configure where and if the agent will send traps? (default = y): n
****************************************
*** Beginning monitoring setup ***
****************************************
Do you want to configure the agent's ability to monitor various aspects of your system? (default = y): n

Error: An snmpd.conf file already exists in this directory.

'overwrite', 'skip', 'rename' or 'append'? : overwrite


The following files were created:

  snmpd.conf

These files should be moved to /usr/local/share/snmp if you
want them used by everyone on the system.  In the future, if you add
the -i option to the command line I'll copy them there automatically for you.

Or, if you want them for your personal use only, copy them to
/root/.snmp .  In the future, if you add the -p option to the
command line I'll copy them there automatically for you.

root@molly:~#cp snmpd.conf /usr/local/share/snmp/
root@molly:~#service snmpd start
Starting snmpd.
root@molly:~#
 
Thank you SirDice.

Following your steps, I can make it work!

Thank you so much for the help.

P.S: How do I set this thread as SOLVED?

Thank you again.
 
Following this to the letter worked like a charm.

Now wouldn't it be nice if the default package install included a working snmpd.conf file.
Code:
godzilla# cp snmpd.conf /usr/local/share/snmp/
godzilla# service snmpd start
Starting snmpd.
godzilla# cd /var/log/
godzilla# cat snmpd.log
NET-SNMP version 5.7.1
godzilla#
 
Back
Top