# Net usage

# Introduction

This plugin allows you to monitor network usage on Linux systems in a simple and comprehensive way. It collects information on the amount of data sent and received by each network interface and provides a grand total, making it easy to see the overall traffic on the system.

The plugin includes options to focus on the interfaces that really interest you, using filters that allow you to include or exclude certain interface names. In addition, it is designed to integrate easily with Pandora FMS and ensures that information is recorded reliably and securely, even if the plugin stops unexpectedly.

With it, administrators can get a clear view of the network behavior of their servers, identify traffic spikes, and make informed decisions about their infrastructure.

# Requisites

- You must have read access to the /proc/net/dev file (included in all modern Linux systems).

# Compatibility matrix

<table border="1" id="bkmrk-sistemas-donde-se-ha" style="border-collapse: collapse; width: 100%; height: 84px;"><tbody><tr style="height: 28px;"><td style="width: 50%; height: 28px;">**Systems where it has been tested**</td><td style="width: 50%; height: 28px;">Rocky 9

</td></tr><tr style="height: 28px;"><td style="width: 50%; height: 28px;">**Systems where it should work**</td><td style="width: 50%; height: 28px;">Any Linux system supported by PandoraFMS

</td></tr></tbody></table>

# Parameters

<table border="1" id="bkmrk-par%C3%A1metro-descripci%C3%B3" style="border-collapse: collapse; width: 100%; height: 408.284px;"><tbody><tr style="height: 29.7167px;"><td style="width: 50%; height: 29.7167px;">**Parameter**</td><td style="width: 50%; height: 29.7167px;">**Description**</td></tr><tr style="height: 29.7167px;"><td style="width: 50%; height: 29.7167px;">--module\_prefix</td><td style="width: 50%; height: 29.7167px;">Allows you to add a prefix to all module names generated by the plugin. This helps to easily identify modules within Pandora FMS, for example the name of the server or distribution: Fedora35\_.</td></tr><tr style="height: 29.7167px;"><td style="width: 50%; height: 29.7167px;">--allow\_regexp</td><td style="width: 50%; height: 29.7167px;">Regular expression to include only certain network interfaces in monitoring. For example, if you only want to measure interfaces that start with br, you can use ^br. If left empty, all interfaces are included.</td></tr><tr style="height: 29.7167px;"><td style="width: 50%; height: 29.7167px;">--deny\_regexp</td><td style="width: 50%; height: 29.7167px;">Regular expression to exclude certain network interfaces from monitoring. For example, if you do not want to count the loopback interface lo, you can use ^lo$. The blacklist is applied after the whitelist if both are configured.</td></tr></tbody></table>

# Manual execution

The plugin execution format is as follows:

```
./pandora_netusage [--module_prefix <module_prefix>] [--allow_regexp <allow_regexp>]  [--deny_regexp <deny_regexp>] 
```

For example:

```
./pandora_netusage --module_prefix "fedora-" --allow_regexp "^br"
```

# Plugin configuration

Copy the plugins to the agent's plugins directory, distribute them through file collections, or copy them to the Pandora agent folder. Do the same with any additional files that are needed. The plugin execution command within the agent configuration will be similar to this, but using the paths where the plugin and configuration file would be located.

Execution example:

```
module_plugin /var/opt/PandoraFMS/etc/pandora/plugins/pandora_netusage
```