Changing port for WMI SNMP Trap listener

  • Thread starter Thread starter tclaytonluce
  • Start date Start date
T

tclaytonluce

Hi,

Can anyone tell me how to change the default port that WMI listens to
for SNMP traps. By default it is port 162 but I need to change this to
sonething other than that. What I have now is the following and it is
working fine:

WqlEventQuery query = new WqlEventQuery( "Select * From
SnmpV1Notification WITHIN 10" );
ManagementEventWatcher watcher = new ManagementEventWatcher(
"root\\snmp\\myComp", "SELECT * FROM SnmpV1Notification" );
watcher.EventArrived += new EventArrivedEventHandler( HandleEvent );

// Start listening for events
watcher.Start();


Thanks in advance.

Tim
 
From: <[email protected]>

| Hi,
|
| Can anyone tell me how to change the default port that WMI listens to
| for SNMP traps. By default it is port 162 but I need to change this to
| sonething other than that. What I have now is the following and it is
| working fine:
|
| WqlEventQuery query = new WqlEventQuery( "Select * From
| SnmpV1Notification WITHIN 10" );
| ManagementEventWatcher watcher = new ManagementEventWatcher(
| "root\\snmp\\myComp", "SELECT * FROM SnmpV1Notification" );
| watcher.EventArrived += new EventArrivedEventHandler( HandleEvent );
|
| // Start listening for events
| watcher.Start();
|
| Thanks in advance.
|
| Tim

You shouldn't change the SNMP Trap receiver port (even if you could) because all the SNMP
compliant devices will still send SNMP Trap Messages to UDP port 162. The SNMP Communities
will still communicate via UDP port 161.
 
That may be true, but I have a scenario where there needs to be 2 SNMP
trap receivers on the same server. The first uses the traditional SNMP
trap receiver port to obtain traps. This processes the traps and then
can be configured to forward the processed trap to another trap
receiver. This wouldn't be an issues of the second trap receiver were
on another server. The hitch is that I need a second trap receiver on
this server to get the "forwarded" traps. So back to my basic question
can one define or configure the WMI SNMP ManagementEventWatcher to use
a port other than UDP port 162?

Tim
 
Back
Top