Install Icinga / Nagios NRPE plugin

# on Icinga / Nagios client
apt-get install -y nagios-nrpe-server
sed -i 's|allowed_hosts=127.0.0.1|allowed_hosts=192.168.1.197|g' /etc/nagios/nrpe.cfg
/etc/init.d/nagios-nrpe-server restart
 
cat <<EOF> /etc/nagios/nrpe.d/my.cfg
command[check_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
command[check_http]=/usr/lib/nagios/plugins/check_http -H localhost
command[check_ssh]=/usr/lib/nagios/plugins/check_ssh localhost
EOF
 
/etc/init.d/nagios-nrpe-server restart
 
# test access
/usr/lib/nagios/plugins/check_nrpe -H <NRPE_CLIENT_IP>
 
# on Icinga / Nagios server
apt-get --no-install-recommends install nagios-nrpe-plugin
 
 
 
cat <<EOF> /etc/icinga/objects/client1.cfg
define host {
    host_name client1
    alias client1 DomU
    address 192.168.1.222
    use generic-host
}
 
define service {
    use generic-service
    host_name client1
    service_description check_users
    check_command check_nrpe_1arg!check_users
}
 
define service {
    use generic-service
    host_name client1
    service_description check_load
    check_command check_nrpe_1arg!check_load
}
 
define service {
    use generic-service
    host_name client1
    service_description check_root
    check_command check_nrpe_1arg!check_root
}
 
define service {
    use generic-service
    host_name client1
    service_description check_zombie_procs
    check_command check_nrpe_1arg!check_zombie_procs
}
 
define service {
    use generic-service
    host_name client1
    service_description check_total_procs
    check_command check_nrpe_1arg!check_total_procs
}
 
define service {
    use generic-service
    host_name client1
    service_description check_http 
    check_command check_nrpe_1arg!check_http
}
 
define service {
    use generic-service
    host_name client1
    service_description check_ssh
    check_command check_nrpe_1arg!check_ssh
}
EOF