CC E-mail Notification


#1

I would like to know if the re is a way to add a CC to the e-mail notifications or at least have in the body of the e-mail a list of all the groups being e-mailed.

I have individuals as groups and i need to let each person who else has been notified.

I did try
define command {
command_name notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOS
TADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nE-mail Sent to: $CONTACTEMAIL$” | /usr/bin/mail -s “Host $HOSTSTATE$ alert for $HOSTNAME$!” $CO
NTACTEMAIL$
}
but this only had the user being e-mailed and not a list.

Thanks
Gareth


#2

If you want to CC someone, then this question really has to do with the Linux mail command. The solution is to use the -c option. So the pipe to the mail command would look like this:

/usr/bin/mail -c cc_address -s “Host $HOSTSTATE$ alert for $HOSTNAME$!” $CONTACTEMAIL$

I haven’t tried this myself. I just checked the –help option for mail.
Edited Wed Feb 08 2006, 10:44PM ]


#3

or mail a group instead of a single email address… (could get hard to do realize if all have different time_periods).

Luca


#4

Thanks for the reply.
The -c will not work as I want to get the e-mail addy from the cfg file. For example… I check the disk space on a drive and need to notify 3 people of a problem. I could creat a group with the three people. But then I will have to creat a group with different combinations of people… I only have 5 contacts in total… so will not take too long if that is the way I have to go.

Each person would like to know who else gets the notification… so they could call the when it is Out of Hours. I do not care if the e-mail addy is in the body of the message… that is why I put in the

E-mail Sent to: $CONTACTEMAIL$"
But like I said it only puts in the actual persons e-mail address !!! No good as they are the ones getting the e-mail. so it is just extra data they do not need !!! :cry:

Time periods is not an issue (Did come up at one point) we just made it 24x7 for stuff that needs notification Out of Hours and workhours for non critical stuff.

Not sure if this makes any more sence than before… !!
:idea:


#5

If I am a member of group A, and I get an email from nagios that sends out notifications for Service X 24/7, shouldn’t I already KNOW who is in group A with me? Do I really care? As long as I’ve been notified, what else matters? Or, if I wish to pawn the task of fixing this problem to someone else in Group A, then I"ll just ignore the message? Duhhh, dunno but simply define a group called techs and put those people in there. Of course, introduce eveyone in “tech” group to each other. So that they will know when they get a nagios email, that it is going to the group called “tech”.
Edited Thu Feb 09 2006, 06:24PM ]


#6

I know what you are saying jakkedup. It is called hight maintenace user !!! All I can do is ask the question !!


#7

I have just tested it with a group and it looks like I am unable to see who the e-mails were sent to…

Well that makes my life easier !!!

If you know a way to do it so i can see who else got the group e-mails then let me know.

Thanks