Monitoring
NRPE Monitoring
What is available
NRPE (Nagios Remote Plugin Executor) is a small daemon that runs on the monitored host and executes local check scripts on behalf of a remote monitoring server, returning a standard Nagios-style status: OK, WARNING, CRITICAL, or UNKNOWN.
Three Nodeum-specific plugins are provided, all Python 3 scripts:
check_nodeum_services.py
That the core Nodeum services (and their dependencies: Solr, nginx, MariaDB, MongoDB) are active via systemctl
check_nodeum_scsi.py
That the tape drives/media changers known to Nodeum (from the drives DB table) are actually visible as SCSI devices (lsscsi -g)
check_nodeum_tasks.py
That recent task executions (archive/rehydration/etc. rules) haven't failed, errored, or stopped within a given time window
check_nodeum_services
Runs systemctl is-active against two lists of services:
Critical:
nodeum_manager,nodeum_scheduler,nodeum_indexation_engine,nodeum_dm,nodeum_file_system_virt,solr,nginx,mariadb,mongod.Optional:
nodeum_watchdog,nodeum_notifications.
Arguments:
-c/--critical(default1): number of failed critical services that triggersCRITICAL.-w/--warning(default1): number of failed optional services that triggersWARNING.
Exit codes: CRITICAL (2) if failed critical services ≥ -c; else WARNING (1) if failed optional services ≥ -w; else OK (0). UNKNOWN (3) if thresholds are negative or -w > -c.
check_nodeum_scsi
Cross-checks two sources:
The Nodeum database
drivestable (vendor, product, device path, sg device) — i.e. what Nodeum expects to find.The live output of
lsscsi -g— i.e. what the OS actually sees.
It fails if lsscsi can't be parsed, if the DB lists drives but no mediumx-type device exists at all (the media changer), or if a specific expected drive (matched by vendor + product name) can't be found among the tape-type SCSI devices.
Arguments: -d/--debug only (verbose output). No thresholds — it's a binary "all expected drives present" check. Exit codes: CRITICAL (2) on any mismatch or parse failure, OK (0) otherwise.
check_nodeum_tasks
Queries stats_info_exec_rule for task executions that finished, within a [start, end) time window, with status 3 (error), 6 (stopped_by_system), or 8 (finished_with_warnings). 3/6 count as critical, 8 counts as warning.
Arguments:
-s/--start-time,-e/--end-time(required): Unix timestamp orYYYY-MM-DD HH:MM:SS/YYYY-MM-DD HH:MM/YYYY-MM-DD.-w/--warning(default5),-c/--critical(default10): thresholds on the number of warning/critical executions found.-d/--debug.
Exit codes: CRITICAL (2) if critical count ≥ -c; else WARNING (1) if warning count ≥ -w; else OK (0). UNKNOWN (3) on bad thresholds or a DB error.
This check is meant to be called with a rolling window (e.g. "the last hour") computed by the monitoring server/scheduler, not a fixed date — see the example in section 3.
How the plugins can be deployed
Ansible
The nodeum.nrpe role automates everything below, and is part of the standard Nodeum installation playbook (install.yml). It runs on every host where nrpe_enabled: true.
To enable it on a given server, edit that host's inventory file (inventory/host_vars/srv01) ; this section is already present there, commented out / disabled by default:
then re-run the installation playbook as usual (e.g. ansible-playbook -i inventory install.yml). There's no need to invoke the role directly — it's already wired into install.yml behind the nrpe_enabled gate.
Once enabled, the role installs the nrpe/Nagios-plugin OS packages, installs pymysql, deploys the three plugin scripts to /usr/lib/nagios/plugins/, renders the NRPE command config, sets up the sudoers rule, configures SSL, starts the service, and runs a smoke test.
Verify from the NRPE host itself: check_nrpe -H 127.0.0.1 -c check_nodeum_services -a 1 1.
How this integrates through NRPE
Server-side (the monitored Nodeum server)
NRPE needs a command definition per check, telling it which script to run and how to map the $ARGn$ placeholders the monitoring server will send. These live in a config file (template: templates/nodeum_nrpe.cfg.j2), typically dropped into /etc/nrpe.d/nodeum_nrpe.cfg:
Key points:
allowed_hostsis an IP allow-list — the monitoring server's address must be added here (vianrpe_additional_allowed_hostsin Ansible), or NRPE will refuse the connection.dont_blame_nrpe=1is required for any command using$ARGn$; without it, NRPE ignores arguments sent by the client for security reasons.SSL is on by default (TLS between the monitoring server's
check_nrpeand the localnrpedaemon). If disabled (nrpe_use_ssl: false), both the daemon and thecheck_nrpeclient must be called with-n.NRPE listens on TCP port
5666— make sure it's open between the monitoring server and the Nodeum node (firewall/security group).
Client-side (the monitoring server: Nagios / Icinga)
On the monitoring server, define a check_nrpe command and one service check per plugin, passing the same arguments the local command[...] definitions expect, in order:
Example Nagios service object definitions:
($LASTHOURSTART$/$LASTHOURENDTIME$ are placeholders — compute the actual rolling window with your monitoring system's macro/templating mechanism, or wrap the check in an event handler/script that fills in the current time range.)
If SSL is disabled on the node, add -n to every check_nrpe invocation above.
Last updated
Was this helpful?