E-Mail notifications


#1

Hello everyone,. i am having trouble getting angios to actually send the e-mails when a service is down… this was copied fmro my maillog,. does anyone have any advice?

Jun 8 04:02:32 lookout sendmail[4807]: j5882W6m004806: to=root@lookout.com, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32855, dsn=2.0.0, stat=Sent
Jun 8 04:02:33 lookout sendmail[4819]: j5882X6R004819: SYSERR(UID0): Who are you?: Permission denied
Jun 8 04:04:25 lookout sendmail[4819]: j5882X6R004819: from=postmaster, size=329, class=0, nrcpts=1, msgid=200506080802.j5882X6R004819@lookout.com, relay=root@localhost
Jun 8 04:04:26 lookout sendmail[5738]: j5884PtS005738: from=postmaster@lookout.com, size=566, class=0, nrcpts=1, msgid=200506080802.j5882X6R004819@lookout.com, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Jun 8 04:04:26 lookout sendmail[4819]: j5882X6R004819: to=root, delay=00:01:53, xdelay=00:00:01, mailer=relay, pri=30329, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (j5884PtS005738 Message accepted for delivery)
Jun 8 04:04:26 lookout sendmail[5739]: j5884PtS005738: to=root@lookout.com, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30750, dsn=2.0.0, stat=Sent
Jun 8 14:39:16 lookout sendmail[11196]: NOQUEUE: SYSERR(UID501): /etc/mail/submit.cf: line 433: readcf: option RunAsUser: unknown user smmsp: Permission denied
Jun 8 14:39:16 lookout sendmail[11196]: NOQUEUE: SYSERR(UID501): /etc/mail/submit.cf: line 452: readcf: option TrustedUser: unknown user smmsp: Permission denied
Jun 8 14:39:16 lookout sendmail[11196]: NOQUEUE: SYSERR(UID501): can not write to queue directory /var/spool/clientmqueue/ (RunAsGid=0, required=51): Permission denied

suggestions? :shock:


#2

Hi did you check your miscommands.cfg?is it ok?
also check out the permission on mail script in /bin/mail

Thanks


#3

what priv’s are they supposed to have ?? here is what i got

-rw-rw-r-- 1 nagios nagios 4248 Jun 3 15:51 misccommands.cfg

-rwxr-xr-x 1 root mail 73588 Jun 15 2004 /bin/mail

???


#4

somebody please helllllllllllllllllllllllpppppppppppppppppppppppppp


#5

Hi
Try giving this perm’s
-rwxrwx–x
Let us know


#6

produce the same output that nagios would, but do it by hand and see if the mail works.

From miscommands.cfg file, email is defined like this:

‘notify-by-email’ command definition

define command{
command_name notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios ***\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional Info:\n\n$OUTPUT$" | /bin/mail -s " $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$
}

So login as nagios:
su - nagios
Send an email the way that nagios would:
/usr/bin/printf “%b” “***** Nagios ***\n\nNotification Type: testNOTIFICATIONTYPE\n\nService: testSERVICEDESC\nHost: testHOSTALIAS\nAddress: testHOSTADDRESS\nState: testSERVICESTATE\n\nDate/Time: testDATETIME\n\nAdditional Info:\n\ntestOUTPUT" | /bin/mail -s " testNOTIFICATIONTYPE alert - testHOSTALIAStestSERVICEDESC is testSERVICESTATE **” someone@someplace.com

If you get an error, then great, you should be able to fix that.


#7

BTW, you have to enable notifications for each an every service that you want enabled, by using the link called “Enable notifications for this service”. Do this please, even though you have enabled it in the config files. There is a good reason for this.

Read more on WHY here>
nagios.sourceforge.net/docs/1_0/ … tion_notes

I am adamant that you do this, since it’s a common mistake, and I too fought this same trouble for weeks, until I read the above URL.


#8

Ooops, sorry, but i read your first post again, and it looks like the emails are being sent but the permissions appear to be wrong on the mailque folder.


#9

guys i still can not get this to worki ,… someone help pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee


#10

Hi
What error are you getting exactly now


#11

Aparna, thanks for the reply,… i still seem to be experiencing the same situation,… the e-mail never get sent out ,. and i see this in the /var/log/maillog

Jun 22 08:02:05 lookout sendmail[28374]: My unqualified host name (lookout) unknown; sleeping for retry
Jun 22 08:03:05 lookout sendmail[28374]: unable to qualify my own domain name (lookout) – using short name
Jun 22 08:03:05 lookout sendmail[28374]: NOQUEUE: SYSERR(UID501): /etc/mail/submit.cf: line 433: readcf: option RunAsUser: unknown user smmsp: Permission denied
Jun 22 08:03:05 lookout sendmail[28374]: NOQUEUE: SYSERR(UID501): /etc/mail/submit.cf: line 452: readcf: option TrustedUser: unknown user smmsp: Permission denied
Jun 22 08:03:05 lookout sendmail[28374]: dangerous permissions=40777 on queue directory /var/spool/clientmqueue/


#12

Hi…
Ok so you still are not getting emails on your configured email id right?
well what you do is check everything from start with a cool mind.

1>check whthe you have properly configured your email id on the server.

2>your nagios is running

3>check for your misscommands.cfg.in this check for the path of mail script if it is correct.

4>check the permissions on your mail script its in /bin.
check yours in /bin folder

they should be similar to as follows

-rwxr-xr-x 1 root mail 69276 Apr 12 23:29 mail*

5>stop nagios completely and then start it

6>if you still get errors check /var/log/messages and paste the output here i will again c to it

Thanks
Let me know