check_oracle_health: update to 2.1.3
[omd.git] / packages / mod-gearman / GEARMAN_NEB.hook
blobec713438f8493a776b726adc39140e279f152f27
1 #!/bin/bash
3 # Alias: Mod-Gearman NEB Module
4 # Menu: Distributed Monitoring
5 # Description:
6 # The Mod-Gearman NEB Module is the server part running in the nagios/icinga
7 # core. Make sure you have at least one gearmand job server and one worker running.
9 case "$1" in
10 default)
11 echo "on"
13 choices)
14 echo "on: enable"
15 echo "off: disable"
17 set)
18 if [ "$2" = "off" -o "$CONFIG_MOD_GEARMAN" != "on" ]; then
19 rm -f $OMD_ROOT/etc/nagios/nagios.d/mod-gearman.cfg
20 rm -f $OMD_ROOT/etc/icinga/icinga.d/mod-gearman.cfg
21 elif [ "$2" = "on" ]; then
22 # generate random key
23 KEYSTORE="$OMD_ROOT/etc/mod-gearman/secret.key"
24 if [ ! -s $KEYSTORE ]; then
25 key=`head -n 20 /dev/urandom | tr -d -c "[:alnum:]"`
26 echo ${key:0:32} > $KEYSTORE
28 mkdir -p $OMD_ROOT/etc/nagios/nagios.d
29 ln -sfn ../../mod-gearman/nagios.cfg $OMD_ROOT/etc/nagios/nagios.d/mod-gearman.cfg
30 mkdir -p $OMD_ROOT/etc/icinga/icinga.d
31 ln -sfn ../../mod-gearman/nagios.cfg $OMD_ROOT/etc/icinga/icinga.d/mod-gearman.cfg
34 depends)
35 [ "$CONFIG_MOD_GEARMAN" = "on" -a "$CONFIG_CORE" = "nagios" ]
37 esac