This function allows you to create a script as defined by the script data array.
| Parameter | Type | Optional | Description | Details |
|---|---|---|---|---|
| script data | array or object | Array of Script objects or a single object | scriptid shouldn't be specified | |
| Parameter | Description |
|---|---|
| result | Operation successful. Result will contain array of created Script IDs. scriptid are assigned to each Script object |
| error | In case of any errors |
Create new script for all hosts and host groups:
{ "jsonrpc":"2.0", "method":"script.create", "params":{ "name":"Ping", "command":"\/bin\/ping -c 3 {HOST.CONN}", "host_access":"2", "usrgrpid":"0", "groupid":"0" }, "auth":"038e1d7b1735c6a5436ee9eae095879e", "id":2 }Script created successfully:
Script already exists: