Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Problems with NRPE
« previous
next »
Print
Pages: [
1
]
Author
Topic: Problems with NRPE (Read 40 times)
kgcrgi
Newbie
Posts: 1
Karma: 0
Problems with NRPE
«
on:
October 30, 2024, 11:05:04 am »
Hi, I have a problem using a custom script via NRPE. The scripts installed with the plugin work. Here is the config:
log_facility=daemon
log_file=/var/log/nrpe.log
debug=0
pid_file=/var/run/nrpe/nrpe.pid
nrpe_user=nagios
nrpe_group=nagios
server_port=5666
server_address=<opn server>
allowed_hosts=<nagios ip>,127.0.0.1
command_timeout=60
connection_timeout=300
dont_blame_nrpe=0
allow_bash_command_substitution=0
include=/usr/local/etc/nrpe_commands.cfg
nrpe_commands:
command[bgp_state]=/usr/local/libexec/nagios/check_bgp_state2.py
command[check_users]=/usr/local/libexec/nagios/check_users -w 5 -c 10
command[test_vtysh]=/usr/local/bin/vtysh -c "show ip bgp summary
/etc/nagios4/conf.d# /usr/lib/nagios/plugins/check_nrpe -H <opn server> -p 5666 -c bfd_state
NRPE: Unable to read output
/usr/lib/nagios/plugins/check_nrpe -H <opn server> -p 5666 -c check_users
USERS OK - 0 users currently logged in |users=0;5;10;0
I tried various scripts, both python and bash, complex and simple, each of them had exit codes adapted for nagios.
I tried adding sudo to the command, or the full path to sudo.
I added an entry in sudoers to the path where all the scripts are.
nagios ALL=(ALL) NOPASSWD: /usr/local/libexec/nagios/*
The script has permissions like those that work.
In the scripts I checked the output character limit. Is it in utf-8 format?
Locally, when I use the nagios user, the script works.
Where could the error be?
I also ran debug, but it didn't show anything of value.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Problems with NRPE