Question

Is there a way to have NB run CLI in privilege mode?

  • 25 April 2023
  • 3 replies
  • 73 views

Userlevel 1

I am trying the following command:  “show platform hardware fed active fwd-asic resources tcam utilization” on cisco 9000 series switches.  The problem is it is a command that is used in the enable mode, but NB treats it like a user. Is there a way to have NB setup cli commands in enable mode? I understand its not normal commands like show run or show log, but for the commands that are needing this privilege mode is there a way to set NB to use the proper mode?


3 replies

Userlevel 2
Badge +1

Hi @ec485n  Logically, NB executes the commands in non-pri mode first, if fails, then will execute it in priv mode.  But if NB “thinks” the command is executed successfully in non-pri mode, it will not go to the priv mode. 

NB will check the following keywords in the first 180 chars of the show command output, if any keywords are in the output, it considers failed, then go to pri mode. Otherwise, it thinks it’s a success, won’t execute it in the pri mode. 

So may need to adjust the keywords or check range(fist 180).

 

Thanks,

Gerry

 

Userlevel 1

Thank you. It looks like it should work, but NB treats it as user instead of enable mode: 

 

switch1>$rm hardware fed switch 1 fwd-asic resource tcam utilization
show platform hardware fed switch 1 fwd-asic resource tcam utilization
      ^
% Invalid input detected at '^' marker.

 

 

 

 

 

Userlevel 2
Badge +1

@ec485n  This command is a little big, the “Invalid” keyword is not in the first 180 chars, so Netbrain considers it as successful. Please try to change the 180 to 230 to give a try.

 

  1. Enable Debug. System Management page>Advanced Settings.
  1. Go to Driver and change it to 230.
  1. Try to retrieve the cmd again to see if it works.

See test results below:

 

2023-04-26 15:24:17 Begin data retrieving task via Worker WIN-QGGLHBCBCD4(pid: 22252)
2023-04-26 15:24:17 Prepare retrieving command.
2023-04-26 15:24:18 Telnet to device y.y.y.y via FS1(x.x.x.x)
2023-04-26 15:24:18 Telnet to device y.y.y.y successfully via FS1(x.x.x.x)
2023-04-26 15:24:18 Return from Device:[ Username:]
2023-04-26 15:24:18 Sending Username:******
2023-04-26 15:24:18 Return from Device:[ Password:]
2023-04-26 15:24:18 Sending Password:******
2023-04-26 15:24:19 Return from Device:[BJ_L2_Core_3>]
2023-04-26 15:24:19 Sending "terminal length 0" command
2023-04-26 15:24:19 Return from Device:[BJ_L2_Core_3>]
2023-04-26 15:24:19 Sending "show platform hardware fed switch 1 fwd-asic resource tcam utilization" command
2023-04-26 15:24:19 BJ_L2_Core_3>show platform hardware fed switch 1 fwd-asic resource tcam utilization
                           ^
% Invalid input detected at '^' marker.

2023-04-26 15:24:19 Sending "enable" command
2023-04-26 15:24:19 Return from Device:[ Password:]
2023-04-26 15:24:19 Sending Enable Password:******
2023-04-26 15:24:20 Return from Device:[BJ_L2_Core_3#]
2023-04-26 15:24:20 Sending "enable" command
2023-04-26 15:24:20 Return from Device:[BJ_L2_Core_3#]
2023-04-26 15:24:20 Sending "terminal length 0" command
2023-04-26 15:24:20 Return from Device:[BJ_L2_Core_3#]
2023-04-26 15:24:20 Sending "show platform hardware fed switch 1 fwd-asic resource tcam utilization" command
2023-04-26 15:24:20 BJ_L2_Core_3#show platform hardware fed switch 1 fwd-asic resource tcam utilization
                           ^
% Invalid input detected at '^' marker.

2023-04-26 15:24:20 The task was done and turns the session state to idle.
2023-04-26 15:24:20 Finished data retrieving task
 

Once it works, i suggset to open a case to Netbrain Support with license ID as we need to record the change in the KC so that it won’t be lost in future upgrade. 

Reply


Community |  Ideas

Facebook |  Instagram |  Youtube |  Twitter |  LinkedIn
Privacy & Security Statement  |  Terms & Conditions |  Impressum  |  UK Modern Slavery Statement