forums.meulie.net

Mail notification

Hi All,

     I having configured the nagios every things seems to be working fine except the mail notification part I am not able to figure out why nagios not been able to send out email. My system is configured to use sendmail . ios and sendmail logs of the nagios and send mail are give bellow.  

[root@nyx var]# tail -f nagios.log

[1111406029] Auto-save of retention data completed successfully.

[1111406319] SERVICE NOTIFICATION: shanthk;nyx;HTTP;WARNING;notify-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden

[1111406319] SERVICE NOTIFICATION: manjuv;nyx;HTTP;WARNING;notify-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden

[1111406319] SERVICE NOTIFICATION: guruprasadgv;nyx;HTTP;WARNING;notify-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden

[1111406489] SERVICE NOTIFICATION: shanthk;nyx;/dev/hdb1 Free Space;CRITICAL;notify-by-email;DISK CRITICAL - free space:

[1111406489] SERVICE NOTIFICATION: manjuv;nyx;/dev/hdb1 Free Space;CRITICAL;notify-by-email;DISK CRITICAL - free space:

[1111406489] SERVICE NOTIFICATION: guruprasadgv;nyx;/dev/hdb1 Free Space;CRITICAL;notify-by-email;DISK CRITICAL - free space:

[1111406919] SERVICE NOTIFICATION: shanthk;nyx;HTTP;WARNING;notify-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden

[1111406919] SERVICE NOTIFICATION: manjuv;nyx;HTTP;WARNING;notify-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden

[1111406919] SERVICE NOTIFICATION: guruprasadgv;nyx;HTTP;WARNING;notify-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden

[root@nyx var]# tail -f messages

Mar 21 17:21:29 nyx nagios: SERVICE NOTIFICATION: <contact_name>;<host_name>;/dev/hdb1 Free Space;CRITICAL;notify-by-email;DISK CRITICAL - free space:

Mar 21 17:23:49 nyx nagios: Auto-save of retention data completed successfully.

Mar 21 17:26:06 nyx sshd(pam_uni:evil:[9655]: authentication failure; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=192.168.0.78 user=root

Mar 21 17:26:31 nyx sshd(pam_uni:evil:[9655]: 1 more authentication failure; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=192.168.0.78 user=root

Mar 21 17:28:39 nyx nagios: SERVICE NOTIFICATION<contact_name>;;<host_name>;/;HTTP;WARNING;notify-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden

Mar 21 17:28:39 nyx nagios: SERVICE NOTIFICATION<contact_name>;;<host_name>;/;HTTP;WARNING;notify-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden

Mar 21 17:28:39 nyx nagios: SERVICE NOTIFICATION<contact_name>;;<host_name>;/;HTTP;WARNING;notify-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden

Mar 21 17:31:29 nyx nagios: SERVICE NOTIFICATION<contact_name>;;<host_name>;/;/dev/hdb1 Free Space;CRITICAL;notify-by-email;DISK CRITICAL - free space:

Mar 21 17:31:29 nyx nagios: SERVICE NOTIFICATION<contact_name>;;<host_name>;/;/dev/hdb1 Free Space;CRITICAL;notify-by-email;DISK CRITICAL - free space:

Mar 21 17:31:29 nyx nagios: SERVICE NOTIFICATION<contact_name>;;<host_name>;/;/dev/hdb1 Free Space;CRITICAL;notify-by-email;DISK CRITICAL - free space:

[root@nyx log]# tail -f maillog

Mar 21 17:30:01 nyx sendmail[9734]: j2LC01Xn009734: from=root@nyx.world2web.com, size=612, class=0, nrcpts=1, msgid=200503211200.j2LC01We009732@nyx.world2web.com, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]

Mar 21 17:30:01 nyx sendmail[9732]: j2LC01We009732: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30338, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (j2LC01Xn009734 Message accepted for delivery)

Mar 21 17:30:01 nyx sendmail[9735]: j2LC01Xn009734: to=root@nyx.world2web.com, ctladdr=root@nyx.world2web.com (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30834, dsn=2.0.0, stat=Sent

Mar 21 17:35:00 nyx sendmail[9824]: j2LC50Vg009824: from=root, size=338, class=0, nrcpts=1, msgid=200503211205.j2LC50Vg009824@nyx.world2web.com, relay=root@localhost

Mar 21 17:35:00 nyx sendmail[9826]: warning: /etc/hosts.allow, line 6: missing newline or line too long

Mar 21 17:35:00 nyx sendmail[9826]: j2LC50c6009826: from=root@nyx.world2web.com, size=612, class=0, nrcpts=1, msgid=200503211205.j2LC50Vg009824@nyx.world2web.com, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]

Mar 21 17:35:00 nyx sendmail[9824]: j2LC50Vg009824: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30338, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (j2LC50c6009826 Message accepted for delivery)

Mar 21 17:35:01 nyx sendmail[9827]: j2LC50c6009826: to=root@nyx.world2web.com, ctladdr=root@nyx.world2web.com (0/0), delay=00:00:01, xdelay=00:00:00, mailer=local, pri=30834, dsn=2.0.0, stat=Sent

Mar 21 17:35:15 nyx sendmail[9830]: warning: /etc/hosts.allow, line 6: missing newline or line too long

Mar 21 17:36:07 nyx sendmail[9830]: j2LC5FtR009830: localhost.localdomain [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA

it looks like sendmail isn’t configured correctly, it’s sending the mail to the itself and probably the messages are looping.
I’d say check how to configure a smartrelay in sendmail.

Luca

Plus, look at the syntax of the sendmail command in misccommand.cfg and try to send yourself a mail by command line.
type man mail for more help with mail syntax.