Linux SNMP (Rust)
The centreon-plugin-rust-snmp Rust plugin is currently in beta.
Connector dependenciesβ
The following monitoring connectors will be installed when you install the Linux SNMP (Rust) connector through the Configuration > Connectors > Monitoring Connectors menu:
Pack assetsβ
Templatesβ
The Monitoring Connector Linux SNMP (Rust) brings a host template:
- OS-Linux-SNMP-Rs-custom
The connector brings the following service templates (sorted by the host template they are attached to):
- OS-Linux-SNMP-Rs-custom
- Not attached to a host template
| Service Alias | Service Template | Service Description |
|---|---|---|
| Cpu | OS-Linux-Cpu-SNMP-Rs-custom | Check CPU utilization rate for the machine |
| Memory | OS-Linux-Memory-SNMP-Rs-custom | Monitor the memory (RAM) usage |
| Swap | OS-Linux-Swap-SNMP-Rs-custom | Check the swap usage |
| Uptime | OS-Linux-Uptime-SNMP-Rs-custom | Time since the host has been running |
The services listed above are created automatically when the OS-Linux-SNMP-Rs-custom host template is used.
| Service Alias | Service Template | Service Description |
|---|---|---|
| Disk-Global | OS-Linux-Disk-Global-SNMP-Rs-custom | Check the rate of free space on disks |
| Memory | OS-Linux-Memory-64bits-SNMP-Rs-custom | Monitor the memory (RAM) usage for sizes higher than 4TB |
| Process-Generic | OS-Linux-Process-Generic-SNMP-Rs-custom | Check if Windows processes are started and monitor their CPU/memory usage |
| Swap | OS-Linux-Swap-64bits-SNMP-Rs-custom | Check the swap usage for sizes higher than 4TB |
The services listed above are not created automatically when a host template is applied. To use them, create a service manually, then apply the service template you want.
Collected metrics & statusβ
Here is the list of services for this connector, detailing all metrics and statuses linked to each service.
- Cpu
- Disk-Global
- Memory
- Process-Generic
- Swap
- Uptime
| Name | Unit |
|---|---|
| avg.cpu.usage.percent | % |
| cpu#core.cpu.usage.percent | % |
| Name | Unit |
|---|---|
| storage.description#storage.usage.bytes | B |
| storage.description#storage.usage.percent | % |
| Name | Unit |
|---|---|
| memory.free.bytes | B |
| memory.usage.bytes | B |
| memory.usage.percent | % |
| Name | Unit |
|---|---|
| processes.name#process.memory.bytes | B |
| processes.name#process.cpu.percent | % |
| Name | Unit |
|---|---|
| swap.free.bytes | B |
| swap.usage.bytes | B |
| swap.usage.percent | % |
| Name | Unit |
|---|---|
| system.uptime.seconds | s |
Prerequisitesβ
To monitor a Linux based device, the SNMP service must be installed and configured. Most of Linux distributions rely on net-snmp.
SNMP server configurationβ
Basic configurationβ
Notice: the configuration below may vary depending on your distribution. Refer to the official documentation if this does not work for you.
Find below a minimalist snmpd.conf / net-snmp config file (replace my-snmp-community by the relevant value).
com2sec notConfigUser default my-snmp-community
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view centreon included .1.3.6.1
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup "" any noauth exact centreon none none
access notConfigGroup "" any noauth exact systemview none none
includeAllDisks 10%
The SNMP server must be restarted each time the configuration is modified. Also make sure that the SNMP server is configured to automatically start on boot.
Network flowβ
The target server must be reachable from the Centreon Poller on the UDP/161 SNMP port.
Installing the monitoring connectorβ
Packβ
The installation procedures for monitoring connectors are slightly different depending on whether your license is offline or online.
- If the platform uses an online license, you can skip the package installation instruction below as it is not required to have the connector displayed within the Configuration > Connectors > Monitoring Connectors menu. If the platform uses an offline license, install the package on the central server with the command corresponding to the operating system's package manager:
- Alma / RHEL / Oracle Linux 8
- Alma / RHEL / Oracle Linux 9
- Debian 12 & 13
dnf install centreon-pack-operatingsystems-linux-snmp-rs
dnf install centreon-pack-operatingsystems-linux-snmp-rs
apt install centreon-pack-operatingsystems-linux-snmp-rs
- Whatever the license type (online or offline), install the Linux SNMP (Rust) connector through the Configuration > Connectors > Monitoring Connectors menu.
Pluginβ
Since Centreon 22.04, you can benefit from the 'Automatic plugin installation' feature. When this feature is enabled, you can skip the installation part below.
You still have to manually install the plugin on the poller(s) when:
- Automatic plugin installation is turned off
- You want to run a discovery job from a poller that doesn't monitor any resource of this kind yet
More information in the Installing the plugin section.
Use the commands below according to your operating system's package manager:
- Alma / RHEL / Oracle Linux 8
- Alma / RHEL / Oracle Linux 9
- Debian 12 & 13
dnf install centreon-plugin-operatingsystems-linux-snmp-rs
dnf install centreon-plugin-operatingsystems-linux-snmp-rs
apt install centreon-plugin-operatingsystems-linux-snmp-rs
Using the monitoring connectorβ
Using a host template provided by the connectorβ
- Log into Centreon and add a new host through Configuration > Hosts.
- Fill in the Name, Alias & IP Address/DNS fields according to your resource's settings.
- Apply the OS-Linux-SNMP-Rs-custom template to the host. A list of macros appears. Macros allow you to define how the connector will connect to the resource, and to customize the connector's behavior.
- Fill in the macros you want. Some macros are mandatory.
| Macro | Description | Default value | Mandatory |
|---|---|---|---|
| SNMP_EXTRA_OPTIONS | Any extra option you may want to add to every command (a --verbose flag for example). All options are listed here. |
- Deploy the configuration. The host appears in the list of hosts, and on the Resources Status page. The command that is sent by the connector is displayed in the details panel of the host: it shows the values of the macros.
Using a service template provided by the connectorβ
- If you have used a host template and checked Create Services linked to the Template too, the services linked to the template have been created automatically, using the corresponding service templates. Otherwise, create manually the services you want and apply a service template to them.
- Fill in the macros you want (e.g. to change the thresholds for the alerts). Some macros are mandatory (see the table below).
- Cpu
- Disk-Global
- Memory
- Process-Generic
- Swap
- Uptime
| Macro | Description | Default value | Mandatory |
|---|---|---|---|
| WARNING_AVERAGE | Warning threshold | 90 | |
| CRITICAL_AVERAGE | Critical threshold | 95 | |
| WARNING_CORE | Warning threshold for the metric 'core.cpu.usage.percent' | ||
| CRITICAL_CORE | Critical threshold for the metric 'core.cpu.usage.percent' | ||
| EXTRA_OPTIONS | Any extra option you may want to add to the command (a --verbose flag for example). All options are listed here. |
| Macro | Description | Default value | Mandatory |
|---|---|---|---|
| INCLUDE_NAME | Include filter (can be used multiple times) | .* | |
| WARNING_BYTES | Warning threshold for the metric 'storage.usage.bytes' | 80 | |
| CRITICAL_BYTES | Critical threshold for the metric 'storage.usage.bytes' | 90 | |
| WARNING_PERCENT | Warning threshold for the metric 'storage.usage.percent' | ||
| CRITICAL_PERCENT | Critical threshold for the metric 'storage.usage.percent' | ||
| EXTRA_OPTIONS | Any extra option you may want to add to the command (a --verbose flag for example). All options are listed here. |
| Macro | Description | Default value | Mandatory |
|---|---|---|---|
| WARNING_BYTES | Warning threshold for the metric 'memory.usage.bytes' | ||
| CRITICAL_BYTES | Critical threshold for the metric 'memory.usage.bytes' | ||
| WARNING_PERCENT | Warning threshold for the metric 'memory.usage.percent' | 90 | |
| CRITICAL_PERCENT | Critical threshold for the metric 'memory.usage.percent' | 95 | |
| EXTRA_OPTIONS | Any extra option you may want to add to the command (a --verbose flag for example). All options are listed here. |
| Macro | Description | Default value | Mandatory |
|---|---|---|---|
| INCLUDE_NAME | Include filter (can be used multiple times) | .* | |
| EXCLUDE_NAME | Exclude filter (can be used multiple times) | ^$ | |
| NO_DATA_STATUS | Status when the filters keep no data: OK, WARNING, CRITICAL or UNKNOWN | CRITICAL | |
| WARNING_CPU | Warning threshold for the metric 'process.cpu.percent' | ||
| CRITICAL_CPU | Critical threshold for the metric 'process.cpu.percent' | ||
| WARNING_MEMORY | Warning threshold for the metric 'process.memory.bytes' | ||
| CRITICAL_MEMORY | Critical threshold for the metric 'process.memory.bytes' | ||
| EXTRA_OPTIONS | Any extra option you may want to add to the command (a --verbose flag for example). All options are listed here. |
| Macro | Description | Default value | Mandatory |
|---|---|---|---|
| WARNING_BYTES | Warning threshold for the metric 'swap.usage.bytes' | ||
| CRITICAL_BYTES | Critical threshold for the metric 'swap.usage.bytes' | ||
| WARNING_PERCENT | Warning threshold for the metric 'swap.usage.percent' | 10 | |
| CRITICAL_PERCENT | Critical threshold for the metric 'swap.usage.percent' | 30 | |
| EXTRA_OPTIONS | Any extra option you may want to add to the command (a --verbose flag for example). All options are listed here. |
| Macro | Description | Default value | Mandatory |
|---|---|---|---|
| WARNING_SECONDS | Warning threshold for the metric 'system.uptime.seconds' | 3600: | |
| CRITICAL_SECONDS | Critical threshold for the metric 'system.uptime.seconds' | ||
| EXTRA_OPTIONS | Any extra option you may want to add to the command (a --verbose flag for example). All options are listed here. |
- Deploy the configuration. The service appears in the list of services, and on the Resources Status page. The command that is sent by the connector is displayed in the details panel of the service: it shows the values of the macros.
How to check in the CLI that the configuration is OK and what are the main options for?β
Once the plugin is installed, log into your Centreon poller's CLI using the
centreon-engine user account (su - centreon-engine). Test that the connector
is able to monitor a resource using a command like this one (replace the sample values by yours):
/usr/lib/centreon/plugins/centreon-plugin-rust-snmp -H '10.0.0.1' -c 'my-snmp-community' -v '2c' \
--json '/usr/lib/centreon/plugins/rs-collections/operatingsystems-linux-snmp/uptime.json' \
--warning-seconds='' \
--critical-seconds=''
The expected command output is shown below:
OK: Uptime: 64750s | 'system.uptime.seconds'=64750s;;;0;
Troubleshootingβ
Please find the troubleshooting documentation for Centreon Plugins typical issues.
Available modesβ
In most cases, a mode corresponds to a service template. The mode appears in the execution command for the connector. In the Centreon interface, you don't need to specify a mode explicitly: its use is implied when you apply a service template. However, you will need to specify the correct mode for the template if you want to test the execution command for the connector in your terminal.
All available modes can be displayed by adding the --list-mode parameter to
the command:
/usr/lib/centreon/plugins/centreon-plugin-rust-snmp -H '10.0.0.1' -c 'my-snmp-community' -v '2c' \
--json '/usr/lib/centreon/plugins/rs-collections/operatingsystems-linux-snmp/uptime.json' \
--list-mode
The plugin brings the following modes:
| Mode | Linked service template |
|---|---|
| cpu [code] | OS-Linux-Cpu-SNMP-Rs-custom |
| inodes [code] | Non utilisΓ© dans ce connecteur de supervision |
| memory [code] | OS-Linux-Memory-SNMP-Rs-custom |
| memory-64 [code] | OS-Linux-Memory-64bits-SNMP-Rs-custom |
| processcount [code] | OS-Linux-Process-Generic-SNMP-Rs-custom |
| storage [code] | OS-Linux-Disk-Global-SNMP-Rs-custom |
| swap [code] | OS-Linux-Swap-SNMP-Rs-custom |
| swap-64 [code] | OS-Linux-Swap-64bits-SNMP-Rs-custom |
| sysdesc [code] | Non utilisΓ© dans ce connecteur de supervision |
| uptime [code] | OS-Linux-Uptime-SNMP-Rs-custom |
Available optionsβ
Generic optionsβ
All generic options are listed here:
| Option | Description |
|---|---|
| --hostname | Hostname or IP address (default: localhost) |
| --port | SNMP port (default: 161) |
| --snmp-version | SNMP version (default: 2c) |
| --json | JSON command definition file |
| --filter-in | Include filter (can be used multiple times) |
| --filter-out | Exclude filter (can be used multiple times) |
| --no-data-status | Status when the filters keep no data: OK, WARNING, CRITICAL or UNKNOWN (default: UNKNOWN) |
| --check-format | Check JSON file validity and exit |
| --check-response | Display raw SNMP response |
| --list-counters | List all available metrics |
| --help | Print this help message |
Modes optionsβ
All available options for each service template are listed below:
- Cpu
- Disk-Global
- Memory
- Process-Generic
- Swap
- Uptime
| Option | Description |
|---|---|
| --warning-core | Warning threshold for the metric 'core.cpu.usage.percent'. |
| --critical-core | Critical threshold for the metric 'core.cpu.usage.percent'. |
| --warning-avg | Warning threshold for the metric 'avg.cpu.usage.percent'. |
| --critical-avg | Critical threshold for the metric 'avg.cpu.usage.percent'. |
| Option | Description |
|---|---|
| --warning-bytes | Warning threshold for the metric 'storage.usage.bytes'. |
| --critical-bytes | Critical threshold for the metric 'storage.usage.bytes'. |
| --warning-prct | Warning threshold for the metric 'storage.usage.percent'. |
| --critical-prct | Critical threshold for the metric 'storage.usage.percent'. |
| Option | Description |
|---|---|
| --warning-free-bytes | Warning threshold for the metric 'memory.free.bytes'. |
| --critical-free-bytes | Critical threshold for the metric 'memory.free.bytes'. |
| --warning-bytes | Warning threshold for the metric 'memory.usage.bytes'. |
| --critical-bytes | Critical threshold for the metric 'memory.usage.bytes'. |
| --warning-prct | Warning threshold for the metric 'memory.usage.percent'. |
| --critical-prct | Critical threshold for the metric 'memory.usage.percent'. |
| Option | Description |
|---|---|
| --warning-process-memory | Warning threshold for the metric 'process.memory.bytes'. |
| --critical-process-memory | Critical threshold for the metric 'process.memory.bytes'. |
| --warning-process-cpu | Warning threshold for the metric 'process.cpu.percent'. |
| --critical-process-cpu | Critical threshold for the metric 'process.cpu.percent'. |
| Option | Description |
|---|---|
| --warning-free-bytes | Warning threshold for the metric 'swap.free.bytes'. |
| --critical-free-bytes | Critical threshold for the metric 'swap.free.bytes'. |
| --warning-bytes | Warning threshold for the metric 'swap.usage.bytes'. |
| --critical-bytes | Critical threshold for the metric 'swap.usage.bytes'. |
| --warning-prct | Warning threshold for the metric 'swap.usage.percent'. |
| --critical-prct | Critical threshold for the metric 'swap.usage.percent'. |
| Option | Description |
|---|---|
| --warning-seconds | Warning threshold for the metric 'system.uptime.seconds'. |
| --critical-seconds | Critical threshold for the metric 'system.uptime.seconds'. |
All available options for a given mode can be displayed by adding the
--help parameter to the command:
/usr/lib/centreon/plugins/centreon-plugin-rust-snmp -H '10.0.0.1' -c 'my-snmp-community' -v '2c' \
--json '/usr/lib/centreon/plugins/rs-collections/operatingsystems-linux-snmp/uptime.json' \
--warning-seconds='' \
--help