Pandora: Agent and remote module creation

From Pandora FMS Wiki
Jump to: navigation, search

Go back to Quick Guides index

1 How to create local and remote modules

1.1 Differences between local and remote modules

A local module is a command or a script that is executed by the software agent which is installed on a machine. The software agent executes commands or scripts and captures their output in order to send it as monitoring information to the Pandora FMS server for its processing.

Esquema-AGENT-MODULE-EXECUTION.png

A remote module is a command executed by the Pandora Server against a remote machine that hasn't got a software agent installed on it. When these modules are executed the server performs a remote query and obtains the result as monitoring information.

Esquema-REMOTE-MODULE-EXECUTION.png

1.2 Local module

There are two types of local modules:

  • Predetermined on the software agent
  • Generic commands

Generic modules are system commands, scripts or other programs which can be executed to get the information and return a single value that will be the value that's monitored. These modules are executed using the module_exec parameter.

In addition to generic modules, Pandora FMS's software agent has predefined modules that make information extraction easy. Some of the predefined modules are: CPU usage, memory usage, disk usage, log parser, etc.

1.2.1 How to create local modules

The local modules are defined in Pandora FMS's software agent configuration file.

An example of generic module definition could be:

module_begin
module_name proctotal
module_type generic_data
module_exec ps -A | tail --lines=+5 | wc -l
module_description Total processes
module_end

This module returns the number of processes running on the system. An example of a predefined module could be:

module_begin
module_name CPUUse
module_type generic_data
module_cpuusage all
module_description CPU usage
module_end

This module returns the total CPU usage of the system.

When the software agent sends the information to the Pandora FMS server you will see all your local modules in the agent as can be seen on this image:

Quickguide local module.png

You can find more information and some examples about software agent monitoring in the section Monitoring with software agents. If you want to know more about predefined or generic modules of agent software you can see the section Agent module definition

1.3 Remote module

The remote module types are the following:

  • Network modules:
    • ICMP
    • TCP
    • SNMP
  • WMI
  • Plugins
  • Web checks

Network modules are checks executed on network protocols such as: ICMP, TCP or SNMP. The values returned by these checks are predefined and could be selected when the module is created. For example if you want to monitor if a port is open on a machine you will select the module TCP boolean data that will return a value of 1 if the port is open and 0 otherwise.

The WMI modules are remote modules that allow you to perform queries on Windows machines using WMI protocol.

Plugin modules allow you to execute remote scripts or checks created by the user that perform any kind of action. The only requirement is that the plugin must return a single value. The plugins are developments created to perform actions that could be executed remotely for example: accessing a webservice to obtain data, correlate information from many sources before to return the value, etc.

Web checks are remote modules that allow you to perform transactional checks on webs. These modules simulate the actions performed by an user when he is browsing a website.

1.3.1 How to create remote modules

You can create a remote module in Modules section of Agent Management View. The next image shows an example of the form to create a remote module which checks if the port 80 of a machine is open.

Create remote port80.png

When the different remote modules collect data they appear in Pandora console using different icons depending on remote module type as you can see in the image below.

Remote modules check example.png

If you want to know more about remote modules and how to configure them, you can go to section Remote Monitoring