Looking for FlexLM/FlexNet monitoring? See nagios-check-flexlm — same output format, same check modes, built for FlexLM servers.
A Nagios/Nagios XI plugin for monitoring Reprise License Manager (RLM) license servers. The plugin is a single self-contained Python 3.9+ script with zero external dependencies that invokes rlmutil rlmstat to check license server health, license expiry, and license usage.
It returns standard Nagios exit codes and performance data suitable for graphing with PNP4Nagios or Grafana, and also supports JSON output mode and structured file logging.
- Python 3.9+ — Uses modern type hints and standard library features
- rlmutil v18.0 — The RLM command-line utility must be accessible on the Nagios server (either in
$PATHor specified via--rlmutil-path). Tested with rlmutil v18.0.
-
Copy the plugin to your Nagios plugins directory:
scp check_rlm.py nagios-server:/usr/local/nagios/libexec/
-
Set the executable permission:
chmod +x /usr/local/nagios/libexec/check_rlm.py
-
Verify Python version (3.9+ required):
python3 --version
-
Confirm the plugin runs:
/usr/local/nagios/libexec/check_rlm.py --help
| Argument | Type | Default | Description |
|---|---|---|---|
port |
positional int | (required) | RLM server port (1–65535) |
server |
positional str | (required) | RLM server hostname or IP address |
feature |
positional str | (required) | License feature name to check |
--mode |
choice | status |
Check mode: status, expiry, or usage |
--rlmutil-path |
str | rlmutil |
Path to the rlmutil binary |
--isv |
str | (none) | ISV server name to query |
--warning-days |
int | 60 |
Warning threshold in days (expiry mode) |
--alert-days |
int | 30 |
Critical threshold in days (expiry mode) |
--warn-pct |
float | 80 |
Warning percentage threshold (usage mode) |
--crit-pct |
float | 90 |
Critical percentage threshold (usage mode) |
--timeout |
int | 10 |
Timeout in seconds for rlmutil execution (1–300) |
--output-format |
choice | standard |
Output format: standard or json |
--log-file |
str | (none) | File path for structured logging output |
Verify that a license feature is available for checkout:
./check_rlm.py 5053 license-server converge_gui --mode status --isv csciExpected output:
OK - converge_gui can be checked out
Monitor how many days remain until the license expires:
./check_rlm.py 5053 license-server converge_gui --mode expiry --isv csci --warning-days 90 --alert-days 30Expected output:
OK - Feature 'converge_gui' expires in 222 days | days_until_expiry=222;;;;
Monitor the percentage of license seats currently in use:
./check_rlm.py 5053 license-server converge_gui --mode usage --isv csci --warn-pct 80 --crit-pct 95Expected output:
OK - Feature 'converge_gui': 3/25 licenses in use (12.0%) | licenses_total=25;;;; licenses_used=3;;;; licenses_available=22;;;; utilization_pct=12.0%;80;95;0;100
Scope the query to a specific ISV server:
./check_rlm.py 5053 license-server converge_gui --mode status --isv csciUse --output-format json to produce machine-readable output:
./check_rlm.py 5053 license-server converge_gui --mode usage --isv csci --warn-pct 80 --crit-pct 95 --output-format jsonExpected output:
{"status": "OK", "exit_code": 0, "message": "Feature 'converge_gui': 3/25 licenses in use (12.0%)", "performance_data": {"licenses_total": 25, "licenses_used": 3, "licenses_available": 22, "utilization_pct": 12.0}, "check_mode": "usage"}The JSON object always contains:
| Field | Type | Description |
|---|---|---|
status |
string | One of OK, WARNING, CRITICAL, UNKNOWN |
exit_code |
int | Nagios exit code (0–3) |
message |
string | Human-readable status message |
performance_data |
object | Metrics as key-value pairs |
check_mode |
string | The check mode that was executed |
Enable structured file logging with --log-file:
./check_rlm.py 5053 license-server converge_gui --mode status --isv csci --log-file /var/log/check_rlm.logLog entries are written in append mode, one per line:
2024-01-15T10:30:00+00:00 INFO [license-server:5053/converge_gui/status] Check starting
2024-01-15T10:30:01+00:00 INFO [license-server:5053/converge_gui/status] Check completed: OK (exit_code=0)
- Timestamps are ISO 8601 with timezone offset
- Levels:
DEBUG,INFO,WARNING,ERROR - Log file is created automatically if it does not exist
- Write failures are silently ignored — logging never causes the check to fail
Configure the following commands in Nagios XI Core Config Manager (CCM) under Commands.
Command Name: check_rlm_status
Command Line: $USER1$/check_rlm.py $ARG1$ $HOSTADDRESS$ $ARG2$ --mode status
| Macro | Purpose |
|---|---|
$ARG1$ |
Port |
$ARG2$ |
Feature |
$ARG3$ |
ISV server name (optional) |
To include the optional ISV argument, use this command line instead:
$USER1$/check_rlm.py $ARG1$ $HOSTADDRESS$ $ARG2$ --mode status --isv $ARG3$
Command Name: check_rlm_expiry
Command Line: $USER1$/check_rlm.py $ARG1$ $HOSTADDRESS$ $ARG2$ --mode expiry --warning-days $ARG3$ --alert-days $ARG4$
| Macro | Purpose |
|---|---|
$ARG1$ |
Port |
$ARG2$ |
Feature |
$ARG3$ |
Warning days threshold |
$ARG4$ |
Alert (critical) days threshold |
$ARG5$ |
ISV server name (optional) |
To include the optional ISV argument:
$USER1$/check_rlm.py $ARG1$ $HOSTADDRESS$ $ARG2$ --mode expiry --warning-days $ARG3$ --alert-days $ARG4$ --isv $ARG5$
Command Name: check_rlm_usage
Command Line: $USER1$/check_rlm.py $ARG1$ $HOSTADDRESS$ $ARG2$ --mode usage --warn-pct $ARG3$ --crit-pct $ARG4$
| Macro | Purpose |
|---|---|
$ARG1$ |
Port |
$ARG2$ |
Feature |
$ARG3$ |
Warning percentage threshold |
$ARG4$ |
Critical percentage threshold |
$ARG5$ |
ISV server name (optional) |
To include the optional ISV argument:
$USER1$/check_rlm.py $ARG1$ $HOSTADDRESS$ $ARG2$ --mode usage --warn-pct $ARG3$ --crit-pct $ARG4$ --isv $ARG5$
define service {
use generic-service
host_name license-server
service_description RLM Status - converge_gui
check_command check_rlm_status!5053!converge_gui!csci
check_interval 5
retry_interval 1
}define service {
use generic-service
host_name license-server
service_description RLM Expiry - converge_gui
check_command check_rlm_expiry!5053!converge_gui!csci!90!30
check_interval 1440
retry_interval 60
}define service {
use generic-service
host_name license-server
service_description RLM Usage - converge_gui
check_command check_rlm_usage!5053!converge_gui!csci!80!95
check_interval 5
retry_interval 1
}Install test dependencies and run the test suite:
pip install -r requirements-dev.txt
pytestThe test suite uses Hypothesis for property-based testing and pytest as the test runner.
tests/
├── test_parser.py # Round-trip property + parser edge cases
├── test_check_expiry.py # Expiry threshold property + examples
├── test_check_usage.py # Usage threshold property + examples
├── test_check_status.py # Status check examples and edge cases
├── test_output_format.py # Nagios format property + JSON property + examples
├── test_cli.py # Argument parsing and validation
├── test_invoke.py # rlmutil invocation (mocked subprocess)
└── test_logging.py # Logger behavior
