Applications
Start an interactive Python session
IX14 User Guide
462
a. Log into the IX14 command line as a user with Admin access.
Depending on your device configuration, you may be presented with an
Access selection
menu
. Type
admin
to access the Admin CLI.
b. At the command line, use the
command to upload the Python application script to the
IX14 device:
> scp host
hostname-or-ip
user
username
remote
remote-path
local
local-path
to local
where:
n
hostname-or-ip
is the hostname or ip address of the remote host.
n
username
is the name of the user on the remote host.
n
remote-path
is the path and filename of the file on the remote host that will be
copied to the IX14 device.
n
local-path
is the location on the IX14 device where the copied file will be placed.
For example:
To upload a script from a remote host with an IP address of 192.168.4.1 to the
/etc/config/scripts directory on the IX14 device, issue the following command:
> scp host 192.168.4.1 user admin remote /home/admin/bin/test.py local
/etc/config/scripts/ to local
[email protected]'s password: adminpwd
test.py
100%
36MB
11.1MB/s
00:03
>
c. Type
exit
to exit the Admin CLI.
Depending on your device configuration, you may be presented with an
Access selection
menu
. Type
quit
to disconnect from the device.
Note
You can also create scripts by using the
vi
command when logged in with shell access.
2. Log into the IX14 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.
3. Use the
python
command to run the Python application. In the following example, the Python
application,
test.py
, takes 3 parameters:
120
,
ports
and
storage
:
# python /etc/config/scripts/test.py 120 ports storage
Start an interactive Python session
Use the
python
command without specifying any parameters to start an interactive Python session.
The Python session operates interactively using REPL (Read Evaluate Print Loop) to allow you to write
Python code on the command line.
Note
The Python interactive session is not available from the Admin CLI. You must access the device
shell in order to run Python applications from the command line. See
for
information about configuring authentication groups that include shell access.
Содержание IX14
Страница 1: ...IX14 User Guide Firmware version 22 2 ...
Страница 45: ...Configuration and management Exit the command line interface IX14 User Guide 45 Type q or quit to exit ...
Страница 515: ...Monitoring This chapter contains the following topics intelliFlow 516 Configure NetFlow Probe 523 IX14 User Guide 515 ...
Страница 756: ...Routing Virtual Router Redundancy Protocol VRRP IX14 User Guide 756 ...
Страница 803: ...Command line interface Command line reference IX14 User Guide 803 Parameters None ...
Страница 812: ...Command line interface Command line reference IX14 User Guide 812 reboot Reboot the system Parameters None ...