# Agents and modules generated by the plugin

The plugin creates a `connection` module for each monitored Load Balancer. This module is always created, with value `1` when the resource is available and `0` when the resource stored in the entities cache no longer appears in Azure.

If **Create agent per Load Balancer** is enabled, one agent is created for each discovered Load Balancer. The agent name is built using the prefix configured in **Custom Load Balancer agent prefix** plus the Load Balancer name.

Example:

```text
Custom Load Balancer agent prefix: Azure LB 
Load Balancer name: lb-production-frontend
Agent name: Azure LB lb-production-frontend

```

If **Create agent per Load Balancer** is disabled, all modules are sent to the agent indicated in **Target agent**. In this mode, the Load Balancer name is added as a prefix to each module name to avoid collisions.

The available modules are:

```bash
connection: Azure Load Balancer resource status (1=UP, 0=DOWN). Always monitored (generic_proc).
allocated SNAT ports: Number of SNAT ports allocated in the selected period (generic_data).
backend pool host count: Number of hosts configured in the Load Balancer backend pools (generic_data).
byte count: Bytes transmitted in the selected period (generic_data_inc).
health probe status: Average status of the Load Balancer health probes (generic_data).
packet count: Packets transmitted in the selected period (generic_data_inc).
SNAT connection count: New SNAT connections created in the selected period (generic_data_inc).
load balancer count: Discovered Load Balancer resource count (generic_data).
SYN count: SYN packets transmitted in the selected period (generic_data_inc).
used SNAT ports: Number of SNAT ports used in the selected period (generic_data).
data path availability: Average availability of the Load Balancer data path (generic_data).

```

> The `byte count`, `packet count`, `SNAT connection count`, and `SYN count` modules are `generic_data_inc` type. Since they are incremental counters, Pandora FMS may need two executions before displaying the calculated data correctly.

**Module type mapping**

<table id="bkmrk-azure-load-balancer-module-types"><thead><tr><th>Metric</th><th>Pandora FMS module type</th><th>Unit</th><th>Description</th></tr></thead><tbody><tr><td>connection</td><td>`generic_proc`</td><td></td><td>Azure Load Balancer resource status. Value 1 if available and 0 if it is not discovered in the current execution.</td></tr><tr><td>allocated SNAT ports</td><td>`generic_data`</td><td>ports</td><td>Number of SNAT ports allocated during the selected window.</td></tr><tr><td>backend pool host count</td><td>`generic_data`</td><td>hosts</td><td>Number of hosts configured in backend pools. It is calculated from the Load Balancer configuration.</td></tr><tr><td>byte count</td><td>`generic_data_inc`</td><td>bytes</td><td>Bytes transmitted. Pandora FMS calculates the rate from the incremental counter.</td></tr><tr><td>health probe status</td><td>`generic_data`</td><td>%</td><td>Average status of health probe checks.</td></tr><tr><td>packet count</td><td>`generic_data_inc`</td><td>packets</td><td>Packets transmitted. Pandora FMS calculates the rate from the incremental counter.</td></tr><tr><td>SNAT connection count</td><td>`generic_data_inc`</td><td>connections</td><td>New SNAT connections created in the selected window.</td></tr><tr><td>load balancer count</td><td>`generic_data`</td><td>count</td><td>Discovered Load Balancer resource count. The plugin reports 1 for each Load Balancer.</td></tr><tr><td>SYN count</td><td>`generic_data_inc`</td><td>packets</td><td>SYN packets transmitted. Pandora FMS calculates the rate from the incremental counter.</td></tr><tr><td>used SNAT ports</td><td>`generic_data`</td><td>ports</td><td>Number of SNAT ports used during the selected window.</td></tr><tr><td>data path availability</td><td>`generic_data`</td><td>%</td><td>Average availability of the Load Balancer data path.</td></tr></tbody></table>

The plugin can assign stable identifiers to agents and modules to make later identification easier from the console, dashboards, extensions, or SQL queries. The recommended external identifier for these data is the Azure `resource_id` or the Load Balancer name.

Recommended format:

- **Agent:** `azure_load_balancer:target:<sanitized_resource_id>` — identifies the monitored Load Balancer.
- **Connection module:** `azure_load_balancer:metric_connection:<sanitized_resource_id>`.
- **Metric modules:** `azure_load_balancer:metric_<metric_name>:<sanitized_resource_id>`.

These markers must be stable and must not depend only on the visible agent or module name, because those fields may change due to prefix configuration.

**Discovered entities cache**

The plugin uses a temporary `entities_list` file to store discovered Load Balancers. This logic makes it possible to detect resources that existed in previous executions and later disappeared from Azure.

When a Load Balancer is stored in the entities file but no longer appears in the current discovery, the plugin keeps its agent and generates the `connection` module with value `0`. This allows Pandora FMS to alert on the disappearance of the resource instead of silently removing it from monitoring.

If **Enable entities file re-scan interval** is enabled, the entities file is cleaned and rebuilt when the interval configured in **Re-scan entities file interval** is exceeded. If left disabled, the list of discovered entities is kept to allow detection of disappearances.