[-]
[+]
|
Changed |
munin.changes
|
|
[-]
[+]
|
Changed |
munin.spec
^
|
|
[-]
[+]
|
Deleted |
munin-node-os_file-path.patch
^
|
@@ -1,11 +0,0 @@
---- node/lib/Munin/Node/OS.pm.orig 2012-09-12 11:46:33.495615832 +0200
-+++ node/lib/Munin/Node/OS.pm 2012-09-12 11:46:45.399614141 +0200
-@@ -13,7 +13,7 @@
-
- use POSIX ();
- use Sys::Hostname;
--use File::Path qw(make_path);
-+use File::Path qw(mkpath);
-
- sub get_uid {
- my ($class, $user) = @_;
|
[-]
[+]
|
Deleted |
munin-2.0.6.tar.bz2/dists/redhat/Makefile.config
^
|
@@ -1,42 +0,0 @@
-# Modifications from ../../Makefile.config
-
-PREFIX = $(DESTDIR)/usr
-CONFDIR = $(DESTDIR)/etc/munin
-BINDIR = $(PREFIX)/bin
-SBINDIR = $(PREFIX)/sbin
-MANDIR = $(PREFIX)/share/man
-LIBDIR = $(PREFIX)/share/munin
-HTMLDIR = $(DESTDIR)/var/www/html/munin
-CGIDIR = $(HTMLDIR)/cgi
-DBDIR = $(DESTDIR)/var/lib/munin
-PLUGSTATE = $(DBDIR)/plugin-state
-LOGDIR = $(DESTDIR)/var/log/munin
-STATEDIR = $(DESTDIR)/var/run/munin
-PERL = $(shell which perl)
-PYTHON = /usr/bin/env python
-GOODSH = $(shell PATH=`getconf PATH` sh -c 'type sh | sed "s/.* //"')
-BASH = /bin/bash
-PERLLIB = $(DESTDIR)$(shell ( $(PERL) -V:vendorlib | egrep -v "UNKNOWN|=''" || $(PERL) -V:sitelib) | cut -d\' -f 2)
-OSTYPE = $(shell uname | tr '[A-Z]' '[a-z]')
-MKTEMP = $(shell ./test-mktemp)
-VERSION = $(shell cat RELEASE)
-USER = munin
-GROUP = munin
-PLUGINUSER = nobody
-GETENT = $(shell which getent || which true 2>/dev/null)
-CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
-CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
-
-DOCDIR = $(PREFIX)/share/doc/munin-$(VERSION)
-
-HASSETR = $(shell perl -e 'use Config; my @vars=("d_setruid", "d_setreuid", "d_setresuid"); foreach my $$var (@vars) { if ($$Config{$$var} eq "define") { print "1\n"; exit 0; } } print "0\n"; exit 0;' )
-
-# Handled in the munin.spec
-CHECKUSER:= true
-CHECKGROUP:= true
-CHOWN := echo Not done: chown
-CHMOD := echo Not done: chmod
-CHGRP := echo Not done: chgrp
-
-# Package building wants an sample hostname
-HOSTNAME = localhost.localdomain
|
[-]
[+]
|
Deleted |
munin-2.0.6.tar.bz2/dists/redhat/munin-node.cron.d
^
|
@@ -1,11 +0,0 @@
-#
-# cron-jobs for lrrd-client
-#
-
-MAILTO=root
-
-# If the APT plugin is enabled, update packages databases approx. once
-# an hour (12 invokations an hour, 1 in 12 chance that the update will
-# happen), but ensure that there will never be more than two hour (7200
-# seconds) interval between updates..
-*/5 * * * * root [ -x /etc/lrrd/client.d/apt ] && /etc/lrrd/client.d/apt update 7200 12 >/dev/null
|
[-]
[+]
|
Deleted |
munin-2.0.6.tar.bz2/dists/redhat/munin-node.rc
^
|
@@ -1,64 +0,0 @@
-#! /bin/sh
-#
-# munin-node Control the Munin Node Server (formerly Linpro RRD client)
-#
-# chkconfig: 2345 90 10
-# description: munin node agents
-# processname: munin-node
-# config: /etc/munin/munin-node.conf
-# pidfile: /var/run/munin/munin-node.pid
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-RETVAL=0
-PROCNAME=munin-node
-
-mkdir -p /var/run/munin 2>/dev/null
-chown munin /var/run/munin
-
-# See how we were called.
-case "$1" in
- start)
- echo -n "Starting Munin Node: "
- /usr/sbin/munin-node &
- sleep 1
- pkill -0 $PROCNAME
- RETVAL=$?
- if [ $RETVAL -eq 0 ]
- then
- echo_success
- touch /var/lock/subsys/munin-node
- else
- echo_failure
- fi
- echo
- ;;
- stop)
- echo -n "Stopping Munin Node agents: "
- kill $(cat /var/run/munin/munin-node.pid)
- RETVAL=$?
- if [ $RETVAL -eq 0 ]
- then
- echo_success
- rm -f /var/lock/subsys/munin-node
- else
- echo_failure
- fi
- echo
- ;;
- status)
- status $PROCNAME
- RETVAL=$?
- ;;
- restart|reload)
- $0 stop
- $0 start
- RETVAL=$?
- ;;
- *)
- echo "Usage: munin-node {start|stop|status|restart}"
- exit 1
-esac
-
-exit $RETVAL
|
[-]
[+]
|
Deleted |
munin-2.0.6.tar.bz2/dists/redhat/munin.cron.d
^
|
@@ -1,7 +0,0 @@
-#
-# cron-jobs for munin
-#
-
-MAILTO=root
-
-*/5 * * * * munin test -x /usr/bin/munin-cron && /usr/bin/munin-cron
|
[-]
[+]
|
Deleted |
munin-2.0.6.tar.bz2/dists/redhat/sendmail_plugin_conf.d
^
|
@@ -1,3 +0,0 @@
-[sendmail*]
-user root
-env.mspqueue /var/spool/clientmqueue
|
[-]
[+]
|
Deleted |
munin-2.0.6.tar.bz2/resources/apache-cgi.conf.in
^
|
@@ -1,17 +0,0 @@
-#
-# Apache configuration to support munin-cgi-graph
-#
-# In addition, the Munin log files and html area should be writable
-# to the web server.
-#
-# Documentation for this is in http://munin-monitoring.org/wiki/CgiHowto2
-#
-ScriptAlias /munin/dyn/ @@CGIDIR@@/
-
-<Directory @@CGIDIR@@>
- AllowOverride None
- Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
- Order allow,deny
- Allow from all
-</Directory>
-
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/ChangeLog
^
|
@@ -1,5 +1,63 @@
-*- text -*-
+munin-2.0.7, 2012-10-03
+
+-------
+Summary
+-------
+
+- Fixed datafiles handling from munin-update to others (cgi & cron).
+ We only use storable datafiles now as it is less error prone.
+
+- Many other minor fixes
+
+Closes: #1259, D#688528, D#497400, D#687495, D#686982, #1251, #1251, #1102, D#628533, #1102, D#628533, D#681938
+
+------------------
+Detailed Changelog
+------------------
+
+Adrien "ze" Urban:
+ master: fix new config reading for m-u 1st run
+ master: fixed datafiles handling
+
+Diego Elio Petteno:
+ docs: fix link names
+ apc_nis: create only one socket before going for config.
+ apc_nis: improve configuration.
+ plugins: replace deprecated graph_vtitle with graph_vlabel.
+ ejabberd_: allow overriding the ejabberd.cfg path and add /etc/jabber to search paths.
+ fw_conntrack: count both ipv4 and ipv6 connections together
+
+Jon Whiteman:
+ plugins: fix plugin vserver_cpu_ for 9+ cpu cores
+
+Kazunori Kojima:
+ Makefile.config: fix bad interpreter
+
+Kenyon Ralph:
+ node.d.linux/interrupts: encode as UTF-8
+
+Steve Schnepp:
+ resources: remove osoblete apache-cgi.conf sample
+ node: remove File::Path as it's not needed
+ redhat: move the redhat stuff outside main repo
+ master: fix too many warnings in munin-graph.log
+ master: remove useless log lines, send to debug
+ plugins: fix import in ipmi_sensor_
+ master: fix typo in Utils.pm
+ plugins: fix apt_all plugin statedir for cron
+ asyncd: fix --spooldir help
+ master: split rrd updates when using rrdcached
+ plugins: use Storable::nstore() instead of store()
+ plugins: ignore wrong state files.
+
+Thorsten Gunkel:
+ plugins: auto detect SATA in hddtemp_smartctl
+
+Vincent Danjean:
+ plugins: add by-id to smart_
+
munin-2.0.6, 2012-08-31
-------
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/Makefile.config
^
|
@@ -89,7 +89,7 @@
# On Linux /bin/sh, SunOS/Solaris /usr/xpg4/bin/sh or /bin/ksh
# In general: bash or ksh will work
#
-GOODSH := $(shell PATH=`getconf PATH 2>/dev/null || echo $(PATH)` sh -c 'type sh | sed "s/.* //"')
+GOODSH := $(shell PATH=`getconf PATH 2>/dev/null || echo $(PATH)` LANG=C sh -c 'type sh | sed "s/.* //"')
# Path of bash for bash specific plugins
BASH := /bin/bash
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/RELEASE
^
|
@@ -1 +1 @@
-2.0.6
+2.0.7
|
[-]
[+]
|
Added |
munin-2.0.7.tar.bz2/dists/redhat/README
^
|
@@ -0,0 +1,4 @@
+Redhat specifics are hosted directly on pkgs.fedoraproject.org.
+
+www: http://pkgs.fedoraproject.org/cgit/munin.git
+git: git://pkgs.fedoraproject.org/munin.git
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/master/_bin/munin-cgi-graph.in
^
|
@@ -90,7 +90,7 @@
my $pinpoint = undef;
my $path = $ENV{PATH_INFO} || "";
- INFO "Request path is $path";
+ DEBUG "Request path is $path";
# The full URL looks like this:
# Case 1:
@@ -133,7 +133,7 @@
my ($dom, $host, $serv, $scale) =
$path =~ m#^/(.*)/([^/]+)/([\w-]+)-([\w=,]+)\.png#; ## avoid bug in vim
- INFO "asked for ($dom, $host, $serv, $scale)";
+ DEBUG "asked for ($dom, $host, $serv, $scale)";
if ($scale =~ /pinpoint=(\d+),(\d+)/) {
$pinpoint = [ $1, $2, ];
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/master/_bin/munin-cgi-html.in
^
|
@@ -43,7 +43,6 @@
my @times = ("day", "week", "month", "year");
my $config;
my $lastchanged = 0;
-my $datafile = "$Munin::Common::Defaults::MUNIN_DBDIR/datafile.storable";
my @params;
push @params, "--config", $ENV{'MUNIN_CONFIG'}
@@ -53,13 +52,7 @@
html_startup(\@params);
while(new CGI::Fast){
print header("text/html");
- my $change = (stat($datafile))[9];
- if($change > $lastchanged){
- $config = get_config(0);
- $lastchanged = $change;
- } else {
- $config = get_config(1);
- }
+ $config = get_config(1);
show_page();
}
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/master/_bin/munin-datafile2storable.in
^
|
@@ -9,6 +9,6 @@
use Munin::Master::Utils;
while (my $file = shift) {
- my $config = munin_readconfig($file);
+ my $config = munin_readconfig_raw($file);
Storable::nstore_fd($config, \*STDOUT);
}
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/master/_bin/munin-graph.in
^
|
@@ -84,7 +84,7 @@
my $graph_fh = new IO::File($config->{dbdir} . "/graphs");
while (my $path = <$graph_fh>) {
my $pinpoint = undef;
- INFO "Request path is $path";
+ DEBUG "Request path is $path";
# The full URL looks like this:
# Case 1:
@@ -126,7 +126,7 @@
my ($dom, $host, $serv, $scale) =
$path =~ m#^/(.*)/([^/]+)/(\w+)-([\w=,]+)\.png#; ## avoid bug in vim
- INFO "asked for ($dom, $host, $serv, $scale)";
+ DEBUG "asked for ($dom, $host, $serv, $scale)";
if ($scale =~ /pinpoint=(\d+),(\d+)/) {
$pinpoint = [ $1, $2, ];
@@ -159,15 +159,8 @@
}
# Now send it: headers
- INFO "X-Munin-Request: $nb_request/$nb_request_max";
+ DEBUG "X-Munin-Request: $nb_request/$nb_request_max";
- my $headers = get_headers_for_file($filename, $graph_ttl);
- foreach my $header_name (keys %$headers) {
- INFO "$header_name: $headers->{$header_name}";
- }
-
- # ... and graph data
- # send_graph_data($filename);
} continue {
$nb_request++;
if ($nb_request_max && $nb_request > $nb_request_max) {
@@ -179,27 +172,6 @@
exit 0;
-
-sub get_headers_for_file {
- my ($filename, $graph_ttl) = @_;
-
- # At this time the file exists and should be served
- my @stats = stat ($filename);
- my $mtime_epoch = $stats[9];
- my $last_modified = get_w3c_date_from_epoch($mtime_epoch);
-
- # "Expires" has to use last modified time as base:
- my $graph_next_expires = $mtime_epoch - ($mtime_epoch % $graph_ttl) + $graph_ttl;
- my $expires = get_w3c_date_from_epoch($graph_next_expires);
-
- return {
- "Expires" => $expires,
- "Last-Modified" => $last_modified,
- "Content-Length" => $stats[7],
- };
-}
-
-
sub get_w3c_date_from_epoch {
my($epoch) = @_;
return strftime("%a, %d %b %Y %H:%M:%S GMT", gmtime($epoch));
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/master/lib/Munin/Master/GraphOld.pm
^
|
@@ -299,7 +299,9 @@
# we either need to die or restart ourselves when this
# happens.
if (!defined($config)) {
- $config = &munin_config($conffile);
+ munin_readconfig_base($conffile);
+ # XXX: check if it needs datafile at that point
+ $config = munin_readconfig_part('datafile', 0);
}
my $palette = &munin_get($config, "palette", "default");
@@ -353,7 +355,7 @@
# The loaded $config is stale within 5 minutes.
# So, we need to reread it when this happens.
- $config = munin_refreshconfig($config);
+ $config = munin_readconfig_part('datafile');
# Reset an eventual custom size
$size_x = undef;
@@ -1348,7 +1350,7 @@
for my $time (keys %times) {
next unless ($draw{$time});
my $picfilename = get_picture_filename($service, $time);
- INFO "[INFO] Looking into drawing $picfilename";
+ DEBUG "[DEBUG] Looking into drawing $picfilename";
(my $picdirname = $picfilename) =~ s/\/[^\/]+$//;
DEBUG "[DEBUG] Picture filename: $picfilename";
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/master/lib/Munin/Master/HTMLConfig.pm
^
|
@@ -27,20 +27,40 @@
my $config;
my $limits;
+my $cache;
my $categories;
my $problems;
sub generate_config {
- $config = shift;
- $categories = {};
- $problems = {"criticals" => [], "warnings" => [], "unknowns" => []};
- $limits = munin_readconfig($config->{dbdir} . "/limits",1,1); #TODO: candidate for caching
-
+ my $use_cache = shift;
+ if ($use_cache) {
+ # if there is some cache, use it (for cgi)
+ my $newcache = munin_readconfig_part('htmlconf', 1);
+ if (defined $newcache) {
+ $cache = $newcache;
+ return $cache;
+ }
+ }
+ $categories = {};
+ $problems = {"criticals" => [], "warnings" => [], "unknowns" => []};
+ my $rev = munin_configpart_revision();
+
+ $config = munin_readconfig_part('datafile', 0);
+ if ($rev != munin_configpart_revision()) {
+ # datafile got updated
initiate_cgiurl_graph();
# convert config for html generation: reorder nodes to their rightful group
node_reorder($config);
- return get_group_tree($config);
+ }
+
+ $limits = munin_readconfig_part("limits");
+ # if only limits changed, still update our cache
+ if ($rev != munin_configpart_revision()) {
+ $cache = get_group_tree($config);
+ }
+
+ return $cache;
}
sub node_reorder {
@@ -462,7 +482,7 @@
}
}
- if ($config->{'graph_strategy'} eq "cgi") {
+ if (munin_get($config, "graph_strategy", "cron") eq "cgi") {
map { $srv{$_} = $config->{'cgiurl_graph'} . "/" . $imgs{$_} } keys %imgs;
} else {
map { $srv{$_} = $root_path . "/" . $imgs{$_} } keys %imgs;
@@ -489,7 +509,7 @@
for my $scale (@times) {
# Don't try to find the size if cgi is enabled,
# otherwise old data might pollute
- next if ($config->{'graph_strategy'} eq "cgi");
+ next if (munin_get($config, "graph_strategy", "cron") eq "cgi");
if (my ($w, $h)
= get_png_size(munin_get_picture_filename($service, $scale))) {
$srv{"img" . $scale . "width"} = $w;
@@ -501,7 +521,7 @@
$srv{imgweeksum} = "$srv{node}-week-sum.png";
$srv{imgyearsum} = "$srv{node}-year-sum.png";
for my $scale (["week", "year"]) {
- next if ($config->{'graph_strategy'} eq "cgi");
+ next if (munin_get($config, "graph_strategy", "cron") eq "cgi");
if (my ($w, $h)
= get_png_size(munin_get_picture_filename($service, $scale, 1)))
{
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/master/lib/Munin/Master/HTMLOld.pm
^
|
@@ -82,7 +82,6 @@
my $DEBUG = 0;
my $conffile = "$Munin::Common::Defaults::MUNIN_CONFDIR/munin.conf";
-my $htmlconfcache = "$Munin::Common::Defaults::MUNIN_DBDIR/htmlconf.storable";
my $do_usage = 0;
my $do_version = 0;
my $stdout = 0;
@@ -134,10 +133,11 @@
exit_if_run_by_super_user() unless $force_run_as_root;
- $config = munin_config($conffile, $config);
- $htmlconfcache = $config->{"dbdir"} . "/htmlconf.storable";
+ munin_readconfig_base($conffile);
+ # XXX: should not need that part here, yet.
+ $config = munin_readconfig_part('datafile', 0);
- logger_open($config->{'logdir'});
+ logger_open($config->{'logdir'});
logger_debug() if $DEBUG;
$tmpldir = $config->{tmpldir};
@@ -151,29 +151,34 @@
}
sub get_config {
- my $cache = shift;
- $htmlconfig = undef;
- if($cache){
- $htmlconfig = munin_readconfig_storable($htmlconfcache);
- }
- if(!defined $htmlconfig){
+ my $use_cache = shift;
+ # usecache should match being in a cgi ($ENV{SCRIPT_NAME})
+ if ($use_cache) {
+ $htmlconfig = generate_config($use_cache);
+ } else {
my $graphs_filename = $config->{dbdir} . "/graphs";
my $graphs_filename_tmp = $graphs_filename . ".tmp." . $$;
- # If we are in a CGI html context, no graphing file dump !
- unless ($ENV{SCRIPT_NAME}) {
- $config->{"#%#graphs_fh"} = new IO::File("> $graphs_filename_tmp");
- }
-
- $htmlconfig = generate_config($config);
-
- unless ($ENV{SCRIPT_NAME}) {
- # Closing the file
- $config->{"#%#graphs_fh"} = undef;
-
- # Atomic move
- rename($graphs_filename_tmp, $graphs_filename);
- }
+ $config->{"#%#graphs_fh"} = new IO::File("> $graphs_filename_tmp");
+
+ $htmlconfig = generate_config($use_cache);
+
+ # Closing the file
+ $config->{"#%#graphs_fh"} = undef;
+
+ # Atomic move
+ rename($graphs_filename_tmp, $graphs_filename);
+
+ # htmlconf cache
+ # munin-html writes it
+ # munin-cgi-html reads it
+ #
+ # full cron - written, never read
+ # munin-html and munin-cgi-html - written, and read as cache
+ # full munin-cgi-html - should not exist!
+ # and here, we avoid leaving a never-updating cache file
+ my $cachefile = "$config->{dbdir}/htmlconf.storable";
+ munin_writeconfig_storable($cachefile, $htmlconfig);
}
return $htmlconfig;
}
@@ -182,17 +187,16 @@
my $staticdir = $config->{staticdir};
copy_web_resources($staticdir, $htmldir);
- my $configtime = Time::HiRes::time;
+ my $configtime = Time::HiRes::time;
get_config(0);
- munin_writeconfig_storable("$htmlconfcache", $htmlconfig);
- my $groups = $htmlconfig;
- $configtime = sprintf("%.2f", (Time::HiRes::time - $configtime));
- INFO "[INFO] config generated ($configtime sec)";
+ my $groups = $htmlconfig;
+ $configtime = sprintf("%.2f", (Time::HiRes::time - $configtime));
+ INFO "[INFO] config generated ($configtime sec)";
if (munin_get($config,"html_strategy","cron") eq "cgi"){
- INFO "[INFO] html_strategy is cgi. Skipping template generation";
- return;
- }
+ INFO "[INFO] html_strategy is cgi. Skipping template generation";
+ return;
+ }
my $update_time = Time::HiRes::time;
my $lockfile = "$config->{rundir}/munin-html.lock";
@@ -218,9 +222,9 @@
}
generate_group_templates($groups);
- generate_category_templates($htmlconfig->{"globalcats"});
+ generate_category_templates($htmlconfig->{"globalcats"});
emit_main_index($groups,$timestamp,0);
- emit_problem_template(0);
+ emit_problem_template(0);
INFO "[INFO] Releasing lock file $lockfile";
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/master/lib/Munin/Master/LimitsOld.pm
^
|
@@ -98,7 +98,9 @@
exit_if_run_by_super_user() unless $force_run_as_root;
- $config = &munin_config($conffile);
+ munin_readconfig_base($conffile);
+ # XXX: check if it does actualy need that part
+ $config = munin_readconfig_part('datafile', 0);
logger_open($config->{'logdir'});
logger_debug() if $DEBUG;
@@ -117,7 +119,7 @@
munin_runlock("$config->{rundir}/munin-limits.lock");
- $oldnotes = &munin_readconfig($config->{'dbdir'} . "/limits", 1, 1);
+ $oldnotes = &munin_readconfig_part('limits', 1);
initialize_for_nagios();
@@ -128,6 +130,7 @@
close_pipes();
&munin_writeconfig("$config->{dbdir}/limits", \%notes);
+ &munin_writeconfig_storable("$config->{dbdir}/limits.storable", \%notes);
$update_time = sprintf("%.2f", (Time::HiRes::time - $update_time));
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/master/lib/Munin/Master/Logger.pm
^
|
@@ -90,7 +90,7 @@
$logopened = 1;
}
- get_logger('')->info("Opened log file");
+ get_logger('')->debug("Opened log file");
# Get perl warnings into the log files
$SIG{__WARN__} = \&_warn_catcher;
@@ -117,7 +117,7 @@
$logopened = 1;
}
- get_logger('')->info("Opened log file");
+ get_logger('')->debug("Opened log file");
# Get perl warnings into the log files
$SIG{__WARN__} = \&_warn_catcher;
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/master/lib/Munin/Master/UpdateWorker.pm
^
|
@@ -893,7 +893,24 @@
}
DEBUG "[DEBUG] Updating $rrd_file with @update_rrd_data";
- RRDs::update($rrd_file, @update_rrd_data);
+ if ($ENV{RRDCACHED_ADDRESS} && (scalar @update_rrd_data > 32) ) {
+ # RRDCACHED only takes about 4K worth of commands. If the commands is
+ # too large, we have to break it in smaller calls.
+ #
+ # Note that 32 is just an arbitrary choosed number. It might be tweaked.
+ #
+ # For simplicity we only call it with 1 update each time, as RRDCACHED
+ # will buffer for us as suggested on the rrd mailing-list.
+ # https://lists.oetiker.ch/pipermail/rrd-users/2011-October/018196.html
+ for my $update_rrd_data (@update_rrd_data) {
+ RRDs::update($rrd_file, $update_rrd_data);
+ # Break on error.
+ last if RRDs::error;
+ }
+ } else {
+ RRDs::update($rrd_file, @update_rrd_data);
+ }
+
if (my $ERROR = RRDs::error) {
#confess Dumper @_;
ERROR "[ERROR] In RRD: Error updating $rrd_file: $ERROR";
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/master/lib/Munin/Master/Utils.pm
^
|
@@ -33,7 +33,7 @@
'munin_removelock',
'munin_runlock',
'munin_getlock',
- 'munin_readconfig',
+ 'munin_readconfig_raw',
'munin_readconfig_storable',
'munin_writeconfig',
'munin_writeconfig_storable',
@@ -43,8 +43,9 @@
'munin_overwrite',
'munin_dumpconfig',
'munin_dumpconfig_as_str',
- 'munin_config',
- 'munin_refreshconfig',
+ 'munin_readconfig_base',
+ 'munin_readconfig_part',
+ 'munin_configpart_revision',
'munin_draw_field',
'munin_get_bool',
'munin_get_bool_val',
@@ -93,6 +94,27 @@
my $nsca = new IO::Handle;
my $config = undef;
+my $config_parts = {
+ # config parts that might be loaded and reloaded at times
+ 'datafile' => {
+ 'timestamp' => 0,
+ 'config' => undef,
+ 'revision' => 0,
+ 'include_base' => 1,
+ },
+ 'limits' => {
+ 'timestamp' => 0,
+ 'config' => undef,
+ 'revision' => 0,
+ 'include_base' => 1,
+ },
+ 'htmlconf' => {
+ 'timestamp' => 0,
+ 'config' => undef,
+ 'revision' => 0,
+ 'include_base' => 0,
+ },
+};
my $configfile="$Munin::Common::Defaults::MUNIN_CONFDIR/munin.conf";
@@ -156,6 +178,35 @@
return @_;
}
+# based on auto_weaken search, but only cares about #%#parents
+sub weaken_config {
+ my @todo = @_;
+ while (my $cur = shift @todo) {
+ if (ref($cur) eq 'HASH') {
+ for my $key (keys %$cur) {
+ next unless ref $cur->{$key};
+ next if isweak $cur->{$key};
+ if ($key eq '#%#parent') {
+ weaken($cur->{$key});
+ next;
+ }
+ push @todo, $cur->{$key};
+ }
+ } elsif (ref($cur) eq 'ARRAY') {
+ for (my $i = 0 ; $i < @$cur ; $i++) {
+ next unless ref $cur->[$i];
+ next if isweak $cur->[$i];
+ push @todo, $cur->[$i];
+ }
+ } elsif (ref($cur) eq 'SCALAR') {
+ next unless ref $$cur;
+ next if isweak $cur;
+ push @todo, $$cur;
+ }
+ }
+ return @_;
+}
+
sub munin_draw_field {
my $hash = shift;
@@ -300,55 +351,43 @@
}
sub munin_readconfig_storable {
- my ($conf) = @_;
-
- my $config = undef;
- $conf ||= $configfile;
+ my ($file) = @_;
+
+ my $part = undef;
+ $file ||= $configfile;
# try to read storable version
- if ( (-r $conf) && open (my $CFG_STORABLE, '<', $conf)) {
- DEBUG "[DEBUG] munin_readconfig: found Storable version of $conf, using it";
- $config = Storable::fd_retrieve($CFG_STORABLE);
+ if ((-r $file) && open (my $CFG_STORABLE, '<', $file)) {
+ DEBUG "[DEBUG] munin_readconfig: found Storable version of $file, using it";
+ $part = Storable::fd_retrieve($CFG_STORABLE);
close ($CFG_STORABLE);
- }
+ weaken_config($part);
+ }
- return $config;
+ return $part;
}
-sub munin_readconfig {
- my ($conf, $missingok, $corruptok) = @_;
+sub munin_readconfig_raw {
+ my ($conf, $missingok) = @_;
- my $config = undef;
+ my $part = undef;
$conf ||= $configfile;
-
# try first to read storable version
- $config = munin_readconfig_storable("$conf.storable");
- if(!defined $config){
+ $part = munin_readconfig_storable("$conf.storable");
+ if (!defined $part) {
if (! -r $conf and ! $missingok) {
WARN "munin_readconfig: cannot open '$conf'";
return;
- }
+ }
if (open (my $CFG, '<', $conf)) {
my @contents = <$CFG>;
close ($CFG);
- $config = munin_parse_config (\@contents);
+ $part = munin_parse_config (\@contents);
}
}
- # Some important defaults before we return...
- $config->{'dropdownlimit'} ||= $Munin::Common::Defaults::DROPDOWNLIMIT;
- $config->{'rundir'} ||= $Munin::Common::Defaults::MUNIN_STATEDIR;
- $config->{'dbdir'} ||= $Munin::Common::Defaults::MUNIN_DBDIR;
- $config->{'logdir'} ||= $Munin::Common::Defaults::MUNIN_LOGDIR;
- $config->{'tmpldir'} ||= "$Munin::Common::Defaults::MUNIN_CONFDIR/templates/";
- $config->{'staticdir'} ||= "$Munin::Common::Defaults::MUNIN_CONFDIR/static/";
- $config->{'htmldir'} ||= $Munin::Common::Defaults::MUNIN_HTMLDIR;
- $config->{'spooldir'} ||= $Munin::Common::Defaults::MUNIN_SPOOLDIR;
- $config->{'#%#parent'} = undef;
- $config->{'#%#name'} = "root";
-
- return ($config);
+ return $part;
}
@@ -974,42 +1013,66 @@
$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_configpart_revision {
+ my $what = shift;
+ if (defined $what and defined $config_parts->{$what}) {
+ return $config_parts->{$what}{revision};
+ }
+ my $rev = 0;
+ foreach $what (keys %$config_parts) {
+ $rev += $config_parts->{$what}{revision};
+ }
+ return $rev;
+}
+
+sub munin_readconfig_part {
+ my $what = shift;
+ my $missingok = shift;
+ if (! defined $config_parts->{$what}) {
+ ERROR "[ERROR] munin_readconfig_part with unknown part name ($what).";
+ return undef;
+ }
+ # for now, we only really care about storable.
+ # No reason to bother reading non-storable elements anyway.
+ my $filename = "$config->{dbdir}/$what.storable";
+ my $part = {};
+ my $doupdate = 0;
+ if (! -f $filename) {
+ unless (defined $missingok and $missingok) {
+ ERROR "[FATAL] munin_readconfig_part($what) - missing file";
+ exit(1);
+ }
+ # missing ok, return last value if we have one, copy config if not
+ if (undef == $config_parts->{$what}{config}) {
+ # well, not if we shouldn't include the config
+ if ($config_parts->{$what}{include_base}) {
+ $doupdate = 1;
}
}
-}
-
-sub munin_refreshconfig {
- my $config = shift;
- my @stat = stat("$config->{dbdir}/datafile");
- if ($config->{'#%#datafile_mtime'} && $stat[9] > $config->{'#%#datafile_mtime'}) {
- # 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;
+ } else {
+ my @stat = stat($filename);
+ if ($config_parts->{$what}{timestamp} < $stat[9]) {
+ # could use _raw if we wanted to read non-storable fallback
+ $part = munin_readconfig_storable($filename);
+ $config_parts->{$what}{timestamp} = $stat[9];
+ $doupdate = 1;
+ }
}
-
- $config->{'#%#datafile_mtime'} = $stat[9];
- return $config;
+ if ($doupdate) {
+ $part->{'#%#name'} = 'root';
+ $part->{'#%#parent'} = undef;
+ $part = munin_overwrite($part, $config) if ($config_parts->{$what}{include_base});
+ $config_parts->{$what}{config} = $part;
+ ++$config_parts->{$what}{revision};
+ }
+ return $config_parts->{$what}{config};
}
-sub munin_config {
+sub munin_readconfig_base {
my $conffile = shift;
- my $config = shift;
$conffile ||= $configfile;
- $config = munin_readconfig ($conffile);
+ $config = munin_readconfig_raw($conffile);
if (defined $config->{'includedir'}) {
my $dirname = $config->{'includedir'};
@@ -1026,15 +1089,25 @@
foreach my $f (@files) {
INFO "Reading additional config from $f";
- my $extra = munin_readconfig ($f);
- $config = munin_overwrite($extra,$config);
+ my $extra = munin_readconfig_raw ($f);
+ # let the new values overwrite what we already have
+ $config = munin_overwrite($config, $extra);
}
}
- my $data = munin_readconfig("$config->{dbdir}/datafile", 1, 1);
+ # Some important defaults before we return...
+ $config->{'dropdownlimit'} ||= $Munin::Common::Defaults::DROPDOWNLIMIT;
+ $config->{'rundir'} ||= $Munin::Common::Defaults::MUNIN_STATEDIR;
+ $config->{'dbdir'} ||= $Munin::Common::Defaults::MUNIN_DBDIR;
+ $config->{'logdir'} ||= $Munin::Common::Defaults::MUNIN_LOGDIR;
+ $config->{'tmpldir'} ||= "$Munin::Common::Defaults::MUNIN_CONFDIR/templates/";
+ $config->{'staticdir'} ||= "$Munin::Common::Defaults::MUNIN_CONFDIR/static/";
+ $config->{'htmldir'} ||= $Munin::Common::Defaults::MUNIN_HTMLDIR;
+ $config->{'spooldir'} ||= $Munin::Common::Defaults::MUNIN_SPOOLDIR;
+ $config->{'#%#parent'} = undef;
+ $config->{'#%#name'} = "root";
- $data = munin_overwrite($data,$config);
- return ($data);
+ return $config;
}
@@ -1699,9 +1772,16 @@
- Failure: undef
-=item B<munin_config>
+=item B<munin_readconfig_base>
+Read configuration file, include dir files, and initalize important
+default values that are optional.
+Parameters:
+ - $file: munin.conf filename. If ommited, default filename is used.
+
+Returns:
+ - Success: The $config hash (also cached in module)
=item B<munin_copy_node>
@@ -2074,9 +2154,15 @@
- Failure: undef
-=item B<munin_readconfig>
+=item B<munin_readconfig_part>
+Read a partial configuration
+Parameters:
+ - $what: name of the part that should be loaded (datafile or limits)
+
+Returns:
+ - Success: a $config with the $specified part, but overwriten by $config
=item B<munin_removelock>
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/node/_bin/munin-asyncd.in
^
|
@@ -264,7 +264,7 @@
Options:
--host <hostname:port> Connect to this munin-node [localhost:4949]
- -s --spool <spooldir> Store the spooled data in this dir [@@SPOOLDIR@@]
+ -s --spooldir <spooldir> Store the spooled data in this dir [@@SPOOLDIR@@]
-i --interval <seconds> Override default interval size of one day [86400]
-r --retain <count> Specify number of interval files to retain [7]
-n --nocleanup Disable automated spool dir cleanup
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/node/lib/Munin/Node/OS.pm
^
|
@@ -13,7 +13,6 @@
use POSIX ();
use Sys::Hostname;
-use File::Path qw(make_path);
sub get_uid {
my ($class, $user) = @_;
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d.debug/colour_tester.in
^
|
@@ -38,7 +38,7 @@
do_config () {
echo "graph_title Colour testing plugin"
- echo "graph_vtitle Colour index and colour"
+ echo "graph_vlabel Colour index and colour"
for I in $(seq 1 $NUMCOL); do
echo "l$I.label "${col[$I]}
echo "l$I.colour "${col[$I]}
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d.linux/apt_all.in
^
|
@@ -52,7 +52,7 @@
$ENV{'LANG'}="C";
$ENV{'LC_ALL'}="C";
-my $statefile = "$ENV{MUNIN_PLUGSTATE}/plugin-apt.state";
+my $statefile = ($ENV{MUNIN_PLUGSTATE} || '@@PLUGSTATE@@/root/') . "/plugin-apt.state";
my @releases = ("stable", "testing","unstable");
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d.linux/diskstats.in
^
|
@@ -44,7 +44,12 @@
}
# Restore data from previous run
-my ( $prev_time, %prev_diskstats ) = choose_old_state();
+my ( $prev_time, %prev_diskstats );
+eval {
+ # Using eval, if it breaks while retreive, $R is still undef.
+ # No need to unlink() it, since it will be overriden anyway.
+ ( $prev_time, %prev_diskstats ) = choose_old_state();
+};
# Persist state from current run
add_new_state( time(), %cur_diskstats );
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d.linux/fw_conntrack.in
^
|
@@ -124,7 +124,7 @@
my $command;
if ( -x $conntrack) {
- $command = "$conntrack -L -o extended 2>/dev/null";
+ $command = "$conntrack -L -o extended -f ipv4 2>/dev/null; $conntrack -L -o extended -f ipv6 2>/dev/null";
} elsif ( -r $nf_conntrack_file ) {
$command = "cat $nf_conntrack_file";
} else {
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d.linux/interrupts.in
^
|
@@ -14,7 +14,7 @@
=head1 AUTHOR
-Idea and base from Ragnar Wisløff.
+Idea and base from Ragnar Wisløff.
=head1 LICENSE
@@ -40,8 +40,8 @@
fi
# If run with the "config"-parameter, give out information on how the
-# graphs should look.
-
+# graphs should look.
+
if [ "$1" = "config" ]; then
# The title of the graph
echo 'graph_title Interrupts and context switches'
@@ -57,7 +57,7 @@
echo 'intr.info Interrupts are events that alter sequence of instructions executed by a processor. They can come from either hardware (exceptions, NMI, IRQ) or software.'
echo 'ctx.info A context switch occurs when a multitasking operatings system suspends the currently running process, and starts executing another.'
# The fields. "label" is used in the legend. "label" is the only
- # required subfield.
+ # required subfield.
echo 'intr.label interrupts'
echo 'ctx.label context switches'
# Specify type
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d.linux/iostat_ios.in
^
|
@@ -59,7 +59,7 @@
use warnings;
use IO::File;
-use Storable qw(store retrieve);
+use Storable qw(nstore retrieve);
use Munin::Plugin;
use constant STATEFILE => "$ENV{MUNIN_PLUGSTATE}/iostat-ios.state";
@@ -206,14 +206,18 @@
sub store_state {
my ($R) = @_;
- store($R, STATEFILE);
+ nstore($R, STATEFILE);
}
sub get_state {
my ($R);
return(undef) unless ( -r STATEFILE);
- $R = retrieve( STATEFILE );
+ eval {
+ # Using eval, if it breaks while retreive, $R is still undef.
+ # No need to unlink() it, since it will be overriden anyway.
+ $R = retrieve( STATEFILE );
+ };
return($R);
}
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d.linux/sensors_.in
^
|
@@ -118,7 +118,7 @@
RPM # RPM string
/xm, # Use extended regular expressions and treat string as multiple lines.
title => 'Fans',
- vtitle => 'RPM',
+ vlabel => 'RPM',
print_threshold => \&fan_threshold,
graph_args => '--base 1000 -l 0'
},
@@ -174,7 +174,7 @@
)? # >>>>end of group
/xm, # Use extended regular expressions and treat string as multiple lines.
title => 'Temperatures',
- vtitle => 'degrees Celsius',
+ vlabel => 'degrees Celsius',
print_threshold => \&temp_threshold,
graph_args => '--base 1000 -l 0'
},
@@ -227,7 +227,7 @@
/xm, # Use extended regular expressions and treat string as multiple lines.
title => 'Voltages',
- vtitle => 'Volt',
+ vlabel => 'Volt',
print_threshold => \&volt_threshold,
graph_args => '--base 1000 --logarithmic'
},
@@ -265,7 +265,7 @@
/xm, # Use extended regular expressions and treat string as multiple lines.
title => 'Power',
- vtitle => 'Watts',
+ vlabel => 'Watts',
print_threshold => \&power_threshold,
graph_args => '--base 1000 --logarithmic'
},
@@ -306,7 +306,7 @@
if ( defined $ARGV[0] and $ARGV[0] eq 'config' ) {
print "graph_title $config{$func}->{title}\n";
- print "graph_vtitle $config{$func}->{vtitle}\n";
+ print "graph_vlabel $config{$func}->{vlabel}\n";
print "graph_args $config{$func}->{graph_args}\n";
print "graph_category sensors\n";
my $text = `$SENSORS`;
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d.linux/vserver_cpu_.in
^
|
@@ -244,11 +244,11 @@
NAME=`echo $LABEL | cut -d. -f1 | tr '-' '_'`
echo -n "${NAME}_$j.value "
if [ "$MODE" == "cpu" ] ; then
- USERCPU=`cat /proc/virtual/$i/sched |grep "cpu $j"| cut -d' ' -f3`
- SYSCPU=`cat /proc/virtual/$i/sched |grep "cpu $j"| cut -d' ' -f4`
+ USERCPU=`cat /proc/virtual/$i/sched |grep "cpu $j:"| cut -d' ' -f3`
+ SYSCPU=`cat /proc/virtual/$i/sched |grep "cpu $j:"| cut -d' ' -f4`
echo $[$USERCPU + $SYSCPU]
else
- cat /proc/virtual/$i/sched |grep "cpu $j"| cut -d' ' -f5
+ cat /proc/virtual/$i/sched |grep "cpu $j:"| cut -d' ' -f5
fi
fi
done
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/apc_nis.in
^
|
@@ -37,35 +37,42 @@
my $host = exists $ENV{'host'} ? $ENV{'host'} : "127.0.0.1";
my $port = exists $ENV{'port'} ? $ENV{'port'} : "3551";
-if($ARGV[0] and $ARGV[0] eq "config") {
- my $sock = new IO::Socket::INET (
- PeerAddr => $host,
- PeerPort => $port,
- Proto => 'tcp'
- );
-
- die "Could not create socket: $!\n" unless $sock;
-
- my $buf = pack("CC", 0, 6);
- print $sock $buf;
- print $sock "status\n";
+my $sock = new IO::Socket::INET (
+ PeerAddr => $host,
+ PeerPort => $port,
+ Proto => 'tcp'
+ );
+die "Could not create socket: $!\n" unless $sock;
+
+my $buf = pack("CC", 0, 6);
+print $sock $buf;
+print $sock "status\n";
+
+if($ARGV[0] and $ARGV[0] eq "config") {
# Test for some capabilities.
- my $has_temperature = 0;
+ my $has_temperature = 0, my $line_volt_min, my $line_volt_max;
my $line;
do {
$line = <$sock>;
chomp($line);
if ($line =~ /\WITEMP /) {
$has_temperature = 1;
- }
+ } elsif ($line =~ /\WLOTRANS /) {
+ $line =~ s/.* (\d+.\d+).*/$1/;
+ $line_volt_min = $line;
+ } elsif ($line =~ /\WHITRANS /) {
+ $line =~ s/.* (\d+.\d+).*/$1/;
+ $line_volt_max = $line;
+ }
} while(!($line =~ /END APC/));
close($sock);
- print "graph_title apcupsd $host:$port\n";
+ print "graph_title APC UPS measurements\n";
print "graph_args -l 0 --base 1000\n";
print "graph_vlabel A bit of all (Volt, time, %)\n";
+ print "graph_info Values received for apcupsd available at $host:$port\n";
print "battery_volt.label batt volt (V)\n";
print "battery_volt.type GAUGE\n";
print "battery_volt.max 300\n";
@@ -75,6 +82,7 @@
print "line_volt.label line (V)\n";
print "line_volt.type GAUGE\n";
print "line_volt.max 300\n";
+ print "line_volt.warning ${line_volt_min}:${line_volt_max}\n";
print "load.label ups load (%)\n";
print "load.type GAUGE\n";
print "load.max 200\n";
@@ -89,18 +97,6 @@
exit 0;
}
-my $sock = new IO::Socket::INET (
- PeerAddr => $host,
- PeerPort => $port,
- Proto => 'tcp'
- );
-
-die "Could not create socket: $!\n" unless $sock;
-
-my $buf = pack("CC", 0, 6);
-print $sock $buf;
-print $sock "status\n";
-
my $line;
do {
$line = <$sock>;
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/ejabberd_.in
^
|
@@ -63,6 +63,15 @@
=back
+If your ejabberd.cfg cannot be found you can se it this way
+
+=over 4
+
+ [ejabberd_*]
+ env.configfile /etc/ejabberd/ejabberd.cfg
+
+=back
+
=head1 MAGIC MARKERS
#%# family=contrib
@@ -88,9 +97,6 @@
There is no way to configure the path to ejabberdctl.
-There is no way to configure the "/etc" path. /etc/ejabberd and
-/usr/local/ejabberd/etc is hardcoded in the script.
-
=cut
EJCTL=$(which ejabberdctl 2>/dev/null)
@@ -118,12 +124,14 @@
# trying to autodetect running vhosts.
if [ -z "$vhosts" ]; then
- for CFGPATH in /etc/ejabberd /usr/local/ejabberd/etc; do
- if [ -f "$CFGPATH/ejabberd.cfg" ]; then
- EJCFG=$CFGPATH/ejabberd.cfg;
- fi
- done
- if [ -z "$EJCFG" ]; then
+ if [ -z "$configfile" ]; then
+ for CFGPATH in /etc/ejabberd /etc/ejabber /usr/local/ejabberd/etc; do
+ if [ -f "$CFGPATH/ejabberd.cfg" ]; then
+ configfile=$CFGPATH/ejabberd.cfg;
+ fi
+ done
+ fi
+ if [ -z "$configfile" ]; then
echo "Unable to find ejabberd.cfg. Exiting." >&2
exit -1
fi
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/hddtemp2.in
^
|
@@ -35,7 +35,7 @@
my %config = (
regex => qr/^\/dev\/([^:]+):\s*([^:]+):\s*([\d.]+) C/m,
title => "Temperatures (Hard Disks)",
- vtitle => '°Celsius',
+ vlabel => '°Celsius',
warning => 50,
critical => 60,
graph_args => '--base 1000'
@@ -73,7 +73,7 @@
if ( defined $ARGV[0] and $ARGV[0] eq 'config' ) {
print "graph_title $config{title}\n";
- print "graph_vtitle $config{vtitle}\n";
+ print "graph_vlabel $config{vlabel}\n";
print "graph_args --base 1000\n";
print "graph_category sensors\n";
my $text = `$HDDTEMP`;
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/hddtemp_smartctl.in
^
|
@@ -141,14 +141,25 @@
# Try to get a default set of drives
if ($^O eq 'linux') {
- # On Linux, we know how to enumerate ide drives. SCSI is not as easy
+ # On Linux, we know how to enumerate ide drives.
+ my @drivesIDE;
if (-d '/proc/ide') {
opendir(IDE, '/proc/ide');
- @drives = grep /hd[a-z]/, readdir IDE;
+ @drivesIDE = grep /hd[a-z]/, readdir IDE;
closedir(IDE);
}
- # "SCSI disks" could be both SCSI or SATA - we can't know which
- # without probing them.
+
+ # Look for SCSI / SATA drives in /sys
+ my @drivesSCSI;
+ if (-d '/sys/block/') {
+ opendir(SCSI, '/sys/block/');
+ @drivesSCSI = grep /sd[a-z]/, readdir SCSI;
+ closedir(SCSI);
+ }
+
+ # Get list of all drives we found
+ @drives=(@drivesIDE,@drivesSCSI);
+
} elsif ($^O eq 'freebsd') {
opendir(DEV, '/dev');
@drives = grep /^ad[0-9]+$/, readdir DEV;
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/ipmi_sensor_.in
^
|
@@ -63,7 +63,7 @@
from subprocess import Popen, PIPE
-from os import stat, access, R_OK, F_OK
+from os import stat, access, R_OK, F_OK, environ
from os.path import join
from stat import ST_MTIME
from time import time
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/nvidia_.in
^
|
@@ -182,13 +182,13 @@
if ($config) {
if ($function eq 'volt') {
print "graph_title Voltages of NVidia graphics card\n";
- print "graph_vtitle Voltage\n";
+ print "graph_vlabel Voltage\n";
} elsif ($function eq 'clock') {
print "graph_title Clock speeds of NVidia graphics card\n";
- print "graph_vtitle Hz\n";
+ print "graph_vlabel Hz\n";
} elsif ($function eq 'temp') {
print "graph_title Temperatures of NVidia graphics card\n";
- print "graph_vtitle Degrees Celcius\n";
+ print "graph_vlabel Degrees Celcius\n";
} else {
die "$me: Unknown function!\n";
}
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/postgres_autovacuum.in
^
|
@@ -61,7 +61,13 @@
info => 'Number of active autovacuum workers',
vlabel => 'Active workers',
minversion => '8.3',
- basequery => "SELECT 'active', count(*) FROM pg_stat_activity WHERE current_query LIKE 'autovacuum: %'",
+ basequery => [
+ "SELECT 'active', count(*) FROM pg_stat_activity WHERE query LIKE 'autovacuum: %'",
+ [
+ 9.1,
+ "SELECT 'active', count(*) FROM pg_stat_activity WHERE current_query LIKE 'autovacuum: %'"
+ ]
+ ],
configquery => [ "VALUES('active','Active workers')", [ 8.1, "SELECT 'active','Active workers'" ] ],
);
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/postgres_connections_.in
^
|
@@ -65,7 +65,18 @@
info => 'Number of connections',
vlabel => 'Connections',
basequery => [
- "SELECT tmp.state,COALESCE(count,0) FROM
+ "SELECT tmp.mstate AS state,COALESCE(count,0) FROM
+ (VALUES ('active'),('waiting'),('idle'),('idletransaction'),('unknown')) AS tmp(mstate)
+ LEFT JOIN
+ (SELECT CASE WHEN waiting THEN 'waiting' WHEN state='idle' THEN 'idle' WHEN state LIKE 'idle in transaction%' THEN 'idletransaction' WHEN state='disabled' THEN 'unknown' WHEN query='<insufficient privilege>' THEN 'unknown' ELSE 'active' END AS mstate,
+ count(*) AS count
+ FROM pg_stat_activity WHERE pid != pg_backend_pid() %%FILTER%%
+ GROUP BY CASE WHEN waiting THEN 'waiting' WHEN state='idle' THEN 'idle' WHEN state LIKE 'idle in transaction%' THEN 'idletransaction' WHEN state='disabled' THEN 'unknown' WHEN query='<insufficient privilege>' THEN 'unknown' ELSE 'active' END
+ ) AS tmp2
+ ON tmp.mstate=tmp2.mstate
+ ORDER BY 1;
+ ",
+ [ 9.1, "SELECT tmp.state,COALESCE(count,0) FROM
(VALUES ('active'),('waiting'),('idle'),('idletransaction'),('unknown')) AS tmp(state)
LEFT JOIN
(SELECT CASE WHEN waiting THEN 'waiting' WHEN current_query='<IDLE>' THEN 'idle' WHEN current_query='<IDLE> in transaction' THEN 'idletransaction' WHEN current_query='<insufficient privilege>' THEN 'unknown' ELSE 'active' END AS state,
@@ -75,8 +86,8 @@
) AS tmp2
ON tmp.state=tmp2.state
ORDER BY 1
- ", [
- 8.1, "SELECT tmp.state,COALESCE(count,0) FROM
+ " ],
+ [ 8.1, "SELECT tmp.state,COALESCE(count,0) FROM
(SELECT 'active' UNION ALL SELECT 'idle' UNION ALL SELECT 'idletransaction' UNION ALL SELECT 'unknown') AS tmp(state)
LEFT JOIN
(SELECT CASE WHEN current_query='<IDLE>' THEN 'idle' WHEN current_query='<IDLE> in transaction' THEN 'idletransaction' WHEN current_query='<insufficient privilege>' THEN 'unknown' ELSE 'active' END AS state,
@@ -85,8 +96,7 @@
GROUP BY CASE WHEN current_query='<IDLE>' THEN 'idle' WHEN current_query='<IDLE> in transaction' THEN 'idletransaction' WHEN current_query='<insufficient privilege>' THEN 'unknown' ELSE 'active' END
) AS tmp2
ON tmp.state=tmp2.state
- ORDER BY 1"
- ]
+ ORDER BY 1" ]
],
wildcardfilter => " AND datname=?",
configquery => [
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/postgres_connections_db.in
^
|
@@ -61,8 +61,13 @@
title => 'PostgreSQL connections per database',
info => 'Number of connections per database',
vlabel => 'Connections',
- basequery =>
- "SELECT pg_database.datname,COALESCE(count,0) AS count FROM pg_database LEFT JOIN (SELECT datname,count(*) FROM pg_stat_activity WHERE procpid != pg_backend_pid() GROUP BY datname) AS tmp ON pg_database.datname=tmp.datname WHERE datallowconn ORDER BY 1",
+ basequery => [
+ "SELECT pg_database.datname,COALESCE(count,0) AS count FROM pg_database LEFT JOIN (SELECT datname,count(*) FROM pg_stat_activity WHERE pid != pg_backend_pid() GROUP BY datname) AS tmp ON pg_database.datname=tmp.datname WHERE datallowconn ORDER BY 1",
+ [
+ 9.1,
+ "SELECT pg_database.datname,COALESCE(count,0) AS count FROM pg_database LEFT JOIN (SELECT datname,count(*) FROM pg_stat_activity WHERE procpid != pg_backend_pid() GROUP BY datname) AS tmp ON pg_database.datname=tmp.datname WHERE datallowconn ORDER BY 1",
+ ]
+ ],
configquery =>
"SELECT datname,datname FROM pg_database WHERE datallowconn ORDER BY 1",
);
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/postgres_oldest_prepared_xact_.in
^
|
@@ -28,8 +28,8 @@
Configuration is done through libpq environment variables, for example
PGUSER, PGDATABASE, etc. For more information, see L<Munin::Plugin::Pgsql>.
-To monitor a specific database, link to postgres_size_<databasename>.
-To monitor all databases, link to postgres_size_ALL.
+To monitor a specific database, link to postgres_oldest_prepared_xact_<databasename>.
+To monitor all databases, link to postgres_oldest_prepared_xact_ALL.
=head1 SEE ALSO
@@ -67,8 +67,8 @@
vlabel => 'Age (seconds)',
minversion => '8.1',
basequery =>
- "SELECT database, COALESCE(max(extract(epoch FROM CURRENT_TIMESTAMP-prepared)),0) FROM pg_prepared_xacts %%FILTER%% GROUP BY database ORDER BY 1",
- wildcardfilter => "WHERE database=?",
+ "SELECT database, COALESCE(max(extract(epoch FROM CURRENT_TIMESTAMP-prepared)),0) FROM pg_prepared_xacts JOIN pg_database ON datname=database %%FILTER%% GROUP BY database ORDER BY 1",
+ wildcardfilter => "WHERE datname=?",
configquery =>
"SELECT datname,datname FROM pg_database %%FILTER%% ORDER BY 1",
suggestquery => "SELECT 'ALL'",
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/postgres_prepared_xacts_.in
^
|
@@ -28,8 +28,8 @@
Configuration is done through libpq environment variables, for example
PGUSER, PGDATABASE, etc. For more information, see L<Munin::Plugin::Pgsql>.
-To monitor a specific database, link to postgres_size_<databasename>.
-To monitor all databases, link to postgres_size_ALL.
+To monitor a specific database, link to postgres_prepared_xacts_<databasename>.
+To monitor all databases, link to postgres_prepared_xacts_ALL.
=head1 SEE ALSO
@@ -67,8 +67,8 @@
vlabel => 'Transactions',
minversion => '8.1',
basequery =>
- "SELECT database, count(*) FROM pg_prepared_xacts %%FILTER%% GROUP BY database ORDER BY 1",
- wildcardfilter => "WHERE database=?",
+ "SELECT database, count(*) FROM pg_prepared_xacts JOIN pg_database ON datname=database %%FILTER%% GROUP BY database ORDER BY 1",
+ wildcardfilter => "WHERE datname=?",
configquery =>
"SELECT datname,datname FROM pg_database %%FILTER%% ORDER BY 1",
suggestquery => "SELECT 'ALL'",
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/postgres_querylength_.in
^
|
@@ -65,10 +65,16 @@
info => 'Most long-running queries and transactions',
vlabel => 'Age (seconds)',
basequery => [
- "SELECT 'query',COALESCE(max(extract(epoch FROM CURRENT_TIMESTAMP-query_start)),0) FROM pg_stat_activity WHERE current_query NOT LIKE '<IDLE%' %%FILTER%%
+ "SELECT 'query',COALESCE(max(extract(epoch FROM CURRENT_TIMESTAMP-query_start)),0) FROM pg_stat_activity WHERE state NOT LIKE 'idle%' %%FILTER%%
UNION ALL
SELECT 'transaction',COALESCE(max(extract(epoch FROM CURRENT_TIMESTAMP-xact_start)),0) FROM pg_stat_activity WHERE 1=1 %%FILTER%%",
[
+ 9.1,
+ "SELECT 'query',COALESCE(max(extract(epoch FROM CURRENT_TIMESTAMP-query_start)),0) FROM pg_stat_activity WHERE current_query NOT LIKE '<IDLE%' %%FILTER%%
+ UNION ALL
+ SELECT 'transaction',COALESCE(max(extract(epoch FROM CURRENT_TIMESTAMP-xact_start)),0) FROM pg_stat_activity WHERE 1=1 %%FILTER%%",
+ ],
+ [
8.2,
"SELECT 'query',COALESCE(max(extract(epoch FROM CURRENT_TIMESTAMP-query_start)),0) FROM pg_stat_activity WHERE current_query NOT LIKE '<IDLE%' %%FILTER%%"
]
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/postgres_streaming_.in
^
|
@@ -27,9 +27,9 @@
The configuration for the database connections need to be made in
pg_service.conf (see the PostgreSQL documentation). To specify which
-cluster to monitor, link this plugin to postgres_lag_<master>:<slave>, where
-<master> and <slave> are the names of the services specified in
-pg_service.conf.
+cluster to monitor, link this plugin to
+postgres_streaming_<master>:<slave>, where <master> and <slave> are
+the names of the services specified in pg_service.conf.
=head1 SEE ALSO
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/postgres_transactions_.in
^
|
@@ -27,8 +27,8 @@
Configuration is done through libpq environment variables, for example
PGUSER, PGDATABASE, etc. For more information, see L<Munin::Plugin::Pgsql>.
-To monitor a specific database, link to postgres_size_<databasename>.
-To monitor all databases, link to postgres_size_ALL.
+To monitor a specific database, link to postgres_transactions_<databasename>.
+To monitor all databases, link to postgres_transactions_ALL.
=head1 SEE ALSO
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/postgres_users.in
^
|
@@ -60,8 +60,13 @@
title => 'PostgreSQL connections per user',
info => 'Number of connections per user',
vlabel => 'Connections',
- basequery =>
- "SELECT usename,count(*) FROM pg_stat_activity WHERE procpid != pg_backend_pid() GROUP BY usename ORDER BY 1",
+ basequery => [
+ "SELECT usename,count(*) FROM pg_stat_activity WHERE pid != pg_backend_pid() GROUP BY usename ORDER BY 1",
+ [
+ 9.1,
+ "SELECT usename,count(*) FROM pg_stat_activity WHERE procpid != pg_backend_pid() GROUP BY usename ORDER BY 1",
+ ]
+ ],
configquery => "SELECT DISTINCT usename,usename FROM pg_stat_activity ORDER BY 1",
);
|
[-]
[+]
|
Changed |
munin-2.0.7.tar.bz2/plugins/node.d/smart_.in
^
|
@@ -110,7 +110,10 @@
try :
verboselog('Reading S.M.A.R.T values')
os.putenv('LC_ALL','C')
- smart_output=os.popen(os.getenv('smartpath','/usr/sbin/smartctl')+' '+os.getenv('smartargs','-a')+(os.getenv('ignorestandby',False) and ' ' or ' -n standby ')+'-A -i /dev/'+hard_drive)
+ device='/dev/'+hard_drive
+ if not os.path.exists(device):
+ device='/dev/disk/by-id/'+hard_drive
+ smart_output=os.popen(os.getenv('smartpath','/usr/sbin/smartctl')+' '+os.getenv('smartargs','-a')+(os.getenv('ignorestandby',False) and ' ' or ' -n standby ')+'-A -i '+device)
read_values=0
lastline=None
for l in smart_output :
@@ -227,7 +230,7 @@
def get_hard_drive_name() :
global plugin_name
try :
- name=[plugin_name[string.rindex(plugin_name,'_')+1:]]
+ name=[plugin_name[string.index(plugin_name,'_')+1:]]
if os.uname()[0]=="SunOS" :
try :
# if hard_drive name starts with "rdsk" or "rmt", try to reconstruct the path
@@ -237,14 +240,15 @@
name[0]=os.path.join("rmt",name[0][3:])
except :
verboselog('Failed to find SunOS hard_drive')
- # For 3ware cards, we have to set multiple plugins for the same hard drive name.
- # Let's see if we find a '-' in the drive name.
- if name[0].find('-')!=-1:
- # Put the drive name and it's number in a list
- name=[name[0][:string.rindex(name[0],'-')],name[0][string.rindex(name[0],'-')+1:]]
+ if (not os.path.exists('/dev/'+name[0])) and (not os.path.exists('/dev/disk/by-id/'+name[0])):
+ # For 3ware cards, we have to set multiple plugins for the same hard drive name.
+ # Let's see if we find a '-' in the drive name.
+ if name[0].find('-')!=-1:
+ # Put the drive name and it's number in a list
+ name=[name[0][:string.rindex(name[0],'-')],name[0][string.rindex(name[0],'-')+1:]]
# Chech that the drive exists in /dev
- if not os.path.exists('/dev/'+name[0]):
- verboselog('/dev/'+name[0]+' not found!')
+ if (not os.path.exists('/dev/'+name[0])) and (not os.path.exists('/dev/disk/by-id/'+name[0])):
+ verboselog('/dev/(disk/by-id/)?'+name[0]+' not found!')
sys.exit(1)
return(name)
except :
|