opnsense / opnsense/plugins

os-nrpe adding new Commands will only be available after disable and re-enable NRPE

Open
#5,681 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.2k
Forks
863
Avg merge
2d 6h
Merged PRs (30d)
10

Description

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug
Running os-nrpe plugin 1.2 on OPNsense 26.7.2_2 (amd64).

Adding new Commands will not be available to be checked. Manual Restart or even Stop and Start of the service did not help.

In the "Commands" tab added a new command check_unbound (with /usr/local/libexec/nagios/check_procs) and did restart the nrpe service. But check from remote Nagios server returned only "NRPE: Command 'check_unbound' not defined". Even stopping and starting the service did not help.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Services / NRPE / Commands Tab
  2. Click on [+] and add a new command with "Name: check_unbound", "Command: /usr/local/libexec/nagios/check_procs" and "Arguments: -w 1:1 -c 1:1 -C unbound"
  3. Click "Save" and the command is shown in the overview
  4. Click on "Restart" (or even "Stop" and "Start")
  5. Check from remote Nagios server with '/usr/local/libexec/nagios/check_nrpe -H IP-Address-of-OPNsense -c check_unbound' and it does respond with "NRPE: Command 'check_unbound' not defined".

Expected behavior
The newly added command should be defined and available for remote check.

Cause and Workaround
The file /usr/local/etc/nrpe_commands.cfg is not updated after adding a Command and Restart or Stop/Start of the service. It is only updated when in the General tab "Enable NRPE" is deactivate and "Save", then "Enable NRPE" is activated again and "Save". Now the /usr/local/etc/nrpe_commands.cfg does have the new command in it and the check from remote system works.

PS: As with the check_procs in use, the issue #5059 may cause another problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the NRPE Commands tab workflow and the generated /usr/local/etc/nrpe_commands.cfg file, then compare what happens after Restart or Stop/Start with the General tab disable-and-enable workaround. Reproduce the issue using the shown check_nrpe command; done means a newly saved command is present in the configuration and responds successfully without toggling NRPE.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.