sending email out
Jay Chandler
chandler at chapman.edu
Tue Jan 16 07:57:30 CET 2007
Formoso, Travis wrote:
>
> Hey guys
>
>
>
> I had a service go into warning tonight and I did not receive and
> email. I have notification interval at 120, period 24x7, options w,u,c,r
>
>
>
> I went in and changed commands.cfg to mailq because in my /bin it is
> mailq and not mailx..
>
>
>
> I configured the other files with my name and email address and have
> the admin email set as the email in my main conf file.
>
>
>
> Anything else I can do to get emails sent to me?
>
From my config:
contacts.cfg:
define contact{
contact_name chandler
alias chandler
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email chandler at chapman.edu
}
commands.cfg:
# 'notify-by-email' command definition
define command{
command_name notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios 2.6
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$
alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
# 'host-notify-by-email' command definition
define command{
command_name host-notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios 2.6
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:
$LONGDATETIME$\n" | /usr/bin/mail -s "Host $HOSTSTATE$ alert for
$HOSTNAME$!" $CONTACTEMAIL$
}
Then I set my host and service definitions, and everything works like a
charm. That help any?
--
Jay Chandler
Network Administrator, Chapman University
714.628.7249 / chandler at chapman.edu
Today's Excuse: emissions from GSM-phones
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list