mychel
(usa Debian)
Enviado em 03/11/2009 - 10:49h
Olá pessoal,
Estou com o nagios configurado e perfeitamente funcionando para hosts e services.
No entanto não estou conseguindo enviar notificações.
Se eu digitar a linha de comando printf "teste"|/usr/bin/mutt -s "subject" meuemail@dominio.com.br" , recebo o email.
Mas quando surge uma notificação no nagios, nao recebo a notificação.
Segue abaixo como está configurado o commands.cfg e o contacts.cfg.
#COMMANDS.CFG
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mutt -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mutt -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
#CONTACTS.CFG
# CONTACTS
define contact{
contact_name nagiosadmin
use generic-contact
alias Administrador do Nagios
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,u,r
service_notification_options w,u,c,r
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
email [EMAIL PROTECTED]
}
define contact{
contact_name users
use generic-contact
alias tecnicos
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,u,r
service_notification_options w,u,c,r
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
email [EMAIL PROTECTED]
}
# CONTACT GROUPS
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
define contactgroup{
contactgroup_name tecn
alias tecnicos
members users
}
alguem sabe dizer se falta algum configuração a ser feita??
Desde já agradeço.