# RabbitMQ

# Introducción

<span style="font-weight: 400;">Este plugin permite obtener datos de monitorización de un entorno de RabbitMQ. </span>

<span style="font-weight: 400;">La información es obtenida vía web a través del API de RabbitMQ, por lo que no es necesario instalar ningún software adicional para su funcionamiento.</span>

**Este plugin está diseñado para funcionar tanto como plugin de servidor como plugin de agente, ofreciendo flexibilidad en su despliegue según tus necesidades de infraestructura y monitorización.**

# Matriz de compatibilidad

<span style="font-weight: 400;">Desarrollado contra:</span>

- <span style="font-weight: 400;">RabbitMQ 3.7.18</span>

# Prerrequisitos

<span style="font-weight: 400;">Se requiere conexión con el API de RabbitMQ desde el equipo donde se lance el plugin.</span>

<span style="font-weight: 400;">Se requiere conexión con el servicio Tentacle asociado a su servidor de Pandora FMS si no se ejecuta como plugin de agente.</span>

<span style="font-weight: 400;">El despliegue de este plugin por binarios no requiere ningún requisito especial.</span>

# Configuración

<span style="font-weight: 400;">El fichero de configuración del plugin se divide en bloques:</span>

**Configuraciones de acceso al API**

<span style="font-weight: 400;">\##################</span>

<span style="font-weight: 400;">\## RabbitMQ access</span>

<span style="font-weight: 400;">\##################</span>

<span style="font-weight: 400;">\## API host:port</span>

<span style="font-weight: 400;">host=192.168.80.20:8080</span>

<span style="font-weight: 400;">\## OVM Manager user</span>

<span style="font-weight: 400;">user=guest</span>

<span style="font-weight: 400;">\## OVM Manager password</span>

<span style="font-weight: 400;">pass=guest</span>

**host**

<span style="font-weight: 400;">Dirección IP y puerto de conexión para el API de RabbitMQ</span>

**user**

<span style="font-weight: 400;">Usuario de acceso al API de RabbitMQ</span>

**pass**

<span style="font-weight: 400;">Contraseña del usuario indicado</span>

##  

**Configuraciones del agente**

<span style="font-weight: 400;">\###################</span>

<span style="font-weight: 400;">\## Agent parameters</span>

<span style="font-weight: 400;">\###################</span>

<span style="font-weight: 400;">\## Agent name (if not running as agent plugin)</span>

<span style="font-weight: 400;">agent\_name=RabbitMQ</span>

<span style="font-weight: 400;">\## Agent interval</span>

<span style="font-weight: 400;">interval=300</span>

**agent\_name**

<span style="font-weight: 400;">Nombre del agente al que se enviará la monitorización si el plugin no se ejecuta como plugin de agente.</span>

**interval**

<span style="font-weight: 400;">Intervalo de monitorización para el agente indicado.</span>

  
  
  
  
**Configuraciones de transferencia de los ficheros XML**

<span style="font-weight: 400;">\######################</span>

<span style="font-weight: 400;">\## Transfer parameters</span>

<span style="font-weight: 400;">\######################</span>

<span style="font-weight: 400;">\## Temporal folder</span>

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

<span style="font-weight: 400;">\## Transfer mode used to send XML file (tentacle or local)</span>

<span style="font-weight: 400;">transfer\_mode=tentacle</span>

<span style="font-weight: 400;">\## Local folder to copy XML file (used only if transfer\_mode is not tentacle)</span>

<span style="font-weight: 400;">local\_folder=/var/spool/pandora/data\_in/</span>

<span style="font-weight: 400;">\## Tentacle server IP</span>

<span style="font-weight: 400;">tentacle\_ip=127.0.0.1</span>

<span style="font-weight: 400;">\## Tentacle server port</span>

<span style="font-weight: 400;">tentacle\_port=41121</span>

<span style="font-weight: 400;">\## Tentacle extra options (if needed)</span>

<span style="font-weight: 400;">\#tentacle\_opts=</span>

<span style="font-weight: 400;">\## Define Module Group</span>

<span style="font-weight: 400;">\#module\_group=General</span>

**tmp**

<span style="font-weight: 400;">Directorio temporal en el que se generarán los ficheros XML del agente antes de su transferencia al servidor de Pandora FMS (si el plugin no se ejecuta como plugin de agente).</span>

**transfer\_mode**

<span style="font-weight: 400;">Método de transferencia de ficheros que se utilizará. Si no se establece como “</span>*<span style="font-weight: 400;">tentacle</span>*<span style="font-weight: 400;">” se considerará que el método de transferencia es “</span>*<span style="font-weight: 400;">local</span>*<span style="font-weight: 400;">” (copiando los ficheros XML del directorio temporal a uno definido).</span>

**local\_folder**

<span style="font-weight: 400;">Directorio al que se copiarán los ficheros XML si el método de transferencia no se establece como “</span>*<span style="font-weight: 400;">tentacle</span>*<span style="font-weight: 400;">”.</span>

**tentacle\_ip**

<span style="font-weight: 400;">Dirección IP al que se enviarán los ficheros XML si el método de transferencia se establece como “</span>*<span style="font-weight: 400;">tentacle</span>*<span style="font-weight: 400;">”.</span>

**tentacle\_port**

<span style="font-weight: 400;">Puerto al que conectarse al servidor de Tentacle indicado en el parámetro “</span>*<span style="font-weight: 400;">tentacle\_ip</span>*<span style="font-weight: 400;">”.</span>

**tentacle\_opts**

<span style="font-weight: 400;">Opciones adicionales para la transferencia de ficheros al servidor de Tentacle indicado.</span>

**module\_group**

<span style="font-weight: 400;">Define el grupo al que pertenecerán los módulos.</span>

  
  
  
**Configuraciones adicionales**

<span style="font-weight: 400;">\###################</span>

<span style="font-weight: 400;">\## Extra parameters</span>

<span style="font-weight: 400;">\###################</span>

<span style="font-weight: 400;">\## Set to 1 to run de plugin as an agent plugin</span>

<span style="font-weight: 400;">as\_agent\_plugin=1</span>

**as\_agent\_plugin**

<span style="font-weight: 400;">Si se establece a “1” el plugin se ejecutará como plugin de agente. Si se establece a “0” el plugin generará ficheros XML que transferirá al servidor de Pandora FMS para ser procesados.</span>

# Ejecución manual

<span style="font-weight: 400;">Para ejecutar el plugin configure el archivo de configuración “</span>*<span style="font-weight: 400;">rabbitmq\_monitor.conf</span>*<span style="font-weight: 400;">” según las instrucciones precedentes.</span>

<span style="font-weight: 400;">Ejecución del plugin:</span>

```
./rabbitmq_monitor rabbitmq_monitor.conf
```

Con as\_agent\_plugin 1:

Imprimirá por consola el XML con la información del RabbitMQ.

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/hP6image.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/hP6image.png)

Con as\_agent\_plugin 0:

 Creará el agente y los módulos asociados en Pandora, imprimiendo 1 como resultado final.

[![Screenshot 2025-07-11 062033.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/screenshot-2025-07-11-062033.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/screenshot-2025-07-11-062033.png)

# Configuración en pandora

**Como plugin de servidor**

Iremos a servidores &gt; plugins:

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/qRtimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/qRtimage.png)

Pinchamos en añadir plugin:

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/Lnfimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/Lnfimage.png)

Le ponemos el nombre y la descripción que se prefiera:

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/QgWimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/QgWimage.png)

Metemos como comando la ruta al plugin, y como parámetros los que hemos metido ejecutando el plugin, los campos "\_field\_" son macros definidas más abajo.

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/Czrimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/Czrimage.png)

Ponemos por cada macro la descripción que se prefiera y como valor los datos de rabbitMQ

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/9cEimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/9cEimage.png)

**Como plugin de agente**

Deberemos habilitar la configuración remota, para habilitarla tenemos que abrir el archivo pandora\_agent.conf :

```bash
vim /etc/pandora/pandora_agent.conf
```

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/uftimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/uftimage.png)

Y después de esto reiniciamos el agente :

```bash
/etc/init.d/pandora_agent_daemon restart
```

Se nos habrá activado la configuración remota, vamos al menu de agentes y pinchamos en el icono de configuración remota que es el siguiente :

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/0Wfimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/0Wfimage.png)

Luego vamos al menu de plugins :

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/8Quimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/8Quimage.png)

Metemos el comando tal como lo ejecutamos y damos a "añadir":

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/UHzimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/UHzimage.png)

Ejemplo :

```bash
/usr/share/pandora_server/util/plugin/rabbitmq_monitor /usr/share/pandora_server/util/plugin/rabbitmq_monitor.conf 
```

Se nos habra creado un nuevo plugin:

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/IDLimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/IDLimage.png)

Hecho esto, reiniciamos el agente :

```bash
/etc/init.d/pandora_agent_daemon restart
```

Y si vamos al agente con la configuración remota se habrán creado los módulos de rabbitMQ.

# Módulos generados por el plugin

<span style="font-weight: 400;">La ejecución estándar de este plugin devolverá los siguientes módulos:</span>

- <span style="font-weight: 400;">Availability.</span>
- <span style="font-weight: 400;">Cluster name.</span>
- <span style="font-weight: 400;">Total queue messages.</span>
- <span style="font-weight: 400;">Messages unacknowledged.</span>
- <span style="font-weight: 400;">Total exchanges.</span>
- <span style="font-weight: 400;">Queue publish rate.</span>
- <span style="font-weight: 400;">Queue deliver get rate.</span>
- <span style="font-weight: 400;">Queue deliver noack rate.</span>
- <span style="font-weight: 400;">Mem used rate - </span>*<span style="font-weight: 400;">nodename</span>*<span style="font-weight: 400;">.</span>
- <span style="font-weight: 400;">Proc used rate - </span>*<span style="font-weight: 400;">nodename</span>*<span style="font-weight: 400;">.</span>
- <span style="font-weight: 400;">Node status - </span>*<span style="font-weight: 400;">nodename</span>*<span style="font-weight: 400;">.</span>
- <span style="font-weight: 400;">Exchanges in rate.</span>
- <span style="font-weight: 400;">Exchanges out rate.</span>
- <span style="font-weight: 400;">Total connections.</span>
- <span style="font-weight: 400;">Connections running.</span>
- <span style="font-weight: 400;">Connections blocked.</span>
- <span style="font-weight: 400;">Total received octets.</span>
- <span style="font-weight: 400;">Total sent octets.</span>

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-09/scaled-1680-/vj6image.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-09/vj6image.png)