Hi All,
I have created the notification contact named testuser and made this as notification contact for one service. Even the service state is changed, the testuser us not receiving any notifiactions,
please be informed that from the server command line I could send the email to the same user and I can observer that the state is changed in nagios.log file
[1397822095] SERVICE ALERT: oracle;CRITICAL;SOFT;1;the oracle process is not running on the server
This is the contacts.cfg file content
define contact {
contact_name testuser
alias User for testing purpose
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period nagiosadmin_notification_times
service_notification_period nagiosadmin_notification_times
host_notification_options d,u,r,f,s,n,
service_notification_options w,u,c,r,f,s,n,
host_notification_commands xi_host_notification_handler
service_notification_commands xi_service_notification_handler
can_submit_commands 1
email emailid
}
I have changed the host_notification and service_notification commands to notify-host-by-email and notify_service_by_email.
The command definition for notify-service-by-email is below
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: http://nagios/nagios/cgi-bin/status.cgi ... l\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n$LONGSERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Still the issue is not getting resolved.
one more question in the nagios.log file I am observing two states service alert and service notification. what is the difference between them
Regarding the notifications
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Regarding the notifications
Is there a user created for this contact as well? If not you are going to have to change your commands to match:
http://exchange.nagios.org/directory/Do ... ns/details
Can you also show the Service's config file, it looks like a process check for 'oracle'? On one of your hosts.
http://exchange.nagios.org/directory/Do ... ns/details
Can you also show the Service's config file, it looks like a process check for 'oracle'? On one of your hosts.
-
kgopiramesh
Re: Regarding the notifications
Please find the below for the services.cfg file.
define service {
host_name 10.16.192.68
service_description oracle
check_command check-oracle-Process!"/usr/lib/jvm/java/bin/java -server"!!!!!!!
initial_state u
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
event_handler xi_service_notification_handler
event_handler_enabled 1
notification_interval 60
notification_period xi_timeperiod_24x7
notifications_enabled 1
contacts +testuser
contact_groups Testusers
_xiwizard linuxsnmp
register 1
}
define service {
host_name 10.16.192.68
service_description oracle
check_command check-oracle-Process!"/usr/lib/jvm/java/bin/java -server"!!!!!!!
initial_state u
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
event_handler xi_service_notification_handler
event_handler_enabled 1
notification_interval 60
notification_period xi_timeperiod_24x7
notifications_enabled 1
contacts +testuser
contact_groups Testusers
_xiwizard linuxsnmp
register 1
}
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Regarding the notifications
Looks like you have the contact "+testuser" set to additive, is there a reason for this? Also, who is in that contact group?Is there a user created for this contact as well? If not you are going to have to change your commands to match
-
kgopiramesh
Re: Regarding the notifications
Please find the below for configuration file for contacts.cfg and contactgroups.cfg
define contact {
contact_name testuser
alias Ramesh
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period testuser_notification_times
service_notification_period testuser_notification_times
host_notification_options d,u,r,f,s,
service_notification_options w,u,c,r,f,s,
can_submit_commands 1
email <email d>
host_notifications_enabled 1
service_notifications_enabled 1
use xi_contact_generic
}
define contactgroup {
contactgroup_name Testusers
alias User for testing purpose
members testuser
}
I dint set to additive by knowingly, I just cloned the user testuser from the another user/contact.
I have received the notifications for the testuser today but I have experienced different problems today i.e I received serveral notifications for one service and the even the service is acknowledged we got the email notification that the problem is still persists
define contact {
contact_name testuser
alias Ramesh
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period testuser_notification_times
service_notification_period testuser_notification_times
host_notification_options d,u,r,f,s,
service_notification_options w,u,c,r,f,s,
can_submit_commands 1
email <email d>
host_notifications_enabled 1
service_notifications_enabled 1
use xi_contact_generic
}
define contactgroup {
contactgroup_name Testusers
alias User for testing purpose
members testuser
}
I dint set to additive by knowingly, I just cloned the user testuser from the another user/contact.
I have received the notifications for the testuser today but I have experienced different problems today i.e I received serveral notifications for one service and the even the service is acknowledged we got the email notification that the problem is still persists
Re: Regarding the notifications
I am glad you resolved the testuser issue.
Could you post the configuration for the noisy service? It could be just beyond the flapping thresholds - when it switches between HARD PROBLEM states and HARD OK states, your acknowledgement will go away.kgopiramesh wrote:I received serveral notifications for one service and the even the service is acknowledged we got the email notification that the problem is still persists
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
kgopiramesh
Re: Regarding the notifications
Please find the below configuration of the service
define service {
host_name ASW13
service_description Port 10103 Bandwidth
use xiwizard_switch_port_bandwidth_service
check_command check_xi_service_mrtgtraf!10.16.128.102_10103.rrd!2,2!5,5!M
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard switch
register 1
}
define service {
host_name ASW13
service_description Port 10103 Status
use xiwizard_switch_port_status_service
check_command check_xi_service_ifoperstatus!JbZmOvgItQgpiQ4!10103!-v 2
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard switch
register 1
}
even after deleting the testuser, I have received the notifications for some time
define service {
host_name ASW13
service_description Port 10103 Bandwidth
use xiwizard_switch_port_bandwidth_service
check_command check_xi_service_mrtgtraf!10.16.128.102_10103.rrd!2,2!5,5!M
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard switch
register 1
}
define service {
host_name ASW13
service_description Port 10103 Status
use xiwizard_switch_port_status_service
check_command check_xi_service_ifoperstatus!JbZmOvgItQgpiQ4!10103!-v 2
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard switch
register 1
}
even after deleting the testuser, I have received the notifications for some time
Re: Regarding the notifications
Both of these are using the nagiosadmin contact. Can you post the config for the nagiosadmin contact?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
kgopiramesh
Re: Regarding the notifications
Please find the below for the contact definition
define contact {
contact_name nagiosadmin
alias Nagios Administrator
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period nagiosadmin_notification_times
service_notification_period nagiosadmin_notification_times
host_notification_options d,u,r,f,s
service_notification_options w,u,c,r,f,s
host_notification_commands xi_host_notification_handler
service_notification_commands xi_service_notification_handler
email <emailid>
use xi_contact_generic
}
define contact {
contact_name nagiosadmin
alias Nagios Administrator
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period nagiosadmin_notification_times
service_notification_period nagiosadmin_notification_times
host_notification_options d,u,r,f,s
service_notification_options w,u,c,r,f,s
host_notification_commands xi_host_notification_handler
service_notification_commands xi_service_notification_handler
email <emailid>
use xi_contact_generic
}
Re: Regarding the notifications
Well, that contact looks ok as well. Can you post a few of the consecutive emails that you have received for this noisy service?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.