# Parámetros específicos del plugin

En esta sección describiremos todos los parámetros opcionales del plug-in, si los tiene, todas las combinaciones y tipo de ejecuciones posibles que sean relevantes.

##### Ejemplo: Continuamos con el conector de Discord en este ejemplo

**Parámetros opcionales**

<span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Como podemos ver, aparte de los datos serializados y la url tenemos varios parámetros opcionales, algunos son muy simples y autoexplicativos como el nombre del autor, el título, la descripción de la alerta o footer.</span>

<span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Otros son un poco menos intuitivos, como la configuración de la gráfica, así que haremos un pequeño ejemplo de una ejecución con los parámetros más relevantes. </span>

<span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Descripción de los parámetros opcionales:</span>

<table border="1" id="bkmrk-par%C3%A1metro-descripci%C3%B3" style="border-collapse: collapse; width: 100%; height: 360px;"><tbody><tr style="height: 35px;"><td style="width: 44.074%; height: 35px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Parámetro</span>**</td><td style="width: 55.926%; height: 35px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Descripción</span>

</td></tr><tr style="height: 35px;"><td style="width: 44.074%; height: 35px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-h, --help </span>**</td><td style="width: 55.926%; height: 35px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Muestra la ayuda.</span>

</td></tr><tr style="height: 28px;"><td style="width: 44.074%; height: 28px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-d DATA, --data </span>**</td><td style="width: 55.926%; height: 28px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Los datos a enviar en pares clave=valor Ej: test=5,house=2</span></td></tr><tr style="height: 28px;"><td style="width: 44.074%; height: 28px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-u URL, --url </span>**</td><td style="width: 55.926%; height: 28px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">URL Discord webhook URL</span></td></tr><tr style="height: 28px;"><td style="width: 44.074%; height: 28px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-t ALERT\_TITTLE, --alert\_tittle ALERT\_TITTLE</span>**</td><td style="width: 55.926%; height: 28px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Título de la alerta</span></td></tr><tr style="height: 28px;"><td style="width: 44.074%; height: 28px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-D ALERT\_DESC, --alert\_desc ALERT\_DESC</span>**</td><td style="width: 55.926%; height: 28px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Descripción de la alerta</span></td></tr><tr style="height: 28px;"><td style="width: 44.074%; height: 28px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-m MESSAGE, --message </span>**</td><td style="width: 55.926%; height: 28px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cuerpo del mensaje</span></td></tr><tr style="height: 28px;"><td style="width: 44.074%; height: 28px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-T TITTLE\_COLOR, --tittle\_color TITTLE\_COLOR </span>**</td><td style="width: 55.926%; height: 28px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Color del título de la alerta en hexadecimal EX: 53e514</span></td></tr><tr style="height: 28px;"><td style="width: 44.074%; height: 28px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-A AUTHOR, --author AUTHOR </span>**</td><td style="width: 55.926%; height: 28px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Nombre del autor (por defecto PandoraFMS)</span></td></tr><tr style="height: 28px;"><td style="width: 44.074%; height: 28px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-F FOOTER, --footer FOOTER</span>**</td><td style="width: 55.926%; height: 28px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Footer personalizado</span></td></tr><tr style="height: 28px;"><td style="width: 44.074%; height: 28px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">--api\_conf API\_CONF</span>**</td><td style="width: 55.926%; height: 28px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Parametros configuracion de la api en formato clave valor. </span>

<span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Ej:</span><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"user=admin,pass=pandora,api\_pass=1234,api\_url=http://test.artica.es/pandora\_console/include/api.php"</span>

</td></tr><tr style="height: 28px;"><td style="width: 44.074%; height: 28px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">--module\_graph MODULE\_GRAPH</span>**</td><td style="width: 55.926%; height: 28px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Generar una gráfica para enviar usando conexión a la api deben pasarse los parametros module\_id y intervalo en formato clave valor. EX "module\_id=55,interval=3600"</span></td></tr><tr style="height: 10px;"><td style="width: 44.074%; height: 10px;">**<span style="font-size: 11pt; font-family: 'Open Sans', sans-serif; color: #767171; background-color: transparent; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">--tmp\_dir TMP\_DIR</span>**</td><td style="width: 55.926%; height: 10px;"><span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Directorio temporal donde se almacenaran las gráficas para su envio.</span></td></tr></tbody></table>

<span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Al descomprimir el paquete hay un fichero test-exec.txt en el que tendremos una ejecución de ejemplo utilizando todos los parámetros:</span>

```
python3 pandora_discord_cli.py -d "Agent=Server22,Module=test_module,Group=Servers,State=Critical,Data=22,Timestamp=2020-11-04 11:14:00" \
-u https://discord.com/api/webhooks/702868786843353179/YI1LOUzC64EcYcpPVB_ \
--tittle_color ed2512 \
--footer "PandoraFMS Alert" \
-A "Sauron Systems" \
--author_icon_url "https://pandorafms.com/wp-content/uploads/2019/04/software-de-monitorizacion-pandorafms-logo.png" \
-m "We have bad news for you. Something is on CRITICAL status 2" \
--author_url https://pandorafms.com/ \
-D "Module test is going to critical" \
--thumb https://pandorafms.com/images/alerta_roja.png \
--avatar_url https://pandorafms.com/images/alerta_roja.png \
--api_conf "user=admin,pass=pandora,api_pass=pandora,api_url=http://192.168.80.222/pandora_console/include/api.php" \
--module_graph "module_id=6266, interval=3600" \
--tmp_dir /tmp
```

<span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="border: none; display: inline-block; overflow: hidden; width: 650px; height: 182px;">![](https://lh3.googleusercontent.com/AO3wxFKbHLC2PFEneUbEPkt2EDtc5zpA069-qYABlRoXLAevOtjpDZs2riX5ng4J-eqcGth0oee_TxnIRN_PN3UovvRW0226exhiudGT6JH6vApSRIxcjzu85E56jBeZ-CcLMNJb)</span></span>

<span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">El resultado de esta ejecución será ligeramente diferente, contendrá más información, indicándonos que tenemos la API configurada y que la gráfica se ha generado con éxito. </span>

<span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Si vemos el mensaje recibido en Discord:</span>

<span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="border: none; display: inline-block; overflow: hidden; width: 624px; height: 375px;">![](https://lh3.googleusercontent.com/-R9_VkWPeIu8H6tAYJZRpvX14n3ODRO4w9ONeUjGbMlerXFSz6Tt_N2bYM503U2Yzcyx0dDvmv2m_sh4UhSIzHiO8VQSjoi0aLJWJ4RkQOp9-Bb0EMYvt0XjIrzhqfJHsUiKgtxZ)</span></span>

<span style="font-weight: normal;"> </span>

<span style="font-size: 11pt; font-family: 'Open Sans',sans-serif; color: #767171; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Veremos que es similar al anterior pero con una imagen de usuario personalizada, el logo de alerta crítica, un color de borde personalizado, título y footer y la gráfica del módulo seleccionado obtenido de la API de Pandora, simplemente pasando los parámetros correspondientes en la ejecución.</span>