Zendesk plugin
Plugin to create tickets in zendesk with pandora.
- Introduction
- Compatibility matrix
- Pre requisites
- Configuration
- Parameters
- Create ticket
- Update ticket
- Delete ticket
- Configuration in PandoraFMS
Introduction
Plugin for managing tickets in Zendesk. With this script, you can create, update, and delete tickets from this system, either from the terminal or from PandoraFMS.
Compatibility matrix
| Systems where it has been tested |
CentOS 7, Fedora |
| Systems where it should work |
Any linux system |
Pre requisites
Required:
- Enable API authentication
- * Python3
- * Module requests
* In the binary version of the plugin it is not necessary to install these dependencies, since they are already included in the plugin.
Configuration
You have to enable password access to the api in zendesk or token access. These options can be found in administrator > API.
Parameters
Parameters
| Method | -m | get,post,put o delete |
| host | -i, --ip | name zendesk site |
| user | -us | name user (email) |
| password | -p | password |
| token | -t | token +API |
| ticket name | -tn | name ticket |
| ticket comment | -tb | content ticket |
| ticket id | -id | id ticket |
| ticket status | -ts | new,open,hold, pending,solved o closed |
| ticket priority | -tp | urgent,high,normal o low |
| ticket type | -tt | problem, incident,question, task |
Methods
Get to list, post to create ticket, put to update ticket and delete to delete ticket.
Create ticket
Parameters
| Method | -m | get,post,put o delete |
| host | -i, --ip | name site zendesk |
| user | -us | name user (email) |
| password | -p | pass API |
| token | -t | token API |
| ticket name | -tn | name ticket |
| ticket comment | -tb | content ticket |
| ticket id | -id | id ticket |
| ticket status | -ts | new,open,hold, pending,solved o closed |
| ticket priority | -tp | urgent,high,normal o low |
| ticket type | -tt | problem, incident,question, task |
You can authenticate in the API with token or pass as you have configured it in zendesk. To do so, enter the required argument.
The group creation options are: name, comment (message body), status, priority and type.
The id is automatically assigned to the ticket.
Example of ticket creation with manual execution.
./pandora_zendesk -m post -i pandoraplugin -us <email> -p <password> -tn "manual" -tb "esto es el contenido de la incidencia" -tp urgent -tt "question" -ts new
That command will create the following ticket :
Update ticket
Parameters
| Method | -m | get,post,put o delete |
| host | -i, --ip | name site zendesk |
| user | -us | name user (email) |
| password | -p | pass API |
| token | -t | token API |
| ticket name | -tn | name ticket |
| ticket comment | -tb | content ticket |
| ticket id | -id | id ticket |
| ticket status | -ts | new,open,hold, pending,solved o closed |
| ticket priority | -tp | urgent,high,normal o low |
| ticket type | -tt | problem, incident,question, task |
Example of a ticket update with manual execution.
./pandora_zendesk -m put -i pandoraplugin -us <email> -p <password> -id 19 -tn "yea22h" -tb "Comg" -tp urgent -tt "question" -ts new
This command will update the following ticket :
Delete ticket
A ticket will be deleted by searching for its id.
Example with manual execution
./pandora_zendesk -m delete -i pandoraplugin -us <email> -p <password> -id 4
Configuration in PandoraFMS
Manual installation
Go to servers > plugins:
Click on add plugin:
We put in name and the description that you prefer.
We put as command the execution with the path of the plugin:
/path pandora_zendesk
Remember that the recommended path for the use of the server plugins is: /usr/share/pandora_server/util/plugin/
We enter the path to the plugin as a command, and as parameters we will configure the “_field_” fields, which are macros that we will define below. Review the “create ticket,” “edit ticket,” and “delete ticket” sections to configure the parameters according to your needs.
Once this is done, click on “create”.
Agent configuration
Once this is done, the only thing left to do is to call it, so we will go to some agent's view and create an add-on module:
We will give it a name and in the section “plugin” we will put the one we have just configured.
Once this is done, click on create.
If the module is shown with 1, it means that it is running correctly.