run service-probe pythonNEW!

run service-probe instance_id python script_file

Description

Executes a Python script file within the network context of a Service Probe.

Syntax Description

instance_idIdentifier of the Service Probe in whose context the script runs. Valid range is 1–9999.
script_fileName of the Python script file to execute.

Usage Guidelines

The script executes inside the probe's network namespace, using the probe's IP configuration, routing, and DNS settings. Environment variables describing the probe's current state are automatically set and available to the script.

Output (stdout and stderr combined) is returned upon completion, up to a maximum of 7,000 bytes. If output exceeds this limit, it is truncated and a truncation indicator is shown.

This command runs asynchronously and is subject to a default timeout of 15 seconds. Scripts run as the admin user and are subject to the resource limits of the SvcProbe cgroup (5% CPU, 5% memory). Only accounts with admin privileges can run this command.

Example

The following command runs the script user.py within Service Probe 1:

run service-probe 1 python user.py

Sample output:

Exit Status: 0
...output follows:
Username: admin, User ID: 1001
Group Name: admin, Group ID: 1001

History

This command was first available in version 33.6.1.

Platform Availability

All platforms.