I configured Nagios core 3.4 in ubuntu 12.04, it's working fine
If any Service down, am getting Mail notification. but If any host down, am not getting notification
Service notification is working, but Host not working
-
praveen.ks
- Posts: 41
- Joined: Wed May 29, 2013 5:35 pm
Re: Service notification is working, but Host not working
Hi praveen.ks,
Could you post the host definition please, as well as any related templates.
In the nagios admin console, do you see the notification being sent when the host is down?
Thank you.
Kind Regards,
Gary Shergill
Could you post the host definition please, as well as any related templates.
In the nagios admin console, do you see the notification being sent when the host is down?
Thank you.
Kind Regards,
Gary Shergill
-
praveen.ks
- Posts: 41
- Joined: Wed May 29, 2013 5:35 pm
Re: Service notification is working, but Host not working
Hi,
Host Def:
define host{
use generic-printer ; Inherit default values from a template
host_name P1XX ; The name we're giving to this printer
alias HP LaserJet 2605dn ; A longer name associated with the printer
address 172.17.123.x ; IP address of the printer
hostgroups network-printers ; Host groups this printer is associated with
}
define host{
use generic-printer ; Inherit default values from a template
host_name P23XX ; The name we're giving to this printer
alias HP LaserJet 2605dn ; A longer name associated with the printer
address 172.17.xx.xx ; IP address of the printer
hostgroups network-printers ; Host groups this printer is associated with
}
Command.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/mail -s "[email protected]" "** $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$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Host Def:
define host{
use generic-printer ; Inherit default values from a template
host_name P1XX ; The name we're giving to this printer
alias HP LaserJet 2605dn ; A longer name associated with the printer
address 172.17.123.x ; IP address of the printer
hostgroups network-printers ; Host groups this printer is associated with
}
define host{
use generic-printer ; Inherit default values from a template
host_name P23XX ; The name we're giving to this printer
alias HP LaserJet 2605dn ; A longer name associated with the printer
address 172.17.xx.xx ; IP address of the printer
hostgroups network-printers ; Host groups this printer is associated with
}
Command.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/mail -s "[email protected]" "** $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$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Re: Service notification is working, but Host not working
Hi praveen.ks,
Could you post the generic-printer template please.
When you go to the Nagios web interface, on the left hand side go to Reports - Notifications, and check if anything is being sent out from there when the host goes down.
Thank you.
Kind Regards,
Gary Shergill
Could you post the generic-printer template please.
When you go to the Nagios web interface, on the left hand side go to Reports - Notifications, and check if anything is being sent out from there when the host goes down.
Thank you.
Kind Regards,
Gary Shergill
Re: Service notification is working, but Host not working
@ praveen.ks
You don't have any contacts defined for P1XX and P23XX hosts. Unless you have a contact defined in the "generic-printer" template, you are not going to receive any alerts for them.
You don't have any contacts defined for P1XX and P23XX hosts. Unless you have a contact defined in the "generic-printer" template, you are not going to receive any alerts for them.
Be sure to check out our Knowledgebase for helpful articles and solutions!