problem with date/time in mail notifications

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nagioshelp
Posts: 2
Joined: Fri Nov 30, 2012 2:08 am

problem with date/time in mail notifications

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: problem with date/time in mail notifications

Post 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.
nagioshelp
Posts: 2
Joined: Fri Nov 30, 2012 2:08 am

Re: problem with date/time in mail notifications

Post 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
Locked