Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

POST notification wrong time and no host address

Discussion in 'General Discussion' started by Vijai, Jan 17, 2018.

  1. Vijai

    Vijai Member

    Joined:
    Jul 2, 2016
    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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
    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?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    41,455
    Likes Received:
    1,608
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  3. Vijai

    Vijai Member

    Joined:
    Jul 2, 2016
    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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
     
Loading...

Share This Page