#!/bin/sh # Copyright (c) 2008 Lars Michelsen # All rights reserved. # # Author: Lars Michelsen # # chkconfig: 0126 99 01 # description: Schedules a downtime in Nagios # ### BEGIN INIT INFO # Provides: nagios_downtime # Required-Start: $network # Required-Stop: # Default-Start: # Default-Stop: 0 1 2 6 # Short-Description: nagios_downtime schedules a downtime to Nagios # Description: The nagios_downtime script schedules a downtime # to the specified Nagios host. The downtime script needs HTTP-access # to the Nagios cmd.cgi to be able to post a downtime. ### END INIT INFO BAR_BIN=/usr/bin/nagios_downtime #BAR_BIN=./nagios_downtime # Check for missing binaries test -x $BAR_BIN || { echo "$BAR_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } case "$1" in stop) echo -n "Running nagios_downtime script... " $BAR_BIN if [ $? -eq 0 ]; then echo "done." exit 0 else echo "ERROR" exit 1 fi ;; *) # If no parameters are given, print which are avaiable echo "Usage: $0 {stop}" exit 1 ;; esac