Use Digidevice.cli To Execute Cli Commands - Digi IX10 User Manual

Hide thumbs Also See for IX10:
Table of Contents

Advertisement

Applications

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
show system
1. Log into the IX10 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.10 (default, Jan 31 2020, 08:45:19)
[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
Serial Number
SKU
Hostname
MAC
Hardware Version
Firmware Version
Alt. Firmware Version
Bootloader Version
Current Time
CPU
Uptime
(541317s)
Temperature
>>>
5. Use Ctrl-D to exit the Python session. You can also exit the session using exit() or quit().
IX10 User Guide
command with the cli module:
: Digi IX10
: IX10-000065
: IX10
: IX10
: DF:DD:E2:AE:21:18
: 50001947-01 1P
: 20.11.32.138
: 20.11.32.138
: 19.7.23.0-15f936e0ed
: Wed, 2 Dec 2020 8:44:23 +0000
: 1.4%
: 6 days, 6 hours, 21 minutes, 57 seconds
: 40C
Digidevice module
341

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents