Skip to main content

Pandora FMS Configuration: Creating an Alert Command

DescargueDownload desdethe el marketplace de pandorafms  el CLI yfrom descomprima en el servidorthe Pandora FMS marketplace and unzip it on the Pandora FMS server (lathe ubicaciónrecommended recomendadalocation esis /usr/share/pandora_server/util/pandora-msteams-workflow oor cualquierany otraother dondewhere el servidorthe Pandora FMS tengaserver derechohas deread lecturaand yexecute ejecución)permissions).Debe 

ParámetrosScript delParameters

Script

ParámetroParameter (Corto)Short) ParámetroParameter (Largo)Long) DescripciónDescription RequeridoRequired ValorDefault por defectoValue
`-uu` `--urlurl` URL del**Teams Webhook de TeamsURL**. GeneradaGenerated porby el flujo dethe Power Automate.Automate flow. **Yes** -
`-dd` `--datadata` Datos**Alert dedata** lain alerta`key=value` enformat formatoseparated clave=valorby separados por comas.commas. **Yes** -
`-tt` `--alert_tittlealert_tittle` TítuloMain principaltitle quethat apareceráwill enappear laon tarjeta.the card. No `PandoraFMS alert firedfired`
`-DD` `--alert_descalert_desc` DescripciónDescription oor textoadditional adicionalalert de la alerta.text. No `Alert FiredFired`
- `--imageimage` URL deof lathe imagenimage queto sebe mostrarádisplayed enon lathe tarjeta.card. No Logo de Pandora FMS Logo
- `--image_sizeimage_size` TamañoImage de la imagensize (Small`Small`, Medium`Medium`, Large`Large`, Stretch`Stretch`). No Medium`Medium`
- `--buttonbutton` URL ato lawhich quethe redirigiráaction elbutton botónwill de acción.redirect. No `https://pandorafms.comcom`
- `--button_descbutton_desc` TextoText quethat sewill mostrarábe dentrodisplayed delinside botón.the button. No `Open web consoleconsole`

EjemplosUsage de UsoExamples

1. EjemploBasic BásicoExample

EnvíoSending de una alertaa simple conalert loswith datosthe mínimosminimum obligatorios:required data:

./pandora-msteams-workflow \
  --url "https://tu-your-webhook-url" \
  --data "Agent=Server_Web_01,Module=CPU_Load,Status=Critical"

image.pngimage.png

2. EjemploFull completoExample conwith personalizaciónCustomization

PersonalizandoCustomizing elthe título,title, ladescription, descripción,button, eland botónimage y el tamaño de la imagen:size:

./pandora-msteams-workflow \
  --url "https://tu-your-webhook-url" \
  --data "Hostname=DB-Server-05,IP=10.0.0.50,Error=MySQL service is down" \
  --alert_tittle "CRITICAL: Database Failure" \
  --alert_desc "The database service has stopped responding. Please check immediately." \
  --image "https://img.icons8.com/color/96/error.png" \
  --image_size "Large" \
  --button "https://tu-consola-pandora.your-pandora-console.com/index.php?sec=estado&sec2=lista_agentes" \
  --button_desc "Open PandoraFMS Console"

image.pngimage.png



FuncionamientoInternal internoOperation delof Parámetro --data

El parámetrothe --data procesaParameter una

The cadena--data deparameter textoprocesses ya latext conviertestring enand unaconverts listait deinto a list of "Facts" (hechos)within dentrothe de laTeams Adaptive Card de Teams.Card.

  • FormatoCorrect correcto:format: Nombre=Valor,OtroNombre=OtroValorName=Value,OtherName=OtherValue
  • Nota:Note: EvitaAvoid usarusing comascommas (,) oor signosequals de igualsigns (=) dentrowithin devalues, losas valores, ya que elthe script losuses usathem comoas delimitadores.delimiters.

< ANTERIORPREVIOUS SIGUIENTENEXT >