Scripted downtime doesn't work!

I am trying to script daily downtime. I created a perl script that writes to downtime.dat in the exact format that is created by the website. However the downtime doesn’t work when the script runs, I still get alerts for the relevant servers. But if I schedule the downtime using the website it does work. But I don’t want to do this every day. Am I missing some other file or something else? Is there a better way to schedule downtime daily? The downtime has exactly the same start & end time, same servers. Thank you.

I’d rather suggest you putting the command in the nagios.cmd file. Then you can put the external command for scheduling downtime from the script .
Have you enabled check_external_command option in nagios.cfg and apply write rights to the nagios.cmd file?

List of external commands:
nagios.org/developerinfo/ext … ndlist.php

Another thing you could do. You say that it is a fixed downtime for those servers. Define a new timeperiod which excludes the period of downtime and assign it to those servers.

Thanks Albin for your suggestion. I completely forgot about the timeperiod configuration. I setup separate timeperiods for these servers and everything is working fine now.