Cloud Foundry

With PandoraFMS Plugin we will be able to obtain information through the API using the
CF-CLI tool.

Introduction

Cloud Foundry has a container-based architecture that runs applications in any programming language. For its administration it organizes the containers in Organizations, Spaces and Apps.

With PandoraFMS Plugin we will be able to obtain information through the API using the CF-CLI tool.

Compatibility matrix

Tested in Pivotal Cloud Foundry environment

Prerequisites

For the correct operation of this plugin it is necessary to install the CF CLI tool and the Pandora FMS::PluginTools library in the server where the plugin are going to be executed.

This library is available with the installation of the Pandora FMS OpenSource package.

You can download the latest version from:

https://github.com/pandorafms/pandorafms/blob/develop/pandora_server/lib/PandoraFMS/PluginTools.pm

To install the CF CLI tool you can download it from the following URL, select the necessary package and install it:

https://pivotal.io/platform/pcf-tutorials/getting-started-with-pivotal-cloud-foundry/install-the-cf-cli
https://github.com/cloudfoundry/cli#downloads

To test if the tool has been installed correctly you can test this command if you have a user in Pivotal Cloud Foundry:
cf login -a https://api.run.pivotal.io

If this is not the case, you can test against the api of the Foundry Cloud that you are going to monitor:

cf login -a <URL_API>

Plugin configuration

The following parameters must be specified in the plugin configuration file:

#Ejemplo parámetros plugin Cloud Foundry
api_url https://api.run.pivotal.io
username user@artica.es
password password
organization Artica
space development
# Pandora Server configuration
mode tentacle
tentacle_ip nova.lab.artica.lan
tentacle_port 41121
tentacle_client tentacle_client
local_folder /var/spool/pandora/data_in
temp /tmp

api_url
Cloud Foundry API to which the plugin is logged to perform all monitoring. If a Pivotal environment is monitored, this will be the URL ​https://api.run.pivotal.io
username
Access user
password
Password of access of that user
organization
The name of one of the organizations that the user can access. It is necessary for the login, later it will make a scan of all the Organizations.
space
login.
mode
The name of one of the spaces of the organization. It is only necessary for the initial
XML file transfer mode, can be:
● local: Copy the files to a local folder
● tentacle: transfer files to tentacle_ip by tentacle_port
tentacle_ip
IP address or FQDN where Pandora FMS is working.
tentacle_port
Port where the Tentacle service associated to your Pandora FMS server is listening.
tentacle_opts
Extra options for the Tentacle client..
tentacle_client
Path where to find the binary of tentacle client.
local_folder
Location where to move files in local mode.
temp
Temporary location where to store files before sending them.

Manual execution

This plugin can be launched as an agent plugin ( module_plugin Cloud_foundry_v1.0.pl cloud_foundry.conf ) or as a server plugin adding it to the list of plugins in the same way as the manual execution explained below.

Plugin execution:

./Cloud_foundry_v1.0.pl cloud_foundry.conf

Binary plugin execution:

./Cloud_foundry_v1.0.64 cloud_foundry.conf

Modules generated by the plugin

The standard execution of this plugin will return the following modules by default:
The following agents will be created:

One agent per organization with the following modules:
Status
Mem usage %
One agent per space with the following modules:
Mem Usage %
App Count
Service Count
One agent per application with the following modules:
Mem Usage %
Disk Usage %
Status
CPU Usage %


All generated modules are obtained through the Cloud Foundry API. In the case of needing the insertion of new modules have to be available in the same one.
https://apidocs.cloudfoundry.org/10.1.0/