Applications
Digidevice module
IX20 User Guide
458
Use digidevice runtime to access the runtime database
Use the
runt
submodule to access and modify the device runtime database.
Read from the runtime database
Use the
keys()
and
get()
methods to read the device configuration:
1. Log into the IX20 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
runt
submodule:
>>> from digidevice import runt
>>>
4. Use
start()
method to open the runtime database:
>>> runt.start()
>>>
5. Display available keys in the runtime database:
>>> print(runt.keys(""))
['advanced', 'drm', 'firmware', 'location', 'manufacture', 'metrics', 'mm',
'network', 'pam', 'serial', 'system']
>>> print(runt.keys("system"))
['boot_count', 'chassis', 'cpu_temp', 'cpu_usage', 'disk', 'load_avg',
'local_time', 'mac', 'mcu', 'model', 'ram', 'serial', 'uptime']
>>> print(runt.get("system.mac"))
00:40:D0:13:35:36
6. Close the runtime database:
>>> runt.stop()
>>>
Modify the runtime database
Use the
set()
method to modify the runtime database:
1. Log into the IX20 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