[-]
[+]
|
Changed |
munin.changes
|
|
[-]
[+]
|
Changed |
munin.spec
^
|
|
[-]
[+]
|
Deleted |
munin-2.0.1.tar.bz2/plugins/node.d.linux/ipmi_.in
^
|
@@ -1,175 +0,0 @@
-#!@@BASH@@
-# -*- sh -*-
-
-: << =cut
-
-=head1 NAME
-
-ipmi_ - Plugin to monitor temperature or fan speed using IPMI
-
-=head1 CONFIGURATION
-
-=head2 ENVIRONMENT VARIABLES
-
-This plugin does not use environment variables
-
-=head2 WILDCARD PLUGIN
-
-This plugin should be linked as ipmi_temp or ipmi_fans, and will show
-either temperatures or fan speeds based on its link name.
-
-=head1 NOTE
-
-WARNING: Munin has a 10 second default timeout on plugins. On some
-hosts ipmitool takes longer than that to probe all your hardware. In
-this case this plugin us unusable.
-
-=head1 AUTHOR
-
-Nicolai Langfeldt <janl@linpro.no>
-
-=head1 LICENSE
-
-Donated to the public domain by Nicolai Langfeldt (janl@linpro.no)
-
-=head1 MAGIC MARKERS
-
- #%# family=auto
- #%# capabilities=autoconf suggest
-
-=cut
-
-#### Parse commandline to determine what the job is
-
-CONFIG=no
-
-case $1 in
- autoconf)
- ! test -x /usr/bin/ipmitool &&
- echo 'no (no /usr/bin/ipmitool)' && exit 0
- ! (/sbin/lsmod | grep -q ipmi) &&
- echo 'no (impi module not loaded' && exit 0
- echo yes
- exit 0
- ;;
- suggest) echo fans
- echo temp
- echo power
- exit 0;;
- config) CONFIG=config;;
-esac
-
-case $0 in
- *_temp) MEASURE=temp;;
- *_fans) MEASURE=fans;;
- *_power) MEASURE=power;;
- *) echo Please invoke as ipmi_temp or ipmi_fans >&2
- exit 1;;
-esac
-
-export CONFIG MEASURE
-
-#### Work is done in this awk script
-
-ipmitool sensor | gawk -F'|' '
-BEGIN {
- FANS = "";
- TEMPS = "";
- POWER = "";
- CFANS = "graph_title Fan speeds based on IPMI\ngraph_vlabel RPM\ngraph_category Sensors\n";
- CTEMPS = "graph_title Machine temperature based on IPMI\ngraph_vlabel Degrees celcius\ngraph_category Sensors\n";
- CPOWER = "graph_title Power usage based on IPMI\ngraph_vlabel W\ngraph_category Sensors\n";
-}
-
-# Remove extraneous spaces to make output prettyer
-{ gsub(/\t/," "); gsub(/ +/," "); gsub(/ +\|/,"|"); gsub(/\| +/,"|") }
-
-# Skip lines with 0x0 in first column
-/^[^|]+\|0x0\|/ { next; };
-
-# Skip lines with na in first column
-/^[^|]+\|na\|/ { next; };
-
-# Parse temperatures
-/degrees C/ {
- NAME=THING=$1;
- gsub(/[^A-Za-z0-9]/,"",NAME);
- TEMP=$2;
-
- # Find unique name
- while (NAMES[NAME] >= 1) {
- NAME=sprintf("%si",NAME);
- }
- NAMES[NAME]=1;
-
- WARN=$8;
- CRIT=$9;
-
- TEMPS = sprintf("%s%s.value %s\n",TEMPS,NAME,TEMP);
- CTEMPS = sprintf("%s%s.label %s\n",CTEMPS,NAME,THING);
-
- if (CRIT !~ /na/) {
- CTEMPS = sprintf("%s%s.critical 0:%s\n",CTEMPS,NAME,CRIT);
- }
-
- if (WARN !~ /na/) {
- CTEMPS = sprintf("%s%s.warning 0:%s\n",CTEMPS,NAME,WARN);
- }
-}
-
-/RPM/ {
- NAME=THING=$1;
- gsub(/[^A-Za-z0-9]/,"",NAME);
- SPEED=$2;
-
- # Find unique name
- while (NAMES[NAME] >= 1) {
- NAME=sprintf("%si",NAME);
- }
- NAMES[NAME]=1;
-
- FANS = sprintf("%s%s.value %s\n",FANS,NAME,SPEED);
- CFANS = sprintf("%s%s.label %s\n",CFANS,NAME,THING);
-
- OK=$4;
-
- MIN=$6;
- if (MIN !~ /na/) {
- CFANS = sprintf("%s%s.warning %s:\n",CFANS,NAME,MIN);
- }
-}
-
-/Watts/ {
- NAME=THING=$1;
- gsub(/[^A-Za-z0-9]/,"",NAME);
- WATTS=$2;
-
- # Find unique name
- while (NAMES[NAME] >= 1) {
- NAME=sprintf("%si",NAME);
- }
- NAMES[NAME]=1;
-
- POWER = sprintf("%s%s.value %s\n",POWER,NAME,WATTS);
- CPOWER = sprintf("%s%s.label %s\n",CPOWER,NAME,THING);
-}
-
-END {
- if (ENVIRON["MEASURE"] == "temp") {
- VALUE=TEMPS;
- CONFIG=CTEMPS;
- } else if (ENVIRON["MEASURE"] == "power") {
- VALUE=POWER;
- CONFIG=CPOWER;
- } else {
- VALUE=FANS;
- CONFIG=CFANS;
- }
- if (ENVIRON["CONFIG"] == "config")
- printf "%s",CONFIG;
- else
- printf "%s",VALUE;
-}
-'
-
-# vim: syntax=sh ts=4 et
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/.gitignore
^
|
@@ -1,3 +1,6 @@
*/Build
*/_build/
*/blib/
+build-*-stamp
+build/
+.*.swp
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/.travis.yml
^
|
@@ -1,5 +1,6 @@
language: perl
perl:
+ - "5.16"
- "5.14"
- "5.10"
branches:
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/ChangeLog
^
|
@@ -1,5 +1,204 @@
-*- text -*-
+munin-2.0.6, 2012-08-31
+
+-------
+Summary
+-------
+
+graph cron is the default again.
+
+This enables simple install either to work out of the box or be upgraded from 1.4.x in a far easier way than with the CGI default.
+
+Only fixes, but many of them.
+* fixes for munin-graph (cron + cgi)
+* fixes for munin-update
+* fixes for links in templates
+* fixes for the various security bugs
+
+------------------
+Detailed Changelog
+------------------
+
+Adrien "ze" Urban:
+ templates: fix multiple bad links (mostly with subgroups)
+ graph: cosmetics for no-data to graph
+ db/graphs: remove duplicate entries
+ munin-cgi-graph: fixed memory leak
+ doc: nginx - Authentication and group access
+ doc: multimaster contrib: munin-mergedb.pl (tool for multimaster)
+ doc: fix missing link to tips/multimaster
+ munin-cgi-*: use MUNIN_CONFIG if available
+ munin-cgi-html: update timestamp when running for a while
+
+Chen-Yu Tsai:
+ update: write node/services with update=no to datafile as well
+
+Diego Elio Petteno:
+ snmp__print_pages: fix snmpconf.
+ http_loadtime: use bash instead of any sh; `time` is not a standard command
+ proc: fix Perl syntax to not use deprecated defined(@array)
+ proc: drop autoconf capability and handling code.
+ varnish_: remove another deprecated defined(@array)
+
+Holger Levsen:
+ munin-cgi-graph: ignore @ARGV to fix CVE-2012-3513 and Debian #684076
+ munin-cron: call munin-graph with --cron argument (Closes: D#685343)
+ Rename cgi-bin to munin-cgi: the default for the Apache webserver is to
+ setup a ScriptAlias for /cgi-bin. The ScriptAlias directive does
+ not permit changing sublocations, thus making it impossible to impose
+ further restrictions like access controls etc.
+ This change was done in munin-cgi-graph, munin-graph, HTMLConfig.pm,
+ static/dynazoom.html and static/zoom.js _and_ also needs to be done in
+ the distribution specific webserver configuration file.
+
+Niall Donegan:
+ Quick fix to http_loadtime
+ Added back in the capacities magic marker
+
+Peter Palfrader:
+ update: bugfix _node_read_fast() (Closes: D#686089, D#686090)
+ update: remove the last line to fix parsing errors
+ update: fix use of undefined variable
+ async: fix retrieve of ip_
+ We probably also want to allow : in spool filenames
+
+Robin H. Johnson:
+ mysql_: Multiple instance support.
+
+Steve Schnepp:
+ adding a new sum+cdef tester plugin
+ munin.conf.in: show the defaut value in the sample
+ adding some comments for HTML cron vs cgi
+ Only kill & log if the subprocess is still alive
+ update/spoolfetch: disable _node_read_fast
+ node: more secure state file handling (Closes: #1234, CVE-2012-3512, D#684075, D#679897)
+ plugins: use runtime $ENV{MUNIN_PLUGSTATE}
+ master: revert to cron GFX per default
+ plugins: fix for uninitialized $MUNIN_VERSION
+ master: fix the D::M:B warning in munin-graph
+ async: allow any good-looking-enough file in spool (Closes: D#686093)
+ plugin: revert removal of munin_graph field
+
+munin-2.0.5, 2012-08-14
+
+Diego Elio Petteno:
+ ipmi_: improve autoconf handling
+ sensors_: add support for power monitoring.
+ munin-cgi-html: apply patch from ticket #1200
+ master: fix images for plugins w/ sub-categories.
+ snmp__print_pages: fix snmpconf:
+
+Malte S. Stretz:
+ Don't exclude simfs per default.
+
+Steve Schnepp:
+ fix: dbdir shall not revert to default on m-u runs
+ munin-cgi-graph: refine the fix for not cached cgi
+ munin-cgi-graph: don't ever die() in CGI
+
+munin-2.0.4, 2012-07-30
+
+Summary:
+
+* fixes for munin-graph
+* fixes for df_inode plugin
+
+Detailed Changelog
+
+Diego Elio Petteno:
+ master: fix relative paths when using cron-based page generation.
+ munin-graph: do not output text meant for CGI.
+ munin-graph: use INFO for further details during execution.
+ munin-graph: use the same default (non-cgi) as the rest of the Master.
+
+Steve Schnepp:
+ Makefile: add a comment about JCVALID
+
+Stig Sandbeck Mathisen:
+ Ignore reiserfs in the df_inode plugin
+ Make df_inode plugin more robust.
+ Add missing regular expression anchors
+
+munin-2.0.3, 2012-07-24
+
+A quite raw output of 'git shortlog' :
+
+Christian Ruppert:
+ nginx_{request,status}: include Munin::Plugin to fix version identifier.
+
+Christoph Biedl:
+ fix bug that disabled gfx CGI caching
+
+Dan McGee:
+ Force usage of the DM5 Date::Manip backend
+ Don't remove Defaults.pm when invoking build-common target
+ Expand list of filesystems excluded in Linux df_inode plugin
+
+Daniel Kahn Gillmor:
+ slony_lag_: allow >1 subscribers
+
+Diego Elio Petteno:
+ ifx_concurrent_sessions_: allow ps and pgrep to be in /bin as well as /usr/bin
+ build: only move adv files if building on HP-UX.
+ build: install TTF files as non-executables
+ config: respect LIBDIR override.
+ build: only install Java plugin files if JCVALID=yes
+ df: exclude cgroup_root filesystem type as well.
+ Add build-doc-stamp to .gitignore.
+ master: bring back checks for graph_strategy set to cron.
+
+Jeremy Olexa:
+ config: make sure to translate correctly for C-locale only
+
+Steve Schnepp:
+ fix munin-graph typo in opening $graph_fh
+ port multigraph_complex to pure POSIX shell
+ doc: add "supersampling" plugins
+ doc: adding supersampling section
+ doc: changing markup
+ use cgiurl_graph config in dynazoom.html
+ use environment var for rrdcached
+ revert to the same naming than 1.4.x
+ makefile: added a comment on LANG
+ node: only use basename for $0
+ Makefile: move default rule to be the 1st one
+ directly compile to output dir
+ git: ignore more build assets
+
+Stig Sandbeck Mathisen:
+ Add documentation for writing a munin plugin.
+ Correct reStructuredText syntax warnings
+ Remove references we do not have targets for yet
+ Document the munin node
+ Add information about authorized_key hardening
+ restructure documentation, work in progress
+ Whitespace cleanup in the doc tree
+ Add munin-cgi-graph manpage
+ Add munin-cgi-html man page
+ Order the man pages alphabetically
+ Use correct reference
+ Set a max depth for the table of contents
+ Rename the graph aggregation directory appropriately
+ Write proper man pages, and ensure "make man" creates them
+ Add better description on the main index pages
+ Add a directory reference page
+ Remove plugin/aggregate, we have a replacement in examples/graph/aggregate
+ Clean up table of contents in reference/
+ Add "how to use plugins" page
+ Add munin-check man page
+ Add markup and links for the supersampling doc
+
+munin-2.0.2, 2012-06-29
+
+Summary :
+
+* munin-graph can be called again from cron
+* workaround "root" field name bug
+* initial doc/ subdir. will be munin book
+* emits percent in log about errors
+* various bugfix
+
munin-2.0.1, 2012-06-10
Well, first bugfix release.
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/Makefile
^
|
@@ -12,6 +12,12 @@
include $(DEFAULTS)
include $(CONFIG)
+ifeq ($(JCVALID),yes)
+JAVA_BUILD=build-plugins-java
+JAVA_INSTALL=install-plugins-java
+JAVA_PLUGINS=plugins/node.d.java/*
+endif
+
RELEASE := $(shell $(CURDIR)/getversion)
INSTALL_PLUGINS ?= "auto manual contrib snmpauto"
INSTALL := ./install-sh
@@ -19,13 +25,12 @@
INFILES := $(shell find . -name '*.in' | sed 's/\.\/\(.*\)\.in$$/build\/\1/')
INFILES_MASTER := $(shell find master -name '*.in' | sed 's/\(.*\)\.in$$/build\/\1/')
CLASSFILES := $(shell find plugins/javalib -name '*.java' | sed 's/\(.*\)\.java$$/build\/\1.class/')
-PLUGINS := $(wildcard plugins/node.d.$(OSTYPE)/* plugins/node.d/*)
+PLUGINS := $(wildcard plugins/node.d.$(OSTYPE)/* plugins/node.d/* $(JAVA_PLUGINS))
MANCENTER := "Munin Documentation"
MAN8 := master/_bin/munin-update master/_bin/munin-limits master/_bin/munin-html master/_bin/munin-graph
PODMAN8 := build/master/doc/munin-cron master/doc/munin master/doc/munin-check
PODMAN5 := build/master/doc/munin.conf node/doc/munin-node.conf
-
.PHONY: install install-pre install-master-prime install-node-prime install-node-pre install-common-prime install-doc install-man \
build build-common-prime build-common-pre build-doc \
source_dist \
@@ -38,11 +43,12 @@
.SUFFIXES: .java .class
-.java.class:
- cd plugins/javalib && $(JC) $(JFLAGS) $(subst plugins/javalib/,,$*.java)
-
+# This HAS to be the 1st rule
default: build
+.java.class:
+ $(JC) -sourcepath plugins/javalib -d build/plugins/javalib $(JFLAGS) plugins/javalib/$(subst plugins/javalib/,,$*.java)
+
uninstall:
echo "Uninstall is not implemented yet"
@@ -58,11 +64,7 @@
######################################################################
-ifeq ($(JCVALID),yes)
-install: install-master-prime install-common-prime install-node-prime install-plugins-prime install-plugins-java install-man install-async-prime
-else
-install: install-master-prime install-common-prime install-node-prime install-plugins-prime install-man install-async-prime
-endif
+install: install-master-prime install-common-prime install-node-prime install-plugins-prime $(JAVA_INSTALL) install-man install-async-prime
install-pre: Makefile Makefile.config
@$(CHECKUSER)
@@ -104,8 +106,8 @@
$(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/partial/ ; \
done
- $(INSTALL) -m 0755 master/DejaVuSansMono.ttf $(LIBDIR)/
- $(INSTALL) -m 0755 master/DejaVuSans.ttf $(LIBDIR)/
+ $(INSTALL) -m 0644 master/DejaVuSansMono.ttf $(LIBDIR)/
+ $(INSTALL) -m 0644 master/DejaVuSans.ttf $(LIBDIR)/
test -f $(HTMLDIR)/.htaccess || $(INSTALL) -m 0644 build/master/www/munin-htaccess $(HTMLDIR)/.htaccess
test -f "$(CONFDIR)/munin.conf" || $(INSTALL) -m 0644 build/master/munin.conf $(CONFDIR)/
@@ -130,6 +132,10 @@
install-node-plugins: install-plugins-prime
# Some HP-UX plugins needs *.adv support files in LIBDIR
+ifneq ($(OSTYPE),hp-ux)
+HPUXONLY=true ||
+endif
+
install-plugins-prime: install-plugins build $(PLUGINS) Makefile Makefile.config
@$(CHECKGROUP)
@@ -138,9 +144,8 @@
mkdir -p $(LIBDIR)/plugins
mkdir -p $(PLUGSTATE)
- $(CHOWN) $(PLUGINUSER):$(GROUP) $(PLUGSTATE)
- # using g+rwxs, so plugins can create and modify their state file without help
- $(CHMOD) 02775 $(PLUGSTATE)
+ $(CHOWN) root:root $(PLUGSTATE)
+ $(CHMOD) 0755 $(PLUGSTATE)
$(CHMOD) 0755 $(CONFDIR)/plugin-conf.d
for p in build/plugins/node.d/* build/plugins/node.d.$(OSTYPE)/* ; do \
@@ -149,13 +154,20 @@
$(INSTALL) -m 0755 $$p $(LIBDIR)/plugins/; \
fi \
done
- -mv $(LIBDIR)/plugins/*.adv $(LIBDIR)
+ $(HPUXONLY) mv $(LIBDIR)/plugins/*.adv $(LIBDIR)
$(INSTALL) -m 0644 build/plugins/plugins.history $(LIBDIR)/plugins/
$(INSTALL) -m 0644 build/plugins/plugin.sh $(LIBDIR)/plugins/
install-plugins-java: build-plugins-java
mkdir -p $(JAVALIBDIR)
$(INSTALL) -m 0644 build/plugins/javalib/munin-jmx-plugins.jar $(JAVALIBDIR)/
+ mkdir -p $(LIBDIR)/plugins
+ for p in build/plugins/node.d.java/*; do \
+ if test -f "$$p" ; then \
+ echo Installing $$p; \
+ $(INSTALL) -m 0755 $$p $(LIBDIR)/plugins/; \
+ fi \
+ done
#TODO:
# configure plugins. Or not. Better done under the direction of the installer
@@ -199,11 +211,7 @@
# Dummy rule to enable parallel building
infiles: $(INFILES)
-ifeq ($(JCVALID),yes)
-build: infiles build-master build-common-prime build-node build-plugins build-plugins-java build-man
-else
-build: infiles build-master build-common-prime build-node build-plugins build-man
-endif
+build: infiles build-master build-common-prime build-node build-plugins $(JAVA_BUILD) build-man
build/%: %.in
@echo "$< -> $@"
@@ -304,9 +312,12 @@
build/plugins/javalib/munin-jmx-plugins.jar: $(CLASSFILES)
cd build/plugins/javalib && $(JAR) cf munin-jmx-plugins.jar org/munin/plugin/jmx
-build/%.class: %.class
- mkdir -p build/`dirname $*.class`
- cp $**.class build/`dirname $*.class`
+build-java-stamp:
+ mkdir -p build/plugins/javalib
+ touch build-java-stamp
+
+build/%.class: %.class build-java-stamp
+ @echo "Compiling $*"
######################################################################
# DIST RULES
@@ -355,6 +366,7 @@
-rm -f build-stamp
-rm -f build-doc-stamp
-rm -f build-man-stamp
+ -rm -f build-java-stamp
-rm -rf t/install
-rm -f dists/redhat/munin.spec
@@ -401,8 +413,6 @@
cd $* && $(PERL) Build
build-common: common/Build
- cd common && $(PERL) Build && rm -f common/blib/lib/Munin/Common/Defaults.pm && true
-
# BUG: the Build script writes files under PWD when it does "install"
# can't seem to find a way to persuade it to write otherwhere.
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/Makefile.config
^
|
@@ -41,16 +41,19 @@
HTMLDIR = $(PREFIX)/www/docs
CGIDIR = $(PREFIX)/www/cgi
-# Where to put RRD files and other internal data, both master and node
+# Where to put internal data for master (RRD, internal files, ...)
DBDIR = $(DESTDIR)/var/opt/munin
+# Where to put internal data for node (plugin state, ...)
+DBDIRNODE = $(DESTDIR)/var/opt/munin-node
+
# Client only - Where the spool files are written. Must be writable by
# group "munin", and should be preserved between reboots
SPOOLDIR = $(DBDIR)/spool
# Client only - Where plugins should put their states. Must be writable by
# group "munin", and should be preserved between reboots
-PLUGSTATE = $(DBDIR)/plugin-state
+PLUGSTATE = $(DBDIRNODE)/plugin-state
# Where Munin should place its logs.
LOGDIR = $(PREFIX)/log/munin
@@ -75,7 +78,7 @@
# this is needed in order to be able to install
# java libraries in a custom location. Many distrubutions
# enforce a spesific location for java libraries.
-JAVALIBDIR:= $(LIBDIR)
+JAVALIBDIR = $(LIBDIR)
# A modern (posix) shell. We're not looking for arrays, but $() and
@@ -96,7 +99,10 @@
PERLLIB = $(DESTDIR)$(PERLSITELIB)
# Client only - Install plugins for this architecture
-OSTYPE := $(shell uname | tr '[A-Z]' '[a-z]' | cut -f 1 -d _)
+# the LANG=C makes tr work as expected, not regarding any locale it
+# isn't done globally to enable users to have as much localized
+# errors as possible
+OSTYPE := $(shell uname | LANG=C tr '[A-Z]' '[a-z]' | cut -f 1 -d _)
# How to figure out the hostname. (Only used in default configuration
# files)
@@ -153,10 +159,13 @@
# Java compiler stuff - only needed on the buildhost
JC := javac
-JFLAGS := -g -source 1.5 -target 1.5
+JFLAGS := -g -source 1.5 -target 1.5 -Xlint
JAR := jar
# Check if the java compiler works
+# Note that we defer JCVALID evaluation to runtime,
+# since $(JC) can be redefined later in a specific Makefile.config
+# The core Makefile.config is then used as a Makefile.default
JCVALID = $(shell $(JC) -version >/dev/null 2>/dev/null && echo "yes")
# Check whether setruid functionality can be used
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/RELEASE
^
|
@@ -1 +1 @@
-2.0.1
+2.0.6
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/UPGRADING
^
|
@@ -7,9 +7,10 @@
The most important change is the CGI requirement.
- * Munin graphs are now generated on-demand by the web server, and the
- "munin-graph" execution has been removed from the munin-cron script.
- Its use is now mostly for debugging purposes.
+ * Munin graphs can now generated on-demand by the web server. It is mandatory
+ for the new zooming feature. The cron "munin-graph" is still the default, as
+ it really ease new install and upgrading for small setups. Going the CGI road
+ is recommended way if you experience performance issues with the cron setup.
* Munin html pages may be generated on-demand by the web server. The
default is still to run "munin-html" from cron after every update.
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/contrib/munin-mergedb.pl
^
|
@@ -0,0 +1,173 @@
+#!/usr/bin/perl
+# -*- cperl -*-
+#
+# Merge munin db (datafile{,.storable} / limits) for multi-update masters
+# environment
+#
+# (c) GPL - Adrien "ze" Urban
+
+use warnings;
+use strict;
+
+use Storable;
+use Munin::Master::Utils;
+
+# Exemple of config (munin-merge.conf):
+# # what to merge ?
+# merge_datafile yes
+# merge_limits yes
+# # destination is the directory having this file
+#
+# # source directories to merge from (option should be used multiple times)
+# merge_source_dbdir /nfs/munin/db/updatehost1
+# merge_source_dbdir /nfs/munin/db/updatehost2
+# merge_source_dbdir /nfs/munin/db/updatehost3
+# merge_source_dbdir /nfs/munin/db/updatehost4
+
+my $configfile_name = 'munin-merge.conf';
+my $config_type = {
+ 'merge_source_dbdir' => 'ARRAY',
+ 'merge_datafile' => 'BOOL',
+ 'merge_limits' => 'BOOL',
+};
+my $config = {
+ 'merge_dbdir' => undef,
+ 'merge_source_dbdir' => [],
+ 'merge_datafile' => 0,
+ 'merge_limits' => 0,
+};
+
+sub usage()
+{
+ print STDERR <<EOF;
+Usage:
+ $0 merge_dbdir
+
+merge_dbdir should include a config file named $configfile_name.
+This is also a security to avoid accidentaly breaking everything.
+EOF
+ exit 1;
+}
+
+sub load_config()
+{
+ my $dbdir = $config->{'merge_dbdir'};
+ my $file = $dbdir . "/" . $configfile_name;
+ open FILE, "<", $file or die "open: $!\n";
+ while (<FILE>) {
+ chomp;
+ next if (/^[[:space:]]*#/); # comment
+ next if (/^[[:space:]]*$/); # empty line
+ unless (/^[[:space:]]*([^[:space:]]+)[[:space:]]+([^[:space:]]+)[[:space:]]*$/) {
+ die "$.: Unrecogized line format\n";
+ }
+ my ($key, $value) = ($1, $2);
+ if (not defined $config_type->{$key}) {
+ die "$.: $key: unrecognized option\n";
+ }
+ if ('ARRAY' eq $config_type->{$key}) {
+ push @{$config->{$key}}, $value;
+ } elsif ('BOOL' eq $config_type->{$key}) {
+ if ($value =~ /(yes|y|1|true)/i) {
+ $config->{$key} = 1;
+ } elsif ($value =~ /(no?|0|false)/i) {
+ $config->{$key} = 0;
+ } else {
+ die "$.: unrecognized boolean: $value\n";
+ }
+ } else {
+ die "INTERNAL ERROR: $config_type->{$key}: " .
+ "type not implemented\n";
+ }
+ }
+ close FILE;
+}
+sub check_sources()
+{
+ if (0 == scalar(@{$config->{'merge_source_dbdir'}})) {
+ die "No source dbdir. " .
+ "Should I produce a result from thin air?\n";
+ }
+ # no datafile, means it's not really a munin dbdir
+ for my $srcdir (@{$config->{'merge_source_dbdir'}}) {
+ unless (-f "$srcdir/datafile") {
+ die "$srcdir: datafile not found";
+ }
+ }
+}
+sub merge_plaintext($)
+{
+ my $name = shift;
+ my $data = [];
+ my $version = undef;
+ for my $srcdir (@{$config->{'merge_source_dbdir'}}) {
+ my $srcfile = "$srcdir/$name";
+ unless (-f $srcfile) {
+ die "$srcdir: $name not found";
+ }
+ open FILE, "<", $srcfile or
+ die "open: $srcfile: $!\n";
+ my $ver = <FILE>;
+ if (defined $version) {
+ die "$srcfile: versions differs: $version vs $ver\n"
+ if ($ver ne $version);
+ } else {
+ $version = $ver;
+ }
+ push @$data, <FILE>;
+ close FILE;
+ #print $name, " ", scalar(@$data), " ", $srcdir, "\n";
+ }
+ my $dstfile = $config->{'merge_dbdir'} . "/" . $name;
+ my $dsttmp = $dstfile . ".tmp.$$";
+ open FILE, ">", $dsttmp or
+ die "open: $dsttmp: $!\n";
+ print FILE $version, @$data;
+ close FILE;
+ rename $dsttmp, $dstfile or
+ die "mv $dsttmp $dstfile: $!\n";
+}
+sub merge_datafile_storable()
+{
+ my $name = 'datafile.storable';
+
+ my $data = undef;
+ for my $srcdir (@{$config->{'merge_source_dbdir'}}) {
+ my $srcfile = "$srcdir/$name";
+ unless (-f $srcfile) {
+ die "$srcdir: $name not found";
+ }
+ my $info = retrieve($srcfile);
+ if (defined $data) {
+ $data = munin_overwrite($data, $info);
+ } else {
+ $data = $info;
+ }
+ }
+ my $dstfile = $config->{'merge_dbdir'} . "/" . $name;
+ my $dsttmp = $dstfile . ".tmp.$$";
+ Storable::nstore($data, $dsttmp);
+ rename $dsttmp, $dstfile or
+ die "mv $dsttmp $dstfile: $!\n";
+}
+sub merge_datafile()
+{
+ merge_plaintext('datafile');
+ merge_datafile_storable();
+}
+sub merge_limits()
+{
+ merge_plaintext('limits');
+}
+
+usage unless (1 == scalar(@ARGV));
+$config->{'merge_dbdir'} = shift @ARGV;
+
+load_config;
+check_sources;
+merge_datafile if ($config->{'merge_datafile'});
+merge_limits if ($config->{'merge_limits'});
+
+exit 0;
+
+# vim: syntax=perl ts=8
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/.gitignore
^
|
@@ -0,0 +1,2 @@
+_build/
+*~
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/Makefile
^
|
@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Munin.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Munin.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/Munin"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Munin"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/_static
^
|
+(directory)
|
|
Changed |
munin-2.0.6.tar.bz2/doc/_static/.gitignore
^
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/_templates
^
|
+(directory)
|
|
Changed |
munin-2.0.6.tar.bz2/doc/_templates/.gitignore
^
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/conf.py
^
|
@@ -0,0 +1,375 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+#
+# Munin documentation build configuration file, created by
+# sphinx-quickstart on Sat Jun 9 11:12:29 2012.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.doctest']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = 'Munin'
+copyright = '2012, Stig Sandbeck Mathisen <ssm@fnord.no>'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '2.0'
+# The full version, including alpha/beta/rc tags.
+release = os.popen('../getversion').read()
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+html_short_title = "Munin"
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+html_logo = '../master/static/logo-h.png'
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'Munindoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+'papersize': 'a4paper',
+
+# The font size ('10pt', '11pt' or '12pt').
+'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'Munin.tex', 'Munin Documentation',
+ 'Stig Sandbeck Mathisen \\textless{}ssm@fnord.no\\textgreater{}', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+latex_logo = '../master/static/logo-h.png'
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('reference/munin-async',
+ 'munin-async',
+ 'Munin async client',
+ ['Steve Schnepp'],
+ 1),
+ ('reference/munin-asyncd',
+ 'munin-asyncd',
+ 'Munin async daemon',
+ ['Steve Schnepp'],
+ 1),
+ ('reference/munin-cgi-graph',
+ 'munin-cgi-graph',
+ 'Munin CGI grapher',
+ ['Steve Schnepp'],
+ 1),
+ ('reference/munin-cgi-html',
+ 'munin-cgi-html',
+ 'Munin CGI HTML generator',
+ ['Steve Schnepp'],
+ 1),
+ ('reference/munin-check',
+ 'munin-check',
+ 'A program to fix permissions of munin directories and files',
+ ['Matthias Schmitz'],
+ 1),
+ ('reference/munin-cron',
+ 'munin-cron',
+ 'Munin cron script',
+ ['Audun Ytterdal',
+ 'Jimmy Olsen'],
+ 1),
+ ('reference/munin-graph',
+ 'munin-graph',
+ 'Create graphs from RRD files',
+ ['Audun Ytterdal',
+ 'Jimmy Olsen',
+ 'Nicolai Langfeldt',
+ 'Steve Schnepp'],
+ 1),
+ ('reference/munin-html',
+ 'munin-html',
+ 'Create HTML pages',
+ ['Knut Haugen',
+ 'Steve Schnepp',
+ 'Audun Ytterdal',
+ 'Jimmy Olsen'],
+ 1),
+ ('reference/munin-limits',
+ 'munin-limits',
+ 'A program to check for any off-limit values',
+ ['Audun Ytterdal',
+ 'Jimmy Olsen',
+ 'Knut Haugen',
+ 'Nikolai Langfeldt'],
+ 1),
+ ('reference/munin-node',
+ 'munin-node',
+ 'A daemon which gathers information from the local node',
+ ['Audun Ytterdal',
+ 'Jimmy Olsen',
+ 'Matthew Boyle',
+ 'Tore Anderson'],
+ 1),
+ ('reference/munin-run',
+ 'munin-run',
+ 'A program to run munin plugins from the command line',
+ ['Audun Ytterdal',
+ 'Jimmy Olsen',
+ 'Tore Anderson',
+ 'Nikolai Langfeldt'],
+ 1),
+ ('reference/munin-update',
+ 'munin-update',
+ 'A program to gather data from machines running munin-node or munin-async',
+ ['Audun Ytterdal',
+ 'Jimmy Olsen',
+ u'Kjell Magne Øierud',
+ 'Knut Haugen',
+ 'Nikolai Langfeldt',
+ 'Tore Anderson'],
+ 1),
+ ('reference/munin.conf',
+ 'munin.conf',
+ 'Configuration file for the munin master',
+ [],
+ 5),
+ ('reference/munin-node.conf',
+ 'munin-node.conf',
+ 'Configuration file for the munin node',
+ [],
+ 5),
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ ('index', 'Munin', 'Munin Documentation',
+ 'Stig Sandbeck Mathisen <ssm@fnord.no>', 'Munin', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+
+# -- Options for Epub output ---------------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title = 'Munin'
+epub_author = 'Stig Sandbeck Mathisen <ssm@fnord.no>'
+epub_publisher = 'Stig Sandbeck Mathisen <ssm@fnord.no>'
+epub_copyright = '2012, Stig Sandbeck Mathisen <ssm@fnord.no>'
+
+# The language of the text. It defaults to the language option
+# or en if the language is not set.
+#epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+#epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#epub_identifier = ''
+
+# A unique identification for the text.
+#epub_uid = ''
+
+# A tuple containing the cover image and cover page html template filenames.
+#epub_cover = ()
+
+# HTML files that should be inserted before the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_pre_files = []
+
+# HTML files shat should be inserted after the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_post_files = []
+
+# A list of files that should not be packed into the epub file.
+#epub_exclude_files = []
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#epub_tocdup = True
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/documentation
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/documentation/index.rst
^
|
@@ -0,0 +1,12 @@
+.. _documentation-index:
+
+===================
+ Documenting Munin
+===================
+
+This document is rather meta, it explains how to document Munin.
+
+.. toctree::
+ :maxdepth: 2
+
+ nomenclature.rst
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/documentation/nomenclature.rst
^
|
@@ -0,0 +1,134 @@
+==============
+ Nomenclature
+==============
+
+To be able to use Munin, to understand the documentation, and - not to
+be neglected - to be able to write documentation that is consistent
+with Munin behaviour, we need a common nomenclature.
+
+Common terms
+============
+
++--------------+--------------------------------------------+------------------------------+
+| Term | Explanation | Also referred to as as |
++==============+============================================+==============================+
+| Munin Master | The central host / server where Munin | master, server, munin server |
+| | gathers all data. | |
+| | The machine runs munin-cron | |
++--------------+--------------------------------------------+------------------------------+
+| Munin Node | The daemon / network service running | In SNMP terms |
+| | on each host to be contacted by the | it may be called an |
+| | | agent. |
++--------------+--------------------------------------------+------------------------------+
+| Plugin | Each munin node handles one or more | service |
+| | plugins to monitor stuff on hosts | |
++--------------+--------------------------------------------+------------------------------+
+| Host | A machine monitored by Munin, | |
+| | maybe by proxy on a munin node, | |
+| | or via a SNMP plugin | |
++--------------+--------------------------------------------+------------------------------+
+| Field | Each plugin presents data from one | Data source |
+| | or more data sources. Each found, | |
+| | read or calculated value corresponds | |
+| | to a field.attribute tuple. | |
++--------------+--------------------------------------------+------------------------------+
+| Attribute | Description found in output from plugins, | |
+| | both general (global) to the plugin, and | |
+| | also specific ot each Field. | |
++--------------+--------------------------------------------+------------------------------+
+| Environment | Set up by munin node, used to control | |
+| variable | plugin behaviour. Found in the plugin | |
+| | configuration directory. | |
+| | (/etc/munin/plugin-conf.d/) | |
++--------------+--------------------------------------------+------------------------------+
+| Global | Used in the global context in the | |
+| (plugin) | configuration output from a plugin. | |
+| attribute | (Note: The attribute is considered | |
+| | "global" only to the plugin (and the | |
+| | node), and only when executed. | |
++--------------+--------------------------------------------+------------------------------+
+| Datasource | Used in the datasource-specific context in | |
+| specific | the output of a plugin | |
+| plugin | | |
+| attribute | | |
++--------------+--------------------------------------------+------------------------------+
+| Global | Used in munin.conf | |
+| directive | | |
++--------------+--------------------------------------------+------------------------------+
+| Node level | Used in munin.conf | |
+| directive | | |
++--------------+--------------------------------------------+------------------------------+
+| Group level | Used in munin.conf | |
+| directive | | |
++--------------+--------------------------------------------+------------------------------+
+| Field level | Used in munin.conf | |
+| directive | | |
++--------------+--------------------------------------------+------------------------------+
+
+
+Examples
+========
+
+To shed some light on the nomenclature, consider the examples below:
+
+Global plugin attribute
+-----------------------
+
+Global plugin attributes are in the plugins output when run with the
+config argument. The full list of these attributes is found on the
+protocol config page. This output does not configure the plugin, it
+configures the plugins graph.
+
+::
+
+ graph_title Load average
+ ----------- ------------
+ | `------ value
+ `------------------ attribute
+
+
+Datasource specific plugin attribute
+------------------------------------
+
+These are found both in the config outout of a plugin and in the
+normal readings of a plugin. A plugin may provide data from one or
+more data sources. Each data source needs its own set of
+field.attribute tuples to define how the data source should be
+presented.
+
+::
+
+ load.warning 100
+ ---- ------- ---
+ | | `- value
+ | `------- one of several attributes used in config output
+ `------------- field
+
+ load.value 54
+ ---- ----- --
+ | | `- value
+ | `------ only attribute when getting values from a plugin
+ `----------- field
+
+Configuration files
+-------------------
+
+This one is from the global section of munin.conf:
+
+::
+
+ dbdir /var/lib/munin/
+ ----- ---------------
+ | `--------- value
+ `-------------------------- global directive
+
+
+And then one from the node level section:
+
+::
+
+ [foo.example.org]
+ address localhost
+ ------- ---------
+ | `----- value
+ `-------------- node level directive
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/example
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/example/graph
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/example/graph/aggregate
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/example/graph/aggregate.rst
^
|
@@ -0,0 +1,191 @@
+.. _example-plugin-aggregate:
+.. index::
+ single: Aggregating munin plugins
+ pair: plugin; aggregate
+
+==============================
+ Graph aggregation by example
+==============================
+
+This example covers creating aggregate graphs. The configuration reads
+the current and power from two UPSes (i.e. two hosts with two plugins
+each) and then creates one virtual host with two virtual plugins; one
+for current and one for power.
+
+Plugins involved
+================
+
+The example uses a plugin for monitoring UPSes through SNMP, where the
+UPS address and the different aspects are defined through symlinks.
+The two UPSes, called "ups-5a" and "ups-5b", are monitored with
+respect to "current" and "power". Thus, the affected plugins are
+called as:
+
+::
+
+ snmp_ups_ups-5a_current
+ snmp_ups_ups-5b_current
+ snmp_ups_ups-5a_power
+ snmp_ups_ups-5b_power
+
+The original plugin name is actually "snmp_ups\_\_" - note the "two"
+underscores at the end. The plugin is then symlinked to the given host
+name(s) (e.g. ups-5a) and what we want to monitor (e.g. power). Let's
+just take one closer look at one of them:
+
+::
+
+ snmp_ups_ups-5a_power
+ -------- ------ -----
+ | | |
+ | | `--- The function we want to monitor
+ | `--------- The node name of the UPS
+ `----------------- The plugin
+
+Extract from munin.conf
+=======================
+
+
+The following extract from /etc/munin/munin.conf is explained in
+detail, step by step, below the configuration.
+
+::
+
+ 1 [UPS;ups-5a]
+ 2 address 127.0.0.1 # localhost fetches data
+ 3
+ 4 [UPS;ups-5b]
+ 5 address 127.0.0.1 # localhost fetches data
+ 6
+ 7 [UPS;Aggregated]
+ 8 update no
+ 9 contacts no
+ 10
+ 11 snmp_ups_current.update no
+ 12 snmp_ups_current.graph_args --base 1000 -l 0
+ 13 snmp_ups_current.graph_category UPS
+ 14 snmp_ups_current.graph_title Aggregated input/output current
+ 15 snmp_ups_current.graph_vlabel Ampere
+ 16 snmp_ups_current.inputtotal.label Input current
+ 17 snmp_ups_current.outputtotal.label Output current
+ 18 snmp_ups_current.graph_order inputtotal outputtotal
+ 19 snmp_ups_current.inputtotal.sum \
+ 20 ups-5a:snmp_ups_ups-5a_current.inputcurrent \
+ 21 ups-5b:snmp_ups_ups-5b_current.inputcurrent
+ 22 snmp_ups_current.outputtotal.sum \
+ 23 ups-5a:snmp_ups_ups-5a_current.outputcurrent \
+ 24 ups-5b:snmp_ups_ups-5b_current.outputcurrent
+ 25
+ 26 snmp_ups_power.update no
+ 27 snmp_ups_power.graph_args --base 1000 -l 0
+ 28 snmp_ups_power.graph_category UPS
+ 29 snmp_ups_power.graph_title Aggregated output power
+ 30 snmp_ups_power.graph_vlabel Watts
+ 31 snmp_ups_power.output.label Output power
+ 32 snmp_ups_power.graph_order output
+ 33 snmp_ups_power.output.sum \
+ 34 ups-5a:snmp_ups_ups-5a_power.outputpower \
+ 35 ups-5b:snmp_ups_ups-5b_power.outputpower
+
+
+Explanations, per line
+======================
+
+* 1 - 2: The SNMP-based plugin for the UPS known as "ups-5a" is
+ defined. The group name is "UPS" and the node name is "ups-5a". The
+ plugin is run from localhost.
+
+* 4 - 5: The SNMP-based plugin for the UPS known as "ups-5b" is
+ defined. The group name is "UPS" and the node name is "ups-5b". The
+ plugin is run from localhost.
+
+* 7: The group and "virtual node name" for the aggregated graphs are
+ defined. The group name is "UPS" and the virtual node name is
+ "Aggregated".
+
+* 8: Make sure that Munin (specifically, "munin-update") does not try
+ to actively gather information for this node.
+
+* 9: Tell "munin-limits" not to send alerts if any limit is breached.
+
+The above lines (1 - 9) have now established the fundament for three
+different graph pages; one for each of the two UPSes and one for the
+aggregate graphs.
+
+* 11 - 15: Define the basic information for the virtual plugin for
+ aggregated current. Note that "snmp_ups_current" is the virtual
+ plugin's name.
+
+* 16 - 17: Simultaneously define and label "two" values to be graphed
+ in the virtual plugin: "inputtotal" and "outputtotal".
+
+* 18: Order the values.
+
+* 19 - 21: Calculate the value for "inputtotal" by reading the
+ "inputcurrent" values from each of the two UPSes.
+
+Let's take a closer look at the components
+
+::
+
+ snmp_ups_current.inputtotal.sum \
+ ---------------- ---------- ---
+ | | |
+ | | `-- The sum mechanism
+ | `--------- One of this virtual plugin's values
+ `----------------------- The name of the virtual plugin
+
+::
+
+ ups-5a:snmp_ups_ups-5a_current.inputcurrent \
+ ups-5b:snmp_ups_ups-5b_current.inputcurrent
+ ------ ----------------------- ------------
+ | | |
+ | | `------ The "inputcurrent" value from the real plugin
+ | `------------------------ The real plugin's name (symlink)
+ `---------------------------------------- The host name from which to seek information
+
+
+* 22 - 24: Similarly for "outputtotal".
+
+* 26 - 35: Like the above, but for power instead. Note that this
+ virtual plugin graphs only "one" value, and as such, only "one"
+ "sum" mechanism is used.
+
+Result graphs
+=============
+
+The graphs below show one of the UPSes, and the aggregated values. The
+graphs used are by week, because they had a nice dip in the beginning
+of the graphing period :-)
+
+Source graphs for one of the UPSes:
+
+.. image:: aggregate/ups-5a_current.png
+
+.. image:: aggregate/ups-5a_power.png
+
+Aggregate graphs:
+
+.. image:: aggregate/aggregate_current.png
+
+.. image:: aggregate/aggregate_power.png
+
+Summary
+=======
+
+We have now, in addition to the two real UPS nodes "ups-5a" and
+"ups-5b" (lines 1 - 5), created one virtual host named "Aggregated"
+(line 7) with two virtual plugins: "snmp_ups_current" (lines 11 - 24)
+and "snmp_ups_power" (lines 26 - 35).
+
+The "snmp_ups_current" virtual plugin outputs two field names:
+"inputtotal" (lines 16 and 19 - 21) and "outputtotal" (lines 17 and
+22 - 24), while the "snmp_ups_power" virtual plugin outputs only one
+field name, namely "output" (lines 31 - 35).
+
+Further reading
+===============
+
+ * [wiki:Using_SNMP_plugins Using SNMP plugins]
+ * [wiki:munin.conf munin.conf] directives explained
|
|
Added |
munin-2.0.6.tar.bz2/doc/example/graph/aggregate/aggregate_current.png
^
|
|
Added |
munin-2.0.6.tar.bz2/doc/example/graph/aggregate/aggregate_power.png
^
|
|
Added |
munin-2.0.6.tar.bz2/doc/example/graph/aggregate/ups-5a_current.png
^
|
|
Added |
munin-2.0.6.tar.bz2/doc/example/graph/aggregate/ups-5a_power.png
^
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/example/index.rst
^
|
@@ -0,0 +1,16 @@
+.. _example-index:
+
+========
+Examples
+========
+
+Examples of munin and related configuration are gathered here.
+
+.. toctree::
+ :maxdepth: 2
+
+ webserver/apache-virtualhost.rst
+ webserver/lighttpd.rst
+ webserver/nginx.rst
+ graph/aggregate.rst
+ tips/multimaster.rst
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/example/tips
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/example/tips/multimaster.rst
^
|
@@ -0,0 +1,166 @@
+.. _example-tips-masteraggregation:
+
+==================================
+ multiple master data aggregation
+==================================
+
+This example describes a way to have multiple master collecting
+different information, and show all the data in a single presentation.
+
+When you reach some size (probably several hundreds of nodes, several
+tousands plugins), 5 minutes is not enough for your single master to
+connect and gather data from all hosts, and you end up having holes in
+your graph.
+
+Requirements
+============
+
+This example requires a shared nfs space for the munin data between the
+nodes.
+
+Before going that road, you should make sure to check other options
+first, like changing the number of update threads, and having rrdcached.
+
+An other option you might consider, is using munin-async. It requires
+modifications on all nodes, so it might not be an option, but I felt
+compeled to mention it. If you can't easily have shared nfs, or if you
+might have connectivity issues between master and some node, async would
+probably be a better approach.
+
+Because there is some rrd path merge required, it is highly recommended
+to have **all** nodes in groups.
+
+Overview
+========
+
+Munin-Master runs differents scripts via the cron script (munin-cron).
+
+``munin-update``
+ is the only part actualy connecting to the nodes. It gathers
+ information and updates the rrd (you'll probably need rrdcached,
+ especialy via nfs).
+
+``munin-limits``
+ checks what was collected, compared to the limits and places
+ warning and criticals.
+
+``munin-html``
+ takes the informations gathered by update and limits, and
+ generate the actual html files (if don't have cgi-html).
+ It currently still generate some data needed by the cgi.
+
+``munin-graph``
+ generate the graphs. If you are thinking about getting many
+ masters, you probably have alot of graph, and don't want to
+ generate them every 5 minutes, but you would rather use
+ cgi-graph.
+
+The trick about having multiple master running to update is :
+
+- run ``munin-update`` on different masters (called update-masters there
+ after), having ``dbdir`` on nfs
+- run ``munin-limits`` on either each of the update-masters, or the
+ html-master (see next line)
+- run ``munin-html`` on a single master (html-master), after merging
+ some data generated by the update processes
+- have graph (cgi) and html (from file or cgi) served by either
+ html-master, or specific presentation hosts.
+
+Of course, all hosts must have access to the shared nfs directory.
+
+Exemples will consider the shared folder /nfs/munin.
+
+Running munin-update
+====================
+
+Cange the ``munin-cron`` to only run ``munin-update`` (and
+``munin-limits``, if you have alerts you want to be managed directly on
+those masters). The cron should NOT launch munin-html or munin-graph.
+
+Change your ``munin.conf`` to use a dbdir within the shared nfs, (ie:
+``/nfs/munin/db/<hostname>``).
+
+To make it easier to see the configuration, you can also update the
+configuration with an ``includedir`` on nfs, and declare all your nodes
+there (ie: ``/nfs/munin/etc/<hostname>.d/``).
+
+If you configured at least one node, you should have
+``/nfs/munin/db/<hostname>`` that starts getting populated with
+subdirectories (groups), and a few files, including ``datafile``, and
+``datafile.storable`` (and ``limits`` if you also have munin-limits
+running here).
+
+Merging data
+============
+
+All our update-masters generate update their dbdir including:
+
+- ``datafile`` and ``datafile.storable`` which contain information about
+ the collected plugins, and graphs to generate.
+- directory tree with the rrd files
+
+In order to have munin-html to run correctly, we need to merge those
+dbdir into one.
+
+Merging files
+-------------
+
+``datafile`` is just plain text with lines of ``key value``, so
+concatenating all the files is enough.
+
+``datafile.storable`` is a binary representation of the data as loaded
+by munin. It requires some munin internal structures knowledge to merge
+them.
+
+If you have ``munin-limits`` also running on update-masters, it generate
+a ``limits`` files, those are also plain text.
+
+In order to make that part easier, a ``munin-mergedb.pl`` is provided in
+contrib.
+
+Merging rrd tree
+----------------
+
+The main trick is about rrd. As we are using a shared nfs, we can use
+symlinks to get them to point to one an other, and not have to duplicate
+them. (Would be hell to keep in sync, that's why we really need shared
+nfs storage.)
+
+As we deal with groups, we could just link top level groups to a common
+rrd tree.
+
+Exemple, if you have two updaters (update1 and update2), and 4 groups
+(customer1, customer2, customer3, customer4), you could make something
+like that::
+
+/nfs/munin/db/shared-rrd/customer1/
+/nfs/munin/db/shared-rrd/customer2/
+/nfs/munin/db/shared-rrd/customer3/
+/nfs/munin/db/shared-rrd/customer4/
+/nfs/munin/db/update1/customer1 -> ../shared-rrd/customer1
+/nfs/munin/db/update1/customer2 -> ../shared-rrd/customer2
+/nfs/munin/db/update1/customer3 -> ../shared-rrd/customer3
+/nfs/munin/db/update1/customer4 -> ../shared-rrd/customer4
+/nfs/munin/db/update2/customer1 -> ../shared-rrd/customer1
+/nfs/munin/db/update2/customer2 -> ../shared-rrd/customer2
+/nfs/munin/db/update2/customer3 -> ../shared-rrd/customer3
+/nfs/munin/db/update2/customer4 -> ../shared-rrd/customer4
+/nfs/munin/db/html/customer1 -> ../shared-rrd/customer1
+/nfs/munin/db/html/customer2 -> ../shared-rrd/customer2
+/nfs/munin/db/html/customer3 -> ../shared-rrd/customer3
+/nfs/munin/db/html/customer4 -> ../shared-rrd/customer4
+
+At some point, an option to get the rrd tree separated from the dbdir,
+and should avoid the need of such links.
+
+Running munin-html
+==================
+
+Once you have your update-masters running, and a merge ready to go, you
+should place a cron on a html-master to :
+
+- merge data as requested
+- launch ``munin-limits``, if not launched on update-masters and merged
+- launch ``munin-html`` (required, even if you use cgi)
+- launch ``munin-graph`` unless you use cgi-graph
+
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/example/webserver
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/example/webserver/apache-virtualhost.rst
^
|
@@ -0,0 +1,71 @@
+.. _example-webserver-apache:
+
+==================================
+ Apache virtualhost configuration
+==================================
+
+This example describes how to set up munin on a separate apache httpd
+virtual host. It uses FastCGI if this is available, and falls back to
+CGI if it is not.
+
+Munin configuration
+===================
+
+This example assumes the following configuration in
+/etc/munin/munin.conf
+
+.. index::
+ pair: example; munin.conf
+
+::
+
+ # graph_strategy should be commented out, if present
+ html_strategy cgi
+
+Virtualhost configuration
+=========================
+
+Add a new virtualhost, using the following example:
+
+.. index::
+ pair: example; apache httpd configuration
+
+::
+
+ <VirtualHost *:80>
+ ServerName munin.example.org
+ ServerAlias munin
+
+ ServerAdmin info@example.org
+
+ DocumentRoot /srv/www/munin.example.org
+
+ ErrorLog /var/log/apache2/munin.example.org-error.log
+ CustomLog /var/log/apache2/munin.example.org-access.log combined
+
+ # Rewrites
+ RewriteEngine On
+
+ # Static content in /static
+ RewriteRule ^/favicon.ico /etc/munin/static/favicon.ico [L]
+ RewriteRule ^/static/(.*) /etc/munin/static/$1 [L]
+
+ # HTML
+ RewriteCond %{REQUEST_URI} .html$ [or]
+ RewriteCond %{REQUEST_URI} =/
+ RewriteRule ^/(.*) /usr/lib/munin/cgi/munin-cgi-html/$1 [L]
+
+ # Images
+ RewriteRule ^/munin-cgi/munin-cgi-graph/(.*) /usr/lib/munin/cgi/munin-cgi-graph/$1 [L]
+
+ # Ensure we can run (fast)cgi scripts
+ <Directory "/usr/lib/munin/cgi">
+ Options +ExecCGI
+ <IfModule mod_fcgid.c>
+ SetHandler fcgid-script
+ </IfModule>
+ <IfModule !mod_fcgid.c>
+ SetHandler cgi-script
+ </IfModule>
+ </Directory>
+ </VirtualHost>
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/example/webserver/lighttpd.rst
^
|
@@ -0,0 +1,55 @@
+.. _example-webserver-lighttpd:
+
+========================
+ lighttpd configuration
+========================
+
+This example describes how to set up munin on lighttpd. It spawns two
+lighttpd processes, one for the graph rendering, and one for the html
+generation.
+
+You need to enable the "mod_rewrite" module in the main lighttpd
+configuration.
+
+Munin configuration
+===================
+
+This example assumes the following configuration in
+/etc/munin/munin.conf
+
+.. index::
+ pair: example; munin.conf
+
+::
+
+ # graph_strategy should be commented out, if present
+ html_strategy cgi
+
+Webserver configuration
+=======================
+
+.. index::
+ pair: example; lighttpd configuration
+
+::
+
+ alias.url += ( "/munin-static" => "/etc/munin/static" )
+ alias.url += ( "/munin" => "/var/cache/munin/www/" )
+
+ fastcgi.server += ("/munin/cgi/munin-cgi-graph" =>
+ (( "socket" => "/var/run/lighttpd/munin-cgi-graph.sock",
+ "bin-path" => "/usr/lib/munin/cgi/munin-cgi-graph",
+ "check-local" => "disable",
+ )),
+ "/munin-cgi/munin-cgi-html" =>
+ (( "socket" => "/var/run/lighttpd/munin-cgi-html.sock",
+ "bin-path" => "/usr/lib/munin/cgi/munin-cgi-html",
+ "check-local" => "disable",
+ ))
+ )
+
+ url.rewrite-repeat += (
+ "/munin/(.*)" => "/munin-cgi/munin-cgi-html/$1",
+ "/munin-cgi/munin-cgi-html$" => "/munin-cgi/munin-cgi-html/",
+ "/munin-cgi/munin-cgi-html/static/(.*)" => "/munin-static/$1"
+ )
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/example/webserver/nginx.rst
^
|
@@ -0,0 +1,160 @@
+.. _example-webserver-nginx:
+
+=====================
+ nginx configuration
+=====================
+
+This example describes how to set up munin on nginx.
+
+nginx does not spawn FastCGI processes by itself, but comes with an
+external "spawn-fcgi" program.
+
+We need one process for the graph rendering, and one for the html
+generation.
+
+Munin configuration
+===================
+
+This example assumes the following configuration in
+/etc/munin/munin.conf
+
+.. index::
+ pair: example; munin.conf
+
+::
+
+ # graph_strategy should be commented out, if present
+ html_strategy cgi
+
+FastCGI configuration
+=====================
+
+This will spawn two FastCGI processes trees. One for munin cgi
+graphing and one for HTML generation. It will create a socket owned by
+www-data, and run the processes as the "munin" user.
+
+.. index::
+ pair: example; munin-cgi-graph invocation
+
+.. code-block:: bash
+
+ spawn-fcgi -s /var/run/munin/fastcgi-graph.sock -U www-data \
+ -u munin -g munin /usr/lib/munin/cgi/munin-cgi-graph
+
+ spawn-fcgi -s /var/run/munin/fastcgi-html.sock -U www-data \
+ -u munin -g munin /usr/lib/munin/cgi/munin-html-graph
+
+Note: Depending on your installation method, the "munin-\*-graph"
+programs may be in another directory. Check Makefile.config if you
+installed from source, or your package manager if you used that to
+install.
+
+Note: If you installed using the package manager on Debian or Ubuntu,
+the /var/log/munin/munin-cgi-\*.log files may be owned by the
+"www-data" user. This example runs the processes as the "munin" user,
+so you need to chown the log files, and edit /etc/logrotate.d/munin.
+
+Webserver configuration
+=======================
+
+.. index::
+ pair: example; nginx configuration
+
+::
+
+ location ^~ /munin-cgi/munin-cgi-graph/ {
+ fastcgi_split_path_info ^(/munin-cgi/munin-cgi-graph)(.*);
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ fastcgi_pass unix:/var/run/munin/fastcgi-graph.sock;
+ include fastcgi_params;
+ }
+
+ location /munin/static/ {
+ alias /etc/munin/static/;
+ }
+
+ location /munin/ {
+ fastcgi_split_path_info ^(/munin)(.*);
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ fastcgi_pass unix:/var/run/munin/fastcgi-html.sock;
+ include fastcgi_params;
+ }
+
+Authentication and group access
+===============================
+
+.. index::
+ pair: example; nginx authentication group configuration
+
+If you have munin statistics, and need to allow some user (ie:
+customers) to access only graphs for a subset of nodes, the easiest way
+might be to use groups, and authentication with the exact same name as
+the node-group name.
+
+Here is an example of how to redirect the users to the group that
+matches their name, and prevent any access to other groups. It also has
+allow an admin user to see it all.
+
+Warning: If you don't want users to get any information about the other
+group names, you should also change the templates accordingly, and
+remove any navigation part that might.
+
+::
+
+ # Here, the whole vhost has auth requirements.
+ # You can duplicate it to the graph and html locations if you have
+ # something else that doesn't need auth.
+ auth_basic "Restricted stats";
+ auth_basic_user_file /some/path/to/.htpasswd;
+
+ location ^~ /cgi-bin/munin-cgi-graph/ {
+ # not authenticated => no rewrite (back to auth)
+ if ($remote_user ~ ^$) { break; }
+
+ # is on the right subtree ?
+ set $ok "no";
+ # admin can see it all
+ if ($remote_user = 'admin') { set $ok "yes"; }
+ # only allow given path
+ if ($uri ~ /cgi-bin/munin-cgi-graph/([^/]*)) { set $path $1; }
+ if ($path = $remote_user) { set $ok "yes"; }
+
+ # not allowed here ? redirect them where they should land
+ if ($ok != "yes") {
+ # redirect to where they should be
+ rewrite / /cgi-bin/munin-cgi-graph/$remote_user/ redirect;
+ }
+
+ fastcgi_split_path_info ^(/cgi-bin/munin-cgi-graph)(.*);
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ fastcgi_pass unix:/var/run/munin/fastcgi-graph.sock;
+ include fastcgi_params;
+ }
+
+ location /munin/static/ {
+ alias /etc/munin/static/;
+ }
+
+ location /munin/ {
+ # not authenticated => no rewrite (back to auth)
+ if ($remote_user ~ ^$) { break; }
+
+ # is on the right subtree ?
+ set $ok "no";
+ # admin can see it all
+ if ($remote_user = 'admin') { set $ok "yes"; }
+ # only allow given path
+ if ($uri ~ /munin/([^/]*)) { set $path $1; }
+ if ($path = $remote_user) { set $ok "yes"; }
+
+ # not allowed here ? redirect them where they should land
+ if ($ok != "yes") {
+ # redirect to where they should be
+ rewrite / /munin/$remote_user/ redirect;
+ }
+
+ fastcgi_split_path_info ^(/munin)(.*);
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ fastcgi_pass unix:/var/run/munin/fastcgi-html.sock;
+ include fastcgi_params;
+ }
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/index.rst
^
|
@@ -0,0 +1,25 @@
+
+Welcome to Munin's documentation!
+=================================
+
+Warning: This documentation is being developed. It is incomplete, and
+may even be plain wrong. Feedback is welcome.
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+ installation/index.rst
+ master/index.rst
+ node/index.rst
+ plugin/index.rst
+ documentation/index.rst
+ reference/index.rst
+ example/index.rst
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`search`
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/installation
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/installation/configuration.rst
^
|
@@ -0,0 +1,84 @@
+=======================
+ Initial configuration
+=======================
+
+Node
+====
+
+Plugins
+-------
+
+Decide which plugins to use. The munin node runs all plugins present
+in CONFDIR/plugins/
+
+The quick auto-plug-and-play solution:
+
+.. code-block:: bash
+
+ munin-node-configure --shell --families=contrib,auto | sh -x
+
+Access
+------
+
+The munin node listens on all interfaces by default, but has a
+restrictive access list. You need to add your master's IP address.
+
+The "cidr_allow", "cidr_deny", "allow" and "deny" statements are used.
+
+cidr_allow uses the following syntax (the /32 is not implicit, so for
+a single host, you need to add it):
+
+ | cidr_allow 127.0.0.0/8
+ | cidr_allow 192.0.2.1/32
+
+allow uses regular expression matching against the client IP address.
+
+ | allow '^127\.'
+ | allow '^192\.0\.2\.1$'
+
+For specific information about the syntax, see `Net::Server
+<http://search.cpan.org/dist/Net-Server/lib/Net/Server.pod>`_. Please
+keep in mind that cidr_allow is a recent addition, and may not be
+available on all systems.
+
+Startup
+-------
+
+Start the node agent (as root) SBINDIR/munin-node. Restart it it it
+was already started. The node only discovers new plugins when it is
+restarted.
+
+You probably want to use an init-script instead and you might find a
+good one under build/dists or in the build/resources directory (maybe
+you need to edit the init script, check the given paths in the script
+you might use).
+
+Master
+======
+
+Add some nodes
+--------------
+
+Add some nodes to CONFDIR/munin.conf
+
+[node.example.com]
+ address 192.0.2.4
+
+[node2.example.com]
+ address node2.example.com
+
+[node3.example.com]
+ address 2001:db8::de:caf:bad
+
+Configure web server
+====================
+
+On the master, you need to configure a web server.
+
+If you have installed "munin" through distribution
+packages, a webserver may have been configured for you already.
+
+If you installed from source, there is a minimal configuration example
+in the "resources" directory in the source tarball.
+
+For a more complex example, see :ref:`example-webserver-apache`
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/installation/help.rst
^
|
@@ -0,0 +1,27 @@
+==============
+ Getting help
+==============
+
+IRC Channel
+===========
+
+The most immediate way to get hold of us is to join our IRC channel:
+
+ ``#munin on server irc.oftc.net``
+
+The main timezone of the channel is Europe+America.
+
+If you can explain your problem in a few clear sentences, without too
+much copy&paste, IRC is a good way to try to get help. If you do need
+to paste log files, configuration snippets, scripts and so on, please
+use a pastebin_.
+
+If the channel is all quiet, try again some time later, we do have
+lives, families and jobs to deal with also.
+
+You are more than welcome to just hang out, and while we don't mind
+the occational intrusion of the real world into the flow, keep it
+mostly on topic, and dont paste random links unless they are *really*
+spectacular and intelligent.
+
+.. _pastebin: https://gist.github.com/
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/installation/index.rst
^
|
@@ -0,0 +1,17 @@
+.. _install-index:
+
+====================
+ Munin installation
+====================
+
+This document explains how to get Munin onto your system, where to get
+help, and how to report bugs.
+
+.. toctree::
+ :maxdepth: 2
+
+ prerequisites.rst
+ install.rst
+ configuration.rst
+ help.rst
+ upgrade.rst
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/installation/install.rst
^
|
@@ -0,0 +1,177 @@
+==================
+ Installing Munin
+==================
+
+With open source software, you can choose to install binary packages
+or install from source-code. To install a package or install from
+source is a matter of personal taste. If you don't know which method
+too choose read the whole document and choose the method you are most
+comfortable with.
+
+Master and node
+===============
+
+Munin is split into two distinct roles.
+
+Node
+----
+
+The "munin node" is a daemon which runs on all servers being
+monitored.
+
+
+Master
+------
+
+The "munin master" connects to all munin nodes, collects data, and
+stores it in `RRD <http://oss.oetiker.ch/rrdtool/>`_
+
+You will need to install "munin-master" on the server which will
+collect data from all nodes, and graph the results. When starting with
+munin, it should be enough to install the munin master on one server.
+
+On the munin master, you will need a web server capable of running CGI
+or FastCGI. Apache HTTD should be suitable. Also reported to be
+working is nginx and lighttpd.
+
+Source or packages?
+===================
+
+Installing Munin on most relevant operating systems can usually be
+done with with the systems package manager, typical examples being:
+
+FreeBSD
+-------
+
+From source:
+
+.. code-block:: bash
+
+ cd /usr/ports/sysutils/munin-master && make install clean
+ cd /usr/ports/sysutils/munin-node && make install clean
+
+Binary packages:
+
+.. code-block:: bash
+
+ pkg_add -r munin-master
+ pkg_add -r munin-node
+
+Debian/Ubuntu
+-------------
+
+Munin is distributed with both Debian and Ubuntu.
+
+In order to get Munin up and running type
+
+.. code-block:: bash
+
+ sudo apt-get install munin-node
+
+on all nodes, and
+
+.. code-block:: bash
+
+ sudo apt-get install munin
+
+on the master.
+
+Please note that this might not be the latest version of Munin. On
+Debian you have the option of enabling "backports", which may give
+access to later versions of Munin.
+
+RedHat / CentOS / Fedora
+------------------------
+
+At time of writing, only the 1.x version of munin is available in
+`EPEL
+<http://dl.fedoraproject.org/pub/epel/6/SRPMS/repoview/munin.html>`_.
+
+If you want 2.x, your best option is probably to install from source.
+
+Other systems
+-------------
+
+On other systems, you are probably best off compiling your own code.
+See `Installing Munin from source`_.
+
+Installing Munin from source
+============================
+
+If there are no binary packages available for your system, or if you
+want to install Munin from source for other reasons, follow these
+steps:
+
+We recommend downloading a release tarball, which you can find on
+`sourceforge.net <http://sourceforge.net/projects/munin/files/stable/>`_.
+
+Alternatively, if you want to hack on Munin, you should clone our git
+repository by doing.
+
+.. code-block:: bash
+
+ git clone git://github.com/munin-monitoring/munin
+
+Please note that a git checkout will need some more build-dependencies
+than listed below, in particular the Python Docutils and Sphinx.
+
+Build dependencies on Debian / Ubuntu
+-------------------------------------
+
+In order to build Munin from source you need a number of packages
+installed. On a Debian or Ubuntu system these are:
+
+* perl
+* htmldoc
+* html2text
+* default-jdk
+
+Configuring and installing
+--------------------------
+
+Warning for NFS users
+~~~~~~~~~~~~~~~~~~~~~
+
+If you're using NFS please note that the "make install" process is
+slightly problematic in that it (Module::Build actually) writes files
+under $CWD. Since "make install" is usually run by root and root
+usually cannot write files on a NFS volume, this will fail. If you use
+NFS please install munin from /var/tmp, /tmp or some such to work
+around this.
+
+Running make
+~~~~~~~~~~~~
+
+There are make targets for node, master, documentation and man files.
+Generally you want to install everything on the master, and just the
+node and plugiuns on the nodes.
+
+- Edit Makefile.config to suit your needs.
+
+- Create the user "munin" with the primary group "munin".
+
+ The user needs no shell and no privileges. On most Linux systems the
+ munin user's shell is the nologin shell (it has different paths on
+ different systems - but the user still needs to be able to run cron
+ jobs.
+
+Node
+~~~~
+
+For the node, you need only the common parts, the node and the plugins.
+
+.. code-block:: bash
+
+ make
+ make install-common-prime install-node-prime install-plugins-prime
+
+
+Master
+~~~~~~
+
+For the master, this will install everything.
+
+.. code-block:: bash
+
+ make
+ make install
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/installation/prerequisites.rst
^
|
@@ -0,0 +1,68 @@
+===============
+ Prerequisites
+===============
+
+In order for you to install Munin you must have the following:
+
+Building munin
+==============
+
+In order to build munin, you need:
+
+* GNU Make — Please do not attempt to use any other make.
+
+* A reasonable Perl 5 (Version 5.8 or newer)
+
+* Perl modules: Module::Build
+
+Developers / packagers need
+
+* Test::MockModule
+* Test::MockObject
+* Test::Pod::Coverage
+* Test::Perl::Critic 1.096 or later
+* Test::Exception
+* Directory::Scratch (err, wherefrom?)
+
+In order to build the documentation, you need:
+* sphinx
+
+Running munin
+=============
+
+In order to run munin, you need:
+
+* A reasonable perl 5 (Version 5.8 or newer)
+
+The munin node needs:
+
+* Perl modules
+
+ * Net::Server
+ * Net::Server::Fork
+ * Time::HiRes
+ * Net::SNMP (Optional, if you want to use SNMP plugins)
+
+* Java JRE (Optional, if you want to use java plugins)
+* Anything the separate plugins may need. These have diverse
+ requirements, not documented here.
+
+The munin master needs
+
+* Perl modules:
+
+ * CGI::Fast
+ * Digest::MD5,
+ * File\::Copy::Recursive
+ * Getopt::Long
+ * HTML::Template
+ * IO::Socket::INET6
+ * Log::Log4perl 1.18 or later
+ * Net::SSLeay (Optional, if you want to use SSL/TLS)
+ * Params::Validate
+ * Storable
+ * Text::Balanced
+ * Time::HiRes
+ * TimeDate
+
+* A web server capable of CGI or FastCGI
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/installation/upgrade.rst
^
|
@@ -0,0 +1,19 @@
+=================================
+ Upgrading Munin from 1.x to 2.x
+=================================
+
+This is a compilation of items you need to pay attention to when
+upgrading from Munin 1.x to munin 2.x
+
+FastCGI
+=======
+
+Munin graphing is now done with FastCGI.
+
+Munin HTML generation is optionally done with FastCGI.
+
+Logging
+=======
+
+The web server needs write access to the munin-cgi-html and
+munin-cgi-graph logs.
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/master
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/master/index.rst
^
|
@@ -0,0 +1,59 @@
+.. _master-index:
+
+==================
+ The Munin master
+==================
+
+Role
+====
+
+The munin master is responsible for gathering data from munin nodes.
+It stores this data in RRD, and graphs them on request.
+
+Components
+==========
+
+The following components are part of munin-master:
+
+.. hlist::
+
+ * :ref:`munin-cron` runs :ref:`munin-graph`, :ref:`munin-html`,
+ :ref:`munin-limits` and :ref:`munin-update`.
+
+ * :ref:`munin-update` is run by :ref:`munin-cron`. It is the munin
+ data collector, and it fetches data from :ref:`munin nodes
+ <munin-node>`, which is then stored in RRD files.
+
+ * :ref:`munin-graph` is run by :ref:`munin-cron`. It generates
+ graphs in PNG format from the RRD files. See also
+ :ref:`munin-cgi-graph`.
+
+ * :ref:`munin-limits` is run by :ref:`munin-cron`. It notifies any
+ configured contacts if a value moves between "ok", "warn" or
+ "crit". Munin is commonly used in combination with Nagios, which
+ is then configured as a contact.
+
+ * :ref:`munin-html` is run by :ref:`munin-cron`. It generates HTML
+ pages. See also :ref:`munin-cgi-html`.
+
+ * :ref:`munin-cgi-graph` is run by a web server. If graph_strategy
+ is set to "cgi", munin-cron will not run munin-graph, and assumes
+ that the web server runs :ref:`munin-cgi-graph` instead.
+
+ * :ref:`munin-cgi-html` is run by a web server. If html_strategy is
+ set to "cgi", munin-cron will not run munin-html, and assumes
+ that the web server runs :ref:`munin-cgi-html` instead.
+
+Configuration
+=============
+
+The munin master has its primary configuration file at
+:ref:`/etc/munin/munin.conf <munin.conf>`.
+
+Other documentation
+===================
+
+.. toctree::
+ :maxdepth: 2
+
+ rrdcached.rst
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/master/rrdcached.rst
^
|
@@ -0,0 +1,116 @@
+.. _munin-master-rrdcached:
+
+=========================================
+ Scaling the munin master with rrdcached
+=========================================
+
+When the master grows big, and has a lot of nodes, there is a risk of
+disk IO becoming a bottleneck.
+
+To reduce this disk IO, you can use the RRD Cache Daemon.
+
+This will spool RRD changes in a queue, and flush changes on demand,
+and periodically. This will replace lots of random writes with a much
+smaller amount of sequential writes.
+
+Configuring rrdcached
+=====================
+
+Parameters
+----------
+
+RRDCached writes the spool data every 5 mintes by default. This is the
+same as the munin master. To have an effect, change the flushing
+intervals to allow more data to be spooled. Use the following
+parameters, and tune to your liking:
+
++---------+-----------------------------------------------------+
+| -w 1800 | Wait 30 minutes before writing data |
++---------+-----------------------------------------------------+
+| -z 1800 | Delay writes by a random factor of up to 30 minutes |
+| | (this should be equal to, or lower than, "-w") |
++---------+-----------------------------------------------------+
+| -f 3600 | Flush all data every hour |
++---------+-----------------------------------------------------+
+
+Example
+-------
+
+Create a directory for the rrdcached journal, and have the "munin"
+user own it. (in this example: /var/lib/munin/rrdcached-journal).
+
+Set up a separate RRDCached instance, run by the munin user. The
+following command starts an RRDCached instance, and can be added to
+/etc/rc.local.
+
+.. code-block:: bash
+
+ sudo -u munin /usr/bin/rrdcached \
+ -p /run/munin/rrdcached.pid \
+ -B -b /var/lib/munin/ \
+ -F -j /var/lib/munin/rrdcached-journal/ \
+ -m 0660 -l unix:/run/munin/rrdcached.sock \
+ -w 1800 -z 1800 -f 3600
+
+Note: While testing, add "-g" to the command line to prevent rrdcached
+from forking into the background.
+
+The munin grapher also needs write access to this socket, in order for
+it to tell the RRDCached to flush data needed for graphing. If you run
+munin with CGI graphing, you will need to give the web server access.
+For a common setup, run the following command, as root, after starting
+rrdcached:
+
+.. code-block:: bash
+
+ chgrp www-data /run/munin/rrdcached.sock
+
+Recommended: If you have systemd installed, use a systemd service. If
+you have upstart installed, write a daemon job configuration file. If
+you use systemd, you can add "-g" to the rrdcached command line.
+
+Configuring munin to use rrdcached
+===================================
+
+To enable rrdcached on the munin master, you will need to set the
+"rrdcached_socket" line in /etc/munin/munin.conf
+
+::
+
+ rrdcached_socket=/run/munin/rrdcached.sock
+
+
+Is it working?
+==============
+
+If all goes well, you should see the following:
+
+Munin logging
+-------------
+
+There should be no messages regarding rrdcached in
+/var/log/munin/munin-update.log.
+
+
+On failure to connect, there will be log lines like:
+
+::
+
+ 2012/06/26 18:56:12 [WARN] RRDCached feature ignored: rrdcached socket not writable
+
+…and you should then check for permissions problems.
+
+RRDCached spool
+---------------
+
+The rrdcached spool file should be in
+/var/lib/munin/rrdcached-journal/, and it should grow for each run of
+munin-update until it hits the flush time. The file looks like:
+
+::
+
+ /var/lib/munin/rrdcached-journal/rrd.journal.1340869388.141124
+
+For a munin master with 200 nodes, this could well grow to 100MiB,
+depending on the number of plugins, and the spool file time
+parameters.
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/node
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/node/async.rst
^
|
@@ -0,0 +1,81 @@
+.. _node-async:
+
+=========================
+ Asynchronous proxy node
+=========================
+
+The munin asynchronous proxy node (or "munin-async") connects to the
+local node periodically, and spools the results.
+
+When the munin master connects, all the data is available instantly.
+
+munin-asyncd
+============
+
+The Munin async daemon starts at boot, and connects to the local
+munin-node periodically, like a :ref:`munin master <master-index>`
+would. The results are stored the results in a spool, tagged with
+timestamp.
+
+You can also use munin-asyncd to connect to several munin nodes. You
+will need to use one spooldir for each node you connect to. This
+enables you to set up a "fanout" setup, with one privileged node per
+site, and site-to-site communication being protected by ssh.
+
+munin-async
+===========
+
+The Munin async client is invoked by the connecting master, and reads
+from the munin-async spool using the "spoolfetch" command.
+
+Example configuration
+=====================
+
+On the munin master
+-------------------
+
+We use ssh encapsulated connections with munin async. In the :ref:`the munin
+master <master-index>` configuration you need to configure a host with a
+"ssh\://" address.
+
+::
+
+ [random.example.org]
+ address ssh://munin-async@random.example.org
+
+You will need to create an SSH key for the "munin" user, and
+distribute this to all nodes running munin-asyncd.
+
+On the munin node
+-----------------
+
+Configure your munin node to only listen on "127.0.0.1".
+
+You will also need to add the public key of the munin user to the
+authorized_keys file for this user.
+
+ * You must add a "command=" parameter to the key to run the command
+ specified instead of whatever command the connecting user tries to
+ use.
+
+::
+
+ command="/usr/share/munin/munin-async --spoolfetch" ssh-rsa AAAA[...] munin@master
+
+The following options are recommended for security, but are strictly
+not necessary for the munin-async connection to work
+
+ * You should add a "from=" parameter to the key to restrict where it
+ can be used from.
+
+ * You should add hardening options. At the time of writing, these are
+ "no-X11-forwarding", "no-agent-forwarding", "no-port-forwarding",
+ "no-pty" and "no-user-rc".
+
+ Some of these may also be set globally in /etc/ssh/sshd_config.
+
+::
+
+ no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,no-user-rc,from="192.0.2.0/24",command="/usr/share/munin/munin-async --spoolfetch" ssh-rsa AAAA[...] munin@master
+
+See the sshd_config (5) and authorized_keys(5) man pages for more information.
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/node/index.rst
^
|
@@ -0,0 +1,28 @@
+.. _node-index:
+
+================
+ The Munin node
+================
+
+Role
+====
+
+The munin node is installed on all monitored servers. It accepts
+connections from the munin master, and runs plugins on demand.
+
+By default, it is started at boot time, listens on port 4949/TCP,
+accepts connections from the :ref:`munin master <master-index>`, and
+runs :ref:`munin plugins <plugin-index>` on demand.
+
+Configuration
+=============
+
+The configuration file is :ref:`munin-node.conf`.
+
+Other documentation
+===================
+
+.. toctree::
+ :maxdepth: 2
+
+ async.rst
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/plugin
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/plugin/index.rst
^
|
@@ -0,0 +1,24 @@
+.. _plugin-index:
+
+==================
+ The Munin plugin
+==================
+
+Role
+====
+
+The munin plugin is a simple executable, which role is to gather one
+set of facts about the local server.
+
+The plugin is called with the argument "config" to get metadata, and
+with no arguments to get the values.
+
+Other documentation
+===================
+
+.. toctree::
+ :maxdepth: 2
+
+ use.rst
+ writing.rst
+ supersampling.rst
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/plugin/supersampling.rst
^
|
@@ -0,0 +1,120 @@
+.. _plugin-supersampling:
+
+===============
+ Supersampling
+===============
+
+Every monitoring software has a polling rate. It is usually 5 min,
+because it's the sweet spot that enables frequent updates yet still
+having a low overhead.
+
+Munin is not different in that respect: it's data fetching routines
+have to be launched every 5 min, otherwise you'll face data loss.
+And this 5 min period is deeply grained in the code. So changing it is
+possible, but very tedious and error prone.
+
+But sometimes we need a very fine sampling rate. Every 10 seconds
+enables us to track fast changing metrics that would be averaged out
+otherwise. Changing the whole polling process to cope with a 10s
+period is very hard on hardware, since now every update has to finish
+in these 10 seconds.
+
+This triggered an extension in the plugin protocol, commonly known as
+"supersampling".
+
+Overview
+========
+
+The basic idea is that fine precision should only be for selected
+plugins only. It also cannot be triggered from the master, since the
+overhead would be way too big.
+
+So, we just let the plugin sample itself the values at a rate it feels
+adequate. Then each polling round, the master fetches all the samples
+since last poll.
+
+This enables various constructions, mostly around "streaming" plugins
+to achieve highly detailed sampling with a very small overhead.
+
+Notes
+-----
+
+This protocol is currently completely transparent to :ref:`munin-node
+<node-index>`, and therefore it means that it can be used even on
+older (1.x) nodes. Only a 2.0 :ref:`master <master-index>` is
+required.
+
+Protocol details
+================
+
+The protocol itself is derived from the :ref:`spoolfetch` extension.
+
+Config
+------
+
+A new plugin directive is used, :ref:`update_rate`. It enables the
+master to create the rrd with an adequate step.
+
+Omitting it would lead to rrd averaging the supersampled values onto
+the default 5 min rate. This means **data loss**.
+
+.. note:: Heartbeat
+
+ The heartbeat has always a 2 step size, so failure to send all the
+ samples will result with unknown values, as expected.
+
+.. note:: Data size
+
+ The RRD file size is always the same in the default config, as all
+ the RRA are configured proportionally to the :ref:`update_rate`.
+ This means that, since you'll keep as much data as with the default,
+ you keep it for a shorter time.
+
+Fetch
+-----
+
+When spoolfetching, the epoch is also sent in front of the value.
+Supersampling is then just a matter of sending multiple epoch/value
+lines, with monotonically increasing epoch.
+
+.. note::
+
+ Note that since the epoch is an integer value for rrdtool_, the
+ smallest granularity is 1 second. For the time being, the protocol
+ itself does also mandates integers. We can easily imagine that with
+ another database as backend, an extension could be hacked together.
+
+.. _rrdtool: http://oss.oetiker.ch/rrdtool/doc/rrdtool.en.html
+
+Compatibility with 1.4
+======================
+
+On older 1.4 masters, only the last sampled value gets into the RRD.
+
+Sample implementation
+=====================
+
+The canonical sample implementation is multicpu1sec_, a contrib plugin
+on github. It is also a so-called streaming plugin.
+
+.. _multicpu1sec: https://github.com/munin-monitoring/contrib/tree/master/plugins/system/multicpu1sec
+
+Streaming plugins
+=================
+
+These plugins fork a background process when called that streams a
+system tool into a spool file. In multicpu1sec_, it is the mpstat_ tool
+with a period of 1 second.
+
+.. _mpstat: https://en.wikipedia.org/wiki/Mpstat
+
+Undersampling
+=============
+
+Some plugins are on the opposite side of the spectrum, as they only
+need a lower precision.
+
+It makes sense when :
+
+* data should be kept for a *very* long time
+* data is *very* expensive to generate and it varies only slowly.
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/plugin/use.rst
^
|
@@ -0,0 +1,83 @@
+.. _plugin-use:
+
+=====================
+ Using munin plugins
+=====================
+
+.. index::
+ pair: plugin; installing
+
+Installing
+==========
+
+The default plugin directory is /etc/munin/plugins/.
+
+To install a plugin, place it in the plugin directory, and make it
+executable.
+
+You can also place the plugin elsewhere, and install a symbolic link
+in the plugin directory. All the plugins provided with munin are
+installed in this way.
+
+.. index::
+ pair: plugin; configuration
+
+Configuring
+===========
+
+The plugin configuration directory is /etc/munin/plugin-conf.d/. The
+syntax is:
+
+user <username>
+ The user the plugin will run as.
+
+ Default: munin
+
+group <groupname>
+ The group the plugin will run as
+
+ Default: munin
+
+env.variablename <variable content>
+ Defines and exports an environment variable called "variablename"
+ with the content set to <variable content>.
+
+ There is no need to quote the variable content.
+
+.. note::
+
+ When configuring a munin plugin, add the least amount of extra
+ privileges needed to run the plugin. For instance, do not run a
+ plugin with "user root" to read syslogs, when it may be sufficient
+ to set "group adm" instead.
+
+Example:
+
+.. index::
+ triple: example; plugin; configuration
+
+::
+
+ [pluginname]
+ user username
+ group groupname
+ env.variablename some content for the variable
+ env.critical 92
+ env.warning 95
+
+Plugin configuration is optional.
+
+.. index::
+ pair: plugin; testing
+
+Testing
+=======
+
+To test if the plugin works when executed by munin, you can use the
+:ref:`munin-run` command.
+
+.. code-block:: bash
+
+ # munin-run myplugin config
+
+ # munin-run myplugin
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/plugin/writing.rst
^
|
@@ -0,0 +1,120 @@
+.. _plugin-writing:
+
+========================
+ Writing a munin plugin
+========================
+
+A munin plugin is a small executable. Usually, it is written in some
+interpreted language.
+
+In its simplest form, when the plugin is executed with the argument
+"config", it outputs metadata needed for generating the graph. If it
+is called with no arguments, it outputs the data which is to be
+collected, and graphed later.
+
+Plugin output
+=============
+
+The minimum plugin output when called with "config" it must output the
+graph title.
+
+It should also output a label for at least one datasource.
+
+::
+
+ graph_title Some title for our plugin
+ something.label Foobar per second
+
+When the plugin is executed with no arguments, it should output a
+value for the datasource labelled in "config". It must not output
+values for which there are no matching labels in the configuration
+output.
+
+::
+
+ something.value 42
+
+For a complete description of the available fields, see the
+:ref:`plugin-reference`.
+
+Example shell plugin
+====================
+
+The base of a plugin is a small option parser, ensuring the plugin is
+called with the correct argument, if any.
+
+Two main functions are defined: One for printing the configuration to
+the standard output, and one for printing the data. In addition, we
+have defined a function to generate the data itself, just to keep the
+plugin readable.
+
+The "output_usage" function is there just to be polite, it serves no
+other function. :)
+
+.. code-block:: bash
+
+ #!/bin/sh
+
+ output_config() {
+ echo "graph_title Example graph"
+ echo "plugins.label Number of plugins"
+ }
+
+ output_values() {
+ printf "plugins.value %d\n" $(number_of_plugins)
+ }
+
+ number_of_plugins() {
+ find /etc/munin/plugins -type l | wc -l
+ }
+
+ output_usage() {
+ printf >&2 "%s - munin plugin to graph an example value\n" ${0##*/}
+ printf >&2 "Usage: %s [config]\n" ${0##*/}
+ }
+
+ case $# in
+ 0)
+ output_values
+ ;;
+ 1)
+ case $1 in
+ config)
+ output_config
+ ;;
+ *)
+ output_usage
+ exit 1
+ ;;
+ esac
+ ;;
+ *)
+ output_usage
+ exit 1
+ ;;
+ esac
+
+Activating the plugin
+=====================
+
+Place the plugin in the /etc/munin/plugins/ directory, and make it
+executable.
+
+Then, restart the munin-node.
+
+Debugging the plugin
+====================
+
+To see how the plugin works, as the munin node would run it, you can
+use the command "munin-run".
+
+If the plugin is called "example", you can run "munin-run example
+config" to see the plugin configuration, and "munin-run example" to
+see the data.
+
+If you do not get the output you expect, check if your munin plugin
+needs more privileges. Normally, it is run as the "munin" user, but
+gathering some data may need more access.
+
+If the munin plugin emits errors, they will be visible in
+/var/log/munin/munin-node.log
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/directories.rst
^
|
@@ -0,0 +1,45 @@
+.. _reference-directories:
+
+=============
+ Directories
+=============
+
+.. _dbdir:
+
+dbdir
+=====
+
+This directory is used to store the munin master database.
+
+It contains one subdirectory with RRD files per group of hosts, as
+well as other variable state the munin master would need.
+
+.. _plugindir:
+
+plugindir
+=========
+
+This directory contains all the plugins the :ref:`munin node
+<munin-node>` should run.
+
+.. _pluginconfdir:
+
+pluginconfdir
+=============
+
+This directory contains plugin configuration.
+
+.. _rundir:
+
+rundir
+======
+
+This directory contains files needed to track the munin run state. PID
+files, lock files, and possibly sockets.
+
+.. _logdir:
+
+logdir
+======
+
+Contains the log files for each munin progam.
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/index.rst
^
|
@@ -0,0 +1,37 @@
+.. _reference-index:
+
+===========
+ Reference
+===========
+
+This section contains man pages and other reference material
+
+Man pages
+=========
+
+.. toctree::
+ :maxdepth: 1
+
+ munin-async.rst
+ munin-asyncd.rst
+ munin-cgi-graph.rst
+ munin-cgi-html.rst
+ munin-check.rst
+ munin-cron.rst
+ munin-graph.rst
+ munin-html.rst
+ munin-limits.rst
+ munin-node.rst
+ munin-run.rst
+ munin-update.rst
+ munin.conf.rst
+ munin-node.conf.rst
+
+Other reference material
+========================
+
+.. toctree::
+ :maxdepth: 1
+
+ directories.rst
+ plugin.rst
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-async.rst
^
|
@@ -0,0 +1,74 @@
+.. _munin-async:
+
+.. program:: munin-async
+
+=============
+ munin-async
+=============
+
+DESCRIPTION
+===========
+
+The munin async clients reads from a spool directory written by
+:ref:`munin-asyncd`.
+
+It can optionally request a cleanup of this directory.
+
+OPTIONS
+=======
+
+.. option:: --spooldir | -s <spooldir>
+
+ Directory for spooled data [/var/lib/munin/spool]
+
+.. option:: --hostname <hostname>
+
+ Overrides the hostname [The local hostname]
+
+ This is used to override the hostname used in the greeting
+ banner. This is used when using munin-async from the munin
+ master, and the data fetched is from another node.
+
+.. option:: --cleanup
+
+ Clean up the spooldir after interactive session completes
+
+.. option:: --cleanupandexit
+
+ Clean up the spooldir and exit (non-interactive)
+
+.. option:: --spoolfetch
+
+ Enables the "spool" capability [no]
+
+.. option:: --vectorfetch
+
+ Enables the "vectorized" fetching capability [no]
+
+ Note that without this flag, the "fetch" command is disabled.
+
+.. option:: --verbose | -v
+
+ Be verbose
+
+.. option:: --help | -h
+
+ View this message
+
+EXAMPLES
+========
+
+.. code-block:: bash
+
+ munin-async --spoolfetch
+
+This starts an interactive munin node session, enabling the
+"spoolfetch" command. This does not connect to the local munin node.
+Everything happens within munin-async, which reads from the spool
+directory instead of connecting to the node.
+
+SEE ALSO
+========
+
+See also :ref:`node-async` for more information and examples of how to
+configure munin-async.
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-asyncd.rst
^
|
@@ -0,0 +1,58 @@
+.. _munin-asyncd:
+
+.. program:: munin-asyncd
+
+==============
+ munin-asyncd
+==============
+
+DESCRIPTION
+===========
+
+The munin async daemon connects to a :ref:`munin node <munin-node>`
+periodically, and requests plugin configuration and data.
+
+This is stored in a spool directory, which is read by
+:ref:`munin-async`.
+
+OPTIONS
+=======
+
+.. option:: --spool | -s <spooldir>
+
+ Directory for spooled data [/var/lib/munin/spool]
+
+.. option:: --host <hostname:port>
+
+ Connect a munin node running on this host name and port
+ [localhost:4949]
+
+.. option:: --interval <seconds>
+
+ Set default interval size [86400 (one day)]
+
+.. option:: --retain <count>
+
+ Number of interval files to retai [7]
+
+.. option:: --nocleanup
+
+ Disable automated spool dir cleanup
+
+.. option:: --fork
+
+ Fork one thread per plugin available on the node. [no forking]
+
+.. option:: --verbose | -v
+
+ Be verbose
+
+.. option:: --help | -h
+
+ View this message
+
+SEE ALSO
+========
+
+See also :ref:`node-async` for more information and examples of how to
+configure munin-asyncd.
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-cgi-graph.rst
^
|
@@ -0,0 +1,94 @@
+.. _munin-cgi-graph:
+
+.. program:: munin-cgi-graph
+
+=================
+ munin-cgi-graph
+=================
+
+DESCRIPTION
+===========
+
+The munin-cgi-graph program is intended to be run from a web server.
+It can either run as CGI, or as FastCGI.
+
+OPTIONS
+=======
+
+munin-cgi-graph is controlled using environment variables. See
+environment variables :envvar:`PATH_INFO` and :envvar:`QUERY_STRING`.
+
+Note: The munin-cgi-graph script may be called with the command line
+options of :ref:`munin-graph`. However, the existence of this should
+not be relied upon.
+
+ENVIRONMENT VARIABLES
+=====================
+
+The following environment variables are used to control the output of
+munin-cgi-graph:
+
+.. envvar:: PATH_INFO
+
+ This is the remaining part of the URI, after the path to the
+ munin-cgi-graph script has been removed.
+
+ The group, host, service and timeperiod values are extracted from
+ this variable. The group may be nested.
+
+.. envvar:: CGI_DEBUG
+
+ If this variable is set, debug information is logged to STDERR, and
+ to /var/log/munin/munin-cgi-graph.log
+
+.. envvar:: QUERY_STRING
+
+ A list of key=value parameters to control munin-cgi-graph. If
+ QUERY_STRING is set, even to an empty value, a no_cache header is
+ returned.
+
+.. envvar:: HTTP_CACHE_CONTROL
+
+ If this variable is set, and includes the string "no_cache", a
+ no_cache header is returned.
+
+.. envvar:: HTTP_IF_MODIFIED_SINCE
+
+ Returns 304 if the graph is not changed since the timestamp in the
+ HTTP_IF_MODIFIED_SINCE variable.
+
+EXAMPLES
+========
+
+When given an URI like the following:
+
+http://munin/munin-cgi/munin-cgi-graph/example.org/client.example.org/cpu-week.png
+
+munin-cgi-graph will be called with the following environment:
+
+PATH_INFO=/example.org/client.example.org/cpu-week.png
+
+To verify that munin is indeed graphing as it should, you can use the
+following command line:
+
+.. code-block:: bash
+
+ sudo -u www-data \
+ PATH_INFO=/example.org/client.example.org/irqstats-day.png \
+ /usr/lib/munin/cgi/munin-cgi-graph | less
+
+The "less" is strictly not needed, but is recommended since
+munin-cgi-graph will output binary data to your terminal.
+
+You can add the :envvar:`CGI_DEBUG` variable, to get more log
+information. Content and debug information is logged to STDOUT and
+STDERR, respectively. If you only want to see the debug information,
+and not the HTTP headers or the content, you can redirect the file
+descriptors:
+
+.. code-block:: bash
+
+ sudo -u www-data \
+ CGI_DEBUG=yes \
+ PATH_INFO=/example.org/client.example.org/irqstats-day.png \
+ /usr/lib/munin/cgi/munin-cgi-graph 2>&1 >/dev/null | less
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-cgi-html.rst
^
|
@@ -0,0 +1,73 @@
+.. _munin-cgi-html:
+
+.. program:: munin-cgi-html
+
+================
+ munin-cgi-html
+================
+
+DESCRIPTION
+===========
+
+The :program:`munin-cgi-html` program is intended to be run from a
+web server. It can either run as CGI, or as FastCGI.
+
+OPTIONS
+=======
+
+munin-cgi-html takes no options. It is controlled using environment
+variables.
+
+ENVIRONMENT VARIABLES
+=====================
+
+The following environment variables are used to control the output of
+munin-cgi-html:
+
+.. envvar:: PATH_INFO
+
+ This is the remaining part of the URI, after the path to the
+ munin-cgi-html script has been removed.
+
+ The group, host, service and timeperiod values are extracted from
+ this variable. The group may be nested.
+
+EXAMPLES
+========
+
+PATH_INFO
+---------
+
+"/"
+ refers to the top page.
+
+"/example.com/"
+ refers to the group page for "example.com" hosts.
+
+"/example.com/client.example.com/"
+ refers to the host page for "client.example.com" in the
+ "example.com" group
+
+COMMAND-LINE
+------------
+
+When given an URI like the following:
+http://munin.example.org/munin-cgi/munin-cgi-html/example.org
+
+munin-cgi-html will be called with the following environment:
+
+PATH_INFO=/example.org
+
+To verify that munin is able to create HTML pages, you can use the
+following command line:
+
+.. code-block:: bash
+
+ sudo -u www-data \
+ PATH_INFO=/example.org \
+ /usr/lib/munin/cgi/munin-cgi-html
+
+SEE ALSO
+========
+
+:ref:`munin-cgi-graph`.
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-check.rst
^
|
@@ -0,0 +1,32 @@
+.. _munin-check:
+
+.. program:: munin-check
+
+=============
+ munin-check
+=============
+
+DESCRIPTION
+===========
+
+munin-check is a utility that fixes the permissions of the munin
+directories and files.
+
+.. note:: munin-check needs superuser rights.
+
+.. note::
+
+ Please don't use this script if you are using 'graph_strategy cgi'.
+ It doesn't care about the right permissions for www-data yet.
+
+
+OPTIONS
+=======
+
+.. option:: --fix-permissions | -f
+
+ Fix the permissions of the munin files and directories.
+
+.. option:: --help | -h
+
+ Display usage information
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-cron.rst
^
|
@@ -0,0 +1,52 @@
+.. _munin-cron:
+
+.. program:: munin-cron
+
+============
+ munin-cron
+============
+
+DESCRIPTION
+===========
+
+Munin-cron is a part of the package Munin, which is used in
+combination with :ref:`munin-node`.
+
+Munin is a group of programs to gather data from Munin's nodes, graph
+them, create html-pages, and optionally warn Nagios about any
+off-limit values.
+
+"munin-cron" runs the following programs, in the given order:
+
+#. :ref:`munin-update`
+#. :ref:`munin-limits`
+#. :ref:`munin-graph`
+ (unless configured to run from CGI)
+#. :ref:`munin-html`
+ (unless configured to run from CGI)
+
+Unless the munin master is configured otherwise, "munin-cron" should
+run every 5 minutes.
+
+OPTIONS
+=======
+
+.. option:: --service <service>
+
+ Limit services to <service>. Multiple --service options may be
+ supplied. [unset]
+
+.. option:: --host <host>
+
+ Limit hosts to <host>. Multiple --host options may be supplied.
+ [unset]
+
+.. option:: --config <file>
+
+ Use <file> as configuration file. [/etc/munin/munin.conf]
+
+SEE ALSO
+========
+
+:ref:`munin-update`, :ref:`munin-graph`, :ref:`munin-limits`,
+:ref:`munin-html`, :ref:`munin.conf`,
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-graph.rst
^
|
@@ -0,0 +1,147 @@
+.. _munin-graph:
+
+.. program:: munin-graph
+
+=============
+ munin-graph
+=============
+
+DESCRIPTION
+===========
+
+The munin-graph script is run by munin-cron, and creates graphs from
+all RRD files in the munin database directory.
+
+OPTIONS
+=======
+
+Some options can be negated by prefixing them with "no".
+Example: --fork and --nofork
+
+.. option:: --fork
+
+ By default munin-graph forks subprocesses for drawing graphs to
+ utilize available cores and I/O bandwidth. Can be negated
+ with --nofork [--fork]
+
+.. option:: --n <processes>
+
+ Max number of concurrent processes [6]
+
+.. option:: --force
+
+ Force drawing of graphs that are not usually drawn due to options
+ in the config file. Can be negated with --noforce [--noforce]
+
+.. option:: --lazy
+
+ Only redraw graphs when needed. Can be negated with --nolazy
+ [--lazy]
+
+.. option:: --help
+
+ View this message.
+
+.. option:: --version
+
+ View version information.
+
+.. option:: --debug
+
+ View debug messages.
+
+.. option:: --cron
+
+ Behave as expected when run from cron. (Used internally in Munin.)
+ Can be negated with --nocron
+
+.. option:: --host <host>
+
+ Limit graphed hosts to <host>. Multiple --host options may be
+ supplied.
+
+.. option:: --only-fqn <FQN>
+
+ For internal use with CGI graphing. Graph only a single fully
+ qualified named graph,
+
+ For instance: --only-fqn
+ root/Backend/dafnes.example.com/diskstats_iops
+
+ Always use with the correct --host option.
+
+.. option:: --config <file>
+
+ Use <file> as configuration file. [/etc/munin/munin.conf]
+
+.. option:: --list-images
+
+ List the filenames of the images created. Can be negated with
+ --nolist-images. [--nolist-images]
+
+.. option:: --output-file | -o
+
+ Output graph file. (used for CGI graphing)
+
+.. option:: --log-file | -l
+
+ Output log file. (used for CGI graphing)
+
+.. option:: --day
+
+ Create day-graphs. Can be negated with --noday. [--day]
+
+.. option:: --week
+
+ Create week-graphs. Can be negated with --noweek. [--week]
+
+.. option:: --month
+
+ Create month-graphs. Can be negated with --nomonth. [--month]
+
+.. option:: --year
+
+ Create year-graphs. Can be negated with --noyear. [--year]
+
+.. option:: --sumweek
+
+ Create summarised week-graphs. Can be negated with --nosumweek.
+ [--summweek]
+
+.. option:: --sumyear
+
+ Create summarised year-graphs. Can be negated with --nosumyear.
+ [--sumyear]
+
+.. option:: --pinpoint <start,stop>
+
+ Create custom-graphs. <start,stop> is the time in the standard unix
+ Epoch format. [not active]
+
+.. option:: --size_x <pixels>
+
+ Sets the X size of the graph in pixels [175]
+
+.. option:: --size_y <pixels>
+
+ Sets the Y size of the graph in pixels [400]
+
+.. option:: --lower_limit <lim>
+
+ Sets the lower limit of the graph
+
+.. option:: --upper_limit <lim>
+
+ Sets the upper limit of the graph
+
+.. note::
+
+ :option:`--pinpoint` and :option:`--only-fqn` must not be combined
+ with any of :option:`--day`, :option:`--week`, :option:`--month` or
+ :option:`--year` (or their negating forms). The result of doing that
+ is undefined.
+
+SEE ALSO
+========
+
+:ref:`munin-cron`, :ref:`munin-cgi-graph`
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-html.rst
^
|
@@ -0,0 +1,61 @@
+.. _munin-html:
+
+.. program:: munin-html
+
+============
+ munin-html
+============
+
+DESCRIPTION
+===========
+
+munin-html is one of the munin master components run from the
+:ref:`munin-cron` script.
+
+This script is responsible for generating static HTML pages.
+
+If "html_strategy cgi" is set in munin.conf, munin-html will assume
+HTML pages are generated by munin-cgi-html, and exit silently.
+
+OPTIONS
+=======
+
+munin-html has one significant option, which configuration file to
+use.
+
+Several other options are recognized and ignored as "compatibility
+options", since :ref:`munin-cron` passes all options through to the
+underlying components, of which munin-html is one.
+
+.. option:: --config <file>
+
+ Use <file> as configuration file. [/etc/munin/munin.conf]
+
+.. option:: --help
+
+ View this message.
+
+.. option:: --debug
+
+ View debug messages.
+
+.. option:: --version
+
+ View version information.
+
+.. option:: --nofork
+
+ Compatibility. No effect.
+
+.. option:: --service <service>
+
+ Compatibility. No effect.
+
+.. option:: --host <host>
+
+ Compatibility. No effect.
+
+SEE ALSO
+========
+
+:ref:`munin-cron`, :ref:`munin-cgi-html`
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-limits.rst
^
|
@@ -0,0 +1,79 @@
+.. _munin-limits:
+
+.. program:: munin-limits
+
+==============
+ munin-limits
+==============
+
+DESCRIPTION
+===========
+
+:ref:`munin-limits` is one of the processes regularly run from the
+:ref:`munin-cron` script.
+
+It reads the current and the previous collected values for each
+plugin, and compares them to the plugin's warning and critical values,
+if it has any.
+
+If the limits are breached, for instance, if a value moves from "ok"
+to "warning", or from "critical" to "ok", it sends an event to any
+configured contacts.
+
+A common configured contact is "nagios", which can use events from
+munin-limits as a source of passive service check results.
+
+OPTIONS
+=======
+
+.. option:: --config <file>
+
+ Use <file> as configuration file. [/etc/munin/munin.conf]
+
+.. option:: --contact <contact>
+
+ Limit contacts to those of <contact<gt>. Multiple --contact options
+ may be supplied. [unset]
+
+.. option:: --host <host>
+
+ Limit hosts to those of <host<gt>. Multiple --host options may be
+ supplied. [unset]
+
+.. option:: --service <service>
+
+ Limit services to those of <service>. Multiple --service options
+ may be supplied. [unset]
+
+.. option:: --force
+
+ Force sending of messages even if you normally wouldn't. Can be
+ negated with --noforce. [--noforce]
+
+.. option:: --force-root
+
+ Force running as root (stupid and unnecessary). Can be negated
+ with --noforce-root [--noforce-root]
+
+.. option:: --help
+
+ View help message.
+
+.. option:: --debug
+
+ If set, view debug messages. Can be negated with --nodebug.
+ [--nodebug]
+
+FILES
+=====
+
+:ref:`/etc/munin/munin.conf <munin.conf>`
+
+:ref:`/var/lib/munin/* <dbdir>`
+
+:ref:`/var/run/munin/* <rundir>`
+
+SEE ALSO
+========
+
+:ref:`munin.conf`
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-node.conf.rst
^
|
@@ -0,0 +1,176 @@
+.. _munin-node.conf:
+
+===============
+munin-node.conf
+===============
+
+DESCRIPTION
+===========
+
+This is the configuration file for :ref:`munin-node` and :ref:`munin-run`.
+
+The directives "host_name", "paranoia" and "ignore_file" are munin
+node specific.
+
+All other directives in munin-node.conf are passed through to the Perl
+module Net::Server. Depending on the version installed, you may have
+different settings available.
+
+DIRECTIVES
+==========
+
+Native
+------
+
+.. option:: host_name
+
+ The hostname used by munin-node to present itself to the munin
+ master. Use this if the local node name differs from the name
+ configured in the munin master.
+
+.. option:: ignore_file
+
+ Files to ignore when locating installed plugins. May be repeated.
+
+.. option:: paranoia
+
+ If set to a true value, :ref:`munin-node` will only run plugins
+ owned by root.
+
+Inherited
+---------
+
+These are the most common Net::Server options used in
+:ref:`munin-node`.
+
+.. option:: log_level
+
+ Ranges from 0-4. Specifies what level of error will be logged. "0"
+ means no logigng, while "4" means very verbose. These levels
+ correlate to syslog levels as defined by the following key/value
+ pairs. 0=err, 1=warning, 2=notice, 3=info, 4=debug.
+
+ Default: 2
+
+.. option:: log_file
+
+ Where the munin node logs its activity. If the value is
+ Sys::Syslog, logging is sent to syslog
+
+ Default: undef (STDERR)
+
+.. option:: port
+
+ The TCP port the munin node listens on
+
+ Default: 4949
+
+.. option:: pid_file
+
+ The pid file of the process
+
+ Default: undef (none)
+
+.. option:: background
+
+ To run munin node in background set this to "1". If you want
+ munin-node to run as a foreground process, comment this line out
+ and set "setsid" to "0".
+
+.. option:: host
+
+ The IP address the munin node process listens on
+
+ Default: * (All interfaces)
+
+.. option:: user
+
+ The user munin-node runs as
+
+ Default: root
+
+.. option:: group
+
+ The group munin-node runs as
+
+ Default: root
+
+.. option:: setsid
+
+ If set to "1", the server forks after binding to release itself
+ from the command line, and runs the POSIX::setsid() command to
+ daemonize.
+
+ Default: undef
+
+.. option:: ignore_file
+
+ Files to ignore when locating installed plugins. May be repeated.
+
+.. option:: host_name
+
+ The hostname used by munin-node to present itself to the munin
+ master. Use this if the local node name differs from the name
+ configured in the munin master.
+
+.. option:: allow
+
+ A regular expression defining which hosts may connect to the munin
+ node.
+
+ .. note:: Use cidr_allow if available.
+
+.. option:: cidr_allow
+
+ Allowed hosts given in CIDR notation (192.0.2.1/32). Replaces or
+ complements “allow”. Requires the precense of Net::Server, but is
+ not supported by old versions of this module.
+
+.. option:: cidr_deny
+
+ Like cidr_allow, but used for denying host access
+
+.. option:: timeout
+
+ Number of seconds after the last activity by the master until the
+ node will close the connection.
+
+ If plugins take longer to run, this may disconnect the master.
+
+ Default: 20 seconds
+
+EXAMPLE
+=======
+
+.. index::
+ tuple: munin-node.conf; example
+
+A pretty normal configuration file:
+
+::
+
+ host *
+ port 4949
+
+ cidr_allow 127.0.0.0/8
+ cidr_allow 192.0.2.0/24
+
+ user root
+ group root
+ background 1
+ setsid 1
+
+ log_level 4
+ log_file /var/log/munin/munin-node.log
+ pid_file /var/run/munin-node.pid
+
+ ignore_file \.bak$
+ ignore_file ^README$
+ ignore_file \.dpkg-(old|new)$
+ ignore_file \.rpm(save|new)$
+ ignore_file \.puppet-new$
+
+SEE ALSO
+========
+
+:ref:`munin-node`, :ref:`munin-run`
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-node.rst
^
|
@@ -0,0 +1,107 @@
+.. _munin-node:
+
+.. program:: munin-node
+
+============
+ munin-node
+============
+
+DESCRIPTION
+===========
+
+munin-node is a daemon for reporting statistics on system performance.
+
+By default, it is started at boot time, listens on port 4949/TCP,
+accepts connections from the :ref:`munin master <master-index>`, and
+runs :ref:`munin plugins <plugin-index>` on demand.
+
+OPTIONS
+=======
+
+.. option:: --config <configfile>
+
+ Use <file> as configuration file. [/etc/munin/munin-node.conf]
+
+.. option:: --paranoia
+
+ Only run plugins owned by root. Check permissions as well. Can be
+ negated with --noparanoia [--noparanoia]
+
+.. option:: --help
+
+ View this help message.
+
+.. option:: --debug
+
+ View debug messages.
+
+ .. note::
+
+ This can be very verbose.
+
+.. option:: --pidebug
+
+ Plugin debug. Sets the environment variable :envvar:`MUNIN_DEBUG`
+ to 1 so that plugins may enable debugging.
+
+CONFIGURATION
+=============
+
+The configuration file is :ref:`munin-node.conf`.
+
+.. index::
+ pair: example; munin-node.conf
+
+FILES
+=====
+
+:ref:`/etc/munin/munin-node.conf <munin-node.conf>`
+
+:ref:`/etc/munin/plugins/* <plugindir>`
+
+:ref:`/etc/munin/plugin-conf.d/* <pluginconfdir>`
+
+:ref:`/var/run/munin/munin-node.pid <rundir>`
+
+:ref:`/var/log/munin/munin-node.log <logdir>`
+
+SEE ALSO
+========
+
+:ref:`munin-node.conf`
+
+Example configuration
+=====================
+
+::
+
+ # /etc/munin/munin-node.conf - config-file for munin-node
+ #
+
+ host_name random.example.org
+ log_level 4
+ log_file /var/log/munin/munin-node.log
+ pid_file /var/run/munin/munin-node.pid
+ background 1
+ setsid 1
+
+ # Which port to bind to;
+
+ host [::]
+ port 4949
+ user root
+ group root
+
+ # Regexps for files to ignore
+
+ ignore_file ~$
+ ignore_file \.bak$
+ ignore_file %$
+ ignore_file \.dpkg-(tmp|new|old|dist)$
+ ignore_file \.rpm(save|new)$
+ ignore_file \.puppet-bak$
+
+ # Hosts to allow
+
+ cidr_allow 127.0.0.0/8
+ cidr_allow 192.0.2.129/32
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-run.rst
^
|
@@ -0,0 +1,74 @@
+.. _munin-run:
+
+.. program:: munin-run
+
+===========
+ munin-run
+===========
+
+DESCRIPTION
+===========
+
+munin-run is a script to run Munin plugins from the command-line.
+
+It is primarily used to debug plugins; munin-run runs these plugins in
+the same conditions as they are under :ref:`munin-node`.
+
+OPTIONS
+=======
+
+.. option:: --config <configfile>
+
+ Use <file> as configuration file. [/etc/munin/munin-node.conf]
+
+.. option:: --servicedir <dir>
+
+ Use <dir> as plugin dir. [/etc/munin/plugins/]
+
+.. option:: --sconfdir <dir>
+
+ Use <dir> as plugin configuration dir. [/etc/munin/plugin-conf.d/]
+
+.. option:: --sconffile <file>
+
+ Use <file> as plugin configuration. Overrides sconfdir. [undefined]
+
+.. option:: --paranoia
+
+ Only run plugins owned by root and check permissions. [disabled]
+
+.. option:: --help
+
+ View this help message.
+
+.. option:: --debug
+
+ Print debug messages.
+
+ Debug messages are sent to STDOUT and are prefixed with "#" (this
+ makes it easier for other parts of munin to use munin-run and still
+ have --debug on). Only errors go to STDERR.
+
+.. option:: --pidebug
+
+ Enable debug output from plugins. Sets the environment variable
+ :envvar:`MUNIN_DEBUG` to 1 so that plugins may enable debugging.
+ [disabled]
+
+.. option:: --version
+
+ Show version information.
+
+FILES
+=====
+
+:ref:`/etc/munin/munin-node.conf <munin-node.conf>`
+
+:ref:`/etc/munin/plugins/* <plugindir>`
+
+:ref:`/etc/munin/plugin-conf.d/* <pluginconfdir>`
+
+:ref:`/var/run/munin/munin-node.pid <rundir>`
+
+:ref:`/var/log/munin/munin-node.log <logdir>`
+
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin-update.rst
^
|
@@ -0,0 +1,68 @@
+.. _munin-update:
+
+.. program:: munin-update
+
+==============
+ munin-update
+==============
+
+DESCRIPTION
+===========
+
+munin-update is the primary Munin component. It is run from the
+:ref:`munin-cron` script.
+
+This script is responsible for contacting all the agents
+(munin-nodes) and collecting their data. Upon fetching the data,
+munin-update stores everything in RRD files - one RRD files for
+each field in each plugin.
+
+Running munin-update with the --debug flag will often give plenty
+of hints on what might be wrong.
+
+munin-update is a component in the Munin server.
+
+OPTIONS
+=======
+
+.. option:: --config_file <file>
+
+ Use <file> as the configuration file. [/etc/munin/munin.conf]
+
+.. option:: --debug
+
+ If set, log debug messages. Can be negated with --nodebug
+ [--nodebug]
+
+.. option:: --fork
+
+ If set, will fork off one process for each host. Can be negated
+ with --nofork [--fork]
+
+.. option:: --host <host>
+
+ Limit fetched data to those from <host<gt>. Multiple --host options
+ may be supplied. [unset]
+
+.. option:: --service <service>
+
+ Limit fetched data to those of <service>. Multiple --service
+ options may be supplied. [unset]
+
+.. option:: --timeout <seconds>
+
+ Set the network timeout to <seconds>. [180]
+
+.. option:: --help
+
+ Print the help message then exit.
+
+.. option:: --version
+
+ Print version information then exit.
+
+
+SEE ALSO
+========
+
+:ref:`munin-cron`
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/munin.conf.rst
^
|
@@ -0,0 +1,115 @@
+.. _munin.conf:
+
+.. program:: munin.conf
+
+============
+ munin.conf
+============
+
+DESCRIPTION
+===========
+
+This is the configuration file for the munin master. It is used by
+:ref:`munin-update`, :ref:`munin-graph`, :ref:`munin-limits`.
+:ref:`munin-html`, :ref:`munin-cgi-graph` and :ref:`munin-cgi-html`.
+
+GLOBAL DIRECTIVES
+=================
+
+Global directives affect all munin master components unless specified
+otherwise.
+
+.. option:: dbdir <path>
+
+ The directory where munin stores its database files. Default:
+ /var/lib/munin
+
+.. option:: logdir <path>
+
+ The directory where munin stores its logfiles. Default:
+ /var/log/munin
+
+.. option:: htmldir <path>
+
+ The directory where :ref:`munin-html` stores generated HTML pages,
+ and where :ref:`munin-graph` stores graphs. Default:
+ /var/cache/munin/www
+
+.. option:: rundir <path>
+
+ Directory for files tracking munin's current running state.
+ Default: /var/run/munin
+
+.. option:: tmpldir <path>
+
+ Directories for templates used by :ref:`munin-html` and
+ :ref:`munin-cgi-html` to generate HTML pages. Default
+ /etc/munin/templates
+
+.. option:: fork <yes|no>
+
+ This directive determines whether :ref:`munin-update` fork when
+ gathering information from nodes. Default is "yes".
+
+ If you set it to "no" munin-update will collect data from the nodes
+ in sequence. This will take more time, but use less resources. Not
+ recommended unless you have only a handful of nodes.
+
+ Affects: :ref:`munin-update`
+
+.. option:: palette <default|old>
+
+ The palette used by :ref:`munin-graph` and :ref:`munin-cgi-graph`
+ to colour the graphs. The "default" palete has more colours and
+ better contrast than the "old" palette.
+
+ Affects: :ref:`munin-graph`
+
+.. option:: graph_data_size <normal|huge>
+
+ This directive sets the resolution of the RRD files that are
+ created by :ref:`munin-graph` and :ref:`munin-cgi-graph`.
+
+ Default is "normal".
+
+ "huge" saves the complete data with 5 minute resolution for 400
+ days.
+
+ Changing this directive has no effect on existing graphs
+
+ Affects: :ref:`munin-graph`
+
+.. option:: graph_strategy <cgi|cron>
+
+ If set to "cron", :ref:`munin-graph` will graph all services on all
+ nodes every run interval.
+
+ If set to "cgi", :ref:`munin-graph` will do nothing. To generate
+ graphs you must then configure a web server to run
+ :ref:`munin-cgi-graph` instead.
+
+ Affects: :ref:`munin-graph`
+
+.. option:: html_strategy <strategy>
+
+ Valid strategies are "cgi" and "cron". Default is "cgi".
+
+ If set to "cron", :ref:`munin-html` will recreate all html pages
+ every run interval.
+
+ If set to "cgi", :ref:`munin-html` will do nothing. To generate
+ html pages you must configure a web server to run
+ :ref:`munin-cgi-graph` instead.
+
+.. index::
+ pair: example; munin.conf
+
+EXAMPLE
+=======
+
+A minimal configuration file
+
+::
+
+ [client.example.com]
+ address client.example.com
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/doc/reference/plugin.rst
^
|
@@ -0,0 +1,151 @@
+.. _plugin-reference:
+
+==================
+ Plugin reference
+==================
+
+.. index::
+ pair: plugin; fields
+
+Fields
+======
+
+On a configuration run, the plugin is called with the argument "config". The
+following fields are used.
+
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| Field | Value | type | Description | See also | Default |
++====================+==================+==========+==========================================+==================+=========+
+| graph_title | string | required | Sets the title of the graph | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| graph_args | string | optional | Arguments for the rrd grapher. This is | rrdgraph_ | |
+| | | | used to control how the generated graph | | |
+| | | | looks, and how values are interpreted or | | |
+| | | | presented. | | |
+| | | | | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| graph_vlabel | string | optional | Label for the vertical axis of the graph | | |
+| | | | | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| graph_category | lower case | optional | Category used to sort the graph on the | | misc |
+| | string, no | | generated index web page. | | |
+| | whitespace | | | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| graph_info | html text | optional | Additional text for the generated graph | | |
+| | | | web page | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| graph_scale | yes|no | optional | If "yes", the generated graph will be | | no |
+| | | | scaled to the uppper and lower values of | | |
+| | | | the datapoints within the graph. | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| graph_order | space separated | optional | Ensures that the listed datapoints are | | |
+| | list of | | displayed in order. Any additional | | |
+| | graph.datapoints | | datapoints are added in the order of | | |
+| | | | appearance after datapoitns appearing on | | |
+| | | | this list. | | |
+| | | | | | |
+| | | | This field is also used for "borrowing", | | |
+| | | | which is the practice of taking | | |
+| | | | datapoints from other graphs. | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| update_rate | integer | optional | Sets the update_rate used by the munin | | |
+| | (seconds) | | master when it creates the RRD file. | | |
+| | | | | | |
+| | | | The update rate is the interval at which | | |
+| | | | the RRD file expects to have data. | | |
+| | | | | | |
+| | | | This field requires a munin master | | |
+| | | | version of at least 2.0.0 | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| datapoint.label | lower case | required | The label used in the graph for this | | |
+| | string, no | | field | | |
+| | whitespace | | | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| datapoint.info | html text | optional | Additional html text for the generated | | |
+| | | | graph web page, used in the field | | |
+| | | | description table | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| datapoint.warning | integer, or | optional | This field defines a threshold value or | | |
+| | integer:integer | | range. If the field value above the | | |
+| | (signed) | | defined warning value, or outside the | | |
+| | | | range, the service is considered to be in| | |
+| | | | a "warning" state. | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| datapoint.critical | integer, or | optional | This field defines a threshold value or | | |
+| | integer:integer | | range. If the field value is above the | | |
+| | (signed) | | defined critical value, or outside the | | |
+| | | | range, the service is considered to be in| | |
+| | | | a "critical" state. | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| datapoint.graph | yes|no | optional | Determines if this datapoint should be | | yes |
+| | | | visible in the generated graph. | | |
+| | | | | | |
+| | | | | | |
+| | | | | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| datapoint.cdef | CDEF statement | optional | A CDEF statement is a Reverse Polish | cdeftutorial_ | |
+| | | | Notation statement used to construct a | | |
+| | | | datapoint from other datapoints. | | |
+| | | | | | |
+| | | | This is commonly used to calculate | | |
+| | | | percentages. | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+| datapoint.draw | AREA, LINE, | | Determines how the graph datapoints are | rrdgraph_ | LINE |
+| | LINE[n], STACK, | | displayed in the graph. The "LINE" takes | | |
+| | AREASTACK, | | an optional width suffix, commonly | | |
+| | LINESTACK, | | "LINE1", "LINE2", etc… | | |
+| | LINE[n]STACK | | The \*STACK values are specific to munin | | |
+| | | | and makes the first a LINE, LINE[n] or | | |
+| | | | AREA datasource, and the rest as STACK. | | |
++--------------------+------------------+----------+------------------------------------------+------------------+---------+
+
+On a data fetch run, the plugin is called with no arguments. the following
+fields are used.
+
++-----------------+-----------------------+----------+------------------+------+------------+
+| Field | Value | type | Description | See | Default |
+| | | | | also | |
++=================+=======================+==========+==================+======+============+
+| datapoint.value | integer, scientific | required | The value to be | | No default |
+| | notation, or "U" (may | | graphed. | | |
+| | be signed) | | | | |
+| | | | | | |
++-----------------+-----------------------+----------+------------------+------+------------+
+
+.. index::
+ pair: plugin; executing
+
+Example
+=======
+
+This is an example of the plugin fields used with the "df" plugin. The
+"munin-run" command is used to run the plugin from the command line.
+
+Configuration run
+-----------------
+
+::
+
+ # munin-run df config
+ graph_title Filesystem usage (in %)
+ graph_args --upper-limit 100 -l 0
+ graph_vlabel %
+ graph_category disk
+ graph_info This graph shows disk usage on the machine.
+ _dev_hda1.label /
+ _dev_hda1.info / (ext3) -> /dev/hda1
+ _dev_hda1.warning 92
+ _dev_hda1.critical 98
+
+Data fetch run
+--------------
+
+::
+
+ # munin-run df
+ _dev_hda1.value 83
+
+
+.. _cdeftutorial: http://oss.oetiker.ch/rrdtool/tut/cdeftutorial.en.html
+
+.. _rrdgraph: http://oss.oetiker.ch/rrdtool/doc/rrdgraph_graph.en.html
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/_bin/munin-cgi-graph.in
^
|
@@ -27,6 +27,9 @@
use strict;
use warnings;
use IO::Handle;
+BEGIN {
+ $Date::Manip::Backend = 'DM5';
+}
use Date::Manip;
use POSIX qw(strftime locale_h);
use CGI::Fast qw(:cgi);
@@ -53,8 +56,10 @@
my $logfile;
my $scale = "day";
-my @params = @ARGV;
+my @params ;
+push @params, "--config", $ENV{'MUNIN_CONFIG'}
+ if (defined $ENV{'MUNIN_CONFIG'});
push @params, "--no-fork"; # FastCgi forks for us
push @params, "--skip-locking", "--skip-stats", "--nolazy";
push @params, "--log-file", $logfile;
@@ -89,7 +94,7 @@
# The full URL looks like this:
# Case 1:
- # http://localhost:8080/cgi-bin/munin-cgi-graph/client/\
+ # http://localhost:8080/munin-cgi/munin-cgi-graph/client/\
# Backend/dafnes.client.example.com/diskstats_iops-week.png
# $path should be
# /client/Backend/dafnes.client.example.com/diskstats_iops-week.png
@@ -97,7 +102,7 @@
# Interesting bits about that url: Nested groups!
#
# Case 2:
- # http://localhost:8080/cgi-bin/munin-cgi-graph/client/\
+ # http://localhost:8080/munin-cgi/munin-cgi-graph/client/\
# Backend/dafnes.client.example.com/diskstats_iops/sda-week.png
# $path should be
# /client/Backend/dafnes.client.example.com/diskstats_iops/\
@@ -107,7 +112,7 @@
# nesting bits at the end.
#
# Case 3:
- # http://localhost:8080/cgi-bin/munin-cgi-graph/client/\
+ # http://localhost:8080/munin-cgi/munin-cgi-graph/client/\
# dafnes.client.example.com/if_err_bond0-day.png
# $path:
# /client/dafnes.client.example.com/if_err_bond0-day.png
@@ -159,7 +164,7 @@
}
# Having some QUERY_STRING disables the cache.
- if (defined($ENV{QUERY_STRING})) {
+ if (defined($ENV{QUERY_STRING}) && $ENV{QUERY_STRING} ne "") {
$no_cache = 1;
}
@@ -204,7 +209,7 @@
}
# Try to generate the graph
- eval {
+ my $generated_file = eval {
draw_graph_or_complain($dom, $host, $serv, $scale_options, $filename);
};
@@ -222,8 +227,18 @@
}
# Generic error
- die $@;
+ # .. we DO NOT DIE, as spawn-fcgi doesn't like it.
+ ERROR "[ERROR] $@";
+ print "Status: 500\r\n",
+ "Content-Type: text/plain\r\n",
+ "X-Munin-Pid: $$\r\n",
+ "X-Munin-Request $nb_request/$nb_request_max\r\n",
+ "";
+ next;
}
+
+ # draw_graph_or_complain return 0, but already displayed a message
+ next unless ($generated_file);
}
# Now send it: headers
@@ -292,7 +307,9 @@
if (! open (GRAPH_PNG_FILE, '<', $filename) ) {
ERROR "[FATAL] Could not open image file \"$filename\" for reading: $!\n";
- die "[FATAL] Could not open image file \"$filename\" for reading: $!\n";
+ # We don't send anything...
+ # .. we DO NOT DIE, as spawn-fcgi doesn't like it.
+ return;
}
# No buffering wanted when sending the file
@@ -411,7 +428,6 @@
# remove old file if present
if (-f $filename and !unlink($filename)) {
ERROR "[FATAL] Could not remove \"$filename\": $!";
- die("[FATAL] cannot remove old graph file \"$filename\": $!");
}
$serv =~ s{[^\w_\/"'\[\]\(\)+=-]}{_}g; $serv =~ /^(.+)$/; $serv = $1; #"
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/_bin/munin-cgi-html.in
^
|
@@ -45,8 +45,12 @@
my $lastchanged = 0;
my $datafile = "$Munin::Common::Defaults::MUNIN_DBDIR/datafile.storable";
+my @params;
+push @params, "--config", $ENV{'MUNIN_CONFIG'}
+ if (defined $ENV{'MUNIN_CONFIG'});
+
# grab config
-html_startup([]);
+html_startup(\@params);
while(new CGI::Fast){
print header("text/html");
my $change = (stat($datafile))[9];
@@ -80,9 +84,10 @@
#process groups
$group = traverse_groups($path, $group);
+ update_timestamp();
if(!defined $group->{"depth"} || $group->{"depth"} == 0){ #root url
my $problems = get_next_part($path);
- if($problems eq "problems.html"){
+ if(defined $problems && $problems eq "problems.html"){
emit_problem_template(1);
} else {
unshift(@$path, $problems);
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/_bin/munin-cron.in
^
|
@@ -11,4 +11,10 @@
@@LIBDIR@@/munin-limits $@
+# We always launch munin-html.
+# It is a noop if html_strategy is "cgi"
nice @@LIBDIR@@/munin-html $@ || exit 1
+
+# The result of munin-html is needed for munin-graph.
+# It is a noop if graph_strategy is "cgi"
+nice @@LIBDIR@@/munin-graph --cron $@ || exit 1
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/_bin/munin-graph.in
^
|
@@ -27,6 +27,16 @@
use strict;
use warnings;
use IO::Handle;
+
+BEGIN {
+ # This is needed because Date::Manip has deprecated the functional
+ # interface in >= 6.x. So, we force the use of the 5.x API.
+ $Date::Manip::Backend = 'DM5';
+
+ # Double line here to avoid spurious warnings about D::M::Backend being
+ # used only once.
+ $Date::Manip::Backend = 'DM5';
+}
use Date::Manip;
use POSIX qw(strftime);
use Time::HiRes qw(gettimeofday tv_interval);
@@ -54,8 +64,7 @@
my @params = @ARGV;
-push @params, "--no-fork"; # FastCgi forks for us
-push @params, "--skip-locking", "--skip-stats", "--nolazy";
+push @params, "--no-fork"; # We do *not* want to fork. Perf -> FastCGI
push @params, "--log-file", $logfile;
my $config = graph_startup(\@params);
@@ -63,17 +72,23 @@
logger_open($config->{'logdir'});
logger_debug() if $config->{debug} or defined($ENV{CGI_DEBUG});
+if (! graph_check_cron() ) {
+ # Should not be launched from cron.
+ INFO "[INFO] graphing is cgi, do nothing";
+ exit 0;
+}
+
# BEGIN FAST-CGI LOOP:
my $nb_request = 0;
my $nb_request_max = 0;
-my $graph_fh = new IO::File($config->{libdir} . "/graphs");
+my $graph_fh = new IO::File($config->{dbdir} . "/graphs");
while (my $path = <$graph_fh>) {
my $pinpoint = undef;
- print "Request path is $path";
+ INFO "Request path is $path";
# The full URL looks like this:
# Case 1:
- # http://localhost:8080/cgi-bin/munin-cgi-graph/client/\
+ # http://localhost:8080/munin-cgi/munin-cgi-graph/client/\
# Backend/dafnes.client.example.com/diskstats_iops-week.png
# $path should be
# client/Backend/dafnes.client.example.com/diskstats_iops-week.png
@@ -81,7 +96,7 @@
# Interesting bits about that url: Nested groups!
#
# Case 2:
- # http://localhost:8080/cgi-bin/munin-cgi-graph/client/\
+ # http://localhost:8080/munin-cgi/munin-cgi-graph/client/\
# Backend/dafnes.client.example.com/diskstats_iops/sda-week.png
# path should be
# client/Backend/dafnes.client.example.com/diskstats_iops/\
@@ -91,7 +106,7 @@
# nesting bits at the end.
#
# Case 3:
- # http://localhost:8080/cgi-bin/munin-cgi-graph/client/\
+ # http://localhost:8080/munin-cgi/munin-cgi-graph/client/\
# dafnes.client.example.com/if_err_bond0-day.png
# path:
# client/dafnes.client.example.com/if_err_bond0-day.png
@@ -323,13 +338,8 @@
if (! -f $ret) {
my ($dom, $host, $serv, $scale, $filename ) = @_;
WARN "[WARNING] Could not draw graph \"$filename\": $ret";
- print "Status: 500\r\n",
- "Content-Type: text/plain\r\n",
- "\r\n",
- "Could not draw graph \"$filename\"\r\n";
return 0;
} else {
- print "X-Graph-Duration: $graph_duration\r\n";
return $ret;
}
}
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/lib/Munin/Master/GraphOld.pm
^
|
@@ -161,7 +161,7 @@
my $watermark = "Munin " . $Munin::Common::Defaults::MUNIN_VERSION;
-# RRD param for --daemon
+# RRD param for RRDCACHED_ADDRESS
my @rrdcached_params;
my $running = 0;
@@ -308,8 +308,9 @@
if ($config->{"rrdcached_socket"}) {
if ($RRDs::VERSION >= 1.3){
- push @rrdcached_params, "--daemon";
- push @rrdcached_params, $config->{"rrdcached_socket"};
+ # Using the RRDCACHED_ADDRESS environnement variable, as
+ # it is way less intrusive than the command line args.
+ $ENV{RRDCACHED_ADDRESS} = $config->{"rrdcached_socket"};
} else {
ERROR "[ERROR] RRDCached feature ignored: RRD version must be at least 1.3. Version found: " . $RRDs::VERSION;
}
@@ -1422,6 +1423,9 @@
# Otherwise, it will be difficult to debug post-mortem
ERROR "[RRD ERROR] rrdtool 'graph' '" . join("' \\\n\t'", @rrdcached_params, @complete) . "'\n";
}
+ elsif (!-f $picfilename) {
+ ERROR "[RRD ERROR] rrdtool graph did not generate the image (make sure there are data to graph).\n";
+ }
else {
# Set time of png file to the time of the last update of
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/lib/Munin/Master/HTMLConfig.pm
^
|
@@ -95,7 +95,7 @@
$config->{'cgiurl_graph'} = $config->{'cgiurl'} . "/munin-cgi-graph";
}
else {
- $config->{'cgiurl_graph'} = "/cgi-bin/munin-cgi-graph";
+ $config->{'cgiurl_graph'} = "/munin-cgi/munin-cgi-graph";
}
DEBUG "[DEBUG] Determined that cgiurl_graph is ".$config->{'cgiurl_graph'};
}
@@ -320,6 +320,7 @@
foreach my $tmpserv (@{$tmpcat->{'services'}}) {
$comparecatshash->{$tmpcat->{'name'}}->{'services'}->{$tmpserv->{'name'}}->{'nodes'}->{$tmpgroup->{'name'}} = $tmpserv;
$comparecatshash->{$tmpcat->{'name'}}->{'services'}->{$tmpserv->{'name'}}->{'nodes'}->{$tmpgroup->{'name'}}->{'nodename'} = $tmpgroup->{'name'};
+ $comparecatshash->{$tmpcat->{'name'}}->{'services'}->{$tmpserv->{'name'}}->{'nodes'}->{$tmpgroup->{'name'}}->{'nodeurl'} = $tmpgroup->{'url'};
}
}
}
@@ -430,8 +431,6 @@
$srv{'root_path'} = $root_path;
$srv{'filename'} = $filename;
- my $method = "cgi"; # Method can no longer be either cron or cgi, it's always cgi
-
$srv{'url'} = "$srv{node}.html";
my $path = join('/', @loc);
@@ -455,12 +454,15 @@
# dump all the png filename to a file
my $fh = $config->{"#%#graphs_fh"};
if ($fh) {
- foreach my $img (keys %imgs) {
- print $fh "/" . $imgs{$img} . "\n";
+ # values %imgs = the image file
+ # get them uniq, so we don't write them twice
+ my %paths = map { $_, 1 } (values %imgs);
+ foreach my $img (keys %paths) {
+ print $fh "/" . $img . "\n";
}
}
- if ($method eq "cgi") {
+ if ($config->{'graph_strategy'} eq "cgi") {
map { $srv{$_} = $config->{'cgiurl_graph'} . "/" . $imgs{$_} } keys %imgs;
} else {
map { $srv{$_} = $root_path . "/" . $imgs{$_} } keys %imgs;
@@ -477,7 +479,7 @@
my $start_year = $epoch_now - (3600 * 24 * 400);
my $size_x = 800;
my $size_y = 400;
- my $common_url = "$root_path/static/dynazoom.html?plugin_name=$path&size_x=$size_x&size_y=$size_y";
+ my $common_url = "$root_path/static/dynazoom.html?cgiurl_graph=$config->{'cgiurl_graph'}&plugin_name=$path&size_x=$size_x&size_y=$size_y";
$srv{zoomday} = "$common_url&start_epoch=$start_day&stop_epoch=$epoch_now";
$srv{zoomweek} = "$common_url&start_epoch=$start_week&stop_epoch=$epoch_now";
$srv{zoommonth} = "$common_url&start_epoch=$start_month&stop_epoch=$epoch_now";
@@ -487,7 +489,7 @@
for my $scale (@times) {
# Don't try to find the size if cgi is enabled,
# otherwise old data might pollute
- next if ($method eq "cgi");
+ next if ($config->{'graph_strategy'} eq "cgi");
if (my ($w, $h)
= get_png_size(munin_get_picture_filename($service, $scale))) {
$srv{"img" . $scale . "width"} = $w;
@@ -499,7 +501,7 @@
$srv{imgweeksum} = "$srv{node}-week-sum.png";
$srv{imgyearsum} = "$srv{node}-year-sum.png";
for my $scale (["week", "year"]) {
- next if ($method eq "cgi");
+ next if ($config->{'graph_strategy'} eq "cgi");
if (my ($w, $h)
= get_png_size(munin_get_picture_filename($service, $scale, 1)))
{
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/lib/Munin/Master/HTMLOld.pm
^
|
@@ -63,7 +63,7 @@
our (@ISA, @EXPORT);
@ISA = qw(Exporter);
-@EXPORT = qw(html_startup html_main get_config emit_main_index emit_comparison_template emit_group_template emit_graph_template emit_service_template emit_category_template emit_problem_template);
+@EXPORT = qw(html_startup html_main get_config emit_main_index emit_comparison_template emit_group_template emit_graph_template emit_service_template emit_category_template emit_problem_template update_timestamp);
use HTML::Template;
use POSIX qw(strftime);
@@ -100,6 +100,18 @@
my $timestamp;
my $htmlconfig;
+sub update_timestamp {
+ # For timestamping graphs
+ $timestamp = strftime("%Y-%m-%d %T%z (%Z)", localtime);
+ if ($timestamp =~ /%z/) {
+ # %z (numeric timezone offset) may not be available, but %Z
+ # (timeszone name) seems to be universaly supported though the
+ # timezone names are not really standardized.
+ $timestamp = strftime("%Y-%m-%d %T%Z", localtime);
+ }
+ $htmltagline = "This page was generated by <a href='http://munin-monitoring.org/'>Munin</a> version ".$Munin::Common::Defaults::MUNIN_VERSION." at $timestamp";
+}
+
sub html_startup {
my ($args) = @_;
local @ARGV = @{$args};
@@ -133,15 +145,7 @@
$max_running = &munin_get($config, "max_html_jobs", $max_running);
- # For timestamping graphs
- $timestamp = strftime("%Y-%m-%d %T%z (%Z)", localtime);
- if ($timestamp =~ /%z/) {
- # %z (numeric timezone offset) may not be available, but %Z
- # (timeszone name) seems to be universaly supported though the
- # timezone names are not really standardized.
- $timestamp = strftime("%Y-%m-%d %T%Z", localtime);
- }
- $htmltagline = "This page was generated by <a href='http://munin-monitoring.org/'>Munin</a> version ".$Munin::Common::Defaults::MUNIN_VERSION." at $timestamp";
+ update_timestamp();
%comparisontemplates = instanciate_comparison_templates($tmpldir);
}
@@ -269,6 +273,24 @@
push((@$comparepeers), {"name" => $peer->{"name"}, "link" => $comparelink});
}
+ # when comparing categories, we're generating the page inside the
+ # domain, but the images' urls will point inside the node itself,
+ # or even worse within a category inside it. We strip out the
+ # extra '../' that is used to generate a relative path which is no
+ # longer valid.
+ foreach my $cat(@{$key->{'comparecategories'}}) {
+ foreach my $service(@{$cat->{'services'}}) {
+ foreach my $node(@{$service->{'nodes'}}) {
+ foreach my $imgsrc(qw(imgday imgweek imgmonth imgyear
+ cimgday cimgweek cimgmonth cimgyear
+ zoomday zoomweek zoommonth zoomyear)) {
+ next unless defined($node->{$imgsrc});
+ $node->{$imgsrc} =~ s|^\.\./\.\./(?:\.\./)?|../|;
+ }
+ }
+ }
+ }
+
$comparisontemplates{$t}->param(
INFO_OPTION => 'Groups on this level',
NAME => $key->{'name'},
@@ -373,6 +395,16 @@
DEBUG "[DEBUG] Creating global category page ".$filename;
+ foreach my $graphs(@{$key->{'graphs'}}) {
+ foreach my $graph(@{$graphs->{'graphs'}}) {
+ foreach my $imgsrc(qw(imgday imgweek imgmonth imgyear
+ cimgday cimgweek cimgmonth cimgyear
+ zoomday zoomweek zoommonth zoomyear)) {
+ $graph->{$imgsrc} =~ s|^(?:\.\./)+||
+ }
+ }
+ }
+
$graphtemplate->param(
PATH => $key->{'path'},
CSS_NAME => get_css_name(),
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/lib/Munin/Master/Node.pm
^
|
@@ -72,6 +72,9 @@
my ($url, $params) = split(/ +/, $self->{address}, 2);
my $uri = new URI($url);
+ # If address is only "ssh://host/" $params will not get set
+ $params = "" unless defined $params;
+
# If the scheme is not defined, it's a plain host.
# Prefix it with munin:// to be able to parse it like others
$uri = new URI("munin://" . $url) unless $uri->scheme;
@@ -109,7 +112,7 @@
} elsif ($uri->scheme eq "cmd") {
# local commands should ignore the username, url and host
my $local_cmd = $uri->path;
- my $local_pipe_cmd = $local_cmd . (defined $params ? " $params" : "");
+ my $local_pipe_cmd = "$local_cmd $params";
# Open a triple pipe
use IPC::Open3;
@@ -400,7 +403,7 @@
$self->_node_write_single("spoolfetch $timestamp\n");
# The whole stuff in one fell swoop.
- my $lines = $self->_node_read_fast();
+ my $lines = $self->_node_read();
# using the multigraph parsing.
# Using "__root__" as a special plugin name.
@@ -508,7 +511,9 @@
}
}
if ($errors) {
- WARN "[WARNING] $errors lines had errors while $correct lines were correct in data from 'fetch $plugin' on $nodedesignation";
+ my $percent = ($errors / ($errors + $correct)) * 100;
+ $percent = sprintf("%.2f", $percent);
+ WARN "[WARNING] $errors lines had errors while $correct lines were correct ($percent%) in data from 'fetch $plugin' on $nodedesignation";
}
return %values;
@@ -522,7 +527,7 @@
$self->_node_write_single("fetch $plugin\n");
- my $lines = $self->_node_read();
+ my $lines = $self->_node_read_fast();
my $elapsed = tv_interval($t0);
my $nodedesignation = $self->{host}."/".$self->{address}."/".$self->{port};
@@ -628,9 +633,17 @@
# Stop when we read a \n.\n
# ... No need to have a full regex : simple index()
- last unless index($buf, "\n.\n", $offset - $read_len) < 0;
+ my $start_offset = $offset - $read_len - 3;
+ $start_offset = 0 if $start_offset < 0;
+ last if index($buf, "\n.\n", $start_offset) >= 0;
+
+ # if empty, the client only sends a plain ".\n"
+ last if $buf eq ".\n";
}
+ # Remove the last line that only contains ".\n"
+ $buf =~ s/\.\n$//;
+
return [ split(/\n/, $buf) ];
}
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/lib/Munin/Master/Update.pm
^
|
@@ -287,6 +287,7 @@
print $io "version $Munin::Common::Defaults::MUNIN_VERSION\n";
$datafile_hash->{version} = $Munin::Common::Defaults::MUNIN_VERSION;
+ $self->_print_service_configs_for_not_updated_services($io, $datafile_hash);
$self->_print_old_service_configs_for_failed_workers($io, $datafile_hash);
for my $host (keys %{$self->{service_configs}}) {
@@ -309,6 +310,29 @@
}
+sub _print_service_configs_for_not_updated_services {
+ my ($self, $handle, $datafile_hash) = @_;
+
+ my @hosts = $self->{group_repository}->get_all_hosts();
+
+ for my $workerdata (@hosts) {
+ my $worker = $workerdata->get_full_path();
+
+ my @data = grep { /\.update$/ and !$workerdata->{$_} } keys %$workerdata;
+ for my $match (@data) {
+ my $prefix = substr $match, 0, -6;
+
+ for my $datum (grep { /^\Q$prefix\E/ } keys %$workerdata) {
+ printf $handle "%s:%s %s\n", $worker, $datum, $workerdata->{$datum};
+ munin_set_var_path($datafile_hash, $worker . ":". $datum, $workerdata->{$datum});
+ }
+
+ }
+
+ }
+}
+
+
sub _print_old_service_configs_for_failed_workers {
my ($self, $handle, $datafile_hash) = @_;
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/lib/Munin/Master/UpdateWorker.pm
^
|
@@ -233,7 +233,7 @@
}; # eval
# kill the remaining process if needed
- if ($self->{node}->{pid}) {
+ if ($self->{node}->{pid} && kill(0, $self->{node}->{pid})) {
INFO "[INFO] Killing subprocess $self->{node}->{pid}";
kill $self->{node}->{pid};
}
@@ -857,8 +857,9 @@
} elsif($RRDs::VERSION < 1.3){
WARN "[WARN] RRDCached feature ignored: perl RRDs lib version must be at least 1.3. Version found: " . $RRDs::VERSION;
} else {
- push @update_rrd_data, "--daemon";
- push @update_rrd_data, $config->{"rrdcached_socket"};
+ # Using the RRDCACHED_ADDRESS environnement variable, as
+ # it is way less intrusive than the command line args.
+ $ENV{RRDCACHED_ADDRESS} = $config->{"rrdcached_socket"};
}
}
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/lib/Munin/Master/Utils.pm
^
|
@@ -974,11 +974,30 @@
$Data::Dumper::Indent = $indent;
}
+sub purge_cycles($)
+{
+ my @topurge = (shift);
+ while (my $item = shift @topurge) {
+ if (ref($item) eq "HASH") {
+ push @topurge, values %$item;
+ %$item = ();
+ } elsif (ref($item) eq 'ARRAY') {
+ push @topurge, @$item;
+ @$item = ();
+ }
+ }
+}
+
sub munin_refreshconfig {
my $config = shift;
my @stat = stat("$config->{dbdir}/datafile");
if ($config->{'#%#datafile_mtime'} && $stat[9] > $config->{'#%#datafile_mtime'}) {
- $config = munin_readconfig("$config->{dbdir}/datafile");
+ # keep dbdir, as we don't reload that part
+ my $dbdir = $config->{dbdir};
+ # purge cyclic current config
+ purge_cycles($config);
+ $config = munin_readconfig("$dbdir/datafile");
+ $config->{dbdir} = $dbdir;
}
$config->{'#%#datafile_mtime'} = $stat[9];
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/munin.conf.in
^
|
@@ -5,34 +5,39 @@
# must be writable by the user running munin-cron. They are all
# defaulted to the values you see here.
#
-# dbdir @@DBDIR@@
-# htmldir @@HTMLDIR@@
-# logdir @@LOGDIR@@
-# rundir @@STATEDIR@@
-#
+#dbdir @@DBDIR@@
+#htmldir @@HTMLDIR@@
+#logdir @@LOGDIR@@
+#rundir @@STATEDIR@@
+
# Where to look for the HTML templates
-# tmpldir @@CONFDIR@@/templates
#
+#tmpldir @@CONFDIR@@/templates
+
# Where to look for the static www files
-# staticdir @@CONFDIR@@/static
-#
-# temporary cgi files are here. note that it has to be writable by the cgi user (usually nobody or httpd).
+#
+#staticdir @@CONFDIR@@/static
+
+# temporary cgi files are here. note that it has to be writable by
+# the cgi user (usually nobody or httpd).
+#
# cgitmpdir @@DBDIR@@/cgi-tmp
# (Exactly one) directory to include all files from.
-#
includedir @@CONFDIR@@/munin-conf.d
-# Make graphs show values per minute instead of per second
-#graph_period minute
+# You can choose the time reference for "DERIVE" like graphs, and show
+# "per minute", "per hour" values instead of the default "per second"
+#
+#graph_period second
-# Graphics files are normally generated on-demand by a CGI process.
+# Graphics files are generated either via cron or by a CGI process.
# See http://munin-monitoring.org/wiki/CgiHowto2 for more
-# documentation. Since 2.0, there is no official support for cron running
-# munin-graph. It has been rewritten to use the cgi code.
+# documentation.
+# Since 2.0, munin-graph has been rewritten to use the cgi code.
# It is single threaded *by design* now.
#
-#graph_strategy cgi
+#graph_strategy cron
# munin-cgi-graph is invoked by the web server up to very many times at the
# same time. This is not optimal since it results in high CPU and memory
@@ -44,7 +49,7 @@
# If the automatic CGI url is wrong for your system override it here:
#
-#cgiurl_graph /cgi-bin/munin-cgi-graph
+#cgiurl_graph /munin-cgi/munin-cgi-graph
# max_size_x and max_size_y are the max size of images in pixel.
# Default is 4000. Do not make it too large otherwise RRD might use all
@@ -55,10 +60,13 @@
# HTML files are normally generated by munin-html, no matter if the
# files are used or not. You can change this to on-demand generation
-# by following the instructions in
-# http://munin-monitoring.org/wiki/CgiHowto2
-#
-#html_strategy cgi
+# by following the instructions in http://munin-monitoring.org/wiki/CgiHowto2
+#
+# Notes:
+# - moving to CGI for HTML means you cannot have graph generated by cron.
+# - cgi html has some bugs, mostly you still have to launch munin-html by hand
+#
+#html_strategy cron
# munin-update runs in parallel.
#
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/static/dynazoom.html
^
|
@@ -62,6 +62,7 @@
</td>
</tr>
</table>
+ <input type=hidden name="cgiurl_graph" />
<input type=submit />
<input type=button name="btnZoomOut" value="Zoom Out x2" />
</form>
@@ -78,6 +79,7 @@
var divOverlay = document.getElementById("overlayDiv");
+form.cgiurl_graph.value = qs.get("cgiurl_graph", "/munin-cgi/munin-cgi-graph");
form.plugin_name.value = qs.get("plugin_name", "localdomain/localhost.localdomain/if_eth0");
form.start_epoch.value = qs.get("start_epoch", "1236561663");
form.stop_epoch.value = qs.get("stop_epoch", "1237561663");
@@ -93,7 +95,7 @@
var scale = refreshImg();
function refreshImg() {
- image.src = "/cgi-bin/munin-cgi-graph/"
+ image.src = form.cgiurl_graph.value + "/"
+ form.plugin_name.value
+ "-pinpoint=" + parseInt(form.start_epoch.value) + "," + parseInt(form.stop_epoch.value)
+ ".png"
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/static/zoom.js
^
|
@@ -21,8 +21,8 @@
var scale = refreshImg();
function refreshImg() {
- image.src = "/cgi-bin/munin-cgi-graph/"
- + form.plugin_name.value
+ image.src = qs.get("cgiurl_graph", "/munin-cgi/munin-cgi-graph");
+ + form.plugin_name.value
+ "-pinpoint=" + parseInt(form.start_epoch.value) + "," + parseInt(form.stop_epoch.value)
+ ".png"
+ "?"
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/www/munin-comparison-day.tmpl
^
|
@@ -15,13 +15,13 @@
<span class="nodetitle"><a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html">
<TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a> :: <TMPL_IF NAME="URL1">
<a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF>
- <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL1">">
+ <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="R_PATH">/<TMPL_VAR NAME="URL">">
</TMPL_IF>
<TMPL_VAR ESCAPE="HTML" NAME="LABEL">
<TMPL_IF NAME="URL1"></a></TMPL_IF>
</span><br />
<TMPL_IF NAME="CIMGDAY">
- <a href="<TMPL_VAR NAME="URL1">">
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_VAR NAME="URL">">
<img src="<TMPL_VAR NAME="CIMGDAY">" alt="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">"
class="i<TMPL_IF NAME="STATE_WARNING">warn</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">crit</TMPL_IF>"
<TMPL_IF NAME="IMGDAYWIDTH">width="<TMPL_VAR NAME="IMGDAYWIDTH">" </TMPL_IF>
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/www/munin-comparison-month.tmpl
^
|
@@ -15,13 +15,13 @@
<span class="nodetitle"><a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html">
<TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a> :: <TMPL_IF NAME="URL1">
<a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF>
- <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL1">">
+ <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="R_PATH">/<TMPL_VAR NAME="URL">">
</TMPL_IF>
<TMPL_VAR ESCAPE="HTML" NAME="LABEL">
<TMPL_IF NAME="URL1"></a></TMPL_IF>
</span><br />
<TMPL_IF NAME="CIMGMONTH">
- <a href="<TMPL_VAR NAME="URL1">">
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_VAR NAME="URL">">
<img src="<TMPL_VAR NAME="CIMGMONTH">" alt="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">"
class="i<TMPL_IF NAME="STATE_WARNING">warn</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">crit</TMPL_IF>"
<TMPL_IF NAME="IMGMONTHWIDTH">width="<TMPL_VAR NAME="IMGMONTHWIDTH">" </TMPL_IF>
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/www/munin-comparison-week.tmpl
^
|
@@ -15,13 +15,13 @@
<span class="nodetitle"><a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html">
<TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a> :: <TMPL_IF NAME="URL1">
<a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF>
- <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL1">">
+ <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="R_PATH">/<TMPL_VAR NAME="URL">">
</TMPL_IF>
<TMPL_VAR ESCAPE="HTML" NAME="LABEL">
<TMPL_IF NAME="URL1"></a></TMPL_IF>
</span><br />
<TMPL_IF NAME="CIMGWEEK">
- <a href="<TMPL_VAR NAME="URL1">">
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_VAR NAME="URL">">
<img src="<TMPL_VAR NAME="CIMGWEEK">" alt="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">"
class="i<TMPL_IF NAME="STATE_WARNING">warn</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">crit</TMPL_IF>"
<TMPL_IF NAME="IMGDAYWIDTH">width="<TMPL_VAR NAME="IMGWEEKWIDTH">" </TMPL_IF>
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/www/munin-comparison-year.tmpl
^
|
@@ -15,13 +15,13 @@
<span class="nodetitle"><a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html">
<TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a> :: <TMPL_IF NAME="URL1">
<a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF>
- <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL1">">
+ <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="R_PATH">/<TMPL_VAR NAME="URL">">
</TMPL_IF>
<TMPL_VAR ESCAPE="HTML" NAME="LABEL">
<TMPL_IF NAME="URL1"></a></TMPL_IF>
</span><br />
<TMPL_IF NAME="CIMGDAY">
- <a href="<TMPL_VAR NAME="URL1">">
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_VAR NAME="URL">">
<img src="<TMPL_VAR NAME="CIMGYEAR">" alt="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">"
class="i<TMPL_IF NAME="STATE_WARNING">warn</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">crit</TMPL_IF>"
<TMPL_IF NAME="IMGYEARWIDTH">width="<TMPL_VAR NAME="IMGYEARWIDTH">" </TMPL_IF>
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/www/munin-overview.tmpl
^
|
@@ -12,10 +12,10 @@
<li <TMPL_IF NAME="__LAST__">class="last"</TMPL_IF>>
<TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
<TMPL_IF NAME="COMPARE"> :: [
- <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a>
- <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a>
- <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a>
- <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-day.html">day</a>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-week.html">week</a>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-month.html">month</a>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-year.html">year</a> ]</TMPL_IF>
<TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES">
<a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></TMPL_LOOP> ]</TMPL_IF>
<ul>
@@ -23,10 +23,10 @@
<li <TMPL_IF NAME="__LAST__">class="last"</TMPL_IF>>
<TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
<TMPL_IF NAME="COMPARE"> :: [
- <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a>
- <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a>
- <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a>
- <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-day.html">day</a>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-week.html">week</a>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-month.html">month</a>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-year.html">year</a> ]</TMPL_IF>
<TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES">
<a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
<ul>
@@ -34,10 +34,10 @@
<li <TMPL_IF NAME="__LAST__">class="last"</TMPL_IF>>
<TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
<TMPL_IF NAME="COMPARE"> :: [
- <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a>
- <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a>
- <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a>
- <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-day.html">day</a>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-week.html">week</a>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-month.html">month</a>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-year.html">year</a> ]</TMPL_IF>
<TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES">
<a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
<ul>
@@ -45,10 +45,10 @@
<li <TMPL_IF NAME="__LAST__">class="last"</TMPL_IF>>
<TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
<TMPL_IF NAME="COMPARE"> :: [
- <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a>
- <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a>
- <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a>
- <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-day.html">day</a>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-week.html">week</a>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-month.html">month</a>
+ <a href="<TMPL_VAR NAME="R_PATH">/<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="pathname"><TMPL_VAR ESCAPE="URL" NAME="PATHNAME">/</TMPL_IF></TMPL_LOOP>comparison-year.html">year</a> ]</TMPL_IF>
<TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES">
<a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></TMPL_LOOP> ]</TMPL_IF>
</TMPL_UNLESS></TMPL_LOOP>
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/www/munin-problemview.tmpl
^
|
@@ -13,7 +13,7 @@
<td>
<div class="node">
<span class="nodetitle">
- <a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html">
+ <a href="<TMPL_VAR NAME="NODEURL">">
<TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a>
:: <TMPL_IF NAME="URL"><a href="<TMPL_VAR NAME="URL">"></TMPL_IF>
<TMPL_VAR ESCAPE="HTML" NAME="LABEL">
@@ -30,7 +30,7 @@
<td>
<div class="node">
<span class="nodetitle">
- <a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html">
+ <a href="<TMPL_VAR NAME="NODEURL">">
<TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a>
:: <TMPL_IF NAME="URL"><a href="<TMPL_VAR NAME="URLX">"></TMPL_IF>
<TMPL_VAR ESCAPE="HTML" NAME="LABEL">
@@ -56,7 +56,7 @@
<td>
<div class="node">
<span class="nodetitle">
- <a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html">
+ <a href="<TMPL_VAR NAME="NODEURL">">
<TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a>
:: <TMPL_IF NAME="URL"><a href="<TMPL_VAR NAME="URL">"></TMPL_IF>
<TMPL_VAR ESCAPE="HTML" NAME="LABEL">
@@ -73,7 +73,7 @@
<td>
<div class="node">
<span class="nodetitle">
- <a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html">
+ <a href="<TMPL_VAR NAME="NODEURL">">
<TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a>
:: <TMPL_IF NAME="URL"><a href="<TMPL_VAR NAME="URLX">"></TMPL_IF>
<TMPL_VAR ESCAPE="HTML" NAME="LABEL">
@@ -99,7 +99,7 @@
<td>
<div class="node">
<span class="nodetitle">
- <a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html">
+ <a href="<TMPL_VAR NAME="NODEURL">">
<TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a>
:: <TMPL_IF NAME="URL"><a href="<TMPL_VAR NAME="URL">"></TMPL_IF>
<TMPL_VAR ESCAPE="HTML" NAME="LABEL">
@@ -116,7 +116,7 @@
<td>
<div class="node">
<span class="nodetitle">
- <a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html">
+ <a href="<TMPL_VAR NAME="NODEURL">">
<TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a>
:: <TMPL_IF NAME="URL"><a href="<TMPL_VAR NAME="URLX">"></TMPL_IF>
<TMPL_VAR ESCAPE="HTML" NAME="LABEL">
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/www/munin-serviceview.tmpl
^
|
@@ -73,7 +73,7 @@
<tr>
<th class="field">Field</th>
<th class="internal"><span title="For use in munin.conf">Internal name</span></th>
- <th class="type"><a href="../../static/definitions.html#data_types">Type</a></th>
+ <th class="type"><a href="<TMPL_VAR ESCAPE="URL" NAME="R_PATH">/static/definitions.html#data_types">Type</a></th>
<th class="warn">Warn</th>
<th class="crit">Crit</th>
<th class="info">Info</th>
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/www/partial/bottom_navigation.tmpl
^
|
@@ -28,6 +28,6 @@
</TMPL_LOOP>
</select>
<TMPL_ELSE>
- :<TMPL_LOOP NAME="PEERS">: <TMPL_IF NAME="LINK"><a href="<TMPL_VAR NAME="LINK">"></TMPL_IF><TMPL_VAR NAME="PATHNAME"><TMPL_IF NAME="LINK"></a></TMPL_IF> </TMPL_LOOP>
+ :<TMPL_LOOP NAME="PEERS">: <TMPL_IF NAME="LINK"><a href="<TMPL_VAR NAME="LINK">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="LINK"></a></TMPL_IF> </TMPL_LOOP>
</TMPL_IF>
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/master/www/partial/logo_navigation_comparison.tmpl
^
|
@@ -1,9 +1,9 @@
<div id="header">
<h1><a href="<TMPL_VAR NAME="R_PATH">"><span class="logo"></span></a><span class="currentpage">
<TMPL_LOOP NAME="PATH">
- <TMPL_IF NAME="NAME"> ::
+ <TMPL_IF NAME="PATHNAME"> ::
<TMPL_IF NAME="PATH"><a href="<TMPL_VAR NAME="PATH">"></TMPL_IF>
- <TMPL_VAR NAME="NAME">
+ <TMPL_VAR NAME="PATHNAME">
<TMPL_IF NAME="PATH"></a></TMPL_IF>
<TMPL_ELSE>
<TMPL_IF NAME="PATH"><a href="<TMPL_VAR NAME="PATH">"></TMPL_IF>
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/node/lib/Munin/Node/OS.pm
^
|
@@ -13,6 +13,7 @@
use POSIX ();
use Sys::Hostname;
+use File::Path qw(make_path);
sub get_uid {
my ($class, $user) = @_;
@@ -249,6 +250,16 @@
sub set_umask { umask(0002) or croak "Unable to set umask: $!\n"; }
+sub mkdir_subdir {
+ my ($class, $path, $uid) = @_;
+
+ my $user = getpwuid($uid);
+
+ unless (-d "$path/$user") {
+ mkdir("$path/$user");
+ chown($uid, 0, "$path/$user");
+ }
+}
1;
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/node/lib/Munin/Node/Service.pm
^
|
@@ -119,8 +119,13 @@
my ($self, $service) = @_;
print STDERR "# Setting up environment\n" if $config->{DEBUG};
+ # We append the USER to the MUNIN_PLUGSTATE, to avoid CVE-2012-3512
+ my $uid = $self->_resolve_uid($service);
+ my $user = getpwuid($uid);
+ $ENV{MUNIN_PLUGSTATE} = "$Munin::Common::Defaults::MUNIN_PLUGSTATE/$user";
+
# Provide a consistent default state-file.
- $ENV{MUNIN_STATEFILE} = "$Munin::Common::Defaults::MUNIN_PLUGSTATE/$service-$ENV{MUNIN_MASTER_IP}";
+ $ENV{MUNIN_STATEFILE} = "$ENV{MUNIN_PLUGSTATE}/$service-$ENV{MUNIN_MASTER_IP}";
my $env = $config->{sconf}{$service}{env} or return;
@@ -236,6 +241,10 @@
{
my ($self, $service, $arg) = @_;
+ # XXX - Create the statedir for the user
+ my $uid = $self->_resolve_uid($service);
+ Munin::Node::OS->mkdir_subdir("$Munin::Common::Defaults::MUNIN_PLUGSTATE", $uid);
+
$self->change_real_and_effective_user_and_group($service);
unless (Munin::Node::OS->check_perms_if_paranoid("$self->{servicedir}/$service")) {
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/node/lib/Munin/Node/SpoolReader.pm
^
|
@@ -158,7 +158,7 @@
or die "Unable to reset the spool directory handle: $!";
my %seen;
- return map { m/^munin-daemon\.(\w+)\.\d+\.\d+$/ && ! $seen{$1}++ ? $1 : () }
+ return map { m/^munin-daemon\.(.*)\.\d+\.\d+$/ && ! $seen{$1}++ ? $1 : () }
readdir $self->{spooldirhandle};
}
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/node/sbin/munin-node
^
|
@@ -54,7 +54,7 @@
$ENV{$key} = $1;
}
- $0 =~ /^(.*)$/;
+ $0 =~ /([^\/]*)$/;
$0 = $1;
parse_args();
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/lib/Munin/Plugin.pm
^
|
@@ -42,7 +42,7 @@
(introduced in 1.3.3) you can put this in your plugin configuration:
[*]
- env.MUNIN_PLUGSTATE /lib/munin/plugin-state
+ env.MUNIN_PLUGSTATE /var/lib/munin-node/plugin-state
env.MUNIN_LIBDIR /usr/share/munin
IF, indeed that is the munin plugin state directory. The default
@@ -88,7 +88,8 @@
=head3 $Munin::Plugin::pluginstatedir
Identical to the environment variable MUNIN_PLUGSTATE (available since
-Munin 1.3.3) or the install time @Z<>@PLUGSTATE@Z<>@ 'constant'.
+Munin 1.3.3)
+
You can use this if you need to save several different state files.
But there is also a function to change the state file name so the
state file support functions can be used for several state files.
@@ -167,6 +168,9 @@
# Replace remaining illegals with _
$name =~ s/[^A-Za-z0-9_]/_/g;
+ # "root" is *not* allowed due to a 2.0 bug
+ $name = "__root" if $name eq "root";
+
return $name;
}
@@ -599,7 +603,7 @@
There is some test stuff in this module.
Test like this:
- MUNIN_PLUGSTATE=/var/lib/munin/plugin-state -e 'require "Plugin.pm.in"; Munin::Plugin::_test;' -- or something.
+ MUNIN_PLUGSTATE=/var/lib/munin-node/plugin-state -e 'require "Plugin.pm.in"; Munin::Plugin::_test;' -- or something.
sub _test () {
my $pos;
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.debug/multigraph_complex
^
|
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /bin/sh
# Plugin to test complex multigraph thingies
# This plugin, ideally, creates a multigraph tree that is 3 levels deep. The
@@ -19,7 +19,7 @@
# the second tier is able to. XXX: Edit this paragraph when we fix it. :)
-test "$1" = "config" && cat <<EOF
+[ "$1" = "config" ] && cat <<EOF
multigraph multigraph_complex
graph_title Testing multigraph
graph_args --base 1000
@@ -209,7 +209,7 @@
fake1_in.cdef fake1_in,8,*
EOF
-test "$1" = "" && cat <<EOF
+[ "$1" = "" ] && cat <<EOF
multigraph multigraph_complex.multigraph_complex_fake2.multigraph_complex_fake2_out
fake2_out.value 728
@@ -230,4 +230,3 @@
EOF
exit 0
-
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/plugins/node.d.debug/sum_cdef_tester.in
^
|
@@ -0,0 +1,71 @@
+#!@@GOODSH@@
+# -*- sh -*-
+
+#%# family=test
+
+random() {
+ head -c4 /dev/urandom | od -l | awk ' { print $2 } '
+}
+
+if [ "$1" = "" ]; then
+
+cat <<EOF
+multigraph mg_donald_mb
+temp1.value $(( 20 + $(( $(random) % 5 )) ))
+
+multigraph mg_ferdinand_mb
+temp1.value $(( 20 + $(( $(random) % 5 )) ))
+
+multigraph mg_donald_disk
+sda.value $(( 20 + $(( $(random) % 5 )) ))
+sdb.value $(( 20 + $(( $(random) % 5 )) ))
+sdc.value $(( 20 + $(( $(random) % 5 )) ))
+
+multigraph mg_ferdinand_disk
+sda.value $(( 20 + $(( $(random) % 5 )) ))
+EOF
+
+exit 0
+
+fi
+
+if [ "$1" = "config" ]; then
+
+cat <<EOF
+multigraph mg_donald_mb
+temp1.label temp1
+
+multigraph mg_donald_disk
+sda.label sda
+sdb.label sdb
+sdc.label sdc
+
+multigraph mg_ferdinand_disk
+sda.label sda
+
+multigraph mg_ferdinand_mb
+temp1.label temp1
+
+multigraph mg_temperatures
+graph_args --base 1000 -l 0
+graph_category Sensors
+graph_title Different temperatures
+graph_order \
+ donald_disk \
+ ferdinand_disk=mg_ferdinand_disk.sda \
+ donald_mb=mg_donald_mb.temp1 \
+ ferdinand_mb=mg_ferdinand_mb.temp1
+temperatures.donald_disk.sum \
+ mg_donald_disk.sda \
+ mg_donald_disk.sdb \
+ mg_donald_disk.sdc
+temperatures.donald_disk.cdef donald_disk,3,/
+temperatures.donald_mb.label Mainboard donald
+EOF
+
+exit 0
+
+fi
+
+echo "Do what now?">&2
+exit 1
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/plugins/node.d.java
^
|
+(directory)
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.java/jmx_.in
^
|
(renamed to plugins/node.d.java/jmx_.in)
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.java/jmx_.in
^
|
(renamed to plugins/node.d.java/jmx_.in)
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.java/jmx_tomcat_dbpools.in
^
|
(renamed to plugins/node.d.java/jmx_tomcat_dbpools.in)
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.java/jmx_tomcat_dbpools.in
^
|
(renamed to plugins/node.d.java/jmx_tomcat_dbpools.in)
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.linux/apt.in
^
|
@@ -75,7 +75,7 @@
$ENV{'LANG'}="C";
$ENV{'LC_ALL'}="C";
-my $statefile = "@@PLUGSTATE@@/plugin-apt.state";
+my $statefile = "$ENV{MUNIN_PLUGSTATE}/plugin-apt.state";
sub update_state() {
if(-l $statefile) {
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.linux/apt_all.in
^
|
@@ -52,7 +52,7 @@
$ENV{'LANG'}="C";
$ENV{'LC_ALL'}="C";
-my $statefile = "@@PLUGSTATE@@/plugin-apt.state";
+my $statefile = "$ENV{MUNIN_PLUGSTATE}/plugin-apt.state";
my @releases = ("stable", "testing","unstable");
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.linux/df.in
^
|
@@ -14,7 +14,7 @@
The plugin excludes per default the following special, read-only or
dynamically allocating file systems from graphing:
- none unknown rootfs iso9660 squashfs udf romfs ramfs debugfs simfs
+ none unknown rootfs iso9660 squashfs udf romfs ramfs debugfs
To change this set the environment variable "exclude" with a list of
space separated fs types. The environment variables "warning" and
@@ -24,7 +24,7 @@
This configuration snipplet is an example with the defaults:
[df]
- env.exclude none unknown rootfs iso9660 squashfs udf romfs ramfs debugfs simfs
+ env.exclude none unknown rootfs iso9660 squashfs udf romfs ramfs debugfs
env.warning 92
env.critical 98
@@ -85,9 +85,9 @@
use Munin::Plugin;
# For these devices use the mount point, the device is useless
-my %usemntpt = ( tmpfs => 1, none => 1, udev => 1 );
+my %usemntpt = ( tmpfs => 1, none => 1, udev => 1, simfs => 1 );
-my $exclude = $ENV{'exclude'} || 'none unknown rootfs iso9660 squashfs udf romfs ramfs debugfs simfs';
+my $exclude = $ENV{'exclude'} || 'none unknown rootfs iso9660 squashfs udf romfs ramfs debugfs cgroup_root';
my $dfopts = "-P -l ".join(' -x ',('',split('\s+',$exclude)));
my $mode = ($ARGV[0] or "print");
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.linux/df_inode.in
^
|
@@ -14,7 +14,7 @@
The plugin excludes per default the following special, read-only or
dynamically allocating file systems from graphing:
- none unknown iso9660 squashfs udf romfs ramfs
+ none unknown iso9660 squashfs udf romfs ramfs vfat debugfs nilfs2 rootfs
To change this set the environment variable "exclude" with a list of
space separated fs types. The environment variables "warning" and
@@ -24,7 +24,7 @@
This configuration snipplet is an example with the defaults:
[df_inode]
- env.exclude none unknown iso9660 squashfs udf romfs ramfs debugfs
+ env.exclude none unknown iso9660 squashfs udf romfs ramfs vfat debugfs nilfs2 rootfs
env.warning 92
env.critical 98
@@ -85,9 +85,9 @@
use Munin::Plugin;
# For these devices use the mount point, the device is useless
-my %usemntpt = ( tmpfs => 1, none => 1, udev => 1 );
+my %usemntpt = ( tmpfs => 1, none => 1, udev => 1, simfs => 1 );
-my $exclude = $ENV{'exclude'} || 'none unknown iso9660 squashfs udf romfs ramfs vfat debugfs simfs';
+my $exclude = $ENV{'exclude'} || 'none unknown iso9660 squashfs udf romfs ramfs vfat debugfs nilfs2 rootfs reiserfs';
my $dfopts = "-P -l -i ".join(' -x ',('',split('\s+',$exclude)));
my $mode = ($ARGV[0] or "print");
@@ -150,6 +150,8 @@
next if skip($name, $mountpt);
+ next unless ($used =~ '^\d+$' && $avail =~ '^\d+$');
+
# Calculate percentage used
my $ps = 0;
$ps = ($used / ($used+$avail)) * 100 if $used;
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.linux/if_err_.in
^
|
@@ -65,7 +65,7 @@
if [ "$1" = "config" ]; then
echo "graph_order rcvd trans"
- echo "graph_title $INTERFACE errors, drops, and collisions"
+ echo "graph_title $INTERFACE errors"
echo 'graph_args --base 1000'
echo 'graph_vlabel packets in (-) / out (+) per ${graph_period}'
echo 'graph_category network'
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.linux/iostat_ios.in
^
|
@@ -62,7 +62,7 @@
use Storable qw(store retrieve);
use Munin::Plugin;
-use constant STATEFILE => '@@PLUGSTATE@@/iostat-ios.state';
+use constant STATEFILE => "$ENV{MUNIN_PLUGSTATE}/iostat-ios.state";
if (defined($ARGV[0]) and $ARGV[0] eq 'autoconf') {
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.linux/port_.in
^
|
@@ -49,7 +49,7 @@
{
my ($fd, $file) = @_;
- my $cache_dir = "@@PLUGSTATE@@";
+ my $cache_dir = "$ENV{MUNIN_PLUGSTATE}";
my $cache = $file;
$cache =~ s:/:_:g;
$cache = "$cache_dir/$cache";
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.linux/proc.in
^
|
@@ -64,7 +64,7 @@
=head1 MAGIC MARKERS
#%# family=auto
- #%# capabilities=autoconf multigraph
+ #%# capabilities=multigraph
=head1 VERSION
@@ -363,21 +363,13 @@
# Bail-function.
sub usage
{
- if (defined(@_) && "@_" ne "") {
+ if (@_) {
print STDERR "@_" . "\n\n";
}
- print STDERR "Known arguments: config, autoconf.\n";
+ print STDERR "Known arguments: config.\n";
exit 1;
}
-# Print 'yes' and exit true if it's reasonable to use this plugin.
-# Otherwise exit with false and a human-readable reason.
-sub autoconf
-{
- print "no (Needs manual configuration, check documentation)\n";
- exit 0;
-}
-
# Print the value of a two-dimensional hash if it exist.
# Returns false if non-existant.
#
@@ -412,7 +404,7 @@
my $uniqname = $_[1];
# Need to double-check since set_aspect only checks this if there
- # is no argument (autoconf doesn't require a valid aspect)
+ # is no argument
if (!defined($ASPECTS{$graph})) {
usage "No such aspect ( $graph )";
}
@@ -563,9 +555,8 @@
}
}
-# Handle arguments (config, autoconf)
-# Populate stats for config is necessary, but we want to avoid it for
-# autoconf as it would generate a nasty error.
+# Handle arguments (config)
+# Populate stats for config is necessary
sub check_args
{
if (@ARGV && $ARGV[0] eq '') {
@@ -584,9 +575,6 @@
}
}
exit 0;
- } elsif ($ARGV[0] eq "autoconf") {
- autoconf($self);
- exit 0;
}
usage "Unknown argument";
}
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.linux/sensors_.in
^
|
@@ -231,6 +231,44 @@
print_threshold => \&volt_threshold,
graph_args => '--base 1000 --logarithmic'
},
+
+ power => {
+ regex => qr/
+ ^ # String must start with:
+ ([^:\n]*) # Match any non-whitespace char, except ':' and new line
+ # one space in front of them.
+ # (match the label as \$1)
+
+ \s*:\s* # Zero or more spaces followed by ':' and
+ # zero or more spaces followed by
+ (\d+ # Match one or more digits
+ # (match the power as \$2) followed by
+ (?:\.\d+)?) # Zero or one match of '.' char followed by one or more digits.
+ # '?:' means it is not a numbered capture group.
+ \sW # one space, 'W' char
+
+ (?: # >>>>Match the following statement.
+ # '?:' means it is not a numbered capture group.
+ \s+ # One or more space followed by
+ \( # '(' char
+ crit # Match crit string
+ \s*=\s* # Match zero or more spaces and then '=' char and
+ # then zero or more spaces, followed by
+ (\d+ # Match one or more digits
+ # (Match the minimum value as \$3) followed by
+ (?:\.\d+)?) # Zero or one match of '.' char followed by one or more
+ # digits. '?:' means it is not a numbered capture group.
+ \sW\s* # One space char, 'W' character followed by zero or
+ # more spaces
+ \) # ')' char
+ )? # >>>>end of statement
+ /xm, # Use extended regular expressions and treat string as multiple lines.
+
+ title => 'Power',
+ vtitle => 'Watts',
+ print_threshold => \&power_threshold,
+ graph_args => '--base 1000 --logarithmic'
+ },
);
if ( defined $ARGV[0] and $ARGV[0] eq 'autoconf' ) {
@@ -329,4 +367,15 @@
printf "$name.critical $min:$max\n";
}
+sub power_threshold {
+ my $name = shift;
+ my $crit = shift;
+ my $warn_percent = exists $ENV{watt_warn_percent} ? $ENV{watt_warn_percent} : 20;
+
+ return unless defined ($crit);
+
+ printf "$name.warning :%.2f\n", $crit * (100-$warn_percent)/100;
+ printf "$name.critical :$crit\n";
+}
+
# vim:syntax=perl
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d.linux/yum.in
^
|
@@ -27,9 +27,8 @@
=cut
use strict;
-use Munin::Common::Defaults;
-my $statefile = "$Munin::Common::Defaults::MUNIN_PLUGSTATE/yum.state";
+my $statefile = "$ENV{MUNIN_PLUGSTATE}/yum.state";
sub update {
if (-l $statefile) {
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/bind9.in
^
|
@@ -51,10 +51,9 @@
=cut
use strict;
-use Munin::Common::Defaults;
my $QUERYLOG = $ENV{logfile} || '/var/log/bind9/query.log';
-my $STATEFILE= $Munin::Common::Defaults::MUNIN_PLUGSTATE.'/bind9.state';
+my $STATEFILE= "$ENV{MUNIN_PLUGSTATE}/bind9.state";
my $OTHER=0;
my %IN;
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/courier_.in
^
|
@@ -54,7 +54,7 @@
# Set the location of the courier logs
COURIER_LOG=${logfile:-/var/log/mail.log}
SERVICE=${service:-`basename $0 | sed 's/^courier_//g'`}
-OFFSET_FILE=@@PLUGSTATE@@/courier_${SERVICE}.offset
+OFFSET_FILE=${MUNIN_PLUGSTATE}/courier_${SERVICE}.offset
LOGTAIL=${logtail:-/usr/sbin/logtail}
mktempfile () {
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/courier_mta_mailstats.in
^
|
@@ -29,7 +29,7 @@
=cut
-my $statefile = "@@PLUGSTATE@@/munin-plugin-courier_mta_mailstats.state";
+my $statefile = "$ENV{MUNIN_PLUGSTATE}/munin-plugin-courier_mta_mailstats.state";
my $pos = undef;
my $delivered = 0;
my $rejects = {};
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/courier_mta_mailvolume.in
^
|
@@ -28,7 +28,7 @@
=cut
-my $statefile = "@@PLUGSTATE@@/munin-plugin-courier_mta_mailvolume.state";
+my $statefile = "$ENV{MUNIN_PLUGSTATE}/munin-plugin-courier_mta_mailvolume.state";
my $pos = undef;
my $volume = 0;
my $LOGDIR = $ENV{'logdir'} || '/var/log';
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/cupsys_pages.in
^
|
@@ -32,7 +32,7 @@
use strict;
use Munin::Plugin;
-my $statefile = "@@PLUGSTATE@@/munin-cupsys-pages.state";
+my $statefile = "$ENV{MUNIN_PLUGSTATE}/munin-cupsys-pages.state";
my $pos = undef;
my %printers = ();
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/http_loadtime.in
^
|
@@ -1,4 +1,4 @@
-#!@@GOODSH@@
+#!@@BASH@@
# -*- sh -*-
: << =cut
@@ -30,25 +30,22 @@
=head1 MAGIC MARKERS
#%# family=contrib
+ #%# capabilities=autoconf
=cut
target=${target:-"http://localhost/"}
-time_bin=$(which time)
-wget_bin=$(which wget)
if [ "$1" = "autoconf" ]; then
- # Need to actually test that the url is reachable, it makes
- # no sense to install the plugin if there is no webserver on localhost.
- echo "no (autoconfiguration not working correctly)"
- exit 0
-
result="yes"
- [ "x$time_bin" = "x" ] && result=1
- [ "x$wget_bin" = "x" ] && result=2
+ command -v wget 2>/dev/null || result=1
if [ "$result" != "yes" ]; then
- echo "no (need time and wget programs)"
- exit 0
+ echo "no (need time and wget programs)"
+ exit 0
+ fi
+ if ! $wget_bin -q -O /dev/null $target; then
+ echo "no (Cannot run wget against \"$target\")"
+ exit 0
fi
echo yes
exit 0
@@ -70,7 +67,7 @@
trap "rm -rf $TMPDIR" EXIT
cd $TMPDIR || exit 1
-loadtime=$($time_bin -p $wget_bin -p --no-cache --delete-after $target -q 2>&1 | awk '/^real / { print $2 }')
+loadtime=$(time -p wget -p --no-cache --delete-after $target -q 2>&1 | awk '/^real / { print $2 }')
cd ..
echo "loadtime.value $loadtime"
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/ifx_concurrent_sessions_.in
^
|
@@ -65,15 +65,15 @@
my @infdir;
if (@ARGV && $ARGV[0] =~ /autoconf|suggest/) {
# Taint mode requires this
- local $ENV{PATH} = '/usr/bin';
+ local $ENV{PATH} = '/bin:/usr/bin';
# First, try lookup in proc table
# Note, this will only work if oninit was started with full path
# On Linux we could easily retreive INFORMIXDIR from /proc by
# tr \\00 \\012 < /proc/$PID/environ | grep INFORMIXDIR
# Following ps command should work on Linux and Solaris
- my $pscmd = '/usr/bin/ps -p `/usr/bin/pgrep -P1 oninit -d,` -o ppid= -o args=';
+ my $pscmd = 'ps -p `pgrep -P1 oninit -d,` -o ppid= -o args=';
# while HP-UX discerns itself once more
- $pscmd = 'UNIX95= /usr/bin/ps -C oninit -o ppid= -o args='
+ $pscmd = 'UNIX95= ps -C oninit -o ppid= -o args='
if ($^O =~ /hp-?ux/i);
@infdir = map $_->[1],
grep $_->[0]==1,
|
[-]
[+]
|
Added |
munin-2.0.6.tar.bz2/plugins/node.d/ipmi_.in
^
|
@@ -0,0 +1,177 @@
+#!@@BASH@@
+# -*- sh -*-
+
+: << =cut
+
+=head1 NAME
+
+ipmi_ - Plugin to monitor temperature or fan speed using IPMI
+
+=head1 CONFIGURATION
+
+=head2 ENVIRONMENT VARIABLES
+
+This plugin does not use environment variables
+
+=head2 WILDCARD PLUGIN
+
+This plugin should be linked as ipmi_temp or ipmi_fans, and will show
+either temperatures or fan speeds based on its link name.
+
+=head1 NOTE
+
+WARNING: Munin has a 10 second default timeout on plugins. On some
+hosts ipmitool takes longer than that to probe all your hardware. In
+this case this plugin us unusable.
+
+=head1 AUTHOR
+
+Nicolai Langfeldt <janl@linpro.no>
+
+=head1 LICENSE
+
+Donated to the public domain by Nicolai Langfeldt (janl@linpro.no)
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf suggest
+
+=cut
+
+#### Parse commandline to determine what the job is
+
+CONFIG=no
+
+case $1 in
+ autoconf)
+ type -p ipmitool &>/dev/null ||
+ { echo 'no (missing ipmitool command)' && exit 0; }
+
+ ipmitool sensor &>/dev/null ||
+ { echo 'no (unable to access IPMI device)' && exit 0; }
+
+ echo yes
+ exit 0
+ ;;
+ suggest) echo fans
+ echo temp
+ echo power
+ exit 0;;
+ config) CONFIG=config;;
+esac
+
+case $0 in
+ *_temp) MEASURE=temp;;
+ *_fans) MEASURE=fans;;
+ *_power) MEASURE=power;;
+ *) echo Please invoke as ipmi_temp or ipmi_fans >&2
+ exit 1;;
+esac
+
+export CONFIG MEASURE
+
+#### Work is done in this awk script
+
+ipmitool sensor | gawk -F'|' '
+BEGIN {
+ FANS = "";
+ TEMPS = "";
+ POWER = "";
+ CFANS = "graph_title Fan speeds based on IPMI\ngraph_vlabel RPM\ngraph_category Sensors\n";
+ CTEMPS = "graph_title Machine temperature based on IPMI\ngraph_vlabel Degrees celcius\ngraph_category Sensors\n";
+ CPOWER = "graph_title Power usage based on IPMI\ngraph_vlabel W\ngraph_category Sensors\n";
+}
+
+# Remove extraneous spaces to make output prettyer
+{ gsub(/\t/," "); gsub(/ +/," "); gsub(/ +\|/,"|"); gsub(/\| +/,"|") }
+
+# Skip lines with 0x0 in first column
+/^[^|]+\|0x0\|/ { next; };
+
+# Skip lines with na in first column
+/^[^|]+\|na\|/ { next; };
+
+# Parse temperatures
+/degrees C/ {
+ NAME=THING=$1;
+ gsub(/[^A-Za-z0-9]/,"",NAME);
+ TEMP=$2;
+
+ # Find unique name
+ while (NAMES[NAME] >= 1) {
+ NAME=sprintf("%si",NAME);
+ }
+ NAMES[NAME]=1;
+
+ WARN=$8;
+ CRIT=$9;
+
+ TEMPS = sprintf("%s%s.value %s\n",TEMPS,NAME,TEMP);
+ CTEMPS = sprintf("%s%s.label %s\n",CTEMPS,NAME,THING);
+
+ if (CRIT !~ /na/) {
+ CTEMPS = sprintf("%s%s.critical 0:%s\n",CTEMPS,NAME,CRIT);
+ }
+
+ if (WARN !~ /na/) {
+ CTEMPS = sprintf("%s%s.warning 0:%s\n",CTEMPS,NAME,WARN);
+ }
+}
+
+/RPM/ {
+ NAME=THING=$1;
+ gsub(/[^A-Za-z0-9]/,"",NAME);
+ SPEED=$2;
+
+ # Find unique name
+ while (NAMES[NAME] >= 1) {
+ NAME=sprintf("%si",NAME);
+ }
+ NAMES[NAME]=1;
+
+ FANS = sprintf("%s%s.value %s\n",FANS,NAME,SPEED);
+ CFANS = sprintf("%s%s.label %s\n",CFANS,NAME,THING);
+
+ OK=$4;
+
+ MIN=$6;
+ if (MIN !~ /na/) {
+ CFANS = sprintf("%s%s.warning %s:\n",CFANS,NAME,MIN);
+ }
+}
+
+/Watts/ {
+ NAME=THING=$1;
+ gsub(/[^A-Za-z0-9]/,"",NAME);
+ WATTS=$2;
+
+ # Find unique name
+ while (NAMES[NAME] >= 1) {
+ NAME=sprintf("%si",NAME);
+ }
+ NAMES[NAME]=1;
+
+ POWER = sprintf("%s%s.value %s\n",POWER,NAME,WATTS);
+ CPOWER = sprintf("%s%s.label %s\n",CPOWER,NAME,THING);
+}
+
+END {
+ if (ENVIRON["MEASURE"] == "temp") {
+ VALUE=TEMPS;
+ CONFIG=CTEMPS;
+ } else if (ENVIRON["MEASURE"] == "power") {
+ VALUE=POWER;
+ CONFIG=CPOWER;
+ } else {
+ VALUE=FANS;
+ CONFIG=CFANS;
+ }
+ if (ENVIRON["CONFIG"] == "config")
+ printf "%s",CONFIG;
+ else
+ printf "%s",VALUE;
+}
+'
+
+# vim: syntax=sh ts=4 et
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/ipmi_sensor_.in
^
|
@@ -70,7 +70,7 @@
import sys
import re
-CACHEDIR = "@@PLUGSTATE@@"
+CACHEDIR = os.environ['MUNIN_PLUGSTATE']
CACHEFILE = "plugin-ipmi_sensor.cache"
CACHEAGE = 120
CONFIG = '@@CONFDIR@@/ipmi'
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/loggrep.in
^
|
@@ -79,7 +79,7 @@
die("No regexes specified") unless keys %regex;
-my $statefile = "@@PLUGSTATE@@/$name.state";
+my $statefile = "$ENV{MUNIN_PLUGSTATE}/$name.state";
if ($ARGV[0] and $ARGV[0] eq 'config') {
my $title = $ENV{title} || "Entries in $logfile";
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/mailman.in
^
|
@@ -24,9 +24,7 @@
=cut
-use Munin::Common::Defaults;
-
-$statefile = "$Munin::Common::Defaults::MUNIN_PLUGSTATE/munin-mailman-log.state";
+$statefile = "$ENV{MUNIN_PLUGSTATE}/munin-mailman-log.state";
$pos = undef;
$posts = 0;
$members = 0;
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/mailscanner.in
^
|
@@ -43,7 +43,7 @@
my $logfile = '/var/log/mail.log';
my $logtail = '/usr/sbin/logtail';
-my $offsetfile = "@@PLUGSTATE@@/munin-mailscanner.offset";
+my $offsetfile = "$ENV{MUNIN_PLUGSTATE}/munin-mailscanner.offset";
my ($clean, $viruses, $spams, $others, $total) = (0, 0, 0, 0, 0);
my $cmd = (defined($ARGV[0])) ? $ARGV[0] : '';
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/mhttping.in
^
|
@@ -36,7 +36,7 @@
############################## STUFF YOU MIGHT NEED TO CHANGE
-my $datafile = "@@PLUGSTATE@@/mhttping.data" ;
+my $datafile = "$ENV{MUNIN_PLUGSTATE}/mhttping.data" ;
my $resultsdir = "/home/gconnor/mhttping/results/" ;
my $httping = "/usr/local/bin/httping" ;
my $timeout = 30 ;
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/munin_stats.in
^
|
@@ -28,7 +28,7 @@
use Munin::Plugin;
-my @logs = qw/update html limits/;
+my @logs = qw/update graph html limits/;
my $logdir = ($ENV{'logdir'} || $ENV{'MUNIN_LOGDIR'} || '@@LOGDIR@@');
if ($ARGV[0] and $ARGV[0] eq 'autoconf') {
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/mysql_.in
^
|
@@ -17,6 +17,11 @@
data for one specific graph, you need to create a symbolic link with a
name like mysql_<GRAPH> to this script.
+If you need to run against multiple MySQL instances on the same host,
+create your symlinks with names like mysql<N>_<GRAPH> where N is any
+non-negative integer. You must also set the env.cachenamespace variable
+to a unique value for each group of symlinks.
+
To get a list of symlinks that can be created, run:
./mysql_ suggest
@@ -34,6 +39,12 @@
env.mysqlconnection DBI:mysql:mysql;host=127.0.0.1;port=3306
env.mysqluser root
env.mysqlpassword geheim
+ env.cachenamespace munin_mysql_pri
+ [mysql2_*]
+ env.mysqlconnection DBI:mysql:mysql;host=127.0.0.1;port=13306
+ env.mysqluser root
+ env.mysqlpassword ryuWyawEv
+ env.cachenamespace munin_mysql_alt
Warning and critical values can be set via the environment in the usual way.
For example:
@@ -145,6 +156,7 @@
'dsn' => $ENV{'mysqlconnection'} || 'DBI:mysql:mysql',
'user' => $ENV{'mysqluser'} || 'root',
'password' => $ENV{'mysqlpassword'} || '',
+ 'cache_namespace' => $ENV{'cachenamespace'} || 'munin_mysql',
);
@@ -153,7 +165,7 @@
#---------------------------------------------------------------------
my %cache_options = (
- 'namespace' => 'munin_mysql',
+ 'namespace' => $config{cache_namespace},
'default_expires_in' => 60,
);
@@ -700,7 +712,8 @@
sub main {
- my $graph = substr(basename($0), length('mysql_'));
+ my $graph = basename($0);
+ $graph =~ s/^mysql[0-9]*_//g; # allow multiple instances
my $command = $ARGV[0] || 'show';
my %command_map = (
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/mysql_isam_space_.in
^
|
@@ -21,7 +21,7 @@
[mysql_isam_space_*]
env.mysqlopts
- env.statefile @@PLUGSTATE@@/plugin-mysql_isam_space.state
+ env.statefile $ENV{MUNIN_PLUGSTATE}/plugin-mysql_isam_space.state
env.ignore
env.absolute 0
@@ -50,7 +50,7 @@
my $DB = `basename $0 | sed 's/^mysql_isam_space_//g' | tr '_' '-'` ;
chomp $DB;
-my $STATEFILE = $ENV{'statefile'} || "@@PLUGSTATE@@/plugin-mysql_isam_space.state";
+my $STATEFILE = $ENV{'statefile'} || "$ENV{MUNIN_PLUGSTATE}/plugin-mysql_isam_space.state";
my $MYSQLSHOW = $ENV{'mysqlshow'} || `which mysqlshow`;
my $ABSOLUTE = $ENV{'absolute'} || 0;
my @mysql_opts = ();
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/nginx_request.in
^
|
@@ -56,6 +56,9 @@
=cut
+use Munin::Plugin;
+use Munin::Common::Defaults;
+
my $ret = undef;
if (! eval "require LWP::UserAgent;"){
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/nginx_status.in
^
|
@@ -55,6 +55,9 @@
=cut
+use Munin::Plugin;
+use Munin::Common::Defaults;
+
my $ret = undef;
if (! eval "require LWP::UserAgent;"){
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/perdition.in
^
|
@@ -55,7 +55,7 @@
# Set the location of the perdition logs
PERDITION_LOG=${logfile:-/var/log/perdition.log}
-OFFSET_FILE=@@PLUGSTATE@@/perdition.offset
+OFFSET_FILE=${MUNIN_PLUGSTATE}/perdition.offset
LOGTAIL=${logtail:-/usr/sbin/logtail}
case $1 in
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/pop_stats.in
^
|
@@ -4,7 +4,7 @@
#%# family=contrib
-$pop{'statefile'} = "@@PLUGSTATE@@/munin-pop-log.state";
+$pop{'statefile'} = "$ENV{MUNIN_PLUGSTATE}/munin-pop-log.state";
$pos = undef;
$logons = 0;
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/slony_lag_.in
^
|
@@ -63,12 +63,12 @@
basename => 'slony_lag_',
title => 'Slony lag',
info => 'Slony replication lag',
- vlabel => 'Lag',
+ vlabel => 'Lag (seconds)',
basequery =>
- "SELECT st_received, extract(epoch FROM st_lag_time) FROM _%%PARAM1%%.sl_status ORDER BY 1",
+ "SELECT 'node_' || st_received, extract(epoch FROM st_lag_time) FROM _%%PARAM1%%.sl_status ORDER BY 1",
paramdatabase => 1,
configquery =>
- "SELECT st_received, 'Node ' || st_received FROM _%%PARAM1%%.sl_status ORDER BY 1",
+ "SELECT 'node_' || st_received, 'Node ' || st_received FROM _%%PARAM1%%.sl_status ORDER BY 1",
graphdraw => 'LINE',
);
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/smart_.in
^
|
@@ -91,13 +91,12 @@
verbose=False
# Suppress SMART warnings (True/False)
report_warnings=True
-# Modify to your needs:
-statefiledir='@@PLUGSTATE@@'
# You may not modify anything below this line
import os, sys, string, pickle
from math import log
plugin_version="2.1"
+statefiledir=os.environ['MUNIN_PLUGSTATE']
def verboselog(s):
global plugin_name
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/snmp__print_pages.in
^
|
@@ -56,11 +56,11 @@
use Munin::Plugin;
use Munin::Plugin::SNMP;
-
+my $oid = '1.3.6.1.2.1.43.10.2.1.4.1.1';
my $response;
if(defined $ARGV[0] and $ARGV[0] eq "snmpconf") {
- print "require 1.3.6.1.2.1.43.10.2.1.4.1.1\n";
+ print "require ${oid}.\n";
exit 0;
}
@@ -94,5 +94,5 @@
exit 0;
}
-print "pages.value ", $session->get_single("1.3.6.1.2.1.43.10.2.1.4.1.1"), "\n";
+print "pages.value ", $session->get_single($oid), "\n";
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/spamstats.in
^
|
@@ -24,7 +24,7 @@
=cut
-$statefile = $ENV{statefile} || "@@PLUGSTATE@@/munin-spamstats.state";
+$statefile = $ENV{statefile} || "$ENV{MUNIN_PLUGSTATE}/munin-spamstats.state";
$pos = undef;
$ham = 0;
$spam = 0;
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/node.d/varnish_.in
^
|
@@ -827,7 +827,7 @@
# Bail-function.
sub usage
{
- if (defined(@_) && "@_" ne "") {
+ if (@_) {
print STDERR "@_" . "\n\n";
}
print STDERR "Known arguments: suggest, config, autoconf.\n";
|
[-]
[+]
|
Changed |
munin-2.0.6.tar.bz2/plugins/plugin.sh.in
^
|
@@ -9,8 +9,9 @@
# very much still break munin.
#
# usage: name="$(clean_fieldname "$item")"
- #
- echo "$@" | sed -e 's/^[^A-Za-z_]/_/' -e 's/[^A-Za-z0-9_]/_/g'
+
+ # "root" is *not* allowed due to a 2.0 bug
+ echo "$@" | sed -e 's/^[^A-Za-z_]/_/' -e 's/[^A-Za-z0-9_]/_/g' -e 's/^root$/__root/'
}
|