Discussion:
couldn't open udp:162 -- errno 98 ("Address already in use")
riva riv
2017-05-17 08:33:09 UTC
Permalink
Hi Experts,

I am trying to receive a trap generated by a cisco router on my VM- Ubuntu
14.04. I can do a snmwalk so I guess snmp is working fine but I am not able
to receive the traps generated by router on my VM.

***@ubuntu:~$ sudo /etc/init.d/snmpd restart
* Restarting network management services:


***@ubuntu:~$ sudo /etc/init.d/snmpd status
* snmpd is running
* snmptrapd is running

Here is what I have inside files-

/etc/default/snmpd-
export MIBS=
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c
/etc/snmp/snmpd.conf'
TRAPDRUN=yes
# snmptrapd options (use syslog).
TRAPDOPTS='-n -On -t -Lsd -p /var/run/snmptrapd.pid'

/etc/snmp/-

snmpd.conf-
rocommunity public

snmptrapd.conf-
disableAuthorization yes

snmp.conf-
mibs:

The command I am running for viewing the traps on VM-

***@ubuntu:/etc/snmp$ sudo snmptrapd -f -Lo -c snmptrapd.conf
couldn't open udp:162 -- errno 98 ("Address already in use")

I am confused since the port is being used by snmptrap itself-

***@ubuntu:~$ cat /etc/services|grep 162
snmp-trap 162/tcp snmptrap # Traps for SNMP
snmp-trap 162/udp snmptrap
***@ubuntu:~$ sudo netstat -lnp| grep 162
udp 0 0 0.0.0.0:162 0.0.0.0:*
6216/snmptrapd
***@ubuntu:~$ ps -ef | grep snmptrapd
root 6216 2076 0 10:43 ? 00:00:00 /usr/sbin/snmptrapd -Lsd
-p /var/run/snmptrapd.pid
a 6493 2667 0 11:47 pts/8 00:00:00 grep --color=auto snmptrapd

Is there any way of solving this issue? I have googled a lot and stuck on
this for days, any help will be very much appreciated.
Thanks a lot in advance!!
Jurkiewicz Jean-Marc
2017-05-17 09:09:29 UTC
Permalink
Hi,

From what I see : It seems that the SNMP trap daemon is working and listening on port 162, what is OK.

How is this daemon configured :
snmptrapd.conf ? => per default the Traps are not handled

How is your cisco router configured: / does it send Traps ?
snmp-server host Your-VM-IP Your-trap-Community

snmp-server enable traps The-Traps-You-Want-To-See

Are the traps reaching the VM:
Sniffing with Wireshark

Hope this helps

Best regards
JMJ





De : riva riv [mailto:***@gmail.com]
Envoyé : mercredi, 17. mai 2017 10:33
À : net-snmp-***@lists.sourceforge.net
Objet : couldn't open udp:162 -- errno 98 ("Address already in use")

Hi Experts,

I am trying to receive a trap generated by a cisco router on my VM- Ubuntu 14.04. I can do a snmwalk so I guess snmp is working fine but I am not able to receive the traps generated by router on my VM.

***@ubuntu:~$ sudo /etc/init.d/snmpd restart
* Restarting network management services:
***@ubuntu:~$ sudo /etc/init.d/snmpd status
* snmpd is running
* snmptrapd is running

Here is what I have inside files-

/etc/default/snmpd-
export MIBS=
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'
TRAPDRUN=yes
# snmptrapd options (use syslog).
TRAPDOPTS='-n -On -t -Lsd -p /var/run/snmptrapd.pid'

/etc/snmp/-

snmpd.conf-
rocommunity public

snmptrapd.conf-
disableAuthorization yes

snmp.conf-
mibs:

The command I am running for viewing the traps on VM-

***@ubuntu:/etc/snmp$ sudo snmptrapd -f -Lo -c snmptrapd.conf
couldn't open udp:162 -- errno 98 ("Address already in use")

I am confused since the port is being used by snmptrap itself-

***@ubuntu:~$ cat /etc/services|grep 162
snmp-trap 162/tcp snmptrap # Traps for SNMP
snmp-trap 162/udp snmptrap
***@ubuntu:~$ sudo netstat -lnp| grep 162
udp 0 0 0.0.0.0:162<http://0.0.0.0:162/> 0.0.0.0:* 6216/snmptrapd
***@ubuntu:~$ ps -ef | grep snmptrapd
root 6216 2076 0 10:43 ? 00:00:00 /usr/sbin/snmptrapd -Lsd -p /var/run/snmptrapd.pid
a 6493 2667 0 11:47 pts/8 00:00:00 grep --color=auto snmptrapd

