Applications
Digidevice module
TX54 User Guide
687
Use digidevice.cli to execute CLI commands
Use the
digidevice.cli
Python module to issue CLI commands from Python to retrieve status and
statistical information about the device.
For example, to display the system status and statistics by using an interactive Python session, use
the
command with the
cli
module:
1. Log into the TX54 command line as a user with shell access.
Depending on your device configuration, you may be presented with an
Access selection
menu
. Type
shell
to access the device shell.
2. At the shell prompt, use the
python
command with no parameters to enter an interactive
Python session:
# python
Python 3.6.13 (default, May
9 2021, 22:49:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
3. Import the
cli
submodule:
>>> from digidevice import cli
>>>
4. Execute a CLI command using the
cli.execute(
command
)
function. For example, to print the
system status and statistics to stdout using the
show system
command:
>>> response = cli.execute("show system")
>>>
>>> print (response)
Model
: Digi TX54
Serial Number
: TX54-000065
SKU
: TX54
Hostname
: TX54
MAC Address
: DF:DD:E2:AE:21:18
Hardware Version
: 50001947-01 1P
Firmware Version
: 22.2.9.85
Alt. Firmware Version
: 22.2.9.85
Alt. Firmware Build Date : Thurs, 03 March 2022 10:16:23
Bootloader Version
: 19.7.23.0-15f936e0ed
Current Time
: Thurs, 03 March 2022 10:16:23 +0000
CPU
: 1.4%
Uptime
: 6 days, 6 hours, 21 minutes, 57 seconds
(541317s)
Temperature
: 40C
>>>
5. Use
Ctrl-D
to exit the Python session. You can also exit the session using
exit()
or
quit()
.
Summary of Contents for TX54
Page 1: ...TX54 User Guide Firmware version 22 2 ...
Page 190: ...Interfaces Bridging TX54 User Guide 190 ...
Page 293: ...Hotspot Hotspot configuration TX54 User Guide 293 ...
Page 332: ...Hotspot Show hotspot status and statistics TX54 User Guide 332 ...
Page 584: ...Services Simple Network Management Protocol SNMP TX54 User Guide 584 4 Click Download ...