Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - kgcrgi

#1
General Discussion / Re: Problems with NRPE
November 12, 2024, 04:47:07 PM
up
#2
General Discussion / Problems with NRPE
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.