The duration argument is ignored for fixed downtimes, so set it to 0.
For flexible downtimes ensure the duration value is within the limits of
a C unsigned long as that is how it is defined in Nagios' downtime.h:
unsigned long duration;
This allows you to create fixed downtimes with durations longer than 7 days.
Also in completely random happenstance @b1naryth1ef happened to walk up to my desk while I was looking at this and say "wait a second, I know that guy!" He says hi.
The duration argument is ignored for fixed downtimes, so set it to 0. For flexible downtimes ensure the duration value is within the limits of a C unsigned long as that is how it is defined in Nagios' downtime.h:
unsigned long duration;
This allows you to create fixed downtimes with durations longer than 7 days.