WARNING: Using the commands below may void your warranty!
Some previous-generation 3Com hardware has a ‘Debug Console’ with interesting features. I have confirmed this to work with 3300XM, 3300SM (debug console 1.4), 4200 and 4912 (debug console 2.0).
It does not work on the recent H3C (4200G, 5500, 7700, etc.) or Accton-based (38(12|24|48) and 3870) hardware. Also not the antique Corebuilder hardware, I have tried 9400.
You can reach it with ‘?d’ (short for ?debug):
Menu options: --------------3Com SuperStack 3 Switch 4900--------------- bridge - Administer bridge-wide parameters feature - Administer system features gettingStarted - Basic device configuration logout - Logout of the Command Line Interface physicalInterface - Administer physical interfaces protocol - Administer protocols security - Administer security system - Administer system-level functions trafficManagement - Administer traffic management Type ? for help -----------------------------------4900 Gigabit (1)--------------------- Select menu option: ?d Debug Console 2.0 'exit' to quit (1) debug 1 />
You can browse over the VFS which contains directories with debug commands.
(1) debug 1 / > dir events 0 r xd - debug radius 0 r xd - debug PDS 0 r xd - debug ... list 0 r x - Outputs registered debug functions u_server 0 r x - Display upgrade server data nistats 0 r x - Display current value of Network Interface statistics API 60593 r xd backup 41981 r xd bin 27609 r xd cli 21532 r xd cs 133 r xd css 2438 r xd debug 15248 xd gifs 81429 r xd gsw 0 r xd hgsw 240 r xd html 89007 r xd index.rhtm 99 r x java 15783 r xd js 45910 r xd layer3 826 r xd tree 10629 r xd Total 165680 (1) debug 2 />
The debug directory contains a number of useful scripts and programs:
(1) debug 1 / > cd debug (1) debug 2 /debug/ > dir smtpDebug 0 r x - SMTP Debug MM_Free 0 r x - Report MM free memory. _pmon.rscr 1233 r x abort.rscr 210 x alias.rscr 251 x cat.rscr 59 x clearPostFailLog.rsc 52 r x cont.rscr 150 x copyport.rscr 242 r x exec.rscr 241 x help.txt 613 r history.rscr 2588 r x initHistory.rscr 178 r x kill.rscr 255 x lic.rscr 564 r x map.rscr 495 r x map_listen.rscr 135 r x mb.rscr 24 x md.rscr 238 x ml.rscr 24 x mw.rscr 24 x next.rscr 40 x pmon.rscr 96 r x postFailure.rscr 735 r x proc.rscr 395 x prof.rscr 3051 r x restart.rscr 133 x sel.rscr 228 x smtp.rscr 1189 r x sprof.rscr 234 x stack.rscr 344 r x step.rscr 40 x stop.rscr 175 x trace.rscr 357 x untrace.rscr 310 x unwatch.rscr 60 x watch.rscr 285 x Total 15248 (1) debug 3 /debug/>
For instance, the history of the box:
(1) debug 2 / > his 3Com SuperStack 3 System Name : 4900 Gigabit Location : Contact : Time Since Reset : 5346 Hrs 22 Mins 5 Seconds Operational Version : 4.21 Hardware Version : 0 Boot Version : 1.00 MAC Address : 00-30-1e-5e-1e-80 Product Number : 3C17700 Serial Number : 7RGV45E1E80 Module Slot 1 : 3C17710 Quad 1000Base-SX module H/w ver: 0.00 No entries in POST Failure log ======================================== Last POST: Passed ======================================== Watchdog handler is RESET Stack dump to serial port is OFF No option available to dump stack data The History Log Id No S/W Rel Reason UpTime SysErr 5 0 Power Unknown 6 0 Power Unknown 7 0 Power Unknown 8 8 Manual Reset (r) 0 Hrs 12 Mins 4 Secs 9 9 4.21 Power (r) Unknown 10 10 4.21 Power (r) Unknown 11 11 4.21 Power (r) Unknown
This shows you all kinds of historical logging from the box that 3Com does not normally expose, this might be useful in debugging strange crashes or other problems.
For instance, it gives this error if you’re adding too many units to a stack. This way you can show an incompetent person was fiddling with your switches:
27 27 2.50 Stack Conflict 0 Hrs 0 Mins 53 Secs Uptime Hours 22336 Reset 26
It’s too bad 3Com hardly if ever logs anything or shows any info like this in the regular interface..
Another useful command is the process monitor:
(2) debug 1 / > pmon on (2) debug 2 / > Calculating RTC Resources...RTC Resource Last 2 Secs (Time=1333773 sec)Cur HWM 0%| | | | | | | | | | |100% Timers :< 0% 0% Sys Process :************< 24% 24% Idle :***< 6% 6% Low :< 0% 0% Med :********************************< 64% 64% High :< 0% 0% Heaps 0%| | | | | | | | | | |100% 200 :*********************< 42% 42% 155 :***********< 22% 22% 220 :*****************< 34% 34% 230 :< 0% 0%RTC Resource Last 2 Secs (Time=1333775 sec)Cur HWM 0%| | | | | | | | | | |100%
This might help you debug issues.
The CLI of your box is available in /cli:
(1) debug 94 / > dir /cli/cmds ?debug.rscr 1390 x bridge 37397 r xd fabric 2945 r xd feature 7134 r xd gettingStarted.rscr 4376 rwx logout.rscr 30 rwx physicalInterface 18001 r xd protocol 60677 r xd security 18191 r xd system 32845 r xd trafficManagement 13051 r xd Total 196037 (1) debug 95 />
Unfortunately, the .rscr scripts are not in text, so I was not able to make sense out of this:
(1) debug 88 /cli/cmds/system/license/ > cat /cli/cmds/system/license/add.rscr ä4°À`[ÿÃ~Enter license Activation Key: [ÿ;Please confirm installation of this license (yes,no)[yes]: [ÿÒ Q IãÚ"b%sà ÿ"À¡âÿÀ Q IèÄ"|"" is not a valid selection. ÿ"c %sà ÿ"À À¡âÿÀ Q»IãÖ"a ÿ¡âÿäáÀÒ Q[ÿÿÀ"b%UÀ [ÿÃ"Àa-( [ÿÄ"à [ÿÅ`[ÿÆ [ÿÄ Gã#.Ä Gè!&ÅÃÆQÿÆ¡ÿÄ¡]؎ˁ[ÿä%3ÀÅ[ÿÿÇ"",generic,AA,stringÀ))[ÿ"Ç+setã*q"c%s ,msg5 ÿ¡âÿÈ"",generic,AA))[ÿ"È+getã/¦"c%s ,msg5 ÿ¡âÿÉ"`"This license is already installed6This license is not valid for any units in this stack.This device does not support this license key.This device does not support this license key.)[ÿÈ Q¡Q¡GÈ Q¡Q¢LMã4"c%s
If you find any more non-obvious neat features, please let me know.
Wonderfull! Excellent stuff, I was able to get access to my switch using this way. BTW, almost every “file” here is a command. for example:
list
cd /vbridge
dir
vbprint meta
and so on, almost any “subfolder” with letter “d” in flags can be explored and executed.