3 # Alias: Process performance data with PNP4Nagios
6 # PNP4Nagios is a great addon for storing Nagios performance data
7 # into round robin databases. This switch enabled the processing
8 # of performance data by pnp. It implies the starting of the daemon
9 # "npcd", the rrdcached and load the broker module npcdmod into
17 echo "on: enable bulk mode with npcdmod and npcd"
18 echo "npcd: enable bulk mode with npcd"
19 echo "gearman: enable gearman worker"
25 #mkdir -p $OMD_ROOT/etc/nagios/nagios.d
26 if [ -e $OMD_ROOT/etc
/nagios
/nagios.d
] ; then
27 ln -sfn ..
/..
/pnp4nagios
/nagios_npcdmod.cfg
$OMD_ROOT/etc
/nagios
/nagios.d
/pnp4nagios.cfg
29 if [ -e $OMD_ROOT/etc
/icinga
/icinga.d
] ; then
30 ln -sfn ..
/..
/pnp4nagios
/nagios_npcdmod.cfg
$OMD_ROOT/etc
/icinga
/icinga.d
/pnp4nagios.cfg
32 ln -sfn ..
/..
/pnp4nagios
/apache.conf
$OMD_ROOT/etc
/apache
/conf.d
/pnp4nagios.conf
33 if [ -s $OMD_ROOT/etc
/mod-gearman
/perfdata.conf
]; then
34 sed -i -e 's/^perfdata=.*$/perfdata=no/' $OMD_ROOT/etc
/mod-gearman
/perfdata.conf
36 elif [ "$2" == "gearman" ]
38 if [ -e $OMD_ROOT/etc
/nagios
/nagios.d
] ; then
39 ln -sfn ..
/..
/pnp4nagios
/nagios_gearman.cfg
$OMD_ROOT/etc
/nagios
/nagios.d
/pnp4nagios.cfg
41 if [ -e $OMD_ROOT/etc
/icinga
/icinga.d
] ; then
42 ln -sfn ..
/..
/pnp4nagios
/nagios_gearman.cfg
$OMD_ROOT/etc
/icinga
/icinga.d
/pnp4nagios.cfg
44 ln -sfn ..
/..
/pnp4nagios
/apache.conf
$OMD_ROOT/etc
/apache
/conf.d
/pnp4nagios.conf
45 if [ -s $OMD_ROOT/etc
/mod-gearman
/perfdata.conf
]; then
46 sed -i -e 's/^perfdata=.*$/perfdata=yes/' $OMD_ROOT/etc
/mod-gearman
/perfdata.conf
48 elif [ "$2" == "npcd" ]
50 if [ -e $OMD_ROOT/etc
/nagios
/nagios.d
] ; then
51 ln -sfn ..
/..
/pnp4nagios
/nagios_npcd.cfg
$OMD_ROOT/etc
/nagios
/nagios.d
/pnp4nagios.cfg
53 if [ -e $OMD_ROOT/etc
/icinga
/icinga.d
] ; then
54 ln -sfn ..
/..
/pnp4nagios
/nagios_npcd.cfg
$OMD_ROOT/etc
/icinga
/icinga.d
/pnp4nagios.cfg
56 ln -sfn ..
/..
/pnp4nagios
/apache.conf
$OMD_ROOT/etc
/apache
/conf.d
/pnp4nagios.conf
58 rm -f $OMD_ROOT/etc
/nagios
/nagios.d
/pnp4nagios.cfg
59 rm -f $OMD_ROOT/etc
/icinga
/icinga.d
/pnp4nagios.cfg
60 rm -f $OMD_ROOT/etc
/apache
/conf.d
/pnp4nagios.conf
61 if [ -s $OMD_ROOT/etc
/mod-gearman
/perfdata.conf
]; then
62 sed -i -e 's/^perfdata=.*$/perfdata=no/' $OMD_ROOT/etc
/mod-gearman
/perfdata.conf