Page 5 of 7

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Posted: Mon Jul 02, 2018 4:50 pm
by cocoyanouck
Yes I think.

I run this command : apt install nagios-nrpe-server

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Posted: Mon Jul 02, 2018 4:56 pm
by scottwilkerson
cocoyanouck wrote:Yes I think.

I run this command : apt install nagios-nrpe-server
On the nagios machine?

You likely need the following for the check_nrpe plugin

Code: Select all

apt install nagios-nrpe-plugin

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Posted: Tue Jul 03, 2018 3:09 am
by cocoyanouck
Sorry, Yes on the nagios-VZ machine.

And Yes I have launched nagios-nrpe-server and nagios-nrpe-plugin one after the other.

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Posted: Tue Jul 03, 2018 9:26 am
by scottwilkerson
Please attach the full commands that are being executed that give the screenshots above

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Posted: Wed Jul 04, 2018 3:18 am
by cocoyanouck
Please find the history of commands on this server :

Code: Select all

1  vi /etc/apt/sources.list
    2  vi /etc/apt/sources.list
    3  apt-get update
    4  apt-get upgrade
    5  apt-get dist-upgrade
    6  apt-get autoremove
    7  sudo apt-get install ssh
    8  apt-get install ssh
    9  cp /media/cdrom/VMwareTools-9.2.2-893683.tar.gz /usr/local/src
   10  cp /media/cdrom/VMwareTools-10.1.15-6677369.tar.gz
   11  cp /media/cdrom/VMwareTools-10.1.15-6677369.tar.gz  /usr/local/src/
   12  cd /usr/local/src/
   13  tar xzf VMwareTools-10.1.15-6677369.tar.gz
   14  cd vmware-tools-distrib/
   15  ./vmware-install.pl
   16  apt install nagios-nrpe-plugin
   17  /usr/lib/nagios/plugins/check_nrpe
   18  cd /usr/lib/nagios/plugins/
   19  ls
   20  cd
   21  vi /etc/nagios-plugins/
   22  cd /etc/nagios-plugins/
   23  ls
   24  cd config/
   25  ls
   26  vi check_nrpe.cfg
   27  vi check_nrpe.cfg
   28  vi check_nrpe.cfg
   29  apt list  --installed |grep nrpe
   30  apt list  --installed |grep libc6
   31  uname -a
   32  cat /etc/*release*
   33  $
   34  apt update
   35  apt upgrade
   36  /usr/lib/nagios/plugins/check_nrpe -H 10.0.2.130
   37  /usr/lib/nagios/plugins/check_nrpe -H localhost
   38  /usr/lib/nagios/plugins/check_nrpe -V
  39 to 42 : (SOME BAD cp text)
   43  apt-get install build-essential openssl perl make php-gd libgd2-xpm-dev libapache2-mod-php libperl-dev libssl-dev daemon apache2-utils unzip
   44  useradd nagios
   45  groupadd nagcmd
   46  usermod -a -G nagcmd nagios
   47  usermod -a -G nagcmd www-data
   48  wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.4.tar.gz
   49  tar -zxvf nagios-4.3.4.tar.gz
   50  cd nagios-4.3.4
   51  ./configure --with-nagios-group=nagios --with-command-group=nagcmd --with-httpd_conf=/etc/apache2/sites-enabled/
   52  make all
   53  make install
   54  make install-init
   55  make install-config
   56  make install-commandmode
   57  make install-webconf
   58  vi /usr/local/nagios/etc/objects/contacts.cfg
   59  htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
   60  a2enmod cgi
   61  service apache2 restart
   62  cd ..
   63  wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz
   64  tar -zxvf /tmp/nagios-plugins-2.2.1.tar.gz
   65  tar -zxvf nagios-plugins-2.2.1.tar.gz
   66  cd nagios-plugins-2.2.1
   67  ./configure --with-nagios-user=nagios --with-nagios-group=nagios
   68  make
   69  make install
   70  /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
   71  /etc/init.d/nagios start
   72  systemctl enable nagios
   73  apt install nagios-nrpe-server
   74  vi /etc/nagios/nrpe.cfg
   75  /etc/init.d/nagios start
   76  system nrpe restart
   77  systemctl enable nrpe.service
   78  service nrpe start
   79  service nrpe restart
   80  systemctl start nrpe.service
   81  restart nrpe
   82  cd /usr/local/nagios/libexec/
   83  ls
   84  apt list  --installed |grep nrpe
   85  /usr/lib/nagios/plugins/check_nrpe -H 10.0.2.130
   86  cd
   87  /usr/lib/nagios/plugins/check_nrpe -H 10.0.2.130
   88  cd /usr/lib/nagios/plugins/
   89  ls
   90  ./check_nrpe -H localhost
   91  ./check_nrpe -H 10.0.2.130
   92  vi /etc/nagios/nrpe.cfg
   93  lsof -i:5666
   94   chkconfig --add nrpe
   95  cd
   96  chkconfig --add nrpe
   97  iptables -I RH-Firewall-1-INPUT 10 -p tcp --dport 5666 -j ACCEPT
   98  /etc/init.d/nagios-nrpe-server start
   99  cd /usr/lib/nagios/plugins/
  100  ./check_nrpe -H 10.0.2.130
  101  vi /usr/local/nagios/etc/objects/commands.cfg
  102  ./check_nrpe -H 10.0.2.130
  103  vi /etc/nagios/nrpe.cfg
  104  ./check_nrpe -H 10.0.2.130
  105  ./check_nrpe -H localhost
  106  netstat -nlp|grep 5666
  107  apt install netstat
  108  apt install net=tools
  109  apt install net-tools
  110  netstat -nlp|grep 5666
  111  cd /etc/nagios/
  112  cat nrpe.cfg
  113  /etc/init.d/nagios-nrpe-server start
  114  cd /usr/lib/nagios/plugins/
  115  ./check_nrpe -H 10.0.2.130
  116  cd /usr/lib/nagios/plugins/
  117  ./check_nrpe -H localhost
  118  wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.4.1.tar.gz
  119  tar xzf nagios-4.4.1.tar.gz
  120  cd nagios-4.4.1
  121  ./configure --with-command-group=nagcmd
  122  make all
  123  make install
  124  /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
  125  service nagios restart
  126  D3bi@n
  127  su
  128  su
  129  cd /usr/lib/nagios/plugins/
  130  ./check_nrpe -h|head -8
  131  ./check_nrpe -H localhost
  132  ./check_nrpe -H 10.0.2.130
  133  cd /usr/lib/nagios/plugins/
  134  ./check_nrpe -H 10.0.2.130
  135  ./check_nrpe -H localhost
  136  service nrpe stop
  137  service nrpe.service stop
  138  chmod 777 /etc/nagios/nrpe/cfg
  139  chmod 777 /etc/nagios/nrpe.cfg
  140  service start nrpe
  141  service nrpe start
  142  service nrpe start
  143  /etc/init.d/nagios-nrpe-server start
  144  cd /usr/local/nagios/libexec/
  145  ls
  146  cd /usr/lib/nagios/
  147  ls
  148  cd plugins/
  149  ms
  150  ls
  151  ./check_nrpe -H 10.0.2.130
  152  cd /usr/lib/nagios/plugins/
  153  ./check_nrpe -H localhost
  154  vi /etc/nagios/nrpe.cfg
  155  vi /etc/nagios/nrpe.cfg
  156  service nrpe restart
  157  restart nrpe
  158  reboot
  159  cd /usr/lib/nagios/plugins/
  160  ./check_nrpe -H localhost
  161  ./check_nrpe -H 10.0.2.130
  162  ./check_nrpe -H 10.0.2.130
  163  cp /usr/lib/nagios/plugins/check_* /usr/local/nagios/libexec
  164  /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
  165  service nagios restart
  166  history
So, apt nagios-nrpe-server found on line 70, but no nagios-nrpe-plugin.
I made a snapshot of this virtual machine, and configured it many times, so It seems this time, I have forgotten it ...

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Posted: Thu Jul 05, 2018 9:29 am
by scottwilkerson
Did everything work after installing it?

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Posted: Thu Jul 05, 2018 2:51 pm
by cocoyanouck
Nop this had never work on this server.

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Posted: Thu Jul 05, 2018 4:31 pm
by scottwilkerson
Please post the output of the following from the nagios server

Code: Select all

ls -al /usr/local/nagios/libexec/check_nrpe
per your screenshot the file doesn't even exist

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Posted: Fri Jul 06, 2018 2:06 am
by cocoyanouck

Code: Select all

-rwxr-xr-x 1 root nagios 43056 juil.  2 11:00 /usr/local/nagios/libexec/check_nrpe

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Posted: Fri Jul 06, 2018 1:17 pm
by scottwilkerson
your screenshot in Capture.PNG of this post shows that the file doesn't exist
https://support.nagios.com/forum/viewto ... 30#p255342

Are you sure these are the same servers?

Can you show the nagios configs for these services?