NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
Emeyer
Jun 20, 2019Aspirant
Telnet - Unsolicited Port Status Mesages
Hello There. I am actively monitoring my switch via a telnet/ssh connection. I would like for the switch to report to me, via an unsolicited message to the telnet console, whenever a port link st...
- Jun 21, 2019
Hi
I'm more on the side of schumaku, I'd be interested in what automation system that is, sounds much like it attempts reinventing the wheel.
[...] For that, I need the console to tell me when a port state has changed.SNMP traps should do exactly that. Netgear switches of that line support both traps and SNMP get/set/walk request.
Netgear hasn't jumped on the bandwagon of integrating APIs into their switches yet. In the meantime SNMP, while old and rather ugly, is present and working (try finding someone who actually likes SNMP...).
Concerning the MAC Address table: I have tried reading the MAC Address table walking BRIDGE-MIB::dot1dTpFdbAddress but it returned not results when, walking, maybe not implemented by Netgear on M4300? Neither NETGEAR-SWITCHING MIB or Q-BRIDGE-MIB which is what I tried as well. You'd have to find out a manner how to obtain the MAC address table globally.
And also if you want to apply configuration, so long as it is only VLANs, that is something that can be done with a RADIUS server that sends the VLAN and the switch assigns it dynamically. Of course that won't automate the rest of the port configuration.
That said, simply turning on debug console, did not send me the port status messages. Do you know off hand which flags need to be set in order for this to show up with debug console turned on? I do not need persistence as I will configure the console each time my system establishes the console connection.I do have CLI logging enabled which is sent to a syslog mostly for post-mortem. Other than that I only issued "logging console 7" in configure mode then "debug console" in privileged exec mode. Working on a console session that has both debug logging enabled is was definitely not pleasant. See how it spits out outputs in between me entering commands, have fun parsing that correctly while modifying configuration through a remote console programmatically ;-)
(sw-<removed>) (Interface 1/0/1)#shutdown (sw-<removed>) (Interface 1/0/1)# <13>1 <timedate-removed>:51.862Z sw-<removed>-1 CMDLOGGER emWeb - : cmd_logger_api.c(83) 564865 %% CLI:<ip-removed>:<user-removed>:shutdown <15>1 <timedate-removed>:52.109Z sw-<removed>-1 DRIVER bcmLINK.1 - : broad_link.c(83) 564866 %% HAPI LS callback, u 1. p 2 <13>1 <timedate-removed>:52.120Z sw-<removed>-1 TRAPMGR trapTask - : traputil.c(753) 564867 %% Link Down: 1/0/1 [...] no shutdown (sw-<removed>) (Interface 1/0/1)# <13>1 <timedate-removed>:54.918Z sw-<removed>-1 CMDLOGGER emWeb - : cmd_logger_api.c(83) 564869 %% CLI:<ip-removed>:<user-removed>:no shutdown <13>1 <timedate-removed>:56.145Z sw-<removed>-1 TRAPMGR PoE Req - : traputil.c(795) 564870 %% PoE: 1/0/1 power downn [2 other messages] (sw-<removed>) (Config)# <13>1 <timedate-removed>:58.990Z sw-<removed>-1 CMDLOGGER emWeb - : cmd_logger_api.c(83) 564873 %% CLI:<ip-removed>:<user-removed>:exit exit (sw-<removed>) # <13>1 <timedate-removed>:00.952Z sw-<removed>-1 CMDLOGGER emWeb - : cmd_logger_api.c(83) 564874 %% CLI:<ip-removed>:<user-removed>:exit <15>1 <timedate-removed>:01.277Z sw-<removed>-1 DRIVER bcmLINK.1 - : broad_link.c(83) 564875 %% HAPI LS callback, u 1. p 2 <13>1 <timedate-removed>:01.284Z sw-<removed>-1 TRAPMGR trapTask - : traputil.c(753) 564876 %% Link Up: 1/0/1 <13>1 <timedate-removed>:01.365Z sw-<removed>-1 TRAPMGR PoE Req - : traputil.c(795) 564877 %% PoE: 1/0/1 power up
Emeyer
Jun 21, 2019Aspirant
msi I have an automation system that needs to monitor when certain devices are plugged into certain ports, so it can dynamically configure those devices based on location (which port they connected to). This device can open a telnet or ssh connection to the device and then enter commands and parse responses to take action accordingly. So, once I see that a port that I need to monitor has changed states, I will pull the mac-addr-table so I can determine what happened and then setup the appropriate devices.
I can just periodically pull the mac table, but I would prefer to adjust dynamically. For that, I need the console to tell me when a port state has changed.
That said, simply turning on debug console, did not send me the port status messages. Do you know off hand which flags need to be set in order for this to show up with debug console turned on? I do not need persistence as I will configure the console each time my system establishes the console connection.
msi
Jun 21, 2019Luminary
Hi
I'm more on the side of schumaku, I'd be interested in what automation system that is, sounds much like it attempts reinventing the wheel.
[...] For that, I need the console to tell me when a port state has changed.
SNMP traps should do exactly that. Netgear switches of that line support both traps and SNMP get/set/walk request.
Netgear hasn't jumped on the bandwagon of integrating APIs into their switches yet. In the meantime SNMP, while old and rather ugly, is present and working (try finding someone who actually likes SNMP...).
Concerning the MAC Address table: I have tried reading the MAC Address table walking BRIDGE-MIB::dot1dTpFdbAddress but it returned not results when, walking, maybe not implemented by Netgear on M4300? Neither NETGEAR-SWITCHING MIB or Q-BRIDGE-MIB which is what I tried as well. You'd have to find out a manner how to obtain the MAC address table globally.
And also if you want to apply configuration, so long as it is only VLANs, that is something that can be done with a RADIUS server that sends the VLAN and the switch assigns it dynamically. Of course that won't automate the rest of the port configuration.
That said, simply turning on debug console, did not send me the port status messages. Do you know off hand which flags need to be set in order for this to show up with debug console turned on? I do not need persistence as I will configure the console each time my system establishes the console connection.
I do have CLI logging enabled which is sent to a syslog mostly for post-mortem. Other than that I only issued "logging console 7" in configure mode then "debug console" in privileged exec mode. Working on a console session that has both debug logging enabled is was definitely not pleasant. See how it spits out outputs in between me entering commands, have fun parsing that correctly while modifying configuration through a remote console programmatically ;-)
(sw-<removed>) (Interface 1/0/1)#shutdown (sw-<removed>) (Interface 1/0/1)# <13>1 <timedate-removed>:51.862Z sw-<removed>-1 CMDLOGGER emWeb - : cmd_logger_api.c(83) 564865 %% CLI:<ip-removed>:<user-removed>:shutdown <15>1 <timedate-removed>:52.109Z sw-<removed>-1 DRIVER bcmLINK.1 - : broad_link.c(83) 564866 %% HAPI LS callback, u 1. p 2 <13>1 <timedate-removed>:52.120Z sw-<removed>-1 TRAPMGR trapTask - : traputil.c(753) 564867 %% Link Down: 1/0/1 [...] no shutdown (sw-<removed>) (Interface 1/0/1)# <13>1 <timedate-removed>:54.918Z sw-<removed>-1 CMDLOGGER emWeb - : cmd_logger_api.c(83) 564869 %% CLI:<ip-removed>:<user-removed>:no shutdown <13>1 <timedate-removed>:56.145Z sw-<removed>-1 TRAPMGR PoE Req - : traputil.c(795) 564870 %% PoE: 1/0/1 power downn [2 other messages] (sw-<removed>) (Config)# <13>1 <timedate-removed>:58.990Z sw-<removed>-1 CMDLOGGER emWeb - : cmd_logger_api.c(83) 564873 %% CLI:<ip-removed>:<user-removed>:exit exit (sw-<removed>) # <13>1 <timedate-removed>:00.952Z sw-<removed>-1 CMDLOGGER emWeb - : cmd_logger_api.c(83) 564874 %% CLI:<ip-removed>:<user-removed>:exit <15>1 <timedate-removed>:01.277Z sw-<removed>-1 DRIVER bcmLINK.1 - : broad_link.c(83) 564875 %% HAPI LS callback, u 1. p 2 <13>1 <timedate-removed>:01.284Z sw-<removed>-1 TRAPMGR trapTask - : traputil.c(753) 564876 %% Link Up: 1/0/1 <13>1 <timedate-removed>:01.365Z sw-<removed>-1 TRAPMGR PoE Req - : traputil.c(795) 564877 %% PoE: 1/0/1 power up
- EmeyerJun 21, 2019Aspirant
Thank very much!! Turning on logging console (I used 5 instead of 7) give me precisely what I was looking for. I will manage the parsing issues. I am using the Priveleged Exec command "show mac-addr-table" to get a report of which addresses are connected to which ports.
For the interested: the automation system is a Crestron Pro3. It is primarily used in the audio visual industry. This M4300 is a private (completely isolated) AV network switch which hosts AV devices that will not go on the client's corporate LAN, so there is no RADIUS server or any other servers present, for that matter, thus the need for gathering this data directly from a console session. Luckily, my Pro3 will quietly and happily parse through all the less meaningful data and only act upon the relevant mesages that are received -- once my code for that is complete :)
- msiJun 25, 2019Luminary
Thanks or sharing that somewhat weird system. Anyhow, poking at the datasheet of the Crestron Pro3 it seems it it has some sort of SNMP support, but it doesn't say if can be reached over SNMP or that it can program things with SNMP GET / SET commands.
Well, if that is what you have to work with: Sometimes an ugly way to something is better than no way at all. ;-)
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!