POST notification wrong time and no host address

Vijai

Member
Jul 2, 2016
17
1
3
India
cPanel Access Level
Root Administrator
Hello,
I have set up POST notification under contact information in Basic WebHost Manager to a php which then pushes the data to my telegram username. I test fire a notification from server contact->Contact manager and the test message received has the time mentioned in UTC as below while the server time is set in IST
This message confirms that “hostname” (IP) can send a message to you via Posturl.

This message was sent on Wednesday, January 17, 2018 at 4:13:59 PM UTC.
Also, the post data seem to not contain the "host" key or it is empty as I dont get any value for the "host" key. Is this all just because it is just a test notification?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

1. As far as the hostname entry, could you verify that your server's hostname is properly listed in "WHM >> Change Hostname"?

2. You'd need to customize the notification template to utilize a different time zone if you want to use something other than UTC. We document how to customize the notification templates at:

Notification Templates - Documentation - cPanel Documentation

For example, to change the dates/times that appear in notifications, you'd first run the following commands to copy the origin_info.html.tmpl template file to the customization location:

Code:
mkdir -p /var/cpanel/templates/icontact_templates/include
cp -a /usr/local/cpanel/etc/icontact_templates/include/origin_info.html.tmpl /var/cpanel/templates/icontact_templates/include/
Then, edit the template file with a command line editor such as "vi":

Code:
vi /var/cpanel/templates/icontact_templates/include/origin_info.html.tmpl
The entry you need to modify is:

Code:
    <p style="[% reduced_spacing %]">
        [% CPANEL.locale.maketext('The system generated this notice on [_1] at [_2] [asis,UTC].', CPANEL.iso_date(), CPANEL.iso_time()) %]
    </p>
Thank you.
 

Vijai

Member
Jul 2, 2016
17
1
3
India
cPanel Access Level
Root Administrator
Thank you for the link and guide Michael! The hostname is empty only for test notification while the real notification contains the hostname. I'll try to change the timezone.

Regards,
Vijai