github mickem/nscp 0.28.0

one hour ago

A web UI page for every module, an agent that suggests what to monitor, and new checks for drives, GPUs, SMB shares and Java

0.28.0 makes the agent easier to set up. Every module with settings now has its own page in the web UI, and a new discovery API looks at the host and suggests which modules to enable. It adds check_smart, check_gpu, check_smb_client, check_jvm and check_csv, brings five Windows checks to Linux, and lets every filter check take -w and -c. It also tightens how SQL checks and client targets handle credentials.

✨ Highlights

  • 🧭 Discovery: the agent says what is on the host. A new admin-only API runs probes on demand: performance counters, SQL Server instances and databases, scripts, services and installed software. From these the agent suggests modules to enable, which the new Suggestions page loads in one click. nscp discovery --suggest does the same from the command line on a fresh install (#1807, #1808, #1814, #1817, #1820).
  • 🖥️ A web UI page for every module. The servers, the clients' targets, the database, WMI, Docker and Kubernetes checks, aliases, scripts, the scheduler and the disk checks each get a page that says plainly what weakens the setup, with Test connection buttons and Show config for an INI fragment. Changes wait for Save. Modules have categories and icons, and the Checks page filters by tag (#1784, #1789, #1794, #1796, #1799, #1801, #1815).
  • 💽 New checks. check_smart reads SMART health natively on Windows and Linux, with no smartctl. On Windows, check_gpu reports GPU load and memory and check_smb_client reports latency to remote shares. check_jvm reads Java applications over Jolokia, and check_csv runs a filter over the rows of a CSV file. All are experimental (#1760, #1767, #1768, #1769, #1770).
  • 🐧 Five Windows checks now run on Linux. check_local_accounts, check_group_members, check_secureboot, check_pending_reboot and check_hardware use the same keywords and output, so one policy works on both platforms (#1771–#1775).
  • 🎚️ -w, -c and show-query. Every filter check takes the short thresholds other plugins use (check_cpu -w 80 -c 90, check_drivesize -w 20%). show-query prints the query a check would run instead of running it. Units such as 500ms, 30min and 4GB parse in full, and every duration keyword accepts them (#1738, #1754, #1757).
  • 🚫 Remove single checks with disabled checks. Enabling a module no longer has to mean offering every check it has. Names listed under [/settings/core] disabled checks are gone for every caller and transport, and answer as if they never existed (#1813).
  • 🔒 Security. SQL checks no longer send the configured login, or the machine account, to a server the request names (#1803). A filter expression that fails is now reported instead of being read as a clean result (#1721).

🔍 Detailed changes

🧭 Discovery

GET /api/v2/discovery lists the probes and POST /api/v2/discovery/<probe> runs one. nscp test gains discover and discover <probe> [module].

Probe Module Answers
pdh.counters CheckSystem (Windows) The performance counters on the host. This replaces /api/v2/metadata/counters.
host.services, host.software CheckSystem Every service and whether it runs, and every installed package.
mssql.instances CheckMSSQL The SQL Server instances installed, with version and edition.
mssql.databases, mysql.databases CheckMSSQL, CheckMySQL The databases the configured login can see.
scripts.external, scripts.python, scripts.lua the script modules The files under the configured script root.

GET /api/v2/discovery/recommendations turns the presence probes into suggestions: SQL Server, MySQL/MariaDB, Docker, IIS and Hyper-V to begin with, each with the checks that apply and the reason, followed by the basic health modules. The web UI uses the probes for the Discovery and Suggestions pages, a Found on this host mark in the module list, Pick a counter on check_pdh, and suggestions in the SQL and script fields.

From the command line. nscp discovery needs no web server, login or running service, and loads CheckSystem for the run when the configuration does not enable it, so a fresh install gets suggestions straight away:

nscp discovery --list                 # the probes
nscp discovery --run host.services    # run one
nscp discovery --suggest              # modules worth enabling, and why
nscp discovery --enable-suggested     # enable them (restart the service to load them)

--json prints what the REST API answers. The recommendations answer gains an enabled field beside loaded: whether the module is enabled in the configuration and so survives a restart (#1820).

A probe takes no host, path or credential. It reads only what the module's saved settings say, keeps nothing it returns, and runs only over REST and the local console. Every endpoint needs the new discovery.run grant, which only the built-in full role holds.

🖥️ Web UI — a page for every module

  • Servers. NRPE, NSCA, NSClient, NCPA, check_mk, the web server and the Icinga agent each get one page with every setting. A Default / Local switch decides whether a value lives in [/settings/default], and the page lists the exact changes before saving them. The page says what weakens the setup (no encryption, a password sent in clear, anonymous web access, an Icinga parent trusted unverified) and will not save a configuration the agent would refuse to start. The web server's roles get an editor of their own.
  • Client targets. One card per client module, with security as a single choice where the protocol has modes. NRPE and NSCP targets have a Test button.
  • Credentialed checks. Pages for SQL Server, MySQL/MariaDB, WMI, Docker and Kubernetes, each with Test connection. The SQL pages list Other servers for target=.
  • Scripts and scheduling. Aliases with a check picker, external scripts with the argument risk spelled out, and a schedule editor that marks schedules the agent would refuse.
  • Everything else. The disk checks' allowed paths, Hyper-V, scheduled tasks, the command line, the result cache and the file writer. A module with no settings says so.
  • How the pages behave. List rows are queued and written by the page's Save, which sits in a bar pinned to the bottom of the window. Save and reload writes the configuration file. "Show advanced" is now Expert mode, which shows the plain schema form.
  • Finding things. Modules declare a category (check, database, container, server, client, script, scheduling, tool) and have icons. Queries is renamed Checks, with tags and an icon per check, and the menu is regrouped. The dashboard graphs keep 30 minutes of history across page changes. The Linux real-time filters use the same editor as the Windows ones.

💽 New checks

Check Platform What it checks
check_smart Windows, Linux Each drive's own verdict and early-warning attributes: reallocated, pending and uncorrectable sectors, wear, temperature. Needs an elevated agent. A drive it cannot read is UNKNOWN, not healthy.
check_gpu Windows 10 1709 / Server 2019+ Load of the busiest engine and per engine type, and dedicated and shared memory, from the vendor-neutral GPU counters.
check_smb_client Windows 8 / Server 2012+ Read and write latency, credit stalls and queue length for each remote share the host has open.
check_jvm all Heap, threads, GC and classes over a Jolokia agent, plus any MBean attribute as a keyword of its own (attribute=alias=mbean/attribute).
check_csv all Rows of a CSV file as filter records. Columns are declared with columns= or read from the header. It shares check_logfile's file access gate and is capped by max csv size.

🐧 Linux — account, boot and inventory checks

Check Reads Notes
check_local_accounts /etc/passwd, /etc/shadow New keywords uid, shell, interactive, is_extra_uid0, password_state, password_age, ... UNKNOWN when /etc/shadow is unreadable, unless allow-unreadable-shadow is passed.
check_group_members /etc/group, /etc/passwd Defaults to sudo or wheel and includes primary-group members.
check_secureboot /sys/firmware/efi New setup_mode keyword.
check_pending_reboot reboot markers, installed kernels Covers the RHEL family, which has no marker. Experimental.
check_hardware /sys/class/dmi/id, SMBIOS Serials, UUID and per-DIMM data need root. A new gather_errors keyword says what could not be read (#1809). Experimental.

🎚️ Filters — short thresholds, show-query and units

check_cpu -w 80 -c 90                 # warning=load > 80, critical=load > 90
check_drivesize -w 20% -c 10%         # free < 20%, free < 10%
check_process process=nginx -c 1:     # critical when fewer than 1 match
check_cpu -w 80 show-query            # prints the resolved query instead of running it

Each check knows which keyword a bare number bounds. Monitoring-plugins ranges (10:, ~:10, @10:20) work, and help names the keyword for each command. show-query masks credential options as ***.

Units are read whole (500ms, 30min, 4GB, 1GiB). Keywords that count milliseconds now take durations, keywords that count days take d and w, and a unit a keyword does not take is an error instead of a bare number. The filter words and, or, in, not, like, regexp and the comparison words only match as whole words, so a column named NotAfter or order parses as itself.

🚫 Core — disabled checks

A module used to be all or nothing: enabling CheckSystem for check_cpu also offered check_process, check_service and everything else it registers. The permission policy could limit who runs a check, but the check stayed in place for whoever was granted it. disabled checks takes named checks out of the agent altogether:

[/settings/core]
disabled checks = check_process, check_nscp*
  • Gone for everyone. A disabled check is not listed by nscp test, the REST API or the web UI. Running it over NRPE, REST, the scheduler, a script or nscp client answers Unknown command(s): ..., exactly as for a command nothing provides. Only the agent's log says it was disabled.
  • Names and patterns. Matching ignores case and takes * and ?. Disabling a command also disables its alternative names, and it covers commands from modules, external scripts, aliases and scripts alike.
  • In force from the start. The list applies before the first module loads and is re-read on a settings reload. It is empty by default (#1813).

🛡️ Core — client targets

  • Client targets inherit every setting from their parent. Before, most keys were reset to the built-in default on every target except default. retries now reaches NRPE and NRDP, and its default is 3 (#1804). A parent cycle no longer overflows the stack (#1805).
  • A target's timeout takes effect in the Syslog, SMTP, Check_MK, NSCA and NSCA-NG clients, which always used 30 seconds (#1806).

🔒 Security

  • SQL checks and the configured login. A check_mssql* or check_mysql* request that named server= or host= kept the configured credentials. With the default CheckMSSQL setup, that sent the agent's machine account to a server the caller chose. A request now either uses the configured connection or brings its own server, user and password, and the two never mix. Other servers for the configured login go under [/settings/mssql/targets] / [/settings/mysql/targets] and are picked with target= (#1803).
  • Failed expressions are reported. A regular expression refused by the 0.24.0 limits read as no match, so data built to trip the limit could keep a record from alerting. A failed filter, warning or critical expression now leaves its record without a verdict. A WARNING or CRITICAL the other records reached stands; otherwise the check is UNKNOWN with Filter evaluation failed: ... (#1721).
  • Client target inheritance also carries allow host override, verify mode, ca and credentials set on default to targets that do not set their own.
  • New exposure to know about. The Linux account and inventory checks, and the discovery probes, return data that was not available before. The notices list exactly what.

🐛 Bug fixes

  • check_http json-path compares decimals (100.5 no longer truncates to 100), and a missing or null value is missing instead of 0 (#1781).
  • check_apache_status, check_nginx_status, check_phpfpm_status, check_tomcat_status answer UNKNOWN with no perfdata when they get no data, instead of CRITICAL with zeros (#1788).
  • NSCAServer loads without a key and opens no port, so its settings can still be fixed from the web UI (#1793).
  • CheckMKServer names its Lua script with one script key. The scripts section still works, with a deprecation warning (#1792).
  • Windows service inventory. One service the agent may not read no longer empties services.installed (#1752).
  • check_hardware leaves non-system memory arrays out of the SMBIOS inventory (#1797).
  • Module list. Unloaded modules no longer vanish from the list, and "Loading module" is logged once (#1800).

📦 Packaging

  • The Visual C++ runtime is an MSI feature, VCRuntime. Where Microsoft's redistributable is already installed, REMOVE=VCRuntime keeps the installer from replacing the shared runtime and closing programs that use it. The installer refuses the install when the redistributable is missing or too old (#1810).

⚠️ Upgrade notes

The full list is on the upgrading page, and the security fixes are on the security notices page.

  • SQL checks: a request that names server=, host=, port=, driver=, encrypt=, trust-cert= or tls= must also name user= and password=. connection-string= is no longer a request option, and an empty user= and named-pipe servers are refused. To reach another server with the configured login, list it under targets and pass target=.
  • Client targets: a key set on default now reaches every target that does not set its own. Check allow host override, verify mode, ca and credentials on default. NRPE now tries an unreachable server 4 times; set retries = 2 to keep the old count.
  • Filter evaluation failed: a check that now reports this was not evaluating the expression as written before. Fix the unit, keyword or regular expression it names. A threshold that used a unit on a millisecond, seconds or bytes keyword compared against 0 before, so it may stop firing where it always fired.
  • Web server status checks: an unreachable status page is now UNKNOWN, not CRITICAL. Make sure UNKNOWN notifies.
  • check_http json-path: replace qlen < 1 used to catch a missing field with qlen = 'missing'.
  • Custom roles: the counter list moved from /api/v2/metadata/counters (metadata.get.counters) to the discovery API, which needs discovery.run.
  • Windows MSI with an explicit feature list: add VCRuntime to ADDLOCAL=, or the install is refused on a machine without the redistributable.
  • CheckMKServer: move the file from [/settings/check_mk/server/scripts] to script =.
  • Linux check_local_accounts: UNKNOWN under the packaged nsclient user until it can read /etc/shadow (Debian: the shadow group), or pass allow-unreadable-shadow.

Full Changelog: 0.27.0...0.28.0

Don't miss a new nscp release

NewReleases is sending notifications on new releases.