Plugin Digital Ocean

Plugin to check data from your DigitalOcean account and your droplets.

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 :

 

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:

image-1621929277635.png

Click on generate new token :

image-1621929327184.png

We give it a name and the permissions we are interested in and we generate it:

image-1621929395447.png

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.

image-1622016164092.png

 

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 :

image-1621868162380.png

Manual execution

We can test the plugin from the terminal to see if it works, to check it, we run the plugin:

image-1622017572016.png

From windows, we can check it with the following command, calling the .exe:

pandora_digitalocean.exe -t <token> --data_dir <direction>

image-1622017624654.png

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:

image-1622016210956.png

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:

image-1621930243127.png

Click on "add":

image-1621930276936.png

We give it a name and, if we want, a description:

image-1621930322520.png

 

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.

 

image-1622016246217.png

 

 

Modules generated by the plugin

Two new agents will be created:

image-1621930502395.png

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 :

image-1621869930146.png

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 :

image-1621870180347.png