check_logfiles: 3.7.5.1
[omd.git] / packages / mod-gearman / MOD_GEARMAN.hook
blob021d574fd973e5f732d56fa0a5669481f74b5f01
1 #!/bin/bash
3 # Alias: Mod-Gearman
4 # Menu: Distributed Monitoring
5 # Description:
6 # Here you can enable/disable distributed features based on Gearman.
7 # Using Mod-Gearman will reduce the latency and load caused by check execution -
8 # even when used on the same host - because the Mod-Gearman worker
9 # is smaller and more efficient in the creation of processes than Nagios.
11 case "$1" in
12 default)
13 echo "off"
15 choices)
16 echo "off: disable gearman features"
17 echo "on: enable gearman features"
19 set)
20 # this just enables/disables the gearman settings tree
21 if [ "$2" = "on" ]; then
22 if [ ! -d $OMD_ROOT/etc/mod-gearman/. ]; then
23 echo "ERROR: make sure $OMD_ROOT/etc/mod-gearman exists! (Should have been shipped with OMD)"
24 exit 1
26 mkdir -p $OMD_ROOT/etc/nagios/nagios.d
27 ln -sfn ../../mod-gearman/nagios.cfg $OMD_ROOT/etc/nagios/nagios.d/mod-gearman.cfg
28 mkdir -p $OMD_ROOT/etc/icinga/icinga.d
29 ln -sfn ../../mod-gearman/nagios.cfg $OMD_ROOT/etc/icinga/icinga.d/mod-gearman.cfg
30 else
31 rm -f $OMD_ROOT/etc/nagios/nagios.d/mod-gearman.cfg
32 rm -f $OMD_ROOT/etc/icinga/icinga.d/mod-gearman.cfg
35 esac