Fixing '--More--' Trap: CLI Navigation on HPE & Ruckus Devices


working with HPE or Ruckus networking devices through CLI, you've likely encountered a '--More--'
prompt. this typically appears when the output of a command exceeds the visible terminal screen, pausing the display until you press a key to continue.
if you're a network engineer, the '--More--'
prompt is bearable- just another minor annoyance. But if you're a network automation engineer, it's downright unbearable. pagination breaks automation workflows causing scripts to hang or fail or produce partially correct output. when scripts are running, stopping for user input isn't an ideal situation.
-- How To Fix It '--More--'
prompt (what worked for me) --
although there are several ways to deal with '--More--'
prompt, from using terminal length commands to modifying device configs or screen settings. But in this post, i will share with you what actually worked for me-both the CLI commands that solved the issue and python code that i used in my automation scripts.
To automate interaction with these devices and bypass the '--More--'
prompt, i used Netmiko - a powerful python library built for SSH automation with network devices.
Below are the scripts I used for HPE and Ruckus devices.
on HPE Device:
command that i used : screen-length 1000
This sets the terminal screen length to 1000 lines, which was enough to show the full configuration in my case.
π Note: My HPE device had a relatively small configuration, so this worked well. If your config is larger and still gets cut off, you may need to increase the value further or use screen-length disable
(if your device supports it) to completely turn off pagination.
script :
def execute_commands_single_session_hpe(host, username, password, commands):
device = {
"device_type": "hp_procurve",
"host": host,
"username": username,
"password": password,
"secret": password
}
results = {}
try:
print(f"π Connecting to {host} as {username}...")
with ConnectHandler(**device) as net_connect:
print("β
Connection successful!")
res = net_connect.send_command_timing('enable')
if "User Name:" in res:
res = net_connect.send_command_timing(username)
if "Password" in res:
res = net_connect.send_command_timing(password)
net_connect.send_command_timing("screen-length 1000")
for command in commands:
print(f"π Sending command: {command}")
output = net_connect.send_command_timing(command)
print(f"π Command Output:\n{output}")
results[command] = {"output": output, "error": ""}
except Exception as e:
for command in commands:
results[command] = {"output": "", "error": "Not Executed!!!"}
print(f"β Unexpected Error: {e}")
return results
on Ruckus Device:
command that i used : skip-page-display
Script :
def execute_commands_single_session_ruckus(host, username, password, commands):
device = {
"device_type": "ruckus_fastiron",
"host": host,
"username": username,
"password": password,
"secret": password,
}
results = {}
try:
print(f"π Connecting to {host} as {username}...")
with ConnectHandler(**device) as net_connect:
print("β
Connection successful!")
if net_connect.check_enable_mode():
print("π Already in enable mode.")
else:
print("π Entering enable mode...")
net_connect.enable()
net_connect.send_command("skip-page-display")
for command in commands:
print(f"π Sending command: {command}")
output = net_connect.send_command(command)
print(f"π Command Output:\n{output}")
results[command] = {"output": output, "error": ""}
except Exception as e:
for command in commands:
results[command] = {"output": "", "error": "Not Executed!!!"}
print(f"β Unexpected Error: {e}")
return results
In Conclusion
This approach worked well for me in handling the --More--
prompt on HPE and Ruckus devices, but every network environment is different. Itβs possible that your setup may require a different solution or additional tweaks.
Thank you for taking the time to read this post. I hope it helps you in your own automation journey!
Subscribe to my newsletter
Read articles from Rahul Makkar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
