Apache Discovery

This document describes the Apachefunctionality of PandoraFMS, composed by the discovery plugin.

Introduction

This Apache discovery plugin for Pandora FMS is designed to automate the monitoring of your Apache HTTP Server web servers, taking advantage of the detailed information provided by the mod_status module. By interacting with the (server-status) page, the plugin can collect vital real-time metrics that are crucial to understanding the performance and health of your Apache environment.

Prerrequisites

Parameters

Simple Mode

--urls url of the apache server 
--user user name if the apache server requires it, optional.
--password password if the apache server requires it, optional
--ssl to verify if the url is https certified or not, optional.
--transfer_mode name of the transfer mode, optional.
--tentacle_ip  ip of the tentacle, optional.
--tentacle_port port of the tentacle, optional.

Advance Mode

--conf configuration file path

Archivo de configuración (--conf)

urls= url of the apache server 
agent_name= name of the agent optional
module_prefix= prefix name for the modules optional
username= user name if the apache server requires it optional
password= password if the apache server requires it optional
verify_ssl= to verify if the url is https certified or not optional
transfer_mode= name of the transfer mode optional
tentacle_ip= ip of the tentacle optional
tentacle_port= port of the tentacle optional 

Ejemplo

urls=https://192.168.0.1/example
agent_name=example
module_prefix=apache
username=admin
password=12345
verify_ssl=true
transfer_mode=tentacle
tentacle_ip=127.0.0.1
tentacle_port=41121

Manual execution

The format of the plugin execution is as follows:

./pandora_apache --url <apache server url> --user <apache user name> --password <apache server password> --ssl <serial or dummy if required> --transfer_mode <transfer mode name> --tentacle_ip <tentacle port> --tentacle_port <tentacle port> --conf <path to configuration file> --string_conf <path to configuration file>

Examples:

to run in simple mode

./pandora_apache --url http://192.168.0.1/server --ssl false --transfer_mode tentacle --tentacle_ip 127.0.0.1 --tentacle_port 41121

to run in advanced mode

./pandora_apache --url http://192.168.0.1/server --ssl false --transfer_mode tentacle --tentacle_ip 127.0.0.1 --tentacle_port 41121 --conf /file/file.conf

The execution will return an output in JSON format with information about the execution, and will generate an XML file for each monitored agent that will be sent to the Pandora FMS server by the transfer method indicated in the configuration.

Discovery

This plugin can be integrated with Pandora FMS Discovery.

To do so, you must load the “.disco” package that you can download from the Pandora FMS library:

https://pandorafms.com/library/

Once loaded, apache services can be monitored by creating Discovery tasks from the Management > Discovery > Application > Apache section.

The following minimum data will be requested for each task:

image.png

On the next page we will be asked for the following :

text area to add the configuration of each of the apache blocks to be monitored

image.png

Successfully completed tasks will have an execution summary with the following information:

image.png

Agent and modules generated by the plugin

The plugin will create an agent, each instance with the name taken from the URL. If it's in advanced mode, it will create the number of agents depending on the blocks sent, and the name will be defined by the agent name field. Otherwise, it will also take the name from the URL if no name is specified. It will contain the modules obtained by interacting with the server status page. The modules to be created are as follows:

ServerVersion:The Apache service version (e.g., Apache/2.4.62).,
ServerMPM:The Multi-Processing Module (MPM) currently in use by Apache (e.g., event, prefork, worker).,
Server Built:The date and time when the Apache server binary was compiled.,
ParentServerConfigGeneration:The configuration generation of the parent Apache process. Increments with each graceful restart.,
ParentServerMPMGeneration:The MPM generation of the parent Apache process.,
ServerUptimeSeconds:The service uptime expressed in seconds.,
Load1:The system load average over the last 1 minute.,
Load5:The system load average over the last 5 minutes.,
Load15:The system load average over the last 15 minutes.,
Total Accesses:The total number of client requests received by the server since its last start/restart. It is calculated as a rate of change for the Total requests statistics.,
Total kBytes:The total kilobytes of data served by the Apache server since its last start/restart.,
Total Duration:The cumulative time spent processing all requests since the server started (in microseconds or milliseconds, depending on Apache version and configuration). This can be higher than Uptime because multiple processes/threads can be active simultaneously.,
CPUUser:The CPU time used by Apache processes in user mode since the server started, expressed as a percentage.,
CPUSystem:The CPU time used by Apache processes in system (kernel) mode since the server started, expressed as a percentage.,
CPUChildrenUser:The CPU time used by child processes of Apache in user mode.,
CPUChildrenSystem:The CPU time used by child processes of Apache in system (kernel) mode.,
CPULoad:The overall CPU load percentage consumed by all Apache processes combined since the server started.,
Uptime:The human-readable representation of the server's uptime (e.g., '2 days 4 hours 40 minutes'). This is derived from ServerUptimeSeconds.,
ReqPerSec:The average number of requests served per second since the server was started/restarted. ReqPerSec is not used, as it counts the average since the last Apache server start.,
BytesPerSec:The average number of bytes served per second since the server was started/restarted. BytesPerSec is not used, as it counts the average since the last Apache server start.,
BytesPerReq:The average number of bytes served per request since the server was started/restarted. The average number of client requests per second., # Note: The Zabbix description for BytesPerReq seems to confuse it with ReqPerSec. BytesPerReq is bytes per request.
DurationPerReq:The average duration (time) it took to serve each request since the server was started/restarted (in milliseconds or microseconds).,
BusyWorkers:The total number of worker threads/processes that are currently busy handling requests.,
GracefulWorkers:The number of worker processes that are currently in a graceful shutdown state (waiting for current requests to finish before exiting).,
IdleWorkers:The total number of worker threads/processes that are currently idle and ready to handle new requests.,
Processes:The number of active Apache processes (not threads) currently running.,
Stopping:The number of worker processes that are in a stopping state.,
ConnsTotal:The total number of connections to the Apache server.,
ConnsAsyncWriting:The number of asynchronous connections in writing state (applicable only to the event MPM).,
ConnsAsyncKeepAlive:The number of asynchronous connections in keep-alive state (applicable only to the event MPM).,
ConnsAsyncClosing:The number of asynchronous connections in closing state (applicable only to the event MPM).,
CacheType:The type of cache mechanism being used by Apache (e.g., SHMCB for shared memory caching).,
CacheSharedMemory:The total amount of shared memory allocated for the cache (in bytes or kilobytes).,
CacheCurrentEntries:The current number of entries stored in the cache.,
CacheSubcaches:The number of subcaches within the main cache (for internal organization).,
CacheIndexesPerSubcaches:The number of index entries per subcache.,
CacheIndexUsage:The percentage of the cache index space currently in use.,
CacheUsage:The overall percentage of the cache memory currently in use.,
CacheStoreCount:The total number of times an item has been successfully stored in the cache.,
CacheReplaceCount:The total number of times an existing cache entry has been replaced.,
CacheExpireCount:The total number of times a cache entry has expired.,
CacheDiscardCount:The total number of times a cache entry has been discarded (e.g., due to space limits or errors).,
CacheRetrieveHitCount:The total number of times a requested item was found in the cache (cache hit).,
CacheRetrieveMissCount:The total number of times a requested item was not found in the cache (cache miss).,
CacheRemoveHitCount:The total number of times an item was successfully removed from the cache when it was found.,
CacheRemoveMissCount:The total number of times an item was attempted to be removed from the cache but was not found.

image.png