Is there any way of solving this issue? I have googled a lot and stuck on this for days, any help will be very much appreciated.
Thanks a lot in advance!!
riva riv
2017-05-17 10:59:47 UTC
Permalink
Hi JMJ,

Thanks a lot for your response.
This is what I have in /etc/snmp/snmptrapd.conf:
disableAuthorization yes

The cisco config is as follows-
snmp-server community public RO
snmp-server enable traps config
snmp-server host 192.168.6.149 vrf Mgmt-intf public

Turns out my router CSRV (running on VM) is not sending traps as I am able
to log in the traps when sent via my windows CMD.

Thanks.

On Wed, May 17, 2017 at 2:39 PM, Jurkiewicz Jean-Marc <
Post by Jurkiewicz Jean-Marc
Hi,
From what I see : It seems that the SNMP trap daemon is working and
listening on port 162, what is OK.
snmptrapd.conf ? => per default the Traps are not handled
How is your cisco router configured: / does it send Traps ?
snmp-server host Your-VM-IP Your-trap-Community
snmp-server enable traps The-Traps-You-Want-To-See
Sniffing with Wireshark
Hope this helps
Best regards
JMJ
*Envoyé :* mercredi, 17. mai 2017 10:33
*Objet :* couldn't open udp:162 -- errno 98 ("Address already in use")
Hi Experts,
I am trying to receive a trap generated by a cisco router on my VM- Ubuntu
14.04. I can do a snmwalk so I guess snmp is working fine but I am not able
to receive the traps generated by router on my VM.
* snmpd is running
* snmptrapd is running
Here is what I have inside files-
/etc/default/snmpd-
export MIBS=
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c
/etc/snmp/snmpd.conf'
TRAPDRUN=yes
# snmptrapd options (use syslog).
TRAPDOPTS='-n -On -t -Lsd -p /var/run/snmptrapd.pid'
/etc/snmp/-
snmpd.conf-
rocommunity public
snmptrapd.conf-
disableAuthorization yes
snmp.conf-
The command I am running for viewing the traps on VM-
couldn't open udp:162 -- errno 98 ("Address already in use")
I am confused since the port is being used by snmptrap itself-
snmp-trap 162/tcp snmptrap # Traps for SNMP
snmp-trap 162/udp snmptrap
udp 0 0 0.0.0.0:162 0.0.0.0:*
6216/snmptrapd
root 6216 2076 0 10:43 ? 00:00:00 /usr/sbin/snmptrapd -Lsd
-p /var/run/snmptrapd.pid
a 6493 2667 0 11:47 pts/8 00:00:00 grep --color=auto snmptrapd
Is there any way of solving this issue? I have googled a lot and stuck on
this for days, any help will be very much appreciated.
Thanks a lot in advance!!
Pushpa Thimmaiah
2017-05-17 10:00:59 UTC
Permalink
Hi Riva,

There is already a snmptrapdaemon running with pid '6216' , stop the same
and then run 'sudo snmptrapd -f -Lo -c snmptrapd.conf'

Regards,
Pushpa.T
Post by riva riv
Hi Experts,
I am trying to receive a trap generated by a cisco router on my VM- Ubuntu
14.04. I can do a snmwalk so I guess snmp is working fine but I am not able
to receive the traps generated by router on my VM.
* snmpd is running
* snmptrapd is running
Here is what I have inside files-
/etc/default/snmpd-
export MIBS=
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c
/etc/snmp/snmpd.conf'
TRAPDRUN=yes
# snmptrapd options (use syslog).
TRAPDOPTS='-n -On -t -Lsd -p /var/run/snmptrapd.pid'
/etc/snmp/-
snmpd.conf-
rocommunity public
snmptrapd.conf-
disableAuthorization yes
snmp.conf-
The command I am running for viewing the traps on VM-
couldn't open udp:162 -- errno 98 ("Address already in use")
I am confused since the port is being used by snmptrap itself-
snmp-trap 162/tcp snmptrap # Traps for SNMP
snmp-trap 162/udp snmptrap
udp 0 0 0.0.0.0:162 0.0.0.0:*
6216/snmptrapd
root 6216 2076 0 10:43 ? 00:00:00 /usr/sbin/snmptrapd -Lsd
-p /var/run/snmptrapd.pid
a 6493 2667 0 11:47 pts/8 00:00:00 grep --color=auto snmptrapd
Is there any way of solving this issue? I have googled a lot and stuck on
this for days, any help will be very much appreciated.
Thanks a lot in advance!!
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-users mailing list
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
riva riv
2017-05-17 11:02:13 UTC
Permalink
Hi Pushpa,

