/* HOSTS Definimos los hosts que forman nuestra red */ object Host "ubuntu" { import "generic-host" address = "10.1.1.13" vars.notification["mail"] = { groups = [ "icingaadmins" ] } } object Host "mint" { import "generic-host" address = "10.1.1.124" vars.notification["mail"] = { groups = [ "icingaadmins" ] } } object Host "windows" { import "generic-host" address = "10.1.1.19" vars.notification["mail"] = { groups = [ "icingaadmins" ] } } /* SERVICIOS GENERICOS Definimos los servicios que queremos monitorizar y en qué hosts hacerlo. */ object Service "servicio-ssh" { import "generic-service" host_name = "ubuntu" check_command = "ssh" vars.notification["mail"] = { groups = [ "icingaadmins" ] } } object Service "servicio-http" { import "generic-service" host_name = "mint" check_command = "http" vars.notification["mail"] = { groups = [ "icingaadmins" ] } } object Service "servicio-ftp" { import "generic-service" host_name = "windows" check_command = "ftp" vars.notification["mail"] = { groups = [ "icingaadmins" ] } } /* MONITORIZACION EN WINDOWS NSClient++ debe estar instalado en Windows. */ object Service "nsclient-disk" { import "generic-service" host_name = "windows" check_command = "nscp" /* la métrica que queremos obtener */ vars.nscp_variable = "USEDDISKSPACE" /* la letra de la unidad de disco */ vars.nscp_params = "c" /* niveles de aviso */ vars.nscp_warn = 70 vars.nscp_crit = 80 /* contraseña de acceso a nsclient */ vars.nscp_password = "12345" vars.notification["mail"] = { groups = [ "icingaadmins" ] } } /* MONITORIZACION POR SSH Ejemplo de como usar SSH para obtener más datos de un host. El comando asignado al modulo "by_ssh" se ejecuta en la máquina remota. */ object Service "ssh-disk" { import "generic-service" host_name = "ubuntu" check_command = "by_ssh" /* check_disk se encuentra en el paquete "monitoring-plugins" de ubuntu */ vars.by_ssh_command = "/usr/lib/nagios/plugins/check_disk -w 30% -c 15% /" /* nombre de usuario remoto */ vars.by_ssh_logname = "alumno" /* clave privada en disco, accesible por el usuario local "nagios" */ vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" vars.notification["mail"] = { groups = [ "icingaadmins" ] } }