config remote hosts
-
install nrpe service
-
on debian
$ sudo apt-get install nagios-nrpe-server
-
centos fedora rhel
$ yum install nagios-nrpe
-
-
conf nrpe
-
config file location
$ sudo pico /etc/nagios/nrpe.cfg ... server_port=5666 ...
-
-
initiating nrpe service
-
for redhat based system the nrpe service needs to be added as a startup service
-
on debian ubuntu or linux mint
$ sudo service nagios-nrpe-server restart
-
on centos fedora or rhel
$ sudo service nrpe restart $ chkconfig nrpe on
-
-
verifying nrpe service status
$ tail /var/log/syslog $ netstat -tpln | grep 5666
config nagios core server
-
install nrpe plugin
-
install package
$ sudo apt-get install nagios-nrpe-plugin # redhat based system centos fedora rhel $ yum install nagios-plugins-nrpe
-
edit
check_nrpe
command$ sudo pico /etc/nagios-plugins/config/check_nrpe.cfg define command{ command_name check_nrpe command_line /usr/lib/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c '$ARG1$' }
-
-
defining nagios command for nrpe plugin
$ sudo pico /usr/local/nagios/etc/object/commands.cfg define command{ command_name check_nrpe command_line /usr/lib/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c '$ARG1$' }
-
adding host and command definition
-
define remote hosts and commands to execut remotely on them
# debian ubuntu or linux mint $ sudo pico /usr/local/nagios/etc/servers/node2.cfg ... define service { use generic-service host_name node2 service_description Current Load check_command check_nrpe!check_load check_interval 1 } ...
-
-
restarting nagios service
-
verify config file
# on debian ubuntu or linux mint $ /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg # on centos fedora or rhel $ nagios -v /etc/nagios/nagios.cfg
-
restart
$ sudo service nagios restart
-
config custom commands with nrpe
-
setup on remote servers
-
define commands
$ sudo pico /etc/nagios/nrpe.cfg ... ## Warn if number of instances for process_abc exceeds 10. Critical for 20 ## command[check_process_abc]=/usr/lib/nagios/plugins/check_procs -w 1:10 -c 1:20 -C process_abc ## Critical if the number of instances for process_xyz drops below 1 ## command[check_process_xyz]=/usr/lib/nagios/plugins/check_procs -w 1: -c 1: -C process_xyz ...
-
-
setup on nagios core server
-
to apply the custom commands defined above
# modify the service definition at nagios core server # /etc/local/nagios/etc/objects/nrpe.cfg # /etc/nagios/nrpe.cfg define service { use generic-service host_name node2 service_description check process abc check_command check_nrpe!check_process_abc check_interval 1 } define service { use generic-service host_name node2 service_description check process xyz check_command check_nrpe!check_process_xyz check_interval 1 }
-
fixed
-
CHECK_NRPE: Error - could not complete SSL handshake
-
this error is usually a client side problem
-
nagios client holds
nrpe.cfg
usually at/etc/nagios/nrpe.cfg
-
to fix this problem you need to edit this file
$ sudo pico /etc/nagios/nrpe.cfg ... allowed_host=127.0.0.1,192.168.120.155
-
restart nrpe service
$ sudo /etc/init.d/nagios-nrpe-server restart
-
test this from nagios server
$ sudo /usr/lib/nagios/plugins/check_nrpe -H 192.168.120.152 NRPE v2.15
-