Thanks a lot. That was the issue. I killed the process and when I sent the
traps via windows CMD, they were visible.

On Wed, May 17, 2017 at 3:30 PM, Pushpa Thimmaiah <
Post by Pushpa Thimmaiah
Hi Riva,
There is already a snmptrapdaemon running with pid '6216' , stop the same
and then run 'sudo snmptrapd -f -Lo -c snmptrapd.conf'
Regards,
Pushpa.T
Post by riva riv
Hi Experts,
I am trying to receive a trap generated by a cisco router on my VM-
Ubuntu 14.04. I can do a snmwalk so I guess snmp is working fine but I am
not able to receive the traps generated by router on my VM.
* snmpd is running
* snmptrapd is running
Here is what I have inside files-
/etc/default/snmpd-
export MIBS=
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c
/etc/snmp/snmpd.conf'
TRAPDRUN=yes
# snmptrapd options (use syslog).
TRAPDOPTS='-n -On -t -Lsd -p /var/run/snmptrapd.pid'
/etc/snmp/-
snmpd.conf-
rocommunity public
snmptrapd.conf-
disableAuthorization yes
snmp.conf-
The command I am running for viewing the traps on VM-
couldn't open udp:162 -- errno 98 ("Address already in use")
I am confused since the port is being used by snmptrap itself-
snmp-trap 162/tcp snmptrap # Traps for SNMP
snmp-trap 162/udp snmptrap
udp 0 0 0.0.0.0:162 0.0.0.0:*
6216/snmptrapd
root 6216 2076 0 10:43 ? 00:00:00 /usr/sbin/snmptrapd
-Lsd -p /var/run/snmptrapd.pid
a 6493 2667 0 11:47 pts/8 00:00:00 grep --color=auto snmptrapd
Is there any way of solving this issue? I have googled a lot and stuck on
this for days, any help will be very much appreciated.
Thanks a lot in advance!!
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-users mailing list
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
riva riv
2017-05-17 06:56:30 UTC
Permalink
Hi Experts,

I am trying to receive a trap generated by a cisco router on my VM- Ubuntu
14.04. I can do a snmwalk so I guess snmp is working fine but I am not able
to receive the traps generated by router on my VM.

***@ubuntu:~$ sudo /etc/init.d/snmpd restart
* Restarting network management services:


***@ubuntu:~$ sudo /etc/init.d/snmpd status
* snmpd is running
* snmptrapd is running

Here is what I have inside files-

/etc/default/snmpd-
export MIBS=
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c
/etc/snmp/snmpd.conf'
TRAPDRUN=yes
# snmptrapd options (use syslog).
TRAPDOPTS='-n -On -t -Lsd -p /var/run/snmptrapd.pid'

/etc/snmp/-

snmpd.conf-
rocommunity public

snmptrapd.conf-
disableAuthorization yes

snmp.conf-
mibs:

The command I am running for viewing the traps on VM-

***@ubuntu:/etc/snmp$ sudo snmptrapd -f -Lo -c snmptrapd.conf
couldn't open udp:162 -- errno 98 ("Address already in use")

I am confused since the port is being used by snmptrap itself-

***@ubuntu:~$ cat /etc/services|grep 162
snmp-trap 162/tcp snmptrap # Traps for SNMP
snmp-trap 162/udp snmptrap
***@ubuntu:~$ sudo netstat -lnp| grep 162
udp 0 0 0.0.0.0:162 0.0.0.0:*
6216/snmptrapd
***@ubuntu:~$ ps -ef | grep snmptrapd
root 6216 2076 0 10:43 ? 00:00:00 /usr/sbin/snmptrapd -Lsd
-p /var/run/snmptrapd.pid
a 6493 2667 0 11:47 pts/8 00:00:00 grep --color=auto snmptrapd

Is there any way of solving this issue? I have googled a lot and stuck on
this for days, any help will be very much appreciated.
Thanks a lot in advance!!

Loading...