Specify port when using snmptrap
Asked Answered
T

1

5

I am trying to specify the port when I am sending a trap via snmptrap. Just in order to test my SNMP receiver I want to send traps to it, but I do not have access to port 162. How do I send the trap to another port?

As I see it the man-page does not describe this option.

(I do not fully understand what the parts of a snmptrap message is either, so if someone feels like explaining that it would be nice to)

Tuttifrutti answered 12/6, 2014 at 12:21 Comment(1)
I assume you're talking about the net-snmp command line tool called "snmptrap".Croupier
C
7

In the net-snmp command line tools, you specify the port number in the host identifier, like so:

192.168.1.12:162

At least, that works on my machine.

I agree that this is not really apparent from the man page of snmptrap, so I understand why you couldn't figure it out. The rest of the format is, however, described in the man page to a somewhat satisfactory extent.

Edit: As was pointed out in the comment, the address format is described on the man page for snmpcmd: http://www.net-snmp.org/docs/man/snmpcmd.html

Croupier answered 13/6, 2014 at 6:37 Comment(1)
Questioner needs to read man-page for 'snmpcmd' which is for "Options and behaviour common to most of the Net-SNMP command-line tools" E.g. hostname[:port] is described in there.Bogusz

© 2022 - 2024 — McMap. All rights reserved.