[% USE date %]
[%# which one is authorized? #%]
[% IF !c.check_cmd_permissions('host', c.request.parameters.host) %]
  [% WRAPPER error.tt errorMessage = "you are not authorized for this command" errorDescription = "check your configuration if you believe this is an error" %][% END %]
[% ELSE %]

[%# description used by the commands page #%]
[% WRAPPER $cmd_tt
   request     = 'You are requesting to delay a host notification'
   description = 'This command is used to delay the next problem notification that is sent out for the specified host. The notification delay will be disregarded if the host changes state before the next notification is scheduled to be sent out. This command has no effect if the host is currently UP.'
%]

[%# definition of the command send to your backend #%]
[% BLOCK action%]
    [% notification_time    = date.now() + c.request.parameters.not_dly * 60 %]
    [% host_name            = c.request.parameters.host %]

    DELAY_HOST_NOTIFICATION;[% sprintf("%s;%lu",host_name,notification_time) %]
[% END %]

[%# definition of the html form data #%]
<tr><td class='optBoxRequiredItem'>Host Name:</td><td><b><input type='text' name='host' value='[% c.request.parameters.host %]'></b></td></tr>
<tr><td class='optBoxRequiredItem'>Notification Delay (minutes from now):</td><td><b><input type='text' name='not_dly' value='0'></b></td></tr>

[% END %]
[% END %]