Terminado de editar o commands.cfg, chegou a hora de editar o arquivo
services.cfg, que define quais itens serão monitorados.
Adicione as linhas abaixo (sempre separo por ## porque não gosto de misturar coisas boas com as ruins).
#################################
# Monitoramento do Windows
#################################
# Serviço espaço em disco
define service{
use service-padrao
host_name Windows
service_description DriveC:
is_volatile 0
check_period diario
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admin
notification_interval 80
notification_period diario
notification_options w,u,c,r
check_command pdm_disk_c
}
# Serviço espaço em disco
define service{
use service-padrao
host_name Windows
service_description DriveD:
is_volatile 0
check_period diario
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admin
notification_interval 80
notification_period diario
notification_options w,u,c,r
check_command pdm_disk_d
}
# Serviço uso cpu
define service{
use service-padrao
host_name Windows
service_description CPU
is_volatile 0
check_period diario
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admin
notification_interval 80
notification_period diario
notification_options w,u,c,r
check_command pdm_cpuload
}
# Serviço uso memória
define service{
use service-padrao
host_name Windows
service_description Memoria
is_volatile 0
check_period diario
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admin
notification_interval 80
notification_period diario
notification_options w,u,c,r
check_command pdm_memload
}
Feito isso, salve o arquivo e verifique a integridade da configuração do Nagios com o seguinte comando:
# nagios -v nagios.cfg
O resultado deve ser parecido com isto:
Nagios 2.11
Copyright (c) 1999-2007 Ethan Galstad (
http://www.nagios.org)
Last Modified: 03-12-2008
License: GPL
Reading configuration data...
Running pre-flight check on configuration data...
Checking services...
Checked 18 services.
Checking hosts...
Checked 3 hosts.
Checking host groups...
Checked 2 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 24 commands.
Checking time periods...
Checked 1 time periods.
Checking extended host info definitions...
Checked 0 extended host info definitions.
Checking extended service info definitions...
Checked 0 extended service info definitions.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0