[-]
[+]
|
Changed |
munin.changes
|
|
[-]
[+]
|
Changed |
munin.spec
^
|
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/ChangeLog
^
|
@@ -1,5 +1,58 @@
-*- text -*-
+munin-2.0.10, 2013-01-09
+
+-------
+Summary
+-------
+
+Bugfix-only release.
+
+- The --force flag of munin-limits is back, sorry for the disruptive API change in the 2.0.x series.
+- Many fixes
+
+Closes: D#615957, D#671448
+
+------------------
+Detailed Changelog
+------------------
+
+D. Johnson:
+ templates: fix overview missing tag
+
+Diego Elio Petteno:
+ mailman: allow user to configure paths instead of hardcoding them.
+ asterisk_*: remove dependency on Net::Telnet.
+ asterisk_channels: fix name of plugin in configuration examples.
+
+Gerald Turner:
+ plugins/bind9_rndc: fix if named.stats is on tmpfs
+
+Holger Levsen:
+ plugins/df: update exclude list doc to match code
+
+Magnus Hagander:
+ Disable server-side prepared statements for pg plugins
+
+Michal Cihar:
+ plugins/snmp__df: find all mount points
+
+Nicolai Langfeldt:
+ getversion: Handle checked out tags better
+
+Steve Schnepp:
+ fix plugins.history
+ plugins/cpuspeed: fix if cpus are at maximum speed
+ getversion: update doc
+ getversion: use the commit SHA instead of tree SHA
+ getversion: prefix the commit with "-g" magic
+ getversion: apply the changes described in doc
+ getversion: also fix the stable-* rules
+
+Stig Sandbeck Mathisen:
+ munin-limits: Add --always-send, --force options
+
+
munin-2.0.9, 2012-12-05
-------
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/RELEASE
^
|
@@ -1 +1 @@
-2.0.9
+2.0.10
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/doc/reference/munin-limits.rst
^
|
@@ -45,15 +45,29 @@
Limit services to those of <service>. Multiple --service options
may be supplied. [unset]
+.. option:: --always-send <severity list>
+
+ Force sending of messages even if you normally wouldn't.
+
+ The <severity list> can be a whitespace or comma separated list of
+ the values "ok", "warning", "critical" or "unknown".
+
+ This option may be specified several times, to add more values.
+
+ Use of "--always-send" overrides the "always_send" value in
+ munin.conf for configured contacts. See also --force.
+
.. option:: --force
- Force sending of messages even if you normally wouldn't. Can be
- negated with --noforce. [--noforce]
+ Alias for "--always-send ok,warning,critical,unknown"
+
+.. option:: --force-run-as-root
-.. option:: --force-root
+ munin-limits will normally prevent you from running as root. Use
+ this option to override this.
- Force running as root (stupid and unnecessary). Can be negated
- with --noforce-root [--noforce-root]
+ The use of this option is not recommended. You may have to clean up
+ file permissions in order for munin to run normally afterwards.
.. option:: --help
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/getversion
^
|
@@ -2,32 +2,48 @@
# Generate a version string for use when building.
#
-# If RELEASE exists, and is non-empty, use the contents of that file.
-# This is in case we're building from a tarball.
+# * If RELEASE exists, and is non-empty, use the contents of that file.
+# This is in case we're building from a tarball.
#
-# If we're inside a git tree:
+# * If we're inside a git tree:
+# - For the "master" branch, use "git describe".
+# - For "detached" branches (mostly for tag checkouts), also use "git describe".
+# - For other branches, use a "$VERSION-$NBCOMMITS-$BRANCH-$DATE-g$COMMIT"
+# sortof version.
#
-# - For the "devel" branch, generate a "devel-date-hash" version.
+# * Try to make it up from the directory name (munin-2.0.1 -> 2.0.1)
#
-# - For other branches, use "git describe". This should result in a
-# clean version for the tagged releases on "master", and a
-# version-revision on the packaging tags.
-#
-# If we're still looking for a version, use "unknown".
+# * If we're still looking for a version, just fallback to "unknown".
current_git_branch() {
- git branch | awk '$1 == "*" {print $2}'
+ # Handle this too:
+
+ # git checkout 2.0.9
+ # git branch
+ # * (no branch)
+ # devel
+
+ GB="$(git branch | awk '$1 == "*" {print $2}')"
+ case $GB in
+ "(no" ) echo;;
+ * ) echo $GB;;
+ esac
}
generate_version_string() {
branch="$(current_git_branch)"
case "${branch}" in
- master)
+ ""|master|stable-*)
git describe
;;
*)
- GIT_REVISION="$(git describe --long | sed 's/-g.*//')"
- git log -n 1 --pretty="${GIT_REVISION}-${branch}-%ad-%tc" --date=short
+ # "foo | read VAR" does *not* work
+ # workaround stolen from http://www.etalabs.net/sh_tricks.html
+ read VERSION COMMITS HASH <<EOF
+$(git describe --long | perl -lne 'print "$1 $2 $3" if m/(.*)-(\d+)-g(\w+)/')
+EOF
+ # As git describe, we also use the "-g" magic string to denote a git hash
+ git log -n 1 --pretty="${VERSION}-${branch}-%ad-c${COMMITS}-g%h" --date=short
;;
esac
}
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/master/_bin/munin-limits.in
^
|
@@ -66,11 +66,23 @@
Use E<lt>fileE<gt> as configuration file. [@@CONFDIR@@/munin.conf]
-=item B<< --[no]force >>
+=item B<< --always-send <severity list> >>
-Force sending of messages even if you normally wouldn't. [--noforce]
+Force sending of messages even if you normally wouldn't.
-=item B<< --[no]force-root >>
+The <severity list> can be a whitespace or comma separated list of the
+values "ok", "warning", "critical" or "unknown".
+
+This option may be specified several times, to add more values.
+
+Use of "--always-send" overrides the "always_send" value in munin.conf
+for configured contacts. See also --force.
+
+=item B<< --force >>
+
+Alias for "--always-send ok,warning,critical,unknown"
+
+=item B<< --[no]force-run-as-root >>
Force running as root (stupid and unnecessary). [--noforce-root]
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/master/lib/Munin/Master/LimitsOld.pm
^
|
@@ -58,7 +58,9 @@
my @limit_hosts = ();
my @limit_services = ();
my @limit_contacts = ();
+my @always_send = ();
my $stdout = 0;
+my $force = 0;
my $force_run_as_root = 0;
my %notes = ();
my $config;
@@ -86,6 +88,8 @@
"config=s" => \$conffile,
"debug!" => \$DEBUG,
"stdout!" => \$stdout,
+ "force!" => \$force,
+ "always-send=s" => \@always_send,
"force-run-as-root!" => \$force_run_as_root,
"version!" => \$do_version,
"help" => \$do_usage
@@ -96,6 +100,8 @@
exit_if_run_by_super_user() unless $force_run_as_root;
+ @always_send = qw{ok warning critical unknown} if $force;
+
munin_readconfig_base($conffile);
# XXX: check if it does actualy need that part
$config = munin_readconfig_part('datafile', 0);
@@ -208,7 +214,15 @@
--help View this message.
--debug View debug messages.
--stdout Log to stdout as well as the log file.
- --force Send messages even if they shouldn't normally be sent.
+ --always-send <severity list>
+ Send messages to contacts even if state has
+ not changed since the last run. The list is a
+ space or comma separated list of severities.
+ Choose from one or more of \"critical\",
+ \"warning\", \"unknown\" and \"ok\".
+ --force Alias for \"--always-send ok,warning,critical,unknown\".
+ Overrides --always-send command line, as well as the
+ always_send contact configuration options.
--service <service> Limit notified services to <service>. Multiple
--service options may be supplied.
--host <host> Limit notified hosts to <host>. Multiple --host
@@ -628,8 +642,22 @@
next;
}
my $obsess = 0;
- my $always_send = munin_get($contactobj, "always_send");
- foreach my $cas (split(/\s+/, lc $always_send)) {
+ my $always_send;
+
+ if (@always_send) {
+ # List of severities from command line argument
+ $always_send = \@always_send;
+ }
+ else {
+ # List of severities from contact configuration
+ my $always_send_config = munin_get( $contactobj, "always_send" );
+ my @always_send_config = ($always_send_config);
+ $always_send = \@always_send_config;
+ }
+
+ $always_send = validate_severities($always_send);
+
+ foreach my $cas ( @{$always_send} ) {
if(defined($stats{$cas})) {
$obsess += scalar @{$stats{$cas}};
}
@@ -788,4 +816,49 @@
return join('', @res);
}
+=pod
+
+Get a list of severities, and return a sorted, lower cased, unique and
+validated list of severities.
+
+Expects and returns an array reference.
+
+If none of the severities given are on the allowed_severities list, it
+will return a reference to an empty array.
+
+=cut
+
+sub validate_severities {
+ my $severities_ref = shift;
+ my @severities = @{$severities_ref};
+
+ my @allowed_severities = qw{ok warning critical unknown};
+
+ # Flatten, split on comma and whitespace, and lowercase
+ my @expanded_severities =
+ split( /[[:space:],]+/, lc( join( ',', @severities ) ) );
+
+ # Remove duplicates
+ my %seen;
+ my @unique_severities = grep { !$seen{$_}++ } @expanded_severities;
+
+ # Filter on allowed values
+ my %count;
+ my @validated_severities;
+ foreach my $severity ( @unique_severities, @allowed_severities ) {
+ $count{$severity}++;
+ }
+
+ foreach my $severity ( keys %count ) {
+ if ( $count{$severity} == 2 ) {
+ push @validated_severities, $severity;
+ }
+ }
+
+ # Sort the final list
+ my @sorted_severities = sort(@validated_severities);
+
+ return \@sorted_severities;
+}
+
1;
|
[-]
[+]
|
Added |
munin-2.0.10.tar.bz2/master/t/munin_master_limitsold.t
^
|
@@ -0,0 +1,34 @@
+# -*- perl -*-
+use warnings;
+use strict;
+
+use Test::More tests => 7;
+
+use_ok('Munin::Master::LimitsOld');
+
+# Test values
+my $severities_csv = ["ok,warning,critical,unknown"];
+my $severities_mix = [ "ok,Warning, CRITICAL", "unknown" ];
+my $severities_bad = [ "ok", "warning", "critical", "unknown", "fluffy" ];
+my $severities_dup = [ "ok", "warning", "ok", "critical", "unknown" ];
+
+# Result value (must be sorted)
+my $severities = [ "critical", "ok", "unknown", "warning" ];
+
+is_deeply( Munin::Master::LimitsOld::validate_severities($severities),
+ $severities, "validate always-send" );
+
+is_deeply( Munin::Master::LimitsOld::validate_severities($severities_csv),
+ $severities, "validate always-send (comma separated)" );
+
+is_deeply( Munin::Master::LimitsOld::validate_severities($severities_mix),
+ $severities, "validate always-send (mixed separation and case)" );
+
+is_deeply( Munin::Master::LimitsOld::validate_severities($severities_bad),
+ $severities, "validate always-send (with bad value)" );
+
+is_deeply( Munin::Master::LimitsOld::validate_severities($severities_dup),
+ $severities, "validate always-send (with duplicate value)" );
+
+is_deeply( Munin::Master::LimitsOld::validate_severities([]),
+ [], "validate always-send (with empty list)" );
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/master/www/munin-overview.tmpl
^
|
@@ -58,6 +58,7 @@
</li>
</TMPL_UNLESS></TMPL_LOOP>
</ul>
+ </li>
</TMPL_UNLESS></TMPL_LOOP>
</ul>
<div class="contentpusher"></div>
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/lib/Munin/Plugin/Pgsql.pm
^
|
@@ -427,7 +427,7 @@
$dbname = $self->{defaultdb} if ($self->{defaultdb});
$dbname = $self->wildcard_parameter(0) if ($self->{paramdatabase} && !defined($nowildcard));
$dbname = $ENV{"PGDATABASE"} if ($ENV{"PGDATABASE"});
- $self->{dbh} = DBI->connect("DBI:Pg:dbname=$dbname");
+ $self->{dbh} = DBI->connect("DBI:Pg:dbname=$dbname", '', '', {pg_server_prepare => 0});
unless ($self->{dbh}) {
$self->{connecterror} = "$DBI::errstr";
return 0;
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/node.d.linux/cpuspeed.in
^
|
@@ -90,6 +90,9 @@
if [ -r $c/cpufreq/cpuinfo_max_freq ]; then
MAXHZ=$(cat $c/cpufreq/cpuinfo_max_freq)
+ # Adding 10% to $MAXHZ, to cope with polling jitters
+ # See bug D#615957
+ MAXHZ=$(( $MAXHZ + $MAXHZ / 10 ))
echo "cpu$N.max $MAXHZ"
if [ "$scaleto100" = "yes" ]; then
|
[-]
[+]
|
Changed |
munin-2.0.10.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
+ none unknown rootfs iso9660 squashfs udf romfs ramfs debugfs cgroup_root
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
+ env.exclude none unknown rootfs iso9660 squashfs udf romfs ramfs debugfs cgroup_root
env.warning 92
env.critical 98
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/node.d/asterisk_channels.in
^
|
@@ -9,7 +9,7 @@
The following configuration parameters are used by this plugin
- [asterisk_voicemail]
+ [asterisk_channels]
env.host - hostname to connect to
env.port - port number to connect to
env.username - username used for authentication
@@ -20,7 +20,7 @@
=head2 DEFAULT CONFIGURATION
- [asterisk_voicemail]
+ [asterisk_channels]
env.host 127.0.0.1
env.port 5038
@@ -58,14 +58,9 @@
=cut
+use IO::Socket;
use strict;
-my $ret = undef;
-if (! eval "require Net::Telnet;")
-{
- $ret = "Net::Telnet not found";
-}
-
if ($ARGV[0] and $ARGV[0] eq "config")
{
print "graph_title Asterisk active channels\n";
@@ -83,28 +78,29 @@
my $username = $ENV{'username'};
my $secret = $ENV{'secret'};
-my $pop = new Net::Telnet (Telnetmode => 0);
-$pop->open(Host => $host,
- Port => $port);
+my $pop = new IO::Socket::INET (PeerAddr => $host,
+ PeerPort => $port,
+ Proto => 'tcp');
+die "Could not create socket: $!\n" unless $pop;
## Read connection message.
my $line = $pop->getline;
die $line unless $line =~ /^Asterisk/;
## Send user name.
-$pop->print("Action: login");
-$pop->print("Username: $username");
-$pop->print("Secret: $secret");
-$pop->print("Events: off");
-$pop->print("");
+$pop->print("Action: login\n");
+$pop->print("Username: $username\n");
+$pop->print("Secret: $secret\n");
+$pop->print("Events: off\n");
+$pop->print("\n");
#Response: Success
#Message: Authentication accepted
## Request status of messages.
-$pop->print("Action: command");
-$pop->print("Command: core show channels");
-$pop->print("");
+$pop->print("Action: command\n");
+$pop->print("Command: core show channels\n");
+$pop->print("\n");
my $result;
while (($line = $pop->getline) and ($line !~ /END COMMAND/o))
{
@@ -113,8 +109,8 @@
}
my $nb = (split ' ',$result)[0];
-$pop->print("Action: logoff");
-$pop->print("");
+$pop->print("Action: logoff\n");
+$pop->print("\n");
## Exhaust buffer before closing (to avoid polluting Asterisk's logs)
while ($line = $pop->getline) {}
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/node.d/asterisk_channelstypes.in
^
|
@@ -66,14 +66,9 @@
=cut
+use IO::Socket;
use strict;
-my $ret = undef;
-if (! eval "require Net::Telnet;")
-{
- $ret = "Net::Telnet not found";
-}
-
my @CHANNELS = exists $ENV{'channels'} ? split ' ',$ENV{'channels'} : qw(Zap IAX2 SIP);
if ($ARGV[0] and $ARGV[0] eq "config")
@@ -100,28 +95,29 @@
my $username = $ENV{'username'};
my $secret = $ENV{'secret'};
-my $pop = new Net::Telnet (Telnetmode => 0);
-$pop->open(Host => $host,
- Port => $port);
+my $pop = new IO::Socket::INET (PeerAddr => $host,
+ PeerPort => $port,
+ Proto => 'tcp');
+die "Could not create socket: $!\n" unless $pop;
## Read connection message.
my $line = $pop->getline;
die $line unless $line =~ /^Asterisk/;
## Send user name.
-$pop->print("Action: login");
-$pop->print("Username: $username");
-$pop->print("Secret: $secret");
-$pop->print("Events: off");
-$pop->print("");
+$pop->print("Action: login\n");
+$pop->print("Username: $username\n");
+$pop->print("Secret: $secret\n");
+$pop->print("Events: off\n");
+$pop->print("\n");
#Response: Success
#Message: Authentication accepted
## Request status of messages.
-$pop->print("Action: command");
-$pop->print("Command: core show channels");
-$pop->print("");
+$pop->print("Action: command\n");
+$pop->print("Command: core show channels\n");
+$pop->print("\n");
#Response: Follows
#Channel Location State Application(Data)
@@ -154,8 +150,8 @@
# Logoff
-$pop->print("Action: logoff");
-$pop->print("");
+$pop->print("Action: logoff\n");
+$pop->print("\n");
## Exhaust buffer before closing (to avoid polluting Asterisk's logs)
while ($line = $pop->getline) {}
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/node.d/asterisk_codecs.in
^
|
@@ -71,14 +71,9 @@
=cut
+use IO::Socket;
use strict;
-my $ret = undef;
-if (! eval "require Net::Telnet;")
-{
- $ret = "Net::Telnet not found";
-}
-
my @CODECS = exists $ENV{'codecs'} ? split ' ',$ENV{'codecs'} : qw(gsm ulaw alaw);
my @CODECSX = exists $ENV{'codecsx'} ? split ' ',$ENV{'codecsx'} : qw(0x2 0x4 0x8);
@@ -110,28 +105,29 @@
my $username = $ENV{'username'};
my $secret = $ENV{'secret'};
-my $pop = new Net::Telnet (Telnetmode => 0);
-$pop->open(Host => $host,
- Port => $port);
+my $pop = new IO::Socket::INET (PeerAddr => $host,
+ PeerPort => $port,
+ Proto => 'tcp');
+die "Could not create socket: $!\n" unless $pop;
## Read connection message.
my $line = $pop->getline;
die $line unless $line =~ /^Asterisk/;
## Send user name.
-$pop->print("Action: login");
-$pop->print("Username: $username");
-$pop->print("Secret: $secret");
-$pop->print("Events: off");
-$pop->print("");
+$pop->print("Action: login\n");
+$pop->print("Username: $username\n");
+$pop->print("Secret: $secret\n");
+$pop->print("Events: off\n");
+$pop->print("\n");
#Response: Success
#Message: Authentication accepted
## Request status of messages.
-$pop->print("Action: command");
-$pop->print("Command: sip show channels");
-$pop->print("");
+$pop->print("Action: command\n");
+$pop->print("Command: sip show channels\n");
+$pop->print("\n");
#Response: Follows
#Peer User/ANR Call ID Seq (Tx/Rx) Format
@@ -175,9 +171,9 @@
}
## Request status of messages.
-$pop->print("Action: command");
-$pop->print("Command: iax2 show channels");
-$pop->print("");
+$pop->print("Action: command\n");
+$pop->print("Command: iax2 show channels\n");
+$pop->print("\n");
#Response: Follows
#Channel Peer Username ID (Lo/Rem) Seq (Tx/Rx) Lag Jitter JitBuf Format
@@ -213,8 +209,8 @@
}
# Logoff
-$pop->print("Action: logoff");
-$pop->print("");
+$pop->print("Action: logoff\n");
+$pop->print("\n");
## Exhaust buffer before closing (to avoid polluting Asterisk's logs)
while ($line = $pop->getline) {}
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/node.d/asterisk_meetme.in
^
|
@@ -58,14 +58,9 @@
=cut
+use IO::Socket;
use strict;
-my $ret = undef;
-if (! eval "require Net::Telnet;")
-{
- $ret = "Net::Telnet not found";
-}
-
if ($ARGV[0] and $ARGV[0] eq "config")
{
print "graph_title Asterisk actives conferences\n";
@@ -83,28 +78,29 @@
my $username = $ENV{'username'};
my $secret = $ENV{'secret'};
-my $pop = new Net::Telnet (Telnetmode => 0);
-$pop->open(Host => $host,
- Port => $port);
+my $pop = new IO::Socket::INET (PeerAddr => $host,
+ PeerPort => $port,
+ Proto => 'tcp');
+die "Could not create socket: $!\n" unless $pop;
## Read connection message.
my $line = $pop->getline;
die $line unless $line =~ /^Asterisk/;
## Send user name.
-$pop->print("Action: login");
-$pop->print("Username: $username");
-$pop->print("Secret: $secret");
-$pop->print("Events: off");
-$pop->print("");
+$pop->print("Action: login\n");
+$pop->print("Username: $username\n");
+$pop->print("Secret: $secret\n");
+$pop->print("Events: off\n");
+$pop->print("\n");
#Response: Success
#Message: Authentication accepted
## Request status of messages.
-$pop->print("Action: command");
-$pop->print("Command: meetme list");
-$pop->print("");
+$pop->print("Action: command\n");
+$pop->print("Command: meetme list\n");
+$pop->print("\n");
#Response: Follows
@@ -125,8 +121,8 @@
$start = 1 if ($line =~ /Conf\sNum\s*Parties/o);
}
-$pop->print("Action: logoff");
-$pop->print("");
+$pop->print("Action: logoff\n");
+$pop->print("\n");
## Exhaust buffer before closing (to avoid polluting Asterisk's logs)
while ($line = $pop->getline) {}
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/node.d/asterisk_meetmeusers.in
^
|
@@ -59,14 +59,9 @@
=cut
+use IO::Socket;
use strict;
-my $ret = undef;
-if (! eval "require Net::Telnet;")
-{
- $ret = "Net::Telnet not found";
-}
-
if ($ARGV[0] and $ARGV[0] eq "config")
{
print "graph_title Asterisk conference's users\n";
@@ -85,28 +80,29 @@
my $username = $ENV{'username'};
my $secret = $ENV{'secret'};
-my $pop = new Net::Telnet (Telnetmode => 0);
-$pop->open(Host => $host,
- Port => $port);
+my $pop = new IO::Socket::INET (PeerAddr => $host,
+ PeerPort => $port,
+ Proto => 'tcp');
+die "Could not create socket: $!\n" unless $pop;
## Read connection message.
my $line = $pop->getline;
die $line unless $line =~ /^Asterisk/;
## Send user name.
-$pop->print("Action: login");
-$pop->print("Username: $username");
-$pop->print("Secret: $secret");
-$pop->print("Events: off");
-$pop->print("");
+$pop->print("Action: login\n");
+$pop->print("Username: $username\n");
+$pop->print("Secret: $secret\n");
+$pop->print("Events: off\n");
+$pop->print("\n");
#Response: Success
#Message: Authentication accepted
## Request status of messages.
-$pop->print("Action: command");
-$pop->print("Command: meetme list");
-$pop->print("");
+$pop->print("Action: command\n");
+$pop->print("Command: meetme list\n");
+$pop->print("\n");
my $nb = 0;
@@ -121,8 +117,8 @@
$nb = $1 if $line =~ /MeetMe users:\s(\d)$/;
}
-$pop->print("Action: logoff");
-$pop->print("");
+$pop->print("Action: logoff\n");
+$pop->print("\n");
## Exhaust buffer before closing (to avoid polluting Asterisk's logs)
while ($line = $pop->getline) {}
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/node.d/asterisk_sipchannels.in
^
|
@@ -67,14 +67,9 @@
=cut
+use IO::Socket;
use strict;
-my $ret = undef;
-if (! eval "require Net::Telnet;")
-{
- $ret = "Net::Telnet not found";
-}
-
#Codecs g723, gsm, ulaw, alaw, g726, adpcm, slin, lpc10, g729, speex, ilbc
my @CODECS = exists $ENV{'codecs'} ? split ' ',$ENV{'codecs'} : qw(gsm ulaw alaw);
@@ -108,25 +103,26 @@
my $username = $ENV{'username'};
my $secret = $ENV{'secret'};
-my $pop = new Net::Telnet (Telnetmode => 0);
-$pop->open(Host => $host,
- Port => $port);
+my $pop = new IO::Socket::INET (PeerAddr => $host,
+ PeerPort => $port,
+ Proto => 'tcp');
+die "Could not create socket: $!\n" unless $pop;
## Read connection message.
my $line = $pop->getline;
die $line unless $line =~ /^Asterisk/;
## Send user name.
-$pop->print("Action: login");
-$pop->print("Username: $username");
-$pop->print("Secret: $secret");
-$pop->print("Events: off");
-$pop->print("");
+$pop->print("Action: login\n");
+$pop->print("Username: $username\n");
+$pop->print("Secret: $secret\n");
+$pop->print("Events: off\n");
+$pop->print("\n");
## Request status of messages.
-$pop->print("Action: command");
-$pop->print("Command: sip show channels");
-$pop->print("");
+$pop->print("Action: command\n");
+$pop->print("Command: sip show channels\n");
+$pop->print("\n");
#Response: Follows
#Privilege: Command
@@ -172,8 +168,8 @@
$start = 1 if ($line =~ /Peer/o);
}
-$pop->print("Action: logoff");
-$pop->print("");
+$pop->print("Action: logoff\n");
+$pop->print("\n");
## Exhaust buffer before closing (to avoid polluting Asterisk's logs)
while ($line = $pop->getline) {}
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/node.d/asterisk_sippeers.in
^
|
@@ -69,14 +69,9 @@
#20 sip peers [Monitored: 0 online, 1 offline Unmonitored: 2 online, 17 offline]
# #################################################################################
+use IO::Socket;
use strict;
-my $ret = undef;
-if (! eval "require Net::Telnet;")
-{
- $ret = "Net::Telnet not found";
-}
-
if ($ARGV[0] and $ARGV[0] eq "config")
{
print "graph_title Asterisk sip peers\n";
@@ -107,28 +102,29 @@
my $username = $ENV{'username'};
my $secret = $ENV{'secret'};
-my $pop = new Net::Telnet (Telnetmode => 0);
-$pop->open(Host => $host,
- Port => $port);
+my $pop = new IO::Socket::INET (PeerAddr => $host,
+ PeerPort => $port,
+ Proto => 'tcp');
+die "Could not create socket: $!\n" unless $pop;
## Read connection message.
my $line = $pop->getline;
die $line unless $line =~ /^Asterisk/;
## Send user name.
-$pop->print("Action: login");
-$pop->print("Username: $username");
-$pop->print("Secret: $secret");
-$pop->print("Events: off");
-$pop->print("");
+$pop->print("Action: login\n");
+$pop->print("Username: $username\n");
+$pop->print("Secret: $secret\n");
+$pop->print("Events: off\n");
+$pop->print("\n");
#Response: Success
#Message: Authentication accepted
## Request status of messages.
-$pop->print("Action: command");
-$pop->print("Command: sip show peers");
-$pop->print("");
+$pop->print("Action: command\n");
+$pop->print("Command: sip show peers\n");
+$pop->print("\n");
my ($peers,$monitor_online,$monitor_offline,$unmonitor_online,$unmonitor_offline)=(0,0,0,0,0);
@@ -148,8 +144,8 @@
}
}
-$pop->print("Action: logoff");
-$pop->print("");
+$pop->print("Action: logoff\n");
+$pop->print("\n");
## Exhaust buffer before closing (to avoid polluting Asterisk's logs)
while ($line = $pop->getline) {}
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/node.d/asterisk_voicemail.in
^
|
@@ -64,14 +64,9 @@
=cut
+use IO::Socket;
use strict;
-my $ret = undef;
-if (! eval "require Net::Telnet;")
-{
- $ret = "Net::Telnet not found";
-}
-
if ($ARGV[0] and $ARGV[0] eq "config")
{
print "graph_title Asterisk Voicemail messages\n";
@@ -89,28 +84,29 @@
my $username = $ENV{'username'};
my $secret = $ENV{'secret'};
-my $pop = new Net::Telnet (Telnetmode => 0);
-$pop->open(Host => $host,
- Port => $port);
+my $pop = new IO::Socket::INET (PeerAddr => $host,
+ PeerPort => $port,
+ Proto => 'tcp');
+die "Could not create socket: $!\n" unless $pop;
## Read connection message.
my $line = $pop->getline;
die $line unless $line =~ /^Asterisk/;
## Send user name.
-$pop->print("Action: login");
-$pop->print("Username: $username");
-$pop->print("Secret: $secret");
-$pop->print("Events: off");
-$pop->print("");
+$pop->print("Action: login\n");
+$pop->print("Username: $username\n");
+$pop->print("Secret: $secret\n");
+$pop->print("Events: off\n");
+$pop->print("\n");
#Response: Success
#Message: Authentication accepted
## Request status of messages.
-$pop->print("Action: command");
-$pop->print("Command: voicemail show users");
-$pop->print("");
+$pop->print("Action: command\n");
+$pop->print("Command: voicemail show users\n");
+$pop->print("\n");
#Context Mbox User Zone NewMsg
#default 1234 Example Mailbox 1
@@ -130,8 +126,8 @@
}
# Logoff
-$pop->print("Action: logoff");
-$pop->print("");
+$pop->print("Action: logoff\n");
+$pop->print("\n");
## Exhaust buffer before closing (to avoid polluting Asterisk's logs)
while ($line = $pop->getline) {}
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/node.d/bind9_rndc.in
^
|
@@ -64,6 +64,11 @@
my $querystats = $ENV{querystats} || '/var/run/named.stats';
my %IN;
+# attempt to create log file if it doesn't exist
+if ( ! -r $querystats ) {
+ system("$rndc stats");
+}
+
# open the log file, and get its size
open(my $stats, '<', $querystats) or die "$0: $querystats: $!\n";
my $size = (stat $stats)[7];
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/node.d/mailman.in
^
|
@@ -8,7 +8,13 @@
=head1 CONFIGURATION
-No configuration
+Configuration for this plugin depends on the mailman's settings on the
+system. Here are the defaults:
+
+[mailman]
+ env.logfile /var/log/mailman/post
+ env.libdir /var/lib/mailman
+ env.lister /usr/lib/mailman/bin/list_members
=head1 AUTHOR
@@ -29,10 +35,10 @@
$posts = 0;
$members = 0;
-# System paths (as known to mailman-limacute
-$logfile = "/var/log/mailman/post";
-$libdir = "/var/lib/mailman";
-$lister = "/usr/lib/mailman/bin/list_members";
+# System paths
+$logfile = $ENV{'logfile'} || "/var/log/mailman/post";
+$libdir = $ENV{'libdir'} || "/var/lib/mailman";
+$lister = $ENV{'lister'} || "/usr/lib/mailman/bin/list_members";
if (-f "$logfile.0")
{
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/node.d/snmp__df.in
^
|
@@ -81,14 +81,8 @@
die "# Error: couldn't understand what I'm supposed to monitor.";
}
-# Disk level
-my $hrDeviceType = "1.3.6.1.2.1.25.3.2.1.2."; # Should be iso.3.6.1.2.1.25.3.1.6 (DiskStorage)
-my $hrDiskStorageRemoveble = "1.3.6.1.2.1.25.3.6.1.3."; # Should be false (2).
- # Windows reports 0.
-my $hrDiskStorageCapacity = "1.3.6.1.2.1.25.3.6.1.4."; # Should be more than 0
-
# Partition level
-my $hrPartitionFSIndex = "1.3.6.1.2.1.25.3.7.1.5."; # Should be more than 0
+my $hrFSIndex = "1.3.6.1.2.1.25.3.8.1.1."; # Should be more than 0
my $hrFSMountPoint = "1.3.6.1.2.1.25.3.8.1.2."; # Used to look up filesystem
# Filesystem level
@@ -108,39 +102,17 @@
{
die "Croaking: $error";
}
-
-# First we want to find the harddisks...
-my $correct_capacity = get_by_regex ($session, $hrDiskStorageCapacity, "[1-9]");
-my $correct_type = get_by_regex ($session, $hrDeviceType, "^1.3.6.1.2.1.25.3.1.6\$");
-my $correct_removable = get_by_regex ($session, $hrDiskStorageRemoveble, "^(0|2)\$");
-
-my @keep = ();
-
-foreach my $id (keys %$correct_capacity)
-{
- if (exists $correct_type->{$id} and
- exists $correct_removable->{$id})
- {
- push (@keep, $id);
- }
-}
-
-print "# Kept: ", join (',', @keep), "\n" if $Munin::Plugin::SNMP::DEBUG;
-
-# Then we take a look at the partitions...
+# Take a look at the partitions...
my %partitions;
-foreach my $kept (@keep) # For each disk...
-{
- my $parts = get_by_regex ($session, $hrPartitionFSIndex . "$kept.", "[1-9]");
+my $parts = get_by_regex ($session, $hrFSIndex, "[1-9]");
- foreach my $partition (keys %$parts)
- {
- my $mp = get_single ($session, $hrFSMountPoint . $partition);
- $partitions{$mp}{partition} = $partition;
- print "# Added partition \"$mp\" as $partition...\n" if $Munin::Plugin::SNMP::DEBUG
- }
+foreach my $partition (keys %$parts)
+{
+ my $mp = get_single ($session, $hrFSMountPoint . $partition);
+ $partitions{$mp}{partition} = $partition;
+ print "# Added partition \"$mp\" as $partition...\n" if $Munin::Plugin::SNMP::DEBUG;
}
my $stor_id;
|
[-]
[+]
|
Changed |
munin-2.0.10.tar.bz2/plugins/plugins.history.in
^
|
@@ -344,3 +344,13 @@
pgbouncer_requests
postgres_oldest_prepared_xact_
postgres_prepared_xacts_
+[2.0.1]
+[2.0.2]
+[2.0.3]
+[2.0.4]
+[2.0.5]
+[2.0.6]
+[2.0.7]
+[2.0.8]
+[2.0.9]
+[2.0.10]
|