Plugin Linode

This plug-in is used to monitor instances in Linode.
It connects to the Linode cloud service to get data about the running instances and sends this data to the Pandora FMS server from which it has been executed.

Introduction

Ver. 120521
This plug-in is used to monitor instances in Linode.
It connects to the Linode cloud service to get data about the running instances and sends this data to the Pandora FMS server from which it has been executed.
Type: Server plug-in

Compatibility matrix

Systems tested

CentOS 7

Systems where it should work

Any Linux operating system that has a Pandora FMS server installed.

Prerequisites

To be able to execute this plug-in you need:

Configuration

Both the Data Server and the Plugin Server are enabled by default in Pandora FMS. However, if we would like to check that we have both servers enabled, or we are not sure, we can access to the Pandora FMS server configuration file, located in /etc/pandora/pandora_server.conf.

Once we've finished editing this file, we must restart the server.

/etc/init.d/pandora_server restart


General plugin parameters

./pandora_linode -t <token> [ -g <group> ] [ --data_dir <data_dir > ]

If the execution was successful we should see a '1' when running the plugin.

image-1621345536762.png

Plugin specific parameters

This plug-in has these four parameters:

Parameter

Description

-h, --help

Show help

-t TOKEN, --token TOKEN

Is mandatory. Used to enter the token to connect to the Linode service.

-g GROUP, --group GROUP

Pandora FMS target group

--data_dir DATA_DIR

Pandora FMS data directory. Default is /var/spool/pandora/data_in/

Configuration in Pandora

Ideally, to run any server plug-in, the plug-in should be located in the following path /usr/share/pandora_server/util/plugin/

Once this is done, we must change the owner and permissions of the plug-in so that they can be executed by the server. To do this we use the following commands:

chown pandora:root pandora_linode
chmod 755 pandora_linode

It should look like this.

Next we will proceed to register the plug-in. In this case we will do the registration manually.

The first step is to access the console. In the Servers section we access the Plugins tab.

In this tab will appear all the server plug-ins that are installed by default with Pandora FMS.

Click on Add.


The following window will be used to configure the plug-in before registering it.
The first section is general options, where we can set the name we want to give to the plug-in, the type of plug-in, standard or Nagios, the maximum execution time of the plug-in and a brief description.

In the next section we define the path where the plug-in is located and a series of macros, which are equivalent to the parameters of which the plug-in is composed.

Finally, if we have added execution parameters, this section will be used to define these parameters by means of macros. We can also add default values to these macros, so that they will be used in case we do not provide a parameter.
In this case, since the only mandatory parameter is the token parameter, the other two will be configured with default values.

image-1621346903209.png

Once we have finished, click on Create.

Next we are going to create a server plug-in module.

To do this we go to Resources > Manage Agents and click on 'Modules'.

image-1621346963658.png

Choose type 'Plugin server module' and click on Create.

image-1621347034187.png

In the plug-in configuration section we can fill in several fields. Select the plug-in and add the token. As the fields group and data directory are defined by default, there is no need to modify them.

image-1621347863700.png

Once finished we click on Create.

If we have configured it well, the result will be as follows:

image-1621347382569.png

Modules generated by the plugin

As we have said before, to know if the plug-in has worked, the module must return a 1.

In this case, the plug-in creates several agents, one for each instance in linode, each with its corresponding modules.

Example of module listing within the agent 'Linode centos-eu-west'.

Module name Description

CPU_Load

Percentage of CPU used
Input/Output statistics IO Blocks written
Last Update Last update date
Linode Type Instance size, image..
Linode_Status Linode is running status
Region Instance location
Running_Status Linode is running status
Traffic netv4 in Input stats for IPv4, measured in bits/s
Traffic netv4 out Output stats for IPv4, measured in bits/s
Traffic netv4 private_in Private IPv4 input statistics, measured in bits/s
Traffic netv4 private_out Private IPv4 output statistics, measured in bits/s