Script Server Reference¶
This page describes the Script Server servlet: its HTTP interface for invoking OneClickExt scripts from a browser or external system, and its configuration properties.
Invoking scripts via HTTP¶
Scripts are invoked by sending an HTTP request to the servlet:
http://<host>:<port>/sl/server?scriptname=<name>[&<parameter>=<value>]...
URL parameters¶
| Parameter | Description | Required |
|---|---|---|
scriptname |
Script identifier, as defined in the properties file | Yes |
username |
User account for permission checks (defaults to the OS user) | No |
iplist |
Path to a device list file on the server — one IP or DNS name per line, # for comments |
No |
eiplist |
Same as iplist, but opens the file in an editor window first so the user can modify it |
No |
iplist=input |
Opens an editor window for the user to enter the device list manually | No |
<name>=<value> |
Any custom parameter, referenced in the script config via .urlparam: <name> |
No |
Output history¶
If output history is enabled, previous script runs can be reviewed at:
http://<host>:<port>/sl/runner/history
Configuration properties¶
Connection to scriptserver daemon¶
sl.rmi.port: <port>
sl.rmi.host: <localhost or hostname>
Syslog settings¶
The script server can send a syslog when starting and after finishing a script. A template for the message can be specified. Multiple destinations are supported.
Syslog can be enabled per syslog, configured with the script.
Syslog destination and source¶
sl.syslog.destinations: <host:port> ...
sl.syslog.source: <hostname>
Syslog Format Template¶
Syslogs are sent according to RFC 3164. The template supports the following variables:
| Name | Description |
|---|---|
%PRI% |
Script specific, defined with the script |
%TS% |
start/stop time |
%SOURCE% |
syslog source hostname (sl.syslog.source) |
%SCRIPT% |
script name |
%USER% |
authenticated user |
%DEVCOUNT% |
number of devices |
Format Examples:
sl.syslog.format.start: <%PRI%>%TS% %SOURCE% started script %SCRIPT% by user %USER% with %DEVCOUNT% devices
sl.syslog.format.end: <%PRI%>%TS% %SOURCE% completed script %SCRIPT% started by user %USER% with %DEVCOUNT% devices
Output history¶
The output of the scripts can be viewed later in the output history.
- enable history
sl.output.history.enable: true
- keep one day or until tomcat restart
sl.output.history.clean: 86400