Metrics and health checks in WikiOasis are distributed across every server in the fleet. Prometheus exporters expose machine- and service-level metrics that the monitoring server scrapes; NRPE (Nagios Remote Plugin Executor) agents run active checks that Icinga2 polls. Both systems are wired up automatically viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wikioasis/salt/llms.txt
Use this file to discover all available pages before exploring further.
top.sls — role-specific exporters and checks are applied to matching host groups without any manual targeting.
Prometheus Exporters
Seven exporter types expose metrics on fixed ports. The monitoring server’s
file_sd targets are auto-generated from the dns_hosts pillar.NRPE Checks
nrpe_common runs on every host; role-specific check states add service-level probes on top.Prometheus exporters overview
| Exporter state | Port | Deployed to | Package / binary |
|---|---|---|---|
monitoring.node_exporter | 9100 | All servers (*) | prometheus-node-exporter |
monitoring.mysqld_exporter | 9104 | db* | prometheus-mysqld-exporter |
monitoring.haproxy_exporter | 9101 | proxy* | prometheus-haproxy-exporter |
monitoring.redis_exporter | 9121 | redis* | prometheus-redis-exporter |
monitoring.statsd_exporter | 9102 | monitoring* | Binary from GitHub releases |
monitoring.phpfpm_exporter | 9253 | apps*, mw*, staging*, task* | Binary from GitHub releases |
monitoring.opensearch_exporter | 9114 | opensearch* | prometheus-elasticsearch-exporter |
phpfpm_exporter and statsd_exporter are not available in the Debian apt repository and are installed by extracting upstream release archives. Their systemd unit files are managed directly by Salt.node_exporter (port 9100)
monitoring/node_exporter.sls is applied to every server via top.sls ('*' matcher). It installs prometheus-node-exporter from the Debian repository and ensures the service is running and enabled.
node_exporter.sls
Apply
mysqld_exporter (port 9104)
monitoring/mysqld_exporter.sls is applied to db* servers. It installs prometheus-mysqld-exporter and writes a .my.cnf credential file at /etc/prometheus/mysqld.my.cnf, owned root:prometheus with mode 0640.
The exporter connects to MariaDB on 127.0.0.1:3306 as the prom_exporter user. The password is sourced from monitoring:mysqld_exporter_password in the private pillar.
/etc/prometheus/mysqld.my.cnf (rendered)
ARGS in /etc/default/prometheus-mysqld-exporter point the exporter at that file:
/etc/default/prometheus-mysqld-exporter
Apply
haproxy_exporter (port 9101)
monitoring/haproxy_exporter.sls is applied to proxy* servers. It installs prometheus-haproxy-exporter and configures it to scrape HAProxy metrics via the Unix stats socket at /run/haproxy/admin.sock.
Because the socket has mode 660 and group haproxy, the state adds the prometheus system user to the haproxy group:
haproxy_exporter.sls (group membership)
/etc/default/prometheus-haproxy-exporter
Apply
redis_exporter (port 9121)
monitoring/redis_exporter.sls is applied to redis* servers. It installs prometheus-redis-exporter from the Debian repository and starts the service with no additional configuration — the exporter connects to Redis on localhost:6379 by default.
Apply
opensearch_exporter (port 9114)
monitoring/opensearch_exporter.sls is applied to opensearch* servers. It uses the prometheus-elasticsearch-exporter package (which is API-compatible with OpenSearch) and configures it to connect to the local OpenSearch instance on port 9200.
/etc/default/prometheus-elasticsearch-exporter
Apply
phpfpm_exporter (port 9253)
monitoring/phpfpm_exporter.sls is applied to apps*, mw*, staging*, and task* servers. Because there is no Debian package, Salt downloads the upstream release archive from GitHub and installs it under /opt/phpfpm_exporter/, then creates a symlink at /usr/local/bin/prometheus-phpfpm-exporter.
phpfpm_exporter.sls (archive install)
php:version pillar (defaulting to 8.3):
prometheus-phpfpm-exporter.service (rendered for PHP 8.3)
Apply
statsd_exporter (port 9102)
monitoring/statsd_exporter.sls is applied only to monitoring* servers. Like phpfpm_exporter, there is no Debian package — Salt extracts the binary from the upstream GitHub release into /opt/statsd_exporter/ and symlinks it to /usr/local/bin/prometheus-statsd-exporter.
A prometheus system user (no login shell, home /var/lib/prometheus) is created before the service starts:
statsd_exporter.sls (user creation)
prometheus-statsd-exporter.service
Apply
NRPE system
NRPE (Nagios Remote Plugin Executor) is the active-check agent that Icinga2 uses to run checks on remote hosts. The base agent (monitoring.nrpe) is installed on every server, then role-specific drop-in states add check definitions to /etc/nagios/nrpe.d/.
Base NRPE agent (monitoring.nrpe)
monitoring/nrpe/init.sls installs four packages and writes the main nrpe.cfg:
nagios-nrpe-server— the NRPE daemon itselfmonitoring-plugins-basic— standard check pluginsmonitoring-plugins-standardmonitoring-plugins-contrib
nrpe.cfg template dynamically builds the allowed_hosts list by filtering the dns_hosts pillar for hosts whose names start with monitoring. All drop-in check definitions are loaded from include_dir=/etc/nagios/nrpe.d.
nrpe.cfg (rendered, excerpt)
Apply
nrpe_common — checks on all servers
monitoring/nrpe_common.sls deploys two drop-in check definitions to every server:
| Check command | Plugin | Description |
|---|---|---|
check_mem | check_mem.sh | Memory usage — warn at 95%, crit at 100% |
check_apt | check_apt (standard plugin) | Pending package upgrades |
/etc/nagios/nrpe.d/mem.cfg
Apply
nrpe_salt — salt-minion check (all servers)
monitoring/nrpe_salt.sls deploys check_systemd_service.sh (a generic systemd unit status script) to all servers and registers check_salt_minion:
/etc/nagios/nrpe.d/salt_minion.cfg
Apply
nrpe_salt_master — salt-master check (salt* servers)
monitoring/nrpe_salt_master.sls is applied only to salt* servers. It adds the check_salt_master command using the same check_systemd_service.sh script deployed by nrpe_salt. The script is required to already be present (installed by nrpe_salt) before the drop-in is written.
/etc/nagios/nrpe.d/salt_master.cfg
Apply
nrpe_haproxy — HAProxy backend checks (proxy* servers)
monitoring/nrpe_haproxy.sls adds two custom HAProxy check scripts and the haproxy.cfg drop-in. The nagios user is added to the haproxy group so it can read the stats socket (/run/haproxy/admin.sock, mode 660 haproxy:haproxy).
| Check command | Script | Description |
|---|---|---|
check_haproxy | check_haproxy.sh | Overall HAProxy health via stats socket |
check_haproxy_backends | check_haproxy_backends.sh | Status of all configured backends |
Apply
nrpe_mediawiki — MediaWiki HTTP health check (mw*, staging*)
monitoring/nrpe_mediawiki.sls deploys check_mediawiki.sh and registers the check_mediawiki command. The script performs an HTTP health check against the local MediaWiki installation.
Apply
nrpe_metal — RAID and SMART disk checks (metal* servers)
monitoring/nrpe_metal.sls handles bare-metal disk monitoring. It installs smartmontools, creates a sudoers entry allowing nagios to run smartctl without a password, and deploys two check scripts:
| Check command | Script | Description |
|---|---|---|
check_smart | check_smart.sh | SMART disk health |
check_raid | check_raid.sh | Software RAID array status |
/etc/sudoers.d/nagios-smartctl
Apply
nrpe_nginx — Nginx error log check (nginx servers)
monitoring/nrpe_nginx.sls adds the nagios user to the adm group (which has read access to /var/log/nginx/) and deploys check_nginx_errors.sh along with nginx.cfg.
| Check command | Script | Description |
|---|---|---|
check_nginx_errors | check_nginx_errors.sh | Nginx error log rate check |
apps*, mw*, staging*, task*, and monitoring* servers (any host running Nginx).
Apply
nrpe_opensearch — OpenSearch cluster health (opensearch* servers)
monitoring/nrpe_opensearch.sls deploys check_opensearch.sh and the opensearch.cfg drop-in.
| Check command | Script | Description |
|---|---|---|
check_opensearch | check_opensearch.sh | OpenSearch cluster health (green/yellow/red) |
Apply
nrpe_php — PHP-FPM pool and error log checks (apps*, mw*, staging*, task*)
monitoring/nrpe_php.sls installs libfcgi-bin (required to query the FPM status page via FastCGI), adds nagios to the adm group for log access, and deploys two check scripts with templated .cfg files (the PHP version and pool name are resolved from the php pillar).
| Check command | Script | Description |
|---|---|---|
check_php_fpm | check_php_fpm.sh | PHP-FPM pool status page (process count, queue depth) |
check_php_errors | check_php_errors.sh | PHP error log rate |
Apply
nrpe_redis — Redis ping check (redis* servers)
monitoring/nrpe_redis.sls deploys check_redis.sh and the redis.cfg.jinja drop-in (templated for the configured Redis port/socket).
| Check command | Script | Description |
|---|---|---|
check_redis | check_redis.sh | Redis PING/PONG health check |
Apply
top.sls assignments
The following excerpt fromtop.sls shows how all exporter and NRPE states are distributed:
top.sls (monitoring-related assignments)