Plugin Digital Ocean
Plugin to check data from your DigitalOcean account and your droplets.
- Introduction
- Compatibility matrix
- Prerequisites
- Configuration
- General plugin parameters
- Plugin-specific parameters
- Manual execution
- Configuration in Pandora
- Modules generated by the plugin
Introduction
Ver. 240521
With this plug-in we can see the data of your digital ocean account and your droplets.
It connects to the account via a token.
Type: Server plug-in
Compatibility matrix
Systems where it has been tested |
CentOS 7 |
Systems where it should work |
Any linux system |
Prerequisites
Required :
- Digital Ocean account
- Generate an API read token from digital ocean
- Have the Pandora FMS Data Server enabled.
- Pandora FMS Plugin Server enabled.
Configuration
We will have to generate a token, which will be the key that will access through the api to the data of our account, this is generated in the following way.
Go to api from the digital ocean menu:
Click on generate new token :
We give it a name and the permissions we are interested in and we generate it:
Recuerda guardar bien el token porque solo saldrá una vez, si se extravía siempre se puede crear otro nuevo.
General plugin parameters
./pandora_digitalocean -t <token> [ -g <group> ] [ --data_dir <data_dir > ]
If the execution was successful we will see a '1' when the plugin is executed.
Plugin-specific parameters
The plug-in has the following parameters:
Parámetro |
Descripción |
-h, --help |
Displays a short help message |
-t TOKEN, --token TOKEN |
It is mandatory. To enter the token we have generated in digital ocean |
-g GROUP, --group GROUP |
Pandora FMS Target Group |
--data_dir DATA_DIR |
Pandora FMS data directory. By default it is /var/spool/pandora/data_in/ |
Help example :
Manual execution
We can test the plugin from the terminal to see if it works, to check it, we run the plugin:
From windows, we can check it with the following command, calling the .exe:
pandora_digitalocean.exe -t <token> --data_dir <direction>
Configuration in Pandora
The best way to manage server plugins in Pandora is from "/usr/share/pandora_server/util/plugin" so we will send it by pscp to that path:
If it does not let us run it because we do not have permissions, we must give them with the following command :
chmod 755 pandora_digitalocean
Once this is done, let's proceed to install it in the Pandora console:
Go to servers > plugins:
Click on "add":
We give it a name and, if we want, a description:
We put in plugin command the path in which we have located previously and in parameters what we want to get, as in this case I only want to generate the agents and the address is already configured only put _field1_, if we want to put another address where to save the data generated by the plugin, we would add --data_dir _field2_ in plugin parameters. We will put a description (token, for example) and in default value we will put the token generated before. Once this is done, two agents with their respective modules will have been created.
Modules generated by the plugin
Two new agents will be created:
In the first one, information about your droplets will be displayed, in the second one, information about your digital ocean account.
Digital Account droplets
Droplet_disk | Disk info |
Droplet_memory | Memory info |
Droplet_name | Droplet name |
Droplet_status | To find out if the droplet is active |
Droplet_vcpus | Information about vcpus |
Example on console :
Digital_Ocean_Account <email>
Account_balance | Account balance in $ |
Digital_Ocean_Status | The status of the digital ocean account |
Month_to_date_balance | Balance of the month to date |
Example in the Pandora console :