obsess_over_services parametr

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

obsess_over_services parametr

Post by vvz »

Hello !
I have local machine with Nagios installed.
I have HP proliant server on the other machine with nrpe and plugins installed on the same lan network.
Everything is installed and looks good including web-interface.
But I don't receive email notifications.

My questions is - shall I put obsess_over_services=1 in my nagios.conf to get notifications? now it is 0



Here my configs , I'm using mutt for testing purpose

commands.cfg
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 echo " TEST" | /usr/bin/mutt -s "TEST" [email protected]
}



my host and services conf.

define host {
use generic-host
name linux-box
notifications_enabled 1
event_handler_enabled 1
failure_prediction_enabled 1
process_perf_data 1
notification_options d,u,r,s
check_period 24x7
check_interval 2
retry_interval 1
max_check_attempts 5
notification_interval 1
notification_period 24x7
contacts nagiosadmin
contact_groups admins
register 0
}



define host {
use linux-box
host_name hp
alias hp proliant
address 192.168.1.70
}


define service{
use generic-service
host_name hp
service_description Current users logged in
check_command check_nrpe_users
check_interval 1
check_period 24x7
retry_interval 2
max_check_attempts 3
notification_interval 4
notification_period 24x7
notification_options c,w,u,r
contacts nagiosadmin
contact_groups admins
notifications_enabled 1
}
my contact.conf
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members root, nagiosadmin
}


############### I added this contact##############################################################

define contact{
contact_name nagiosadmin
alias Admin
host_notifications_enabled 1
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
host_notification_commands notify-host-by-email
service_notifications_enabled 1
service_notification_period 24x7
service_notification_commands notify-service-by-email
service_notification_options w,u,c,r
email [email protected]
}
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: obsess_over_services parametr

Post by jsmurphy »

You definitely don't want to use obsess over service in this instance. Obsess over service is primarily for distributed/clustered Nagios setups, it allows you to execute a command whenever a service check receives an update.

Your problem in this case is most likely to do with Nagios being unable to execute mutt.

If you haven't already, su to the nagios user and then run your command from the linux command prompt: echo " TEST" | /usr/bin/mutt -s "TEST" [email protected]

This should hopefully tell you why it's not working, assuming that it works from the command line of your own user.
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: obsess_over_services parametr

Post by vvz »

I've changed shell for nagios user for bash

then I su nagios and
from command line -> echo "TEST" | /usr/bin/mutt -s "HELLO" my@gmail
and I received test email from command line


but still no emails coming from nagios :(
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: obsess_over_services parametr

Post by lmiltchev »

Do you see any clues in the mail log?

Code: Select all

tail -50 /var/log/maillog
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked