Not Getting Windows Server Reboot Notifications
Posted: Wed Dec 03, 2014 8:47 pm
Hi Guys,
I have copied over my existing configuration for a Nagios 2.2 version to a Nagios 4.0.7 and have been running it for a few months now.
I am not getting an email notification for when a host(server) is rebooted. I used to in the old server.
I am stumped with this one.
Any ideas?
I am using the generic-host template for all my hosts.
Please find a copy of the config.
I appreciate the help with this.
Bryce
generic-host config
host config
Contacts config
Command Config
I have copied over my existing configuration for a Nagios 2.2 version to a Nagios 4.0.7 and have been running it for a few months now.
I am not getting an email notification for when a host(server) is rebooted. I used to in the old server.
I am stumped with this one.
Any ideas?
I am using the generic-host template for all my hosts.
Please find a copy of the config.
I appreciate the help with this.
Bryce
generic-host config
Code: Select all
# Generic host definition template - This is NOT a real host, just a template!
define host{
name generic-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
notification_period 24x7 ; Send host notifications at any time
check_command check-host-alive
max_check_attempts 3
check_interval 1
notification_interval 30
notification_options d,u,r
contact_groups admins
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
Code: Select all
define host {
use generic-host
host_name PERAV01
alias Perth Trend AV Server 1
address 10.1.1.4
}
define service {
host_name PERAV01
service_description Check Drive C:
check_command nt_check_disk_c
use generic-service
}
define service {
host_name PERAV01
service_description Standard Win2k8 Services Check
check_command nt_check_win2k8_std
use generic-service
}
define service {
host_name PERAV01
service_description Eventlog Check
check_command nt_eventlog_60
use generic-service
}
Code: Select all
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
service_notification_period 24x7
host_notification_period 24x7
service_notification_options u,r,c
host_notification_options d,r,u
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
email [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
Code: Select all
# '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/mailx -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$\n" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
# This command checks to see if a host is "alive" by pinging it
# The check must result in a 100% packet loss or 5 second (5000ms) round trip
# average time to produce a critical error.
# Note: Five ICMP echo packets are sent (determined by the '-p 5' argument)
# 'check-host-alive' command definition
define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
}