Os objetos a seguir est?o diretamente relacionados ¨¤ API script
.
The script object has the following properties.
Property | Type | Description |
---|---|---|
scriptid | string | (readonly) ID of the script. |
name (required) |
string | Name of the script. |
type (required) |
integer | Script type. Possible values: 0 - Script; 1 - IPMI; 2 - SSH; 3 - Telnet; 5 - (default) Webhook. |
command (required) |
string | Command to run. |
scope | integer | Script scope. Possible values: 1 - default action operation; 2 - manual host action; 4 - manual event action. |
execute_on | integer | Where to run the script. Used if type is 0 (script).Possible values: 0 - run on Áú»¢¶Ä²© agent; 1 - run on Áú»¢¶Ä²© server; 2 - (default) run on Áú»¢¶Ä²© server (proxy). |
menu_path | string | Folders separated by slash that form a menu like navigation in frontend when clicked on host or event. Used if scope is 2 or 4 . |
authtype | integer | Authentication method used for SSH script type. Used if type is 2 .Possible values: 0 - password; 1 - public key. |
username | string | User name used for authentication. Required if type is 2 or 3 . |
password | string | Password used for SSH scripts with password authentication and Telnet scripts. Used if type is 2 and authtype is 0 or type is 3 . |
publickey | string | Name of the public key file used for SSH scripts with public key authentication. Required if type is 2 and authtype is 1 . |
privatekey | string | Name of the private key file used for SSH scripts with public key authentication. Required if type is 2 and authtype is 1 . |
port | string | Port number used for SSH and Telnet scripts. Used if type is 2 or 3 . |
groupid | string | ID of the host group that the script can be run on. If set to 0, the script will be available on all host groups. Default: 0. |
usrgrpid | string | ID of the user group that will be allowed to run the script. If set to 0, the script will be available for all user groups. Used if scope is 2 or 4 .Default: 0. |
host_access | integer | Host permissions needed to run the script. Used if scope is 2 or 4 .Possible values: 2 - (default) read; 3 - write. |
O objeto script tem as seguintes propriedades.
Propriedade | Tipo | Descri??o |
---|---|---|
scriptid | string | (somente leitura) ID do script. |
name (requerido) |
string | Nome do script. |
type (requerido) |
integer | Tipo de script. Valores poss¨ªveis: 0 - Script; 1 - IPMI; 2 - SSH; 3 - Telnet; 5 - (padr?o) Webhook. |
command (requerido) |
string | Comando para executar. |
scope | integer | Escopo do script. Valores poss¨ªveis: 1 - opera??o de a??o padr?o; 2 - a??o de host manual; 4 - a??o de evento manual. |
execute_on | integer | Onde executar o script. Usado se type for 0 (script).Valores poss¨ªveis: 0 - executar no agente Áú»¢¶Ä²©; 1 - executar no servidor Áú»¢¶Ä²© ; 2 - (padr?o) roda no servidor Áú»¢¶Ä²© (proxy). |
menu_path | string | Pastas separadas por barra que formam um menu como navega??o no frontend quando clicado no host ou evento. Usado se scope for 2 ou 4 . |
authtype | integer | M¨¦todo de autentica??o usado para o tipo de script SSH. Usado se type for 2 .Valores poss¨ªveis: 0 - senha; 1 - chave p¨²blica. |
username | string | Nome de usu¨¢rio usado para autentica??o. Obrigat¨®rio se type for 2 ou 3 . |
password | string | Senha usada para scripts SSH com autentica??o de senha e scripts Telnet. Usado se type for 2 e authtype for 0 ou type for 3 . |
publickey | string | Nome do arquivo de chave p¨²blica usado para scripts SSH com autentica??o de chave p¨²blica. Obrigat¨®rio se type for 2 e authtype for 1 . |
privatekey | string | Nome do arquivo de chave privada usado para scripts SSH com autentica??o de chave p¨²blica. Obrigat¨®rio se type for 2 e authtype for 1 . |
port | string | N¨²mero da porta usado para scripts SSH e Telnet. Usado se o tipo for 2 ou 3 . |
groupid | string | ID do grupo de hosts no qual o script pode ser executado. Se definido como 0, o script estar¨¢ dispon¨ªvel em todos os grupos de hosts. Padr?o: 0. |
usrgrpid | string | ID do grupo de usu¨¢rios que ter¨¢ permiss?o para executar o script. Se definido como 0, o script estar¨¢ dispon¨ªvel para todos os grupos de usu¨¢rios. Usado se scope for 2 ou 4 .Padr?o: 0. |
host_access | integer | Permiss?es de host necess¨¢rias para executar o script. Usado se scope for 2 ou 4 .Valores poss¨ªveis: 2 - (padr?o) Leitura; 3 - Escrita. |
confirmation | string | Texto pop-up de confirma??o. O pop-up aparecer¨¢ ao tentar executar o script do frontend do Áú»¢¶Ä²©. Usado se scope for 2 ou 4 . |
timeout | string | Tempo limite de execu??o do script do webhook em segundos. Sufixos de tempo s?o suportados, por exemplo 30s, 1m. Obrigat¨®rio se type for 5 .Valores poss¨ªveis: 1-60s Valor padr?o: 30s |
parameters | array | Array de par?metros de entrada do webhook. Usado se type for 5 . |
description | string | Descri??o do script. |
confirmation | string | Confirmation pop up text. The pop up will appear when trying to run the script from the Áú»¢¶Ä²© frontend. Used if scope is 2 or 4 . |
timeout | string | Webhook script execution timeout in seconds. Time suffixes are supported, e.g. 30s, 1m. Required if type is 5 .Possible values: 1-60s Default value: 30s |
parameters | array | Array of webhook input parameters. Used if type is 5 . |
description | string | Description of the script. |
Os par?metros passados ??para o script de webhook quando ele ¨¦ chamado t¨ºm as seguintes propriedades.
Propriedade | Tipo | Descri??o |
---|---|---|
name (requerido) |
string | Nome do par?metro. |
value | string | Valor do par?metro. Suporta macros. |
Informa??es de depura??o do script de webhook executado. O objeto de depura??o tem as seguintes propriedades.
Propriedade | Tipo | Descri??o |
---|---|---|
logs | array | Array de entradas de log. |
ms | string | Dura??o da execu??o do script em milissegundos. |
O objeto de entrada de log tem as seguintes propriedades.
Propriedade | Tipo | Descri??o |
---|---|---|
level | integer | N¨ªvel de Log. |
ms | string | O tempo decorrido em milissegundos desde que o script foi executado antes que a entrada de log fosse adicionada. |
message | string | Mensagem de log. |