Page 1 of 2

[PROBLEM]Notifications

Posted: Tue Jun 03, 2014 12:21 pm
by frenyman
Hello,
I have problems with notifications,these are not sent, when service or host is in critical
when send custom service notification, this is sent correctly. and mail arrives.

this was not happening before

Thanks

Re: [PROBLEM]Notifications

Posted: Tue Jun 03, 2014 3:06 pm
by scottwilkerson
Can you send a copy of the applicable service definition along with any applied templates so we can make sure hit is setup with the appropriate notification settings.

Thanks.

Re: [PROBLEM]Notifications

Posted: Tue Jun 03, 2014 8:18 pm
by frenyman

Code: Select all

======================================
services.cfg
======================================
#-----------------------------------
#Check Port
#-----------------------------------
define service {
host_name VPN.XXX
service_description TCP.8989
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups nt-admins
notification_interval 240
notification_period 24x7
notification_options c,r
check_command check_tcp!7002
}
=======================================
Hosts
=======================================
#----------------------------------------
##----------------------------------------
define host{
use linux-server
host_name VPN.XXX
alias Linux Server
address X.X.X.X
check_command check-host-alive
contact_groups nt-admins
max_check_attempts 10
notification_interval 480
notification_period 24x7
notification_options d,u,r
}
=========================================
Contacts.cfg
=========================================
define contact{
contact_name nagiosadmin
alias Nagios Super Admin
contactgroups nt-admins ;grupos
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-service-by-email
host_notification_commands notify-host-by-email
email [email protected]
}

Re: [PROBLEM]Notifications

Posted: Wed Jun 04, 2014 12:56 pm
by tmcdonald
Are you seeing any entries in your /var/log/maillog for these? They could be getting blocked. Look for any rejected email messages. Also, what do you mean by "when send custom service notifications"?

Re: [PROBLEM]Notifications

Posted: Thu Jun 05, 2014 12:02 am
by frenyman
when i run: echo "text mail" | mail -s "subject" [email protected]
the mail arrives correctly. but not with NAGIOS

this is what the log shows

Code: Select all

[1401881158] SERVICE ALERT: VPN.XXX;TCP.8989;CRITICAL;SOFT;1;CRITICAL - Socket timeout after 10 seconds
[1401881208] SERVICE ALERT: VPN.XXX;TCP.8989;OK;SOFT;2;TCP OK - 0.108 second response time on port 7002
[1401883478] Auto-save of retention data completed successfully.
[1401887078] Auto-save of retention data completed successfully.
[1401890678] Auto-save of retention data completed successfully.
[1401894278] Auto-save of retention data completed successfully.
[1401897878] Auto-save of retention data completed successfully.
but no traces in Postifix of outgoing mail or not delivered of [email protected]

Re: [PROBLEM]Notifications

Posted: Thu Jun 05, 2014 9:39 am
by tmcdonald
That output does not look like the mail log format. Can you please check /var/log/maillog for errors? Or post it here, though it may contain sensitive information.

Re: [PROBLEM]Notifications

Posted: Thu Jun 05, 2014 10:11 am
by frenyman
the previous log is of Nagios.

This is the mail log

Code: Select all

Jun  3 10:11:23 mbcolombia postfix/local[10707]: ED46A1CE8002: to=<[email protected]>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=5.2.2, status=bounced (cannot update mailbox /var/mail/root for user root. cannot open file: File too large)

Code: Select all

Jun  3 11:44:42 mbcolombia postfix/smtp[13685]: 84C731CE8005: to=<[email protected]>, relay=aspmx.l.google.com[173.194.77.26]:25, delay=0.22, delays=0.01/0.08/0.04/0.09, dsn=2.0.0, status=sent (250 2.0.0 OK 1401813882 v2si28010406obd.78 - gsmtp)
Jun  3 11:44:42 mbcolombia postfix/smtp[13712]: 77D271CE8004: to=<[email protected]>, relay=aspmx.l.google.com[173.194.77.26]:25, delay=0.42, delays=0.01/0.02/0.03/0.36, dsn=2.0.0, status=sent (250 2.0.0 OK 1401813882 b5si30068493obq.91 - gsmtp)
Jun  3 11:44:42 mbcolombia postfix/smtp[13682]: 3A6722090033: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[173.194.64.26]:25, delay=0.69, delays=0.03/0.02/0.11/0.52, dsn=2.0.0, status=sent (250 2.0.0 OK 1401813882 s2si30141738obk.14 - gsmtp)


Re: [PROBLEM]Notifications

Posted: Thu Jun 05, 2014 3:03 pm
by lgroschen
Try running this command:

Code: Select all

postconf -n
If there is no field that says 'mailbox_size_limit=' then it is set to the default which is 50MB.

Try running this to set a new limit:

Code: Select all

postconf -e mailbox_size_limit=512000000

Then run the postconf -n again to verify it was set.

Re: [PROBLEM]Notifications

Posted: Thu Jun 05, 2014 3:12 pm
by sreinhardt
It looks like mail using the gmail relay gets through fine, but local mail is all filled up. Are all of your notifications intended to go to\through gmail? Are you using an internal mail server, that is supposed to receive normal notifications and gmail is a special case? Could you post the notification commands for gmail and the ones that are not working?

Re: [PROBLEM]Notifications

Posted: Fri Jun 06, 2014 9:06 am
by frenyman
the log post previous are the notifications

My config the postfix:

Code: Select all

postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost
mail_owner = postfix
mailbox_size_limit = 512000000
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 2048000
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
unknown_local_recipient_reject_code = 550
the notifications should go out to a gmail mail [email protected]

log Status Host nagios

Code: Select all

Service Ok[06-06-2014 03:02:48] SERVICE ALERT: VPN.XXX;TCP.8989;OK;SOFT;2;TCP OK - 0.129 second response time on port 7002
Service Ok[06-06-2014 03:02:48] SERVICE ALERT: VPN.XXX.Backup;TCP.9898;OK;SOFT;2;TCP OK - 0.112 second response time on port 7002
Service Critical[06-06-2014 03:01:58] SERVICE ALERT: VPN.XXX;TCP.8989;CRITICAL;SOFT;1;CRITICAL - Socket timeout after 10 seconds
Service Critical[06-06-2014 03:01:58] SERVICE ALERT: VPN.XXX.Backup;TCP.9898;CRITICAL;SOFT;1;CRITICAL - Socket timeout after 10 seconds
Log notifications for all host:

Code: Select all

Host	Service	Type	Time	Contact	Notification Command	Information
No notifications have been recorded in the current log file