# Redmine Plugin

# Introducción

Plugin para gestionar tickets de tus proyectos en Redmine, puedes crear, editar o eliminar tickets desde el terminal o desde la consola de PandoraFMS.

# Matriz de compatibilidad

<table border="1" id="bkmrk-sistemas-donde-se-ha" style="border-collapse: collapse; width: 100%; height: 72.7812px;"><tbody><tr style="height: 37.3906px;"><td style="width: 30.6574%; height: 37.3906px;">**Sistemas donde se ha probado**</td><td style="width: 69.3426%; height: 37.3906px;">CentOS 7, Fedora

</td></tr><tr style="height: 35.3906px;"><td style="width: 30.6574%; height: 35.3906px;">**Sistemas donde debería funcionar**</td><td style="width: 69.3426%; height: 35.3906px;">Cualquier sistema linux

</td></tr></tbody></table>

# Pre requisitos

Se requiere:

- Habilitar Servicios web rest en redmine
- **\*** Python3
- **\*** Librería requests

**\* En la versión binaria del plugin no es necesario instalar estas dependencias, ya que ya vienen incluidas en el.**

# Configuración

Se deberá habilitar servicio web rest para usar el plugin pues este se comunica con la API.

[![image-1641996074638.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1641996074638.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1641996074638.png)

Para llegar a este menu habrá que pinchar en administración, después en configuración y por último en autenticación.

El token de la API se puede ver en "mi cuenta":

[![image-1641998437878.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1641998437878.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1641998437878.png)

**\* Recuerda que para crear tickets (aunque sea de manera manual en redmine) hay que hacer alguna configuración básica, como crear un tipo de ticket, estado y prioridad, esto se puede hacer en el menu administración:**

[![image-1641996396304.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1641996396304.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1641996396304.png)

[![image-1641996454638.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1641996454638.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1641996454638.png)

[![image-1641996482548.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1641996482548.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1641996482548.png)

[![image-1641996517861.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1641996517861.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1641996517861.png)

# Parámetros

**Parámetros**

<table border="1" id="bkmrk-method--m-get%2Cpost%2Cp" style="height: 435px;"><tbody><tr style="height: 29px;"><td style="height: 29px; width: 114.188px;">Method</td><td style="height: 29px; width: 56.3594px;">-m</td><td style="height: 29px; width: 195.172px;">post,put o delete</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 114.188px;">host</td><td style="height: 29px; width: 56.3594px;">-i, --ip</td><td style="height: 29px; width: 195.172px;">dirección de redmine</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 114.188px;">token</td><td style="height: 29px; width: 56.3594px;">-t </td><td style="height: 29px; width: 195.172px;">token de la API</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 114.188px;">project id</td><td style="height: 29px; width: 56.3594px;">-p</td><td style="height: 29px; width: 195.172px;">id del proyecto</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 114.188px;">ticket id</td><td style="height: 29px; width: 56.3594px;">-tid</td><td style="height: 29px; width: 195.172px;">ticket id</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 114.188px;">subject</td><td style="height: 29px; width: 56.3594px;">-s</td><td style="height: 29px; width: 195.172px;">subject</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 114.188px;">description</td><td style="height: 29px; width: 56.3594px;">-d</td><td style="height: 29px; width: 195.172px;">descripción</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 114.188px;">priority id</td><td style="height: 29px; width: 56.3594px;">-pi</td><td style="height: 29px; width: 195.172px;">prioridad </td></tr><tr style="height: 29px;"><td style="height: 29px; width: 114.188px;">status id</td><td style="height: 29px; width: 56.3594px;">-st</td><td style="height: 29px; width: 195.172px;">estado</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 114.188px;">assigned to id</td><td style="height: 29px; width: 56.3594px;">-a</td><td style="height: 29px; width: 195.172px;">asignación petición</td></tr></tbody></table>

**Métodos**

Get para listar, post para crear ticket, put para actualizar ticket y delete para borrar ticket .

# Crear ticket

**Argumentos necesarios**

-m (post)

-i (host)

-t (token)

-p (id de proyecto)

-s (subject)

-d (descrición)

-pi (id de prioridad)

-st (id del estado)

-a (id de asginación)

**Ejemplo ejecución manual**

```
./pandora_redmine -m post -i http://pandorap.m.redmine.org -t <token> -p 1 -s "este es el subject" -d "la descripcion" -pi 1 -st 1 -a 1

```

La solicitud se creará en nuestro proyecto.

[![image-1641999655271.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1641999655271.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1641999655271.png)

# Actualizar ticket

**Argumentos necesarios**

-m (post)

-i (host)

-t (token)

-p (project id)

-tid (ticket id)

-s (subject)

-d (description)

-pi (priority id)

-st (status id)

-a (asigned to id)

**Ejemplo ejecución manual**

```
./pandora_redmine -m put -tid 1 -i http://pandorap.m.redmine.org -t <token> -p 1 -s "omg" -d "descripcion" -pi 1 -st 1 -a 1
```

Se actualizará el ticket con id #1

[![image-1641999846846.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1641999846846.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1641999846846.png)

# Eliminar ticket

Se eliminara buscando la petición por id.

**Ejemplo ejecución manual:**

```
./pandora_redmine.py -m delete -tid 2 -i http://pandorap.m.redmine.org -t <token>
```

# Configuración en PandoraFMS

**Instalación manual**

Iremos a servidores &gt; plugins:

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

Pinchamos en añadir plugin:

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

Le ponemos en nombre y la descripción que se prefiera

Metemos como comando la ejecución con la ruta del plugin:

```bash
/path pandora_redmine
```

Como parámetros configuraremos los campos "\_field\_" que son macros que definiremos abajo. Repasa las secciones "crear ticket", "editar ticket" y "borrar ticket" para configurar los parámetros según tus necesidades.

Una vez hecho esto, daremos a "crear".

**Configuración en agente**

Una vez hecho esto, solo queda llamarlo por lo que iremos a la vista de algún agente y crearemos un módulo de complementos:

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

Le daremos un nombre y en el apartado "plugin" pondremos el que acabamos de configurar.

Una vez hecho esto, damos a crear.

Si el modulo se muestra con 1, quiere decir que se esta ejecutando correctamente