#!/bin/bash # This is a sample shell script showing how you can submit the SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME command # to Nagios. Adjust variables to fit your environment as necessary. [ -z "$3" ] && { echo "Syntaxe: ${O##*/} { etc..}"; exit 1; } now=`date +%s` commandfile='/var/nagios/rw/nagios.cmd' end=`expr $now + $1` comment="$2" shift 2 while [ -n "$1" ]; do /usr/bin/printf "[%lu] SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME;$3;$now;$end;1;0;7200;toto;$comment\n" $now > $commandfile shift done