Monthly Archives: October 2016

CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

 

CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

check_nrpe-received-0

Testing check_nrpe from nagios server to one of our nrpe hosts..

[18:36][[email protected] /etc/nagios/hosts]# /usr/lib64/nagios/plugins/check_nrpe -H 192.XXX.XX.XX -c check_disk -a 60 80 /
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

As we can see (first image), nagios server can see/ping the nrpe host…

Taking a look of my logs at the nrpe host located at

  • ubuntu – /var/log/syslog
  • centos – /var/log/messages
Oct 20 14:51:56 ubuntu-512mb-nyc1-01 nrpe[17097]: Error: Request contained command arguments!
Oct 20 14:51:56 ubuntu-512mb-nyc1-01 nrpe[17097]: Client request was invalid, bailing out...

This means that nrpe isn’t configured to allow command arguments.

Some possible ways to fix it!..

POSSIBLE SOLUTION Nº 1

Matt Yakel said that he had to add the following line to to the /etc/services

nrpe 5666/tcp # nrpe

Mine already had it so…. this wasn’t my problem.

POSSIBLE SOLUTION Nº 2

WELL!, since this was taking to long!
I decided to make the request without passing arguments from the server to the host.
This way, we can have dont_blame_nrpe=0.

Like *everyone* else uses, I’v defined check_nrpe_1arg command on my nagios server on file /etc/nagios/objects/commands.cfg.

Edit

nano /etc/nagios/objects/commands.cfg

Add the following lines to it

define command{
   command_name        check_nrpe_1arg
   command_line        $USER1$/check_nrpe -H $HOSTADDRESS$ -C $ARG1$
}

Now, on the file of the desired host configuration file (/etc/nagios/hosts/), lets replace check_nrpe for check_nrpe_1arg and remove the arguments.

Example

define service {
 use generic-service
 host_name sdxxx.host.com
 service_description DISK: root partition
 check_command check_nrpe_1arg!check_disk
}

On nagios nrpe host, on nrpe.cfg we need to use the hardcoded command arguments.

Example

command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p /
command[check_procs]=/usr/lib/nagios/plugins/check_procs -w 300 -c 500 -s RSZDT
command[check_apt]=/usr/lib/nagios/plugins/check_apt

This possible solution worked for me. 🙂

 

Install a plugin on discourse

So!,

One of my clients needs a plugin on his discourse installation!
First you need to update your discourse installation!

Then grab the GIT url from the plugin.

captura-de-ecra%cc%83-2016-10-21-as-09-25-13

Let’s edit app.yml

nano /var/discourse/containers/app.yml

and add the url of plugin’s git (author recommends, for those with discourse running the latest version to use -b beta)

- git clone -b beta https://github.com/gdpelican/babble.git

captura-de-ecra%cc%83-2016-10-21-as-10-50-02

Rebuild the container!

cd /var/discourse
./launcher rebuild app

 

https://meta.discourse.org/t/babble-a-chat-plugin/31753

 

nagios check_yum

Okay!, here we go.

Download  check_yum plugin from https://github.com/calestyo/check_yum/blob/master/check_yum to /usr/lib64/nagios/plugins/ on your CentOS nrpe server.

Add the command on your nagios.cfg

command[check_yum]=/usr/lib64/nagios/plugins/check_yum

 

Restart NRPE

/bin/systemctl restart  nrpe.service

And on your nagios server on your host/s5.domain.com.cfg

define service {
    use                    generic-service
    host_name              s5.domain.com
    service_description    SYS: system updates
    check_command          check_nrpe!check_yum!1
}

 

Restart Nagios

/bin/systemctl restart  nagios.service