Question

Centreon 22.10 / Debian 11: NRPE 4 ?


Badge +2

Bonjour,

Comment mettre en oeuvre NRPE 4 sous Debian ?

J’ai essayé avec le package nagios-nrpe-server et avec les sources linux-nrpe-agent.tar (cf .https://support.nagios.com/kb/article/nrpe-how-to-install-nrpe-8.html )

[CENTREON_CENTRAL] /usr/lib/nagios/plugins/check_nrpe -H NRPE_SERVER -p 5666 -t 30 -u -c check_centreon_plugins -a 'os::linux::local::plugin' 'cpu'
[NRPE_SERVER] systemctl status nagios-nrpe-server

nrpe[27333]: Error: Request contained command arguments!
nrpe[27333]: Client request from 172.23.202.207 was invalid, bailing out...


12 replies

Userlevel 4
Badge +13

Hello @Fabien34 

Can you check on the monitored server thefile nrpe.cfg?

What is the value for dont_blame_nrpe? 

If it’s 0, you don’t allow the arguments.

Badge +2

Thanks @sduret ,

Yes, on the server side I set dont_blame_nrpe=1 but I still have the error message:

Client request from 172.23.202.207 was invalid, bailing out...

On the central server:

CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).

 

More investigation soon… I hope to give news here.

Userlevel 4
Badge +13
/usr/lib/nagios/plugins/check_nrpe -H XXhostXX -p 5666 -t 60 -2 -P 8192

try with the above if it is on Debian

and confirm your version:

/usr/lib/nagios/plugins/check_nrpe -V
NRPE Plugin for Nagios
Version: 4.0.3

good luck on your tests

Badge +2

Hi @ponchoh ,

/usr/lib/nagios/plugins/check_nrpe -H MyNRPEServer -p 5666 -t 60 -2 -P 8192

→ CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).

 

/usr/lib/nagios/plugins/check_nrpe -V

→ NRPE Plugin for Nagios

→ Version: 4.0.3

 

Pas glop glop…

 

Userlevel 4
Badge +13

Are you using the command from lets say:

  1. hostA to check on hostB? or
  2. hostA to check on hostA? or
  3. ?

 

Userlevel 4
Badge +13

If the NRPE server version is 4.x.x you don’t need to use -2 option

From your centreon server, can you try these commands?

/usr/lib/nagios/plugins/check_nrpe -H MyNRPEServer -p 5666 -t 60 -P 8192
/usr/lib/nagios/plugins/check_nrpe -H MyNRPEServer -p 5666 -t 60

 

Badge +2

Hello,

Here a workaround to Centreon IT using the Linux NRPE 3 plugin.( In fact this is NRPE in version 4).

Note the check_centreon_plugins is required ! 

On the client (NRPE server)

  1.  Add centreon-engine user
    useradd --create-home centreon-engine
  2. # Install gpg
    apt install gpg
  3. # Add Centreon repo
    wget -qO- https://apt-key.centreon.com | gpg --dearmor > /etc/apt/trusted.gpg.d/centreon.gpg
    echo "deb https://apt.centreon.com/repository/22.10/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/centreon.list
    apt update
  4. # Install centreon-nrpe3-daemon
    apt install centreon-nrpe3-daemon centreon-plugin-operatingsystems-linux-local
  5. # Create directory for the plugin cache
    mkdir -p /var/lib/centreon/centplugins/

    chown centreon-engine: /var/lib/centreon/centplugins/
  6. # Add this line, it is missing in the NRPE3 configuration file !
    cat "Add command[check_centreon_plugins]=/usr/lib/centreon/plugins/centreon_linux_local.pl --plugin=$ARG1$ --mode=$ARG2$ $ARG3$" >> /etc/nrpe/centreon-nrpe3.cfg
  1. Restart and check the centreon-nrpe3 service.

Test on the poller:
 /usr/lib/nagios/plugins/check_nrpe -H 172.23.202.143 -p 5666 -t 5 -u -c check_centreon_plugins -a 'os::linux::local::plugin' 'cpu-detailed'  ' --warning-idle= --critical-idle=  --statefile-dir=/var/log/nrpe/centplugins'
 

Actually, NRPE on Centreon is not an easy way !

Badge +2

Hi,

Important: the host model should be modified for calling the check_nrpe client macro.

 

Userlevel 1
Badge +9

Hi, 

i dig out this post and i want to know if this possible to install nagios-nrpe-server from the source but keep the /usr/lib64/nagios/plugins/check_centreon_nrpe3.

The reason, we accounter a nrpe error for check a debian 11.

we are on Centreon 23.04 and we actually use nrpe3 from centreon source for check all our linux (rhel 8) server. But we have now some debian 11 to check and it’s seem not working on some of them ...

Userlevel 4
Badge +13

@SavCent what exactly is not working?

Userlevel 1
Badge +9

Hi @ponchoh 

all my tests give me 

Status information

CHECK_NRPE: Error - Could not connect to 10.10.10.10. Check system logs on 10.10.10.10

 

in the nrpe log on 10.10.10.10 where my poller comme from 10.10.100.159:

[1720421189] CONN_CHECK_PEER: checking if host is allowed: 10.10.100.159 port 695
[1720421189] Connection from 10.10.100.159 port 695
[1720421189] is_an_allowed_host (AF_INET): is host >10.10.100.159< an allowed host >10.10.100.159<
[1720421189] is_an_allowed_host (AF_INET): host is in allowed host list!
[1720421189] Host address is in allowed_hosts
[1720421189] CONN_CHECK_PEER: checking if host is allowed: 10.10.100.159 port 34356
[1720421189] Connection from 10.10.100.159 port 34356
[1720421189] is_an_allowed_host (AF_INET): is host >10.10.100.159< an allowed host >10.10.100.159<
[1720421189] is_an_allowed_host (AF_INET): host is in allowed host list!
[1720421189] Host address is in allowed_hosts
[1720421189] Error: (ERR_get_error_line_data = 337092801), Could not complete SSL handshake with 10.10.100.159: no shared cipher
[1720421189] Error: This could be because you have not specified certificate or ca-certificate files
[1720421189] Connection from 10.10.100.159 closed.
[1720421189] Error: (nerrs = 0) Could not complete SSL handshake with 10.10.100.159: 5
[1720421189] Connection from 10.10.100.159 closed.
 

Userlevel 4
Badge +13

Thank you, this helps:

 

 Could not complete SSL handshake with 10.10.100.159: no shared cipher[1720421189] Error: This could be because you have not specified certificate or ca-certificate files[1720421189] Connection from 10.10.100.159 closed.[1720421189] Error: (nerrs = 0) Could not complete SSL handshake with 10.10.100.159: 5[1720421189] Connection from 10.10.100.159 closed.

 

Do you have something like this?

; CERTIFICATE - Ssl certificate to use for the ssl server
certificate = ${certificate-path}/certificate.pem

Reply