Page 1 of 1

problem with date/time in mail notifications

Posted: Fri Nov 30, 2012 2:17 am
by nagioshelp
Hello,
my question is about nagios e-mail notification
When i receive a notification by e-mail i only see the date and not the time. for example:

Notification Type: PROBLEM

Service: Memoria
Host: Servidor vmware04
Address: 10.21.0.14
State: CRITICAL

Date/Time: 11-29-2012 Additional Info : P1.PL CRITICAL - mem usage=90.41 %

As you can see, Date/Time only shows the day and not the time.

I have searched about this problem and i guess that my command notify-service-by-email is correct because i have the $LONGDATETIME$ variable:

define command{
command_name notify-service-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: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$

can you help me please?

thanks

Re: problem with date/time in mail notifications

Posted: Fri Nov 30, 2012 2:24 pm
by slansing
Can you open your nagios.cfg file and check what you have under the line:

Code: Select all

date_format=
In addition can you check your commands list and make sure you don't have more than one notify by email command and that the one you listed, is in fact the one being used for email notifications, and that $LONGDATETIME$ is the true macro being used.

Re: problem with date/time in mail notifications

Posted: Mon Dec 03, 2012 3:05 am
by nagioshelp
thanks for your reply.

nagios.cfg i think it's correct:

date_format=us

"us" has the format MM/DD/YYYY HH:MM:SS according to the documentation

on the other hand, i only have one notify-service-by-email in commands.cfg file