os-nrpe adding new Commands will only be available after disable and re-enable NRPE
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:
- I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- The title contains the plugin to which this issue belongs
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:
- Go to Services / NRPE / Commands Tab
- 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"
- Click "Save" and the command is shown in the overview
- Click on "Restart" (or even "Stop" and "Start")
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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