How to enable nrpe service checks in Icinga for remote host
NRPE is the application to execute Nagios plugins in remote server. We can install nrpe on remote Linux machine by following the steps in the below url.
Once nrpe service is installed and running on remote host, we need to configure Icinga for enabling the checks.
Open the services.conf and update the following lines.
apply Service "Disk" {
import "generic-service"
check_command = "nrpe"
vars.nrpe_command = "check_hda1"
assign where "linux-servers" in host.groups
ignore where match("*icinga*", host.name)
}
apply Service "Processes" {
import "generic-service"
check_command = "nrpe"
vars.nrpe_command = "check_total_procs"
assign where "linux-servers" in host.groups
ignore where match("*icinga*", host.name)
}
apply Service "Load" {
import "generic-service"
check_command = "nrpe"
vars.nrpe_command = "check_load"
assign where "linux-servers" in host.groups
ignore where match("*icinga*", host.name)
}
apply Service "Users" {
import "generic-service"
check_command = "nrpe"
vars.nrpe_command = "check_users"
assign where "linux-servers" in host.groups
ignore where match("*icinga*", host.name)
}
Then create a new file for the new host and update the following line.
object Host "HOSTNAME" {
import "generic-host"
address = "IP"
vars.os = "Linux"
vars.notification["mail"] = {
groups = [ "icingaadmins" ]
}
Here we need to replace HOSTNAME and IP with the required details.
Finally reload the icinga service.
#systemctl reload icinga
That's all…