Install NRPE on Linux (Ubuntu) remote host

  • sudo apt-get install nagios-nrpe-server
  • Now on remote-host edit /etc/nagios/nrpe.cfg changing:                       allowed_hosts= nagios server ip
  • Add below in the command definition area 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_all_disks]=/usr/lib/nagios/plugins/check_disk -w 20 -c 10 command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200 command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 20 -c 10 Finally, restart nagios-nrpe-server:
  • sudo /etc/init.d/nagios-nrpe-server restart or sudo service nagios-nrpe-server restart
Tasks on Nagios Server
  • Download check_nrpe on nagios server.
  • Install it on /usr/local/nagios/libexec
  • nrpe command definition at /usr/local/nagios/etc/objects/commands.cfg
# Checknrpe define command{ command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ }
  • Now test the connection to the remote server we set up just now. The test should be performed from nagios server. /usr/local/nagios/libexec/check_nrpe -H REMOTE.SERVER.IP NRPE v2.12  [out put should be like this]
  FINALLY BOTH SERVERS SHOULD PERFORM SSL HANDSHAKE you need to add the public key of nagios server to the remote machine create ssh key on nagios server. ssh-keygen add that key on remote server: cat ~/FILENAME.pub >> authorized_keys