summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-06-13 00:38:22 +0200
committermh <mh@immerda.ch>2013-06-13 00:38:22 +0200
commit2d11bc0ba8a636cee4adeb73689392a077a76006 (patch)
tree5990d356a1f1be9277507b7e51c28ea19ce5ec39 /files
parentded0a8765946706262ec3c746864df4d09638292 (diff)
parenta814cdad2b1ff47066df4c8b5d948f22210c0832 (diff)
Merge branch 'master' of git.puppet.immerda.ch:module-nagios
Diffstat (limited to 'files')
-rw-r--r--files/munin/nagios_hosts10
-rw-r--r--files/munin/nagios_perf8
-rw-r--r--files/munin/nagios_svc12
-rw-r--r--files/pnp4nagios/action.gifbin0 -> 1536 bytes
-rw-r--r--files/pnp4nagios/apache.conf30
-rw-r--r--files/pnp4nagios/npcd8
-rw-r--r--files/pnp4nagios/pnp4nagios-popup-templates.cfg31
-rw-r--r--files/pnp4nagios/pnp4nagios-templates.cfg33
-rw-r--r--files/pnp4nagios/status-header.ssi8
9 files changed, 131 insertions, 9 deletions
diff --git a/files/munin/nagios_hosts b/files/munin/nagios_hosts
index fa8f9dc..3fa00f1 100644
--- a/files/munin/nagios_hosts
+++ b/files/munin/nagios_hosts
@@ -1,5 +1,9 @@
#!/bin/bash
+if [ -z "$nag_stats_binary" ]; then
+ nag_stats_binary=/usr/sbin/nagios3stats
+fi
+
if [ "$1" = "config" ]; then
echo 'graph_title Nagios host stats'
echo 'graph_args --base 1000 -l 0'
@@ -20,9 +24,9 @@ if [ "$1" = "config" ]; then
fi
echo -n 'up.value '
-/usr/local/sbin/nagiostats --mrtg --data NUMHSTUP
+$nag_stats_binary --mrtg --data NUMHSTUP
echo -n 'down.value '
-/usr/local/sbin/nagiostats --mrtg --data NUMHSTDOWN
+$nag_stats_binary --mrtg --data NUMHSTDOWN
echo -n 'unr.value '
-/usr/local/sbin/nagiostats --mrtg --data NUMHSTUNR
+$nag_stats_binary --mrtg --data NUMHSTUNR
diff --git a/files/munin/nagios_perf b/files/munin/nagios_perf
index 35fd9cd..609d62f 100644
--- a/files/munin/nagios_perf
+++ b/files/munin/nagios_perf
@@ -1,5 +1,9 @@
#!/bin/bash
+if [ -z "$nag_stats_binary" ]; then
+ nag_stats_binary=/usr/sbin/nagios3stats
+fi
+
NAME=$(basename $0)
TYPE=${NAME##nagios_perf_}
@@ -30,5 +34,5 @@ if [ "$1" = "config" ]; then
exit 0
fi
-echo "act_lat_$TYPE_ABBR.value " $(/usr/local/sbin/nagiostats --mrtg --data AVGACT${TYPE_ABBR}LAT)
-echo "act_ext_$TYPE_ABBR.value " $(/usr/local/sbin/nagiostats --mrtg --data AVGACT${TYPE_ABBR}EXT)
+echo "act_lat_$TYPE_ABBR.value " $($nag_stats_binary --mrtg --data AVGACT${TYPE_ABBR}LAT)
+echo "act_ext_$TYPE_ABBR.value " $($nag_stats_binary --mrtg --data AVGACT${TYPE_ABBR}EXT)
diff --git a/files/munin/nagios_svc b/files/munin/nagios_svc
index 0a9a9bf..97c8bfc 100644
--- a/files/munin/nagios_svc
+++ b/files/munin/nagios_svc
@@ -1,5 +1,9 @@
#!/bin/bash
+if [ -z "$nag_stats_binary" ]; then
+ nag_stats_binary=/usr/sbin/nagios3stats
+fi
+
if [ "$1" = "config" ]; then
echo 'graph_title Nagios service stats'
echo 'graph_args --base 1000 -l 0'
@@ -23,11 +27,11 @@ if [ "$1" = "config" ]; then
fi
echo -n 'ok.value '
-/usr/local/sbin/nagiostats --mrtg --data NUMSVCOK
+$nag_stats_binary --mrtg --data NUMSVCOK
echo -n 'warn.value '
-/usr/local/sbin/nagiostats --mrtg --data NUMSVCWARN
+$nag_stats_binary --mrtg --data NUMSVCWARN
echo -n 'crit.value '
-/usr/local/sbin/nagiostats --mrtg --data NUMSVCCRIT
+$nag_stats_binary --mrtg --data NUMSVCCRIT
echo -n 'unkn.value '
-/usr/local/sbin/nagiostats --mrtg --data NUMSVCUNKN
+$nag_stats_binary --mrtg --data NUMSVCUNKN
diff --git a/files/pnp4nagios/action.gif b/files/pnp4nagios/action.gif
new file mode 100644
index 0000000..96571a4
--- /dev/null
+++ b/files/pnp4nagios/action.gif
Binary files differ
diff --git a/files/pnp4nagios/apache.conf b/files/pnp4nagios/apache.conf
new file mode 100644
index 0000000..8f66756
--- /dev/null
+++ b/files/pnp4nagios/apache.conf
@@ -0,0 +1,30 @@
+# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
+
+Alias /pnp4nagios "/usr/share/pnp4nagios/html"
+
+<Directory "/usr/share/pnp4nagios/html">
+ AllowOverride None
+ Order allow,deny
+ Allow from all
+ #
+ # Use the same value as defined in nagios.conf
+ #
+ AuthName "Nagios Access"
+ AuthType Basic
+ AuthUserFile /etc/nagios3/htpasswd.users
+ Require valid-user
+ <IfModule mod_rewrite.c>
+ # Turn on URL rewriting
+ RewriteEngine On
+ Options FollowSymLinks
+ # Installation directory
+ RewriteBase /pnp4nagios/
+ # Protect application and system files from being viewed
+ RewriteRule ^(application|modules|system) - [F,L]
+ # Allow any files or directories that exist to be displayed directly
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ # Rewrite all other URLs to index.php/URL
+ RewriteRule .* index.php/$0 [PT,L]
+ </IfModule>
+</Directory>
diff --git a/files/pnp4nagios/npcd b/files/pnp4nagios/npcd
new file mode 100644
index 0000000..64b3d4d
--- /dev/null
+++ b/files/pnp4nagios/npcd
@@ -0,0 +1,8 @@
+# Default settings for the NPCD init script.
+
+# Should NPCD be started? ("yes" to enable)
+RUN="yes"
+
+# Additional options that are passed to the daemon.
+DAEMON_OPTS="-d -f /etc/pnp4nagios/npcd.cfg"
+
diff --git a/files/pnp4nagios/pnp4nagios-popup-templates.cfg b/files/pnp4nagios/pnp4nagios-popup-templates.cfg
new file mode 100644
index 0000000..de17d84
--- /dev/null
+++ b/files/pnp4nagios/pnp4nagios-popup-templates.cfg
@@ -0,0 +1,31 @@
+# http://docs.pnp4nagios.org/de/pnp-0.6/webfe
+
+define host {
+ name host-pnp
+ action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_
+ register 0
+}
+
+define service {
+ name srv-pnp
+ action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
+ register 0
+}
+
+# templates for explicit use, i.e.
+# use => 'generic-host-pnp'
+
+define host {
+ name generic-host-pnp
+ use generic-host,host-pnp
+# action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_
+ register 0
+}
+
+define service {
+ name generic-service-pnp
+ use generic-service,srv-pnp
+# action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_
+ register 0
+}
+
diff --git a/files/pnp4nagios/pnp4nagios-templates.cfg b/files/pnp4nagios/pnp4nagios-templates.cfg
new file mode 100644
index 0000000..64c5186
--- /dev/null
+++ b/files/pnp4nagios/pnp4nagios-templates.cfg
@@ -0,0 +1,33 @@
+# http://docs.pnp4nagios.org/de/pnp-0.6/webfe
+
+# templates for additional use, i.e.
+# use => 'generic-host,host-pnp'
+define host {
+ name host-pnp
+ action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_
+ register 0
+}
+
+define service {
+ name srv-pnp
+ action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
+ register 0
+}
+
+# templates for explicit use, i.e.
+# use => 'generic-host-pnp'
+
+define host {
+ name generic-host-pnp
+ use generic-host,host-pnp
+# action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_
+ register 0
+}
+
+define service {
+ name generic-service-pnp
+ use generic-service,srv-pnp
+# action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_
+ register 0
+}
+
diff --git a/files/pnp4nagios/status-header.ssi b/files/pnp4nagios/status-header.ssi
new file mode 100644
index 0000000..472be3a
--- /dev/null
+++ b/files/pnp4nagios/status-header.ssi
@@ -0,0 +1,8 @@
+<script src="/pnp4nagios/media/js/jquery-min.js" type="text/javascript"></script>
+<script src="/pnp4nagios/media/js/jquery.cluetip.js" type="text/javascript"></script>
+<script type="text/javascript">
+$(document).ready(function() {
+ $('a.tips').cluetip({ajaxCache: false, dropShadow: false,showTitle: false });
+});
+</script>
+