Adding contacts and contact groups
Posted: Wed Oct 02, 2019 12:12 pm
I am trying to set up one contact group with 3 contacts in that group. As soon as I changed my contacts.cfg file to add the contacts and restarted nagios, it stopped running. Could you please help out on this? My contacts.cfg file looks something like this :
define contact {
contact_name nagiosadmin1 ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin 1 ; Full name of user
email [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
define contact {
contact_name nagiosadmin2 ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin 2 ; Full name of user
email [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
define contact {
contact_name nagiosadmin3 ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin 3 ; Full name of user
email [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
define contactgroup {
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin1, nagiosadmin2, nagiosadmin3
}
And my host definition looks like this :
define host {
use linux-server
host_name lsbx.icbc.net
alias lsbx
address 10.132.7.200
contact_groups admins
}
And one of my service definitions is :
define service{
use generic-service
host_name lsbx.icbc.net
service_description HTTP
contact_groups admins
check_command check_http
}
define contact {
contact_name nagiosadmin1 ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin 1 ; Full name of user
email [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
define contact {
contact_name nagiosadmin2 ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin 2 ; Full name of user
email [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
define contact {
contact_name nagiosadmin3 ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin 3 ; Full name of user
email [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
define contactgroup {
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin1, nagiosadmin2, nagiosadmin3
}
And my host definition looks like this :
define host {
use linux-server
host_name lsbx.icbc.net
alias lsbx
address 10.132.7.200
contact_groups admins
}
And one of my service definitions is :
define service{
use generic-service
host_name lsbx.icbc.net
service_description HTTP
contact_groups admins
check_command check_http
}