#! /bin/sh

### BEGIN INIT INFO
# Provides:          shinken-poller
# Required-Start:    $time $syslog $network $named $local_fs
# Required-Stop:     $time $syslog $network $named $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Shinken poller daemon
# Description:       Shinken is a monitoring tool and the Poller
#                    is one of its daemon. This one gets the configuration from the arbiter
#                    His purpose is to actually do the checks ordered by the schedulers,
#                    and then sends the results to the schedulers specified in the
#                    configuration
### END INIT INFO

### Chkconfig Header
# Shinken        Starts Shinken Poller
#
# chkconfig: 345 99 01
# description: Start Shinken poller daemon

# Author: Gabes Jean <naparuba@gmail.com>
#         Olivier LI-KIANG-CHEONG <lkco@gezen.fr>

SHORTNAME=poller
NAME="shinken-$SHORTNAME"

curdir=$(dirname "$0")

export SHINKEN_MODULE_FILE="$NAME"  ## for 'shinken' init script to see that it's called by us

if [ -f /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
fi

case "$1" in
    start|stop|reload|restart|force-reload|status|check|checkconfig)
        "$curdir/shinken" $@ "$SHORTNAME"
        exit $?
        ;;
    *)
        echo "Usage: /etc/init.d/$NAME [-d] {start|stop|reload|restart|force-reload|status|check}"
        exit 1
        ;;
esac
