[-]
[+]
|
Changed |
munin.changes
|
|
[-]
[+]
|
Changed |
munin.spec
^
|
|
[-]
[+]
|
Deleted |
munin-1.4.6.tar.bz2/ChangeLog.head
^
|
@@ -1,138 +0,0 @@
-3611 4259
- r3625 | feiner.tom | 2010-05-27 20:56:35 +0200 (Thu, 27 May 2010) | 1 line
- Update Changelog for 1.4.5
- r3666 | ssm | 2010-06-03 08:25:07 +0200 (Thu, 03 Jun 2010) | 1 line
- Merge r3665 to branches/1.4-stable
- r3668 | feiner.tom | 2010-06-03 20:45:12 +0200 (Thu, 03 Jun 2010) | 1 line
- Fix some copy-paste errors in the latest ChangeLog for 1.4.5, causing some lines to break and mess up
- r3673 | mha | 2010-06-09 15:23:54 +0200 (Wed, 09 Jun 2010) | 3 lines
- Include the name of the database in the graph title for PostgreSQL
- wildcard graphs.
- r3825 | feiner.tom | 2010-07-26 20:22:23 +0200 (Mon, 26 Jul 2010) | 1 line
- Solve ticket #941, allow parsing of bind 9.6 instead of expecting 9.6.x. Thanks to Clemens Lang for the patch!
- r3865 | janl | 2010-08-18 13:49:50 +0200 (Wed, 18 Aug 2010) | 2 lines
- * Enhance node side timeout message to enable understanding what happened
- r3868 | mha | 2010-08-19 11:19:37 +0200 (Thu, 19 Aug 2010) | 3 lines
- Properly return undef when the SNMP client returns noSuchObject instead
- of setting an error.
- r3870 | janl | 2010-08-19 12:22:35 +0200 (Thu, 19 Aug 2010) | 2 lines
- * munin-node: Insert a reset_timeout() to enable munin-update to get a word in edgeways after executing a slow plugin
- r3872 | janl | 2010-08-20 14:12:55 +0200 (Fri, 20 Aug 2010) | 3 lines
- * munin-html: Start using fork to save some wall-clock time. Option --fork us now active and max_html_jobs is recognized by munin-html as the maximum number of paralell processes.
- r3883 | bldewolf | 2010-09-02 20:12:53 +0200 (Thu, 02 Sep 2010) | 1 line
- Clean up Perl warnings due to use of undefined variables in two functions in LimitsOld.pm in 1.4-stable as well.
- r3884 | feiner.tom | 2010-09-09 15:57:19 +0200 (Thu, 09 Sep 2010) | 1 line
- snort_* : fix bashism & literal quote causing $warning/$critical to be printed instead of their value. Thanks to Gerald Turner for the bug report (http://bugs.debian.org/595899)
- r3907 | bldewolf | 2010-09-27 23:36:30 +0200 (Mon, 27 Sep 2010) | 1 line
- Merge Solaris if_ fixups to 1.4-stable. Original commit to trunk is r3906.
- r3929 | ligne | 2010-10-05 14:23:33 +0200 (Tue, 05 Oct 2010) | 2 lines
- backport r3916 from trunk ("setting the pidfile here prevents it being changed in the config file"). fixes #975 in 1.4 branch.
- r3930 | ligne | 2010-10-05 14:27:35 +0200 (Tue, 05 Oct 2010) | 2 lines
- backport r3892 from trunk ("document the idiosyncrasies of cidr_{allow,deny} with regard to /32 netmasks"). fixes #948 in the 1.4 maintenance branch.
- r3940 | ligne | 2010-10-06 18:54:45 +0200 (Wed, 06 Oct 2010) | 2 lines
- when listing services, force the node name to lowercase. ported from r3404.
- r3948 | bldewolf | 2010-10-07 20:59:05 +0200 (Thu, 07 Oct 2010) | 1 line
- Add previous commit to 1.4-stable branch as well.
- r3955 | bldewolf | 2010-10-12 01:46:31 +0200 (Tue, 12 Oct 2010) | 1 line
- Commit previous changes to 1.4-stable as well.
- r3960 | feiner.tom | 2010-10-24 19:38:36 +0200 (Sun, 24 Oct 2010) | 10 lines
- Apply patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601200.
- munin-cgi / munin-fast-cgi must return the HTTP Last-Modified in GMT time otherwise it is a violation
- of HTTP RFC 2606 "3.3.1 Full Date":
- "All HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT), without exception."
- Looks like this was already fixed in trunk (http://munin-monitoring.org/browser/trunk/master/_bin/munin-cgi-graph.in#L234)
- r3966 | lupe | 2010-10-28 14:11:59 +0200 (Thu, 28 Oct 2010) | 2 lines
- Replace #!/bin/bash with #!@@BASH@@ in plugins/node.d/multigraph_tester.in.
- r3985 | ssm | 2010-11-08 13:25:47 +0100 (Mon, 08 Nov 2010) | 3 lines
- Merge r3984: Log a sensible service path when graphing
- r3993 | bldewolf | 2010-11-11 01:34:00 +0100 (Thu, 11 Nov 2010) | 1 line
- Make last commit's changes to trunk to 1.4-stable as well.
- r3999 | bldewolf | 2010-11-12 20:35:38 +0100 (Fri, 12 Nov 2010) | 1 line
- Apply these two changes to 1.4-stable as well: Remove unnecessary evals in TLS.pm that break do_with_timeout() calls. Re-order TLS read function to handle both empty string and undef returns from Net::SSLeay::read.
- r4001 | bldewolf | 2010-11-13 04:19:47 +0100 (Sat, 13 Nov 2010) | 1 line
- Commit this change to 1.4-stable as well: Rewrite _node_read to use _node_read_single to read lines. Previously, it read them directly from the socket/tls and didn't handle errors correctly. Instead, we'll handle all errors in _node_read_single.
- r4007 | bldewolf | 2010-11-18 00:23:48 +0100 (Thu, 18 Nov 2010) | 1 line
- Commit these changes to 1.4-stable too: Correct comment in plugin.sh. Add more convenience functions to plugin.sh. Change cpu plugins for linux and sunos to use new adjusted threshold convenience functions, allowing users to specify limits as a % of the total cpu time available (percentage * number of cpus * 100).
- r4063 | mha | 2010-12-16 15:46:08 +0100 (Thu, 16 Dec 2010) | 4 lines
- Fix autoconf and suggest in postgres wildcard plugins that use the "paramdatabase" flag
- Reported by Greg Smith.
- r4073 | jo | 2011-01-04 15:43:44 +0100 (Tue, 04 Jan 2011) | 1 line
- - Fixed issues with having multiple contacts defined (#732, #1004, backport of r3598).
- r4076 | jo | 2011-01-07 12:24:51 +0100 (Fri, 07 Jan 2011) | 1 line
- - Mark the ip_ plugin as a bash plugin, as it uses bash syntax (#1009)
- r4078 | jo | 2011-01-07 13:10:28 +0100 (Fri, 07 Jan 2011) | 1 line
- - make slapd_ plugin autoconf work, support anonymous bind, and env.server variable (#963)
- r4081 | knan | 2011-01-11 12:57:02 +0100 (Tue, 11 Jan 2011) | 3 lines
- snmp__df - fallback to filesystems only if no disks/partitions found
- helps graphing a Check Point SecurePlatform (SPLAT)
- r4084 | jo | 2011-01-14 11:31:54 +0100 (Fri, 14 Jan 2011) | 1 line
- * Correct the initial rundir definition (#887).
- r4086 | jo | 2011-01-14 13:41:09 +0100 (Fri, 14 Jan 2011) | 1 line
- - Make lpstat plugin always use EN_us locale.
- r4089 | jo | 2011-01-14 13:51:52 +0100 (Fri, 14 Jan 2011) | 1 line
- - Make bind9 plugin handle non-existing statefile.
- r4091 | jo | 2011-01-14 14:03:23 +0100 (Fri, 14 Jan 2011) | 1 line
- Force lpstat to C locale instead of EN_us.
- r4092 | jo | 2011-01-14 14:30:21 +0100 (Fri, 14 Jan 2011) | 1 line
- - Make the mysql_ plugin better at parsing innodb output (#956)
- r4094 | jo | 2011-01-14 14:48:15 +0100 (Fri, 14 Jan 2011) | 1 line
- - Better checks for undefs in munin-limits (#973)
- r4096 | jo | 2011-01-14 14:58:55 +0100 (Fri, 14 Jan 2011) | 1 line
- - In the darwin load plugin, replaced 'echo -n', which is implementation-defined - with printf, which is posix (backport of trunk r3962)
- r4099 | jo | 2011-01-14 16:07:06 +0100 (Fri, 14 Jan 2011) | 1 line
- - Fix swap usage numbers in the sunos memory plugin (#696)
- r4101 | jo | 2011-01-14 16:26:21 +0100 (Fri, 14 Jan 2011) | 1 line
- - Make exim_mailstats plugin behave properly after initialisation (#985)
- r4104 | jo | 2011-01-14 17:21:48 +0100 (Fri, 14 Jan 2011) | 1 line
- Clean up field names in the bonding_err_ plugin on linux (#962)
- r4105 | jo | 2011-01-14 17:47:06 +0100 (Fri, 14 Jan 2011) | 1 line
- - Cosmetic cleanups in snmp__if_multi plugin (#1008)
- r4107 | jo | 2011-01-14 17:54:01 +0100 (Fri, 14 Jan 2011) | 1 line
- - The snmp__if_multi plugin now makes proper use of 64bit counters if available (#1006)
- r4109 | jo | 2011-01-14 18:10:29 +0100 (Fri, 14 Jan 2011) | 1 line
- - The linux plugin selinux_avcstat now uses integers instead of floating points (#1005)
- r4112 | knan | 2011-01-17 11:03:29 +0100 (Mon, 17 Jan 2011) | 1 line
- freebsd/coretemp - rrd doesn't do celsius/fahrenheit
- r4113 | jo | 2011-01-17 13:19:00 +0100 (Mon, 17 Jan 2011) | 1 line
- - Fix autoconf in the nfs_client plugin for linux nodes (#1015).
- r4115 | knan | 2011-01-17 17:24:03 +0100 (Mon, 17 Jan 2011) | 1 line
- add snmp__df_ram plugin
- r4118 | jo | 2011-01-18 13:12:48 +0100 (Tue, 18 Jan 2011) | 1 line
- Fix issues with plugin names with - in them.
- r4119 | jo | 2011-01-18 14:15:33 +0100 (Tue, 18 Jan 2011) | 1 line
- Make linux df plugin not die when it encounters a mountpoint it can't access (#940)
- r4122 | knan | 2011-01-18 15:57:07 +0100 (Tue, 18 Jan 2011) | 3 lines
- snmp__df - avoid division by zero
- gets it working for net-snmp snmpd on a ubuntu 10.04 lts desktop with fuse mounts
- r4130 | jo | 2011-01-20 16:51:37 +0100 (Thu, 20 Jan 2011) | 1 line
- Fixed a very silly bug, where a field couldn't be named "root" (#921)
- r4136 | feiner.tom | 2011-02-06 17:00:21 +0100 (Sun, 06 Feb 2011) | 1 line
- Backport to 1.4 branch: Correct $ENV{MUNIN_PLUGSTATE} to $Munin::Common::Defaults::MUNIN_PLUGSTATE. http://bugs.debian.org/612108
- r4141 | bldewolf | 2011-02-24 20:50:24 +0100 (Thu, 24 Feb 2011) | 1 line
- Fix usage of read that breaks dash in 1.4-stable as well.
- r4156 | bldewolf | 2011-04-09 09:25:23 +0200 (Sat, 09 Apr 2011) | 5 lines
- Make the master check the node entry for a "tls" configuration option before
- using the global value. With this option, tls can now be disabled on a per
- node basis, resolving #880. (Pushed to 1.4-stable branch)
- r4158 | bldewolf | 2011-04-10 03:54:24 +0200 (Sun, 10 Apr 2011) | 1 line
- Change message that is logged when call to accept times out to INFO and give status only, as calls to accept should time out if work is not completed. (This time in 1.4-stable)
- r4159 | bldewolf | 2011-04-10 04:47:04 +0200 (Sun, 10 Apr 2011) | 3 lines
- Modify node.d.linux/if_ plugin to pull interface speed from sysfs if other methods don't work. (Now to 1.4-stable)
- r4163 | bldewolf | 2011-04-15 06:42:08 +0200 (Fri, 15 Apr 2011) | 4 lines
- Switch if_ plugins in 1.4-stable and trunk to use type DERIVE instead of COUNTER and set min to zero.
- This resolves ticket #877.
- r4169 | bldewolf | 2011-04-19 05:01:40 +0200 (Tue, 19 Apr 2011) | 11 lines
- Backport trunk fixes to 1.4-stable:
- r4168: Fix autoconf command in Solaris if_err_.
- r4150 / r4132: Improvements to mysql_ plugin.
- r4167: Refactoring linux df/df_inode, pull new features (namely white/blacklisting devices).
- r4058: Improvements for Solaris df/df_inode.
- r4057: Replace improper call to mkpath (same issue as ticket #992).
- r3982: Fix call to mkpath in Utils.pm (ticket #992).
- r3981: Don't accidentally skip hosts when max_processes is set (ticket #990).
- r4178 | mha | 2011-05-06 10:47:43 +0200 (Fri, 06 May 2011) | 2 lines
- Fix typo
- r4193 | mha | 2011-05-15 10:55:56 +0200 (Sun, 15 May 2011) | 4 lines
- Fix PostgreSQL lock list to not show NaN for zero locks
-
- Based on a suggested query by Brian de Wolf, slightly updated by me.
|
[-]
[+]
|
Changed |
munin-1.4.7.tar.bz2/ChangeLog
^
|
@@ -9,6 +9,54 @@
* Way too much time since the last major stable release. 1.2.0 was
uploaded to sourceforge in february 2005.
+munin 1.4.7, r4260:4540, 2012-3-14
+
+ r4358 | bldewolf | 2011-09-02 02:11:33 +0200 (Fri, 02 Sep 2011) | 1 line
+ Silence Perl 5.14 warnings by adding parenthesis around a use of qw(...) in trunk and 1.4-stable.
+ r4359 | bldewolf | 2011-09-03 01:37:19 +0200 (Sat, 03 Sep 2011) | 1 line
+ Instead of silently skipping a contact that is listed but misconfigured, emit warnings and skip.
+ r4366 | kenyon | 2011-09-13 08:25:37 +0200 (Tue, 13 Sep 2011) | 3 lines
+ fix #1108: syntax error in python exit calls
+ Also run whitespace-cleanup.
+ r4369 | kenyon | 2011-09-13 09:04:45 +0200 (Tue, 13 Sep 2011) | 1 line
+ fix #1135: count IPv6 client queries
+ r4370 | kenyon | 2011-09-13 09:04:50 +0200 (Tue, 13 Sep 2011) | 1 line
+ whitespace-cleanup
+ r4371 | kenyon | 2011-09-13 09:57:05 +0200 (Tue, 13 Sep 2011) | 1 line
+ trivial whitespace change to sync with trunk as of [4368]
+ r4384 | bldewolf | 2011-09-16 22:06:55 +0200 (Fri, 16 Sep 2011) | 1 line
+ Push r3679 from trunk to 1.4-stable and revise get_fq_hostname in both:
+ this sub is expected to return a value, so instead of returning gethostbyname's
+ results (which can be undef), fall back to alternatives such as the node name
+ and then 'unknown' if we're really desperate.
+ r4385 | bldewolf | 2011-09-17 01:30:47 +0200 (Sat, 17 Sep 2011) | 1 line
+ Allow use_node_name to be defined at the global level that can still be
+ overridden on a per-node basis.
+ r4397 | bldewolf | 2011-09-23 21:35:38 +0200 (Fri, 23 Sep 2011) | 1 line
+ Update the slapd_ comments and change plugin behavior to die if an invalid
+ action is specified (for the paths that require an action).
+ r4400 | bldewolf | 2011-09-29 02:45:15 +0200 (Thu, 29 Sep 2011) | 14 lines
+ Re-work the IPC bits in LimitsOld to fix #732 for everyone:
+ - Add num_messages as a valid token
+ - Clean up functions pulled from Text::Balanced
+ - Add a function for closing the output pipes before exiting
+ - Replace all the command-parsing and hacking with an idiomatic pipe/fork/exec
+ (see man perlipc) and make the surrounding bits more cognizant of errors.
+ Note that, since we don't do anywhere near as much hacking to the command by
+ parsing quotes and stuff, it's possible that command strings that used to work
+ will no longer. This is an unfortunate but necessary casualty in making the
+ operations of munin-limits simpler and more robust.
+ r4507 | holger | 2011-12-04 18:05:53 +0100 (Sun, 04 Dec 2011) | 8 lines
+ Description: Ejabberd in squeeze (version 2.1.5) uses a new CLI
+ This patch changes the plugin to use the new CLI.
+ In addition it fixes a small bug in the vlabel for "uptime in days"
+ Origin: http://bugs.debian.org/597599
+ Author: Gerald Turner <gturner@unzane.com>
+ closes Ticket #867
+ r4538 | kenyon | 2012-01-07 02:52:21 +0100 (Sat, 07 Jan 2012) | 1 line
+ - fix qw for perl 5.14+ (closes #1161)
+ r4540 | kenyon | 2012-01-09 09:02:43 +0100 (Mon, 09 Jan 2012) | 1 line
+ merge r4539 from trunk (fix spelling mistakes, closes Debian bug #610528)
munin 1.4.6, r3625:4259, 2011-7-7
|
[-]
[+]
|
Changed |
munin-1.4.7.tar.bz2/RELEASE
^
|
@@ -1 +1 @@
-1.4.6
+1.4.7
|
[-]
[+]
|
Changed |
munin-1.4.7.tar.bz2/common/lib/Munin/Common/Config.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Common::Config;
-# $Id: Config.pm 3872 2010-08-20 12:12:55Z janl $
+# $Id: Config.pm 4400 2011-09-29 00:45:15Z bldewolf $
use warnings;
use strict;
@@ -38,7 +38,7 @@
"onlynullcdef", "group_order", "pipe", "pipe_command",
"unknown_limit", "num_unknowns", "dropdownlimit",
"max_graph_jobs", "max_cgi_graph_jobs", "munin_cgi_graph_jobs",
- "max_html_jobs", );
+ "max_html_jobs", "num_messages");
my %bools = map { $_ => 1} qw(yes no true false on off 1 0);
|
[-]
[+]
|
Changed |
munin-1.4.7.tar.bz2/master/lib/Munin/Master/LimitsOld.pm
^
|
@@ -26,7 +26,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-$Id: LimitsOld.pm 4130 2011-01-20 15:51:37Z jo $
+$Id: LimitsOld.pm 4400 2011-09-29 00:45:15Z bldewolf $
=end comment
@@ -44,8 +44,7 @@
use POSIX qw ( strftime );
use Getopt::Long;
use Time::HiRes;
-use Text::Balanced qw ( extract_multiple extract_delimited
- extract_quotelike extract_bracketed );
+use Text::Balanced qw ( extract_bracketed );
use Log::Log4perl qw ( :easy );
use Munin::Master::Logger;
@@ -105,6 +104,9 @@
sub limits_main {
+ # We're liable to receive SIGPIPEs if the given commands don't work
+ $SIG{PIPE} = 'IGNORE';
+
my $update_time = Time::HiRes::time;
my $lockfile = "$config->{rundir}/munin-limits.lock";
@@ -121,6 +123,8 @@
process_limits();
+ close_pipes();
+
&munin_writeconfig("$config->{dbdir}/limits", \%notes);
$update_time = sprintf("%.2f", (Time::HiRes::time - $update_time));
@@ -130,6 +134,16 @@
INFO "[INFO] munin-limits finished ($update_time sec)";
}
+sub close_pipes {
+ foreach my $cont (@{munin_get_children($config->{"contact"})}) {
+ if($cont->{pipe}) {
+ my $c = munin_get_node_name($cont);
+
+ DEBUG "[DEBUG] Closing pipe for contact $c";
+ close $cont->{pipe} or WARN "[WARNING] Failed to close pipe for contact $c: $!";
+ }
+ }
+}
sub process_limits {
@@ -576,8 +590,10 @@
foreach my $c (split(/\s+/, $contactlist)) {
next if $c eq "none";
my $contactobj = munin_get_node($config, ["contact", $c]);
- next unless defined $contactobj;
- next unless defined munin_get($contactobj, "command", undef);
+ if(!defined $contactobj) {
+ WARN("[WARNING] Missing configuration options for contact $c; skipping");
+ next;
+ }
if (@limit_contacts and !grep (/^$c$/, @limit_contacts)) {
next;
}
@@ -589,8 +605,12 @@
if (!$hash->{'state_changed'} and !$obsess) {
next; # No need to send notification
}
- DEBUG "state has changed, notifying $c";
- my $precmd = munin_get($contactobj, "command");
+ DEBUG "[DEBUG] state has changed, notifying $c";
+ my $precmd = munin_get($contactobj, "command", undef);
+ if(!defined $precmd) {
+ WARN("[WARNING] Missing command option for contact $c; skipping");
+ next;
+ }
my $pretxt = munin_get(
$contactobj,
"text",
@@ -603,113 +623,59 @@
$txt =~ s/\\n/\n/g;
$txt =~ s/\\t/\t/g;
- # In some cases we want to reopen the command
+ if($cmd =~ /^\s*([|><]+)/) {
+ WARN "[WARNING] Found \"$1\" at beginning of command. This should no longer be necessary and will be removed from the command before execution";
+ $cmd =~ s/^\s*[|><]+//;
+ }
+
my $maxmess = munin_get($contactobj, "max_messages", 0);
my $curmess = munin_get($contactobj, "num_messages", 0);
my $curcmd = munin_get($contactobj, "pipe_command", undef);
my $pipe = munin_get($contactobj, "pipe", undef);
if ($maxmess and $curmess >= $maxmess) {
- close($pipe);
+ DEBUG "[DEBUG] Resetting pipe for $c because max messages was reached";
+ close($pipe) or WARN "[WARNING] Failed to close pipe for $c: $!";
$pipe = undef;
- munin_set_var_loc($contactobj, ["pipe"], undef);
- DEBUG "[DEBUG] Closing \"$c\" -> command (max number of messages reached).";
+ munin_set($contactobj, "pipe", undef);
}
elsif ($curcmd and $curcmd ne $cmd) {
- close($pipe);
+ DEBUG "[DEBUG] Resetting pipe for $c because the command has changed";
+ close($pipe) or WARN "[WARNING] Failed to close pipe for $c: $!";
$pipe = undef;
- munin_set_var_loc($contactobj, ["pipe"], undef);
- DEBUG "[DEBUG] Closing \"$c\" -> command (command has changed).";
+ munin_set($contactobj, "pipe", undef);
}
if (!defined $pipe) {
- my @cmd = extract_multiple(
- message_expand($hash, $cmd),
- [sub {extract_delimited($_[0], q{"'})}, qr/\S+/],
- undef, 1
- );
- @cmd = map {
- my $c = $_;
- $c =~ s/['"]$//;
- $c =~ s/^['"]//;
- $c;
- } @cmd;
- $contactobj->{"num_messages"} = 0;
- if ($cmd[0] eq "|") {
- $cmd[0] = "|-";
- }
- elsif ($cmd[0] !~ /^[|>]/) {
- unshift(@cmd, "|-");
- }
- DEBUG("[DEBUG] opening \"$c\" for writing: \""
- . join('" "', @cmd)
- . "\".");
- if ($cmd[0] eq ">") {
- ## no critic
- if (!open($pipe, join(' ', @cmd))) {
- FATAL("[FATAL] Could not open "
- . join(' ', @cmd[1 .. $#cmd])
- . " for writing: $!");
- exit 3;
- }
- ## critic
+ DEBUG "[DEBUG] Opening pipe for $c";
+ pipe(my $r, my $w) or WARN "[WARNING] Failed to open pipe for $c: $!";
+ my $pid = fork();
+ defined($pid) or WARN "[WARNING] Failed fork for pipe for $c: $!";
+ if($pid) { # parent
+ DEBUG "[DEBUG] Opened pipe for $c as pid $pid";
+
+ close $r;
+ $pipe = $w;
+ munin_set($contactobj, "pipe_command", $cmd);
+ munin_set($contactobj, "pipe", $pipe);
+ munin_set($contactobj, "num_messages", 0);
+ $curmess = 0;
+ } else { # child
+ close $w;
+ open(STDIN, "<&", $r);
+ exec($cmd) or WARN "[WARNING] Failed to exec for contact $c in pid $$";
+ exit;
}
- else {
- my $pid = open($pipe, "|-");
- if (!defined $pid) {
- FATAL "Fatal: Unable to fork: $!";
- exit 3;
- }
- if (!$pid) { # Child
- # Fork of stdout-to-log filter
- my $logstdout;
- my $logstderr;
- my $logpid = open($logstdout, "|-");
- if (!defined $logpid) {
- FATAL "Fatal: Unable to fork: $!";
- exit 3;
- }
- if (!$logpid) { # Child
- while (<STDIN>) {
- chomp;
- INFO "Command \"$c\" stdout: $_";
- }
- exit 0;
- }
- close(STDOUT);
- *STDOUT = \$logstdout;
- $logpid = open($logstderr, "|-");
- if (!defined $logpid) {
- FATAL "Fatal: Unable to fork: $!";
- exit 3;
- }
- if (!$logpid) { # Child
- while (<STDIN>) {
- chomp;
- FATAL "Command \"$c\" stderr: $_";
- }
- exit 0;
- }
- open(STDOUT, ">&", $logstdout);
- open(STDERR, ">&", $logstderr);
-
- exec(@cmd[1 .. $#cmd])
- or WARN("[WARNING] Could not run command \""
- . join(' ', @cmd[1 .. $#cmd])
- . "\": $!");
- exit 5;
+ }
- # NOTREACHED
- }
- }
- munin_set_var_loc($contactobj, ["pipe_command"], $cmd);
- munin_set_var_loc($contactobj, ["pipe"], $pipe);
+ DEBUG "[DEBUG] sending message to $c: \"$txt\"";
+ if(defined $pipe and !print $pipe $txt, "\n") {
+ WARN "[WARNING] Writing to pipe for $c failed: $!";
+ close($pipe) or WARN "[WARNING] Failed to close pipe for $c: $!";
+ $pipe = undef;
+ munin_set($contactobj, "pipe", undef);
}
- DEBUG "[DEBUG] sending message: \"$txt\"";
- print $pipe $txt, "\n" if (defined $pipe);
- DEBUG "[DEBUG] explicitely closing pipe as suggested by schamane on #732";
- close $pipe if (defined $pipe);
- $contactobj->{"num_messages"}
- = 1 + munin_get($contactobj, "num_messages", 0); # $num_messages++
+
+ munin_set($contactobj, "num_messages", $curmess + 1);
}
}
|
[-]
[+]
|
Changed |
munin-1.4.7.tar.bz2/master/lib/Munin/Master/Node.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Master::Node;
-# $Id: Node.pm 4156 2011-04-09 07:25:23Z bldewolf $
+# $Id: Node.pm 4385 2011-09-16 23:30:47Z bldewolf $
# This module is used by UpdateWorker to keep in touch with a node and
# parse some of the output.
@@ -157,7 +157,11 @@
sub list_plugins {
my ($self) = @_;
- my $host = $self->{configref}{use_node_name}
+ # Check for one on this node- if not, use the global one
+ my $use_node_name = defined($self->{configref}{use_node_name})
+ ? $self->{configref}{use_node_name}
+ : $config->{use_node_name};
+ my $host = $use_node_name
? $self->{node_name}
: $self->{host};
|
[-]
[+]
|
Changed |
munin-1.4.7.tar.bz2/node/lib/Munin/Node/OS.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Node::OS;
-# $Id: OS.pm 3516 2010-04-23 17:17:34Z ligne $
+# $Id: OS.pm 4384 2011-09-16 20:06:55Z bldewolf $
use warnings;
use strict;
@@ -12,6 +12,7 @@
use Munin::Common::Timeout;
use POSIX ();
+use Sys::Hostname;
sub get_uid {
my ($class, $user) = @_;
@@ -36,24 +37,12 @@
}
}
+sub get_fq_hostname {
+ my $short = Sys::Hostname::hostname();
-sub get_fq_hostname {
- my ($class) = @_;
-
- my $hostname = eval {
- require Sys::Hostname;
- return (gethostbyname(Sys::Hostname::hostname()))[0];
- };
- return $hostname if $hostname;
-
- $hostname = `hostname`;
- chomp($hostname);
- $hostname =~ s/\s//g;
- return $hostname;
+ return (gethostbyname $short)[0] || $short || "unknown";
}
-
-
sub check_perms_if_paranoid {
my ($class, $target) = @_;
my @stat;
|
[-]
[+]
|
Changed |
munin-1.4.7.tar.bz2/plugins/node.d.linux/memory.in
^
|
@@ -186,7 +186,7 @@
print "inact_clean.draw LINE1\n";
print "inact_clean.info Memory not currently used.\n";
}
- for my $field qw(apps buffers swap cached free slab swap_cache page_tables vmalloc_used committed mapped active active_anon active_cache inactive inact_dirty inact_laundry inact_clean) {
+ for my $field (qw(apps buffers swap cached free slab swap_cache page_tables vmalloc_used committed mapped active active_anon active_cache inactive inact_dirty inact_laundry inact_clean)) {
my ($warning, $critical) = get_thresholds($field);
my $total = $mems{MemTotal};
$total = $mems{SwapTotal} if($field eq "swap");
|
[-]
[+]
|
Changed |
munin-1.4.7.tar.bz2/plugins/node.d/bind9.in
^
|
@@ -31,10 +31,11 @@
=cut
use strict;
-use Munin::Common::Defaults;
+use Munin::Common::Defaults;
my $QUERYLOG = $ENV{logfile} || '/var/log/bind9/query.log';
my $STATEFILE= $Munin::Common::Defaults::MUNIN_PLUGSTATE.'/bind9.state';
+
my $OTHER=0;
my %IN;
@@ -54,18 +55,18 @@
sub do_stats {
- my $k;
+ my $k;
open(Q,"< $QUERYLOG") or die "$!";
while (<Q>) {
- chomp;
- if (/client \d+\.\d+.\d+.\d+\#\d+: (view \S+\: |)query\: \S+ (\w+) (\w+)/) {
- if ($2 eq 'IN' and $3 !~ /^TYPE/) {
+ chomp;
+ if (/: (view \S+\: |)query\: \S+ (\w+) (\w+)/) {
+ if ($2 eq 'IN' and $3 !~ /^TYPE/) {
$IN{$3}++;
- } else {
- $OTHER++;
- }
- }
+ } else {
+ $OTHER++;
+ }
+ }
}
close(Q);
@@ -73,8 +74,8 @@
open(Q,"> $STATEFILE") or die;
foreach $k (keys %IN) {
- print "query_$k.value ",$IN{$k},"\n";
- print Q "$k ",$IN{$k},"\n";
+ print "query_$k.value ",$IN{$k},"\n";
+ print Q "$k ",$IN{$k},"\n";
}
close(Q);
@@ -96,7 +97,7 @@
get_state;
foreach $k (keys %IN) {
- print "query_$k.label $k
+ print "query_$k.label $k
query_$k.type DERIVE
query_$k.min 0
query_$k.draw STACK
|
[-]
[+]
|
Changed |
munin-1.4.7.tar.bz2/plugins/node.d/ejabberd_.in
^
|
@@ -220,7 +220,7 @@
done;
elif [ "$MODE" = "uptime" ]; then
echo 'graph_title Uptime of ejabberd server'
- echo 'uptime in days'
+ echo 'graph_vlabel uptime in days'
echo "uptime.label uptime"
echo 'uptime.draw AREA'
fi
@@ -237,7 +237,7 @@
if [ "$MODE" = "users" ]; then
for host in $vhosts; do
formathost=$(echo $host | tr '.' '_')
- echo "connected_users_$formathost.value $($EJCTL vhost $host stats onlineusers)";
+ echo "connected_users_$formathost.value $($EJCTL stats-host onlineusers $host)";
echo "connected_unique_users_$formathost.value $($EJCTL connected-users | awk -v var=$host -F/ '{users[$1]} END {for (user in users) {if (index(user,var)) {count++}} print count}')";
done
exit 0
@@ -246,7 +246,7 @@
if [ "$MODE" = "registrations" ]; then
for host in $vhosts; do
formathost=$(echo $host | tr '.' '_')
- num=$($EJCTL vhost $host stats registeredusers)
+ num=$($EJCTL stats-host registeredusers $host)
if [ "$?" != 0 ]; then
num="U"
fi
@@ -259,7 +259,7 @@
for host in $vhosts; do
formathost=$(echo $host | tr '.' '_')
for status in $statuses; do
- num=$($EJCTL vhost $host status-num $status)
+ num=$($EJCTL status-num-host $status $host)
if [ "$?" != 0 ]; then
num="U"
fi
@@ -284,12 +284,12 @@
for host in $vhosts; do
for num in $days; do
formathost=$(echo $host | tr '.' '_')
- echo "usersindays_${formathost}_${num}.value $($EJCTL vhost $host num-active-users $num)";
+ echo "usersindays_${formathost}_${num}.value $($EJCTL num-active-users $host $num)";
done;
done;
exit 0
fi
if [ "$MODE" = "uptime" ]; then
- echo "uptime.value $($EJCTL stats uptime-seconds | awk '{printf "%.2f", $1/86400}')"
+ echo "uptime.value $($EJCTL stats uptimeseconds | awk '{printf "%.2f", $1/86400}')"
fi
|
[-]
[+]
|
Changed |
munin-1.4.7.tar.bz2/plugins/node.d/slapd_.in
^
|
@@ -13,7 +13,8 @@
# performing different functions:
# slapd_statistics_bytes
# slapd_statistics_pdu
-# slapd_statistics_other
+# slapd_statistics_referrals
+# slapd_statistics_entries
# slapd_connections
# slapd_waiters
# slapd_operations
@@ -199,6 +200,9 @@
}
}
+# Determine action based on filename first
+(my $action = $0) =~ s/^.*slapd_([\w\d_]+)$/$1/;
+
if ($ARGV[0]) {
if ($ARGV[0] eq 'autoconf') {
# Check for Net::LDAP
@@ -238,28 +242,25 @@
print "yes\n";
exit 0;
} elsif ($ARGV[0] eq "config") {
- if ($0 =~ /slapd_([\w\d_]+)$/) {
- my $action = $1;
- &config ($1);
- } else {
- die ("Can't run config without a symlinked name\n");
+ if(!exists $ops{$action}) {
+ die "Unknown action specified: $action";
}
+ &config ($action);
} elsif ($ARGV[0] eq "suggest") {
print join ("\n", keys (%ops)), "\n";
}
exit 0;
}
-# We won't run this without parameters.
-die ("Can't run without a symlinked name\n") if $0 =~ /slapd_$/;
+# If $action isn't in %ops, we quit
+if(!exists $ops{$action}) {
+ die "Unknown action specified: $action";
+}
# Default scope for LDAP searches. We'll change to other scopes if
# necessary.
$scope = "one";
-# The filename is teh key
-(my $action = $0) =~ s/^.*slapd_([\w\d_]+)$/$1/;
-
# Net::LDAP variant
my $ldap = Net::LDAP->new ($server, version => 3)
or die "Failed to connect to server $server: $@";
|
[-]
[+]
|
Changed |
munin-1.4.7.tar.bz2/plugins/node.d/smart_.in
^
|
@@ -4,8 +4,8 @@
# Wildcard-plugin to monitor S.M.A.R.T attribute values through smartctl,
# which is part of smartmontools package:
# http://smartmontools.sourceforge.net/
-#
-# To monitor a S.M.A.R.T device, link smart_<device> to this file.
+#
+# To monitor a S.M.A.R.T device, link smart_<device> to this file.
# E.g.
# ln -s /usr/share/munin/plugins/smart_ /etc/munin/plugins/smart_hda
# ...will monitor /dev/hda.
@@ -16,10 +16,10 @@
# group disk
#
# Parameters
-# smartpath - Specify path to smartctl program (Default: /usr/sbin/smartctl)
-# smartargs - Override '-a' argument passed to smartctl with '-A -i'+smartargs
+# smartpath - Specify path to smartctl program (Default: /usr/sbin/smartctl)
+# smartargs - Override '-a' argument passed to smartctl with '-A -i'+smartargs
# ignorestandby - Ignore the standby state of the drive and perform SMART query. Default: False
-#
+#
# Parameters can be specified on a per-drive basis, eg:
# [smart_hda]
# user root
@@ -39,7 +39,7 @@
# env.smartargs -H -l error -d 3ware,2
#
# Author: Nicolas Stransky <Nico@stransky.cx>
-#
+#
# v1.0 22/08/2004 - First draft
# v1.2 28/08/2004 - Clean up the code, add a verbose option
# v1.3 14/11/2004 - Compatibility with python<2.2. See comments in the code
@@ -181,7 +181,7 @@
verboselog('No state file, reading S.M.A.R.T values for the first time')
read_values(hard_drive[0])
pickle.dump(smart_values,open_state_file(hard_drive,"w"))
- smart_values_state=smart_values
+ smart_values_state=smart_values
verboselog('Printing configuration')
print('graph_title S.M.A.R.T values for drive '+string.join(hard_drive,","))
@@ -211,7 +211,7 @@
sys.exit(1)
else :
verboselog('No state file, reading S.M.A.R.T values for the first time')
- exit(1)
+ sys.exit(1)
verboselog('Printing unknown values for all attributes in state file')
attributes=smart_values_state.keys()
@@ -264,7 +264,7 @@
drives.append(drive)
except :
continue
- except :
+ except :
verboselog('Failed to list devices in /sys/block')
else :
verboselog('Not running linux2.6, failing back to /proc/partitions')
@@ -275,7 +275,7 @@
words=string.split(l)
if len(words)==0 or words[0][0] not in string.digits : continue
if words[0] in ['1','9','58','254'] : continue # Ignore RAM, md, LVM and LVM2 devices
- if words[-1][-1] not in string.digits :
+ if words[-1][-1] not in string.digits :
try :
verboselog('Trying '+words[-1]+'...')
exit_status=read_values(words[-1])
@@ -370,13 +370,13 @@
print_config(hard_drive)
sys.exit(0)
elif sys.argv[1]=="autoconf" :
- if os.path.exists(os.getenv('smartpath','/usr/sbin/smartctl')) :
+ if os.path.exists(os.getenv('smartpath','/usr/sbin/smartctl')) :
if not find_smart_drives():
print('no (no drives accessible)')
else :
print('yes')
sys.exit(0)
- else :
+ else :
print('no (smartmontools not found)')
sys.exit(0)
elif sys.argv[1]=="suggest" :
@@ -395,7 +395,7 @@
read_values(hard_drive[0])
if not emptyoutput: update_state_file(hard_drive)
print_plugin_values(hard_drive)
-exit(0)
+sys.exit(0)
### The following is the smart_ plugin documentation, intended to be used with munindoc
@@ -415,7 +415,7 @@
To monitor a S.M.A.R.T device, create a link in the service directory
of the munin-node named smart_<device>, which is pointing to this file.
-
+
E.g.
ln -s /usr/share/munin/plugins/smart_ /etc/munin/plugins/smart_hda
|
[-]
[+]
|
Changed |
munin-1.4.7.tar.bz2/plugins/node.d/users.in
^
|
@@ -33,7 +33,7 @@
=head1 VERSION
- $Id: users.in 1966 2009-04-01 12:24:27Z kjellm $
+ $Id: users.in 4540 2012-01-09 08:02:43Z kenyon $
=head1 AUTHOR
@@ -74,12 +74,12 @@
print "pts.colour 00FFFF\n";
print "X.label X displays\n";
print "X.draw AREASTACK\n";
- print "X.info Users logged in on a X display\n";
+ print "X.info Users logged in on an X display\n";
print "X.colour 000000\n";
print "other.label Other users\n";
- print "other.info Users loged in by indeterminate method\n";
+ print "other.info Users logged in by indeterminate method\n";
print "other.colour FF0000\n";
- foreach my $field qw(tty pty pts X other) {
+ foreach my $field (qw(tty pty pts X other)) {
print_thresholds($field);
}
exit 0;
|