[-]
[+]
|
Added |
munin.changes
|
|
[-]
[+]
|
Changed |
munin.spec
^
|
|
[-]
[+]
|
Deleted |
munin-1.4.1.tar.bz2/dists/redhat/munin.spec.in
^
|
@@ -1,347 +0,0 @@
-# Macro 'dist' is needed for rhel3 and rhel4. fedora includes it. On fedora,
-# just remove this line, or set it to fc5 or something suitable.
-%define dist rhel4
-
-# Macro 'RHEL' is a conditional for other macros. On fedora, set it to 0.
-%define RHEL 1
-
-# Macro 'perl_vendorlib' is needed for rhel3. rhel4 and fedora includes it.
-# Macro 'usermgmt' needed for a common package. Set this to
-# 'fedora-usermgmt >= 0.7' in fedora, and 'shadow-utils' on rhel.
-# Corresponding macros for groupadd and useradd, and groupdel and userdel
-# are needed. Set these to corresponding commands, like
-# '/usr/sbin/fedora-groupadd' and '/usr/sbin/fedora-useradd' on fedora, and
-# '/usr/sbin/groupadd' and '/usr/sbin/useradd' on rhel
-
-%if %{RHEL}
-%define perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
-%define usermgmt shadow-utils
-%define groupadd /usr/sbin/groupadd -g
-%define useradd /usr/sbin/useradd -u
-%define groupdel /usr/sbin/groupdel
-%define userdel /usr/sbin/userdel
-%else
-%define usermgmt fedora-usermgmt >= 0.7
-%define groupadd /usr/sbin/fedora-groupadd
-%define useradd /usr/sbin/fedora-useradd
-%define groupdel /usr/sbin/fedora-groupdel
-%define userdel /usr/sbin/fedora-userdel
-%endif
-
-Name: munin
-Version: @@VERSION@@
-Release: 0.%{?dist}
-Summary: Network-wide graphing framework (grapher/gatherer)
-License: GPL
-Group: System Environment/Daemons
-URL: http://munin.projects.linpro.no/
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-Source0: http://download.sourceforge.net/sourceforge/munin/%{name}_%{version}.tar.gz
-#Patch0: munin-conf.patch
-BuildArchitectures: noarch
-Requires: perl-HTML-Template
-Requires: perl-Net-Server
-Requires: rrdtool
-Requires: logrotate
-Requires(pre): %{usermgmt}
-Requires(postun): %{usermgmt}
-
-%description
-Munin is a highly flexible and powerful solution used to create graphs of
-virtually everything imaginable throughout your network, while still
-maintaining a rattling ease of installation and configuration.
-
-This package contains the grapher/gatherer. You will only need one instance of
-it in your network. It will periodically poll all the nodes in your network
-it's aware of for data, which it in turn will use to create graphs and HTML
-pages, suitable for viewing with your graphical web browser of choice.
-
-Munin is written in Perl, and relies heavily on Tobi Oetiker's excellent
-RRDtool.
-
-The RHEL package is based on the package from Fedora Extras
-
-%package node
-Group: System Environment/Daemons
-Summary: Network-wide graphing framework (node)
-BuildArchitectures: noarch
-Requires: perl-Net-Server
-Requires: procps >= 2.0.7
-Requires: sysstat
-Requires(pre): %{usermgmt}
-Requires(postun): %{usermgmt}
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/chkconfig
-Requires(preun): /sbin/service
-
-%description node
-Munin is a highly flexible and powerful solution used to create graphs of
-virtually everything imaginable throughout your network, while still
-maintaining a rattling ease of installation and configuration.
-
-This package contains node software. You should install it on all the nodes
-in your network. It will know how to extract all sorts of data from the
-node it runs on, and will wait for the gatherer to request this data for
-further processing.
-
-It includes a range of plugins capable of extracting common values such as
-cpu usage, network usage, load average, and so on. Creating your own plugins
-which are capable of extracting other system-specific values is very easy,
-and is often done in a matter of minutes. You can also create plugins which
-relay information from other devices in your network that can't run Munin,
-such as a switch or a server running another operating system, by using
-SNMP or similar technology.
-
-Munin is written in Perl, and relies heavily on Tobi Oetiker's excellent
-RRDtool.
-
-The RHEL package is based on the package from Fedora Extras
-
-%prep
-%setup -q
-#%patch0 -p1
-
-%build
-rm -rf %{buildroot}
-# htmldoc and html2text are not available for Red Hat. Quick hack with perl:
-# Skip the PDFs.
-perl -pi -e 's,htmldoc munin,cat munin, or s,html(2text|doc),# $&,' Makefile
-perl -pi -e 's,\$\(INSTALL.+\.(pdf|txt) \$\(DOCDIR,# $&,' Makefile
-cp dists/redhat/Makefile.config Makefile.config
-%{__make} build
-
-%install
-
-## Node
-%{__make} DESTDIR=%{buildroot} install-main install-node-non-snmp install-node-plugins install-doc install-man
-
-mkdir -p %{buildroot}/etc/rc.d/init.d
-mkdir -p %{buildroot}/etc/munin/plugins
-mkdir -p %{buildroot}/etc/munin/plugin-conf.d
-mkdir -p %{buildroot}/etc/logrotate.d
-mkdir -p %{buildroot}/var/lib/munin
-mkdir -p %{buildroot}/var/log/munin
-
-#
-# don't enable munin-node by default.
-#
-cat dists/redhat/munin-node.rc | sed -e 's/2345/\-/' > %{buildroot}/etc/rc.d/init.d/munin-node
-chmod 755 %{buildroot}/etc/rc.d/init.d/munin-node
-
-install -m0644 dists/tarball/plugins.conf %{buildroot}/etc/munin/
-install -m0644 dists/tarball/plugins.conf %{buildroot}/etc/munin/plugin-conf.d/munin-node
-install -m0644 dists/debian/munin.logrotate %{buildroot}/etc/logrotate.d/munin
-install -m0644 dists/debian/munin-node.logrotate %{buildroot}/etc/logrotate.d/munin-node
-install -m0644 dists/redhat/sendmail_plugin_conf.d %{buildroot}/etc/munin/plugin-conf.d/sendmail
-
-#
-# remove the Net::SNMP and Sybase plugins for now, as they need perl modules
-# that are not in extras. We can readd them when/if those modules are added.
-#
-rm -f %{buildroot}/usr/share/munin/plugins/pm3users_
-rm -f %{buildroot}/usr/share/munin/plugins/snmp_*
-rm -f %{buildroot}/usr/share/munin/plugins/sybase_space
-
-## Server
-make CONFIG=dists/redhat/Makefile.config \
- DESTDIR=%{buildroot} \
- install-main
-
-mkdir -p %{buildroot}/var/www/html/munin
-mkdir -p %{buildroot}/var/log/munin
-mkdir -p %{buildroot}/etc/cron.d
-
-install -m 0644 dists/redhat/munin.cron.d %{buildroot}/etc/cron.d/munin
-install -m 0644 server/style.css %{buildroot}/var/www/html/munin
-install -m 0644 ChangeLog %{buildroot}%{_docdir}/%{name}-%{version}/ChangeLog
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-#
-# node package scripts
-# uid 18 is the next uid in http://fedoraproject.org/wiki/PackageUserRegistry
-#
-%pre node
-%{groupadd} 18 -r munin &>/dev/null || :
-%{useradd} 18 -r -s /sbin/nologin -d /var/lib/munin -M \
- -c 'Munin user' -g munin munin &>/dev/null || :
-
-%post node
-/sbin/chkconfig --add munin-node
-/usr/sbin/munin-node-configure --shell | sh
-
-%preun node
-test "$1" != 0 || %{_initrddir}/munin-node stop &>/dev/null || :
-test "$1" != 0 || /sbin/chkconfig --del munin-node
-
-%postun node
-test "$1" != 0 || %{userdel} munin &>/dev/null || :
-test "$1" != 0 || %{groupdel} munin &>/dev/null || :
-
-#
-# main package scripts
-# uid 18 is the next uid in http://fedoraproject.org/wiki/PackageUserRegistry
-#
-%pre
-%{groupadd} 18 -r munin &>/dev/null || :
-%{useradd} 18 -r -s /sbin/nologin -d /var/lib/munin -M \
- -c 'Munin user' -g munin munin &>/dev/null || :
-
-%postun
-test "$1" != 0 || %{userdel} munin &>/dev/null || :
-test "$1" != 0 || %{groupdel} munin &>/dev/null || :
-
-%files
-%defattr(-, root, root)
-#%doc %{_docdir}/%{name}-%{version}/README.api
-#%doc %{_docdir}/%{name}-%{version}/README.plugins
-%doc COPYING ChangeLog
-#%doc %{_docdir}/%{name}-%{version}/README-apache-cgi
-%{_bindir}/munin-cron
-%{_bindir}/munin-check
-%{_datadir}/munin/munin-graph
-%{_datadir}/munin/munin-html
-%{_datadir}/munin/munin-limits
-%{_datadir}/munin/munin-update
-%{_datadir}/munin/VeraMono.ttf
-%{perl_vendorlib}/Munin.pm
-/var/www/html/munin/cgi/munin-cgi-graph
-/var/www/html/munin/.htaccess
-/var/www/html/munin/favicon.ico
-%dir /etc/munin/templates
-%dir /etc/munin
-%config(noreplace) /etc/munin/templates/*
-%config(noreplace) /etc/cron.d/munin
-%config(noreplace) /etc/munin/munin.conf
-%config(noreplace) /etc/logrotate.d/munin
-
-%attr(-, munin, munin) %dir /var/lib/munin
-%attr(-, munin, munin) %dir /var/run/munin
-%attr(-, munin, munin) %dir /var/log/munin
-%attr(-, munin, munin) %dir /var/www/html/munin
-%attr(-, root, root) %dir /var/www/html/munin/cgi
-%attr(-, root, root) /var/www/html/munin/style.css
-%doc %{_mandir}/man8/munin-graph*
-%doc %{_mandir}/man8/munin-update*
-%doc %{_mandir}/man8/munin-limits*
-%doc %{_mandir}/man8/munin-html*
-%doc %{_mandir}/man8/munin-cron*
-%doc %{_mandir}/man5/munin.conf*
-
-%files node
-%defattr(-, root, root)
-%config(noreplace) /etc/munin/munin-node.conf
-%config(noreplace) /etc/munin/plugin-conf.d/munin-node
-%config(noreplace) /etc/munin/plugin-conf.d/sendmail
-%config(noreplace) /etc/logrotate.d/munin-node
-/etc/rc.d/init.d/munin-node
-%config(noreplace) /etc/munin/plugins.conf
-%{_sbindir}/munin-run
-%{_sbindir}/munin-node
-%{_sbindir}/munin-node-configure
-%{perl_vendorlib}/Munin/Plugin.pm
-%attr(-, munin, munin) %dir /var/log/munin
-%dir %{_datadir}/munin
-%dir /etc/munin/plugins
-%dir /etc/munin
-%attr(-, munin, munin) %dir /var/lib/munin
-%dir %attr(-, munin, munin) /var/lib/munin/plugin-state
-%{_datadir}/munin/plugins/*
-%doc COPYING README
-#%doc %{_docdir}/%{name}-%{version}/munin-doc.html
-#%doc %{_docdir}/%{name}-%{version}/munin-faq.html
-%doc %{_mandir}/man8/munin-run*
-%doc %{_mandir}/man8/munin-node*
-%doc %{_mandir}/man5/munin-node*
-
-%changelog
-* Wed May 27 2009 Ingvar Hagelund <ingvar@redpill-linpro.com> - 1.3.4
-- Synced the specfile to upstream unstable. Added missing files
-- Probably needs more sanitizing, and sync against Fedora
-
-* Mon Jun 12 2006 Ingvar Hagelund <ingvar@linpro.no> - 1.3-unstable
-- Synced most changes from Fedora package into unstable tree
-- Added a sendmail config file that is RedHat specific
-
-* Thu Jun 01 2006 Ingvar Hagelund <ingvar@linpro.no> - 1.2.4-8rhel4
-- Simple repacking from fc5 to rhel. All kudos to Kevin for
- maintaining the Fedora Package
-
-* Sat Apr 22 2006 Kevin Fenzi <kevin@tummy.com> - 1.2.4-8
-- add patch to remove unneeded munin-nagios in cron.
-- add patch to remove buildhostname in munin.conf (fixes #188928)
-- clean up prep section of spec.
-
-* Fri Feb 24 2006 Kevin Fenzi <kevin@scrye.com> - 1.2.4-7
-- Remove bogus Provides for perl RRDs (fixes #182702)
-
-* Thu Feb 16 2006 Kevin Fenzi <kevin@tummy.com> - 1.2.4-6
-- Readded old changelog entries per request
-- Rebuilt for fc5
-
-* Sat Dec 24 2005 Kevin Fenzi <kevin@tummy.com> - 1.2.4-5
-- Fixed ownership for /var/log/munin in node subpackage (fixes 176529)
-
-* Wed Dec 14 2005 Kevin Fenzi <kevin@tummy.com> - 1.2.4-4
-- Fixed ownership for /var/lib/munin in node subpackage
-
-* Wed Dec 14 2005 Kevin Fenzi <kevin@tummy.com> - 1.2.4-3
-- Fixed libdir messup to allow builds on x86_64
-
-* Mon Dec 12 2005 Kevin Fenzi <kevin@tummy.com> - 1.2.4-2
-- Removed plugins that require Net-SNMP and Sybase
-
-* Tue Dec 6 2005 Kevin Fenzi <kevin@tummy.com> - 1.2.4-1
-- Inital cleanup for fedora-extras
-
-* Thu Apr 21 2005 Ingvar Hagelund <ingvar@linpro.no> - 1.2.3-4
-- Fixed a bug in the iostat plugin
-
-* Wed Apr 20 2005 Ingvar Hagelund <ingvar@linpro.no> - 1.2.3-3
-- Added the missing /var/run/munin
-
-* Tue Apr 19 2005 Ingvar Hagelund <ingvar@linpro.no> - 1.2.3-2
-- Removed a lot of unecessary perl dependencies
-
-* Mon Apr 18 2005 Ingvar Hagelund <ingvar@linpro.no> - 1.2.3-1
-- Sync with svn
-
-* Tue Mar 22 2005 Ingvar Hagelund <ingvar@linpro.no> - 1.2.2-5
-- Sync with release of 1.2.2
-- Add some nice text from the suse specfile
-- Minimal changes in the header
-- Some cosmetic changes
-- Added logrotate scripts (stolen from debian package)
-
-* Sun Feb 01 2004 Ingvar Hagelund <ingvar@linpro.no>
-- Sync with CVS. Version 1.0.0pre2
-
-* Sun Jan 18 2004 Ingvar Hagelund <ingvar@linpro.no>
-- Sync with CVS. Change names to munin.
-
-* Fri Oct 31 2003 Ingvar Hagelund <ingvar@linpro.no>
-- Lot of small fixes. Now builds on more RPM distros
-
-* Wed May 21 2003 Ingvar Hagelund <ingvar@linpro.no>
-- Sync with CVS
-- 0.9.5-1
-
-* Tue Apr 1 2003 Ingvar Hagelund <ingvar@linpro.no>
-- Sync with CVS
-- Makefile-based install of core files
-- Build doc (only pod2man)
-
-* Thu Jan 9 2003 Ingvar Hagelund <ingvar@linpro.no>
-- Sync with CVS, auto rpmbuild
-
-* Thu Jan 2 2003 Ingvar Hagelund <ingvar@linpro.no>
-- Fix spec file for RedHat 8.0 and new version of lrrd
-
-* Wed Sep 4 2002 Ingvar Hagelund <ingvar@linpro.no>
-- Small bugfixes in the rpm package
-
-* Tue Jun 18 2002 Kjetil Torgrim Homme <kjetilho@linpro.no>
-- new package
|
[-]
[+]
|
Deleted |
munin-1.4.1.tar.bz2/resources/solaris-init.d_munin-node.in
^
|
@@ -1,27 +0,0 @@
-#!/sbin/sh
-#
-prog="munin-node"
-path="@@SBINDIR@@"
-
-/usr/bin/mkdir -p @@STATEDIR@@
-
-case "$1" in
-'restart')
- #stop the daemon, then fall through to the start
- /usr/bin/pkill -x $prog
- $path/$prog
- ;;
-'start')
- $path/$prog
- ;;
-
-'stop')
- /usr/bin/pkill -x $prog
- ;;
-
-*)
- echo "Usage: $0 { start | stop | restart }"
- exit 1
- ;;
-esac
-exit 0
|
|
Deleted |
munin-1.4.3.tar.bz2
^
|
|
Deleted |
munin-1.4.4.tar.bz2
^
|
|
Deleted |
munin-1.4.5.tar.bz2
^
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/ChangeLog
^
|
@@ -10,6 +10,360 @@
uploaded to sourceforge in february 2005.
+munin 1.4.6, r3625:4259, 2011-7-7
+
+ 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.
+
+munin 1.4.5, r3379,3611, 2010-5-27
+
+* Apply TLS improvements from r3483 to 1.4-stable branch
+* Fixes for TLS with unverifiable certificates
+* Apply r3451 from trunk: ligne: use the local $DEBUG to toggle debug output,
+ rather than the one in 'main' package.
+* Backport r3444: ligne: fix warnings when running under certain versions of
+ perl, caused by exporting an undefined variable to the environment.
+ Thanks to Aleksandar Lazic (al4711) for the patch.
+* Typo in SNMPv3 code fixes ticket #911
+* Backport r3546 to r3554 from trunk (fix for #912, and more extensive test
+ coverage for Munin::Plugin::SNMP).
+* Fix ticket #928. Adding missing max_cgi_graph_jobs directive to the
+ %legal hash
+* Remove trailing whitespace from 1.4-stable/node directory, as in trunk
+* Ignore the sandbox and Module::Build-generated content, as in trunk
+* Backport r3439: ligne: and add a newline to the error message when there was
+ a plugin exec failure.
+* Backport r3434: ligne: set Net::Server's syslog_ident parameter, so log
+ lines have 'munin-node' as the process name, rather than the significantly
+ less useful 'net_server'. fixes ticket #789.
+* snort_*: clean up autoconf
+* if_: cosmetic fix
+* mysql_: comment typo
+* jmx_: respect JRE_HOME, if configured
+* merge r3406 (multigraph support for munin-node) into 1.4 maintenance branch.
+* sensors_*: podify, document regexes, various bugfixes
+* amavis: prevent a spike in the graph after Amavis is restarted.
+ Thanks to claudius for the patch. fixes ticket #889
+* snmp_netstat: tidy and document
+* snmp_netstat: Fix bug where snmp_netstat undercounts the number
+ of connections
+* uptime: graph should not scale, as it makes it hard to read after 1000
+ days of uptime
+* postgres_users: Usernames fetched from pg_stat_activity need to be
+ distinctified
+* mysql_isam_space: undeprecate, sanity-check mysqlshow output, fix autoconf
+ fix various typos
+* munin_update: Fix bashism
+
+
+
+
+
+munin 1.4.4, r3276,3379, 2010-2-26
+
+* Localization problem in 1.4.1 (closes #781)
+* Sort plugin configuration file order. This ensures some predictability
+ regarding where a configuration setting comes from when multiple files
+ specify the same configuration variables.
+ For details, see debian bug http://bugs.debian.org/564098
+* munin-cgi-graph*: cgi semaphore fix, hopefully cures #834
+* Munin/Master/GraphOld.pm sum+colour fix (closes #731)
+ plugin to connect to a separate munin-node (or other daemon speaking the
+ munin-node protocol) and fetch values from there.
+* munin-update: Fix config line continuation hadling
+* Add patch from munin ticket #828, to suppress "occasional" unknown states
+ to avoid alerts. Thanks to Steve Wilson for the patch!
+* proxy_plugin: New proxy plugin, that makes it possible for a single Munin
+* jmx/Uptime: decimal days, not integer - closes #815
+* nvidia_: fix suggest
+* linux/vserver*: fix autoconf exit codes
+* linux/ip_: RE fix to be able to match IPv6 addresses
+* linux/selinux_avcstat: New plugin from Lars Strand showing selinux stats
+ Taken from Muninexchange. Thanks to Lars!
+* linux/lpar_cpu: A plugin to measure IBM PPC hardware virtualization logical
+ partition CPU usage (made for the platform once called OpenPower)
+* varnish_: backend_unhealthy is a DERIVE value, note that canonical upstream
+ is the varnish project
+* Add simfs" to linux df* plugins ignore list
+* linux/buddyinfo multigraph plugin by Gábor Gombás
+* Remediate patches from Gentoo that never came upstream.
+ Prevents possible output on stderr in plugin linux/iostat_ios and corrects
+ linux/fw_forwarded_local to handle a missing /proc/net/ip_conntrack
+ linux/fw_forwarded_local: need to dereference the _conntrack_file variable
+* linux/diskstats: Upstream update, closes #838 #835 #837
+* linux/ip_: Better matching of IPv6 addresses. Use a single awk command
+ instead of a mix of awk and grep.
+* mysql_: fix graph_base error (Closes #840) Patch from Gábor Gombás
+* mysql_: plugin suggests wrong values (closes #857)
+* linux/selinux_avcstat - exit 0 on autoconf
+* linux/tcp: Add contributed plugin from Tim Small
+* linux/df_abs: multiple filesystem excludes do not work in df_abs
+ Thanks to Daniel Reichelt for the patch!
+* snort*: Add documentation and minor updates
+* multips_memory: correct printing out raw fieldname,
+ instead of clean_fieldname, documentation updates
+* linux/df_abs: Added configuration option to df_abs to Enable/Disable the
+ graph total (The default is on). Thanks to Daniel Reichelt for the patch,
+ submitted at http://bugs.debian.org/567895 - adapted, tested
+ and documented by Tom Feiner
+* snmp__if_multi: Add env.ifTypeOnly filtering, fix multiple buglets
+* mailman: Corrected incorrect use of $MUNIN_PLUGSTATE in mailman plugin
+* amavis: Change amavis mktempfile function to run with backticks instead of
+ $(command) as it doesnt work correctly piping to sed
+* exim_mailstats: exim_mailstats doesnt count Completed properly.
+ Thanks to Wakko Warner for noticing this in http://bugs.debian.org/569621
+* Deprecated tomcat plugins: Fix in to work properly when only one connector
+ is availabe http://bugs.debian.org/543523
+* postfix_mailstats: Fix shell->perl syntax in perl plugin
+* apt: update description with a pointer to apt_all
+* jmx/GCCount - fix negative counts on jvm restart (closes #852)
+* ping_: fix obvious typo (closes #854)
+
+
+munin 1.4.3, r3232:3274, 2009-12-30
+
+* linux/diskstats: New multigraph plugin to replace diskstat_ - more
+ tidy and more efficient. Thanks to Michael Renner for the
+ deveopment of this and porting to multigraph
+* linux/cpuspeed: Specify "average" for the speed, switch to printf to
+ get numbers printed in full, E notation looses significant digits
+ and there are whispers of a bug in the E notation handling in
+ munin-update
+* Make munin-update --nofork not die when nodes are unavailable. Closes #800.
+* hddtemp_smartctl: Multiple enhancements:
+ - document how to set type_ for sata drives
+ - document need to run as a user with device access
+ - Support some debugging
+ - detect if smartctl fails
+ - detect if no recognized temperature output is present
+* lpstat: Warn if the predefined $lpstat executable is not executable,
+ Make lpstat path configurable and search for it in likely places if
+ it's not set. Patch from Lupe - thanks! Closes #826.
+* dhcpd3: Only emit .max if the .max is valid. Document a bug from
+ the trac - adresses but doe not close #829. Patches for a complete
+ fix welcome.
+* More specific test for watermark feature (1.2.13 required)
+* Make 0755 default permissions for $DBDIR and make consistent in
+ Makefile and munin-check
+* Fix issue where far too many mails would be sent by munin-limits
+ (fixes #795)
+* munin_stats: Fix a typo in the "no"-message that made
+ munin-node-configure reject it.
+* linux/yum: Enhance statefile error message. Update to use M::C::Defaults
+* linux/vserver_*: Add autoconfiguration (patch from #811 submitted by
+ proppy, closes ticket).
+* munin-update: Make true check into defined check to avoid dereferencing undefs
+* Munin::Plugin:
+ - Better documentation of new default state file name.
+ - In need_multigraph, if run from a tty with "config" or no arguments
+ advice to use munin-run and exit.
+* mailman: User contributed patch to make plugin work better the first
+ time. Also replaced "exit $n" with "die" with good error messages.
+ Untested but perl says syntax ok.
+* hddtemp_smartctl: Added chomp, as it won't work with a newline at
+ the end. Thanks to Ingvar Hagelund for pointing this out
+
+* munin-update: Suppress warning "Error reading includedir directory"
+ in case the includedir is empty (which is the case in new
+ installations. This caused cron to send these messages all the time
+* Munin::Master::GraphOld: warn_min/warn_max typo fix
+
+
+munin 1.4.2, r3167:3231, 2009-12-16
+
+* Munin::Plugin::Pgslq: Clean the fieldnames before returning them, so
+ we don't generate invalid data with for example a dash in the
+ database name.
+* jmx_: Add authentication support, fix exceptions in various memory
+ related parts, refactor connection negotiation to one central
+ connection class, add default connection info for jmx_, so we
+ actually are a bit autoconfy
+* munin_update: Update to work correctly with 1.4, document and enhance a bit
+* munin_stats: Provide better graph_info and set some warning and
+ critical levels at 4 minutes and 4m45s
+* Improove colors contrast in jmx plugins which have Max area, to make
+ them more readable + fix some indentation
+* ntp_offset: make info into graph_info
+* Munin-(node|run): Make group name resolution lazy, enhance error
+ messages and reinstate the group foo,(bar) syntax
+* munin-(node|run): Set umask to 0002 so that state files are group writable
+
+ INSTALLERS: chmod g+w on the files in your state directory
+ (/var/opt/munin/plugin-state in a default install)
+
+* multips_memory: New plugin graphing the sum of the memory usage of
+ different processes matched by regular expression.
+* Perl modules should not have x bit set: Remove on *Old.pm
+* munin-update: Make I/O timeout fatal to terminate
+ munin-update<->munin-node communication otherwise the two parties
+ falls out of phase (or we need to introduce a RESET command or close
+ and reopen node connection, but I don't want to do that, esp. not
+ now). Handle the fallout of making it fatal.
+* linux/load and linux/cpu: Correct warning/critical documentation
+* postgres_querylength_: Fix query that can never have worked...
+* Switch fonts to DejaVuSans og DejaVuSansMono. Vera is now obsoleted
+ by DejaVu in most contexts.
+
+ INSTALLERS: On platforms with RRD 1.3 the fonts need not be removed
+ and no paths need to be installed as long as the DejaVuSans font
+ family is installed.
+
+* Reorder somewhat to get lines on top of areas
+* Patch from blueyed to make munin-*cgi-graph work
+* snmp__if_multi: Only set .max if the interface speed has been obtained
+* mysql_: always exit 0 on autoconf
+* dhcpd3: re-fix deprecated non-0 exit on autoconf
+* add freeradius plugins from Alan DeKok and adapt better for munin-trunk
+* linux/df_inode: Small pod correction and add debugfs to df_inode exclude list
+* linux/df: Added debugfs to df.in exclude list
+* Apache plugins: Exit with proper error of LWP::UserAgent not
+ found. This can happen if someone configured the plugin manually, or
+ if the plugin is installed when LWP::Useragent is installed and
+ passes autoconf, but sometime later LWP::Useragent is
+ removed. Without this patch the error message is confusing: Cant
+ locate object method "new" via package "LWP::UserAgent" This also
+ keeps autoconf output sane even if LWP::Useragent is not available
+* linux/ip_: Actually support ipv6. Munin does actually handle : in
+ plugin names right
+* make rpm does not work and won't work. Remove makefile target and
+ spec file. Might be added back later.
+* There are no new autoconfiguring plugins in this release.
+
munin (1.4.1, r3116:3166, 2009-12-04)
* munin-node: Introduce a select loop to read from plugin
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/ChangeLog.head
^
|
@@ -0,0 +1,138 @@
+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.6.tar.bz2/Checklist
^
|
@@ -2,19 +2,18 @@
* is there any "FIX" in: ChangeLog, INSTALL, Announce?
- * Does make node-monkeywrench run without abnormal abortions?
* Is .htaccess installed?
* rm -f /etc/munin/plugins/*
Does munin-node-configure -d show any autoconf errors?
- * Update node/plugins.history.in:
+ * Update plugins/plugins.history.in:
- 1. cd plugins
+ 1. cd plugins
2. Figure out which r the previous tag was at and do this (r910 was
1.3.2 and r1234 is head)
svn --verbose log -r910:1234 | fgrep node.d | grep -w A |
- cut -d/ -f 4- | sed 's/^node.d.//'
+ cut -d/ -f 4- | sed 's/^node\.d\.//'
3. Check if the listed plugins are still present (or moved):
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/Makefile
^
|
@@ -2,7 +2,7 @@
#
# Gnu make only. Seriously.
#
-# $Id: Makefile 3137 2009-12-01 10:52:11Z janl $
+# $Id: Makefile 3265 2009-12-29 16:03:49Z janl $
# Defaults/paths. Allows $(CONFIG) to be overrided by
# make command line
@@ -84,6 +84,7 @@
mkdir -p $(CGIDIR)
$(CHOWN) $(USER) $(HTMLDIR) $(DBDIR)
+ $(CHMOD) 0755 $(DBDIR)
for p in master/www/*.tmpl master/www/*.png master/www/*.css resources/favicon.ico; do \
$(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/ ; \
@@ -94,7 +95,8 @@
done
$(INSTALL) -m 0644 master/www/definitions.html $(CONFDIR)/templates/
- $(INSTALL) -m 0755 master/VeraMono.ttf $(LIBDIR)/
+ $(INSTALL) -m 0755 master/DejaVuSansMono.ttf $(LIBDIR)/
+ $(INSTALL) -m 0755 master/DejaVuSans.ttf $(LIBDIR)/
test -f $(HTMLDIR)/.htaccess || $(INSTALL) -m 0644 build/master/www/munin-htaccess $(HTMLDIR)/.htaccess
test -f "$(CONFDIR)/munin.conf" || $(INSTALL) -m 0644 build/master/munin.conf $(CONFDIR)/
@@ -299,24 +301,6 @@
tar: tar-pre
GZIP=-9 tar -C .. --dereference --exclude .svn -cvzf ../munin-$(RELEASE).tar.gz munin-$(VERSION)/
-rpm-pre:
- (! grep MAINTAINER Makefile.config)
- @for file in `find dists/redhat/ -type f -name '*.in'`; do \
- destname=`echo $$file | sed 's/.in$$//'`; \
- echo Generating $$destname..; \
- sed -e 's|@@VERSION@@|$(VERSION)|g' \
- $$file > $$destname; \
- done
- -cp dists/tarball/plugins.conf .
-# (cd ..; ln -s munin munin-$(VERSION))
-
-rpm: rpm-pre
- tar -C .. --dereference --exclude .svn -cvzf ../munin_$(RELEASE).tar.gz munin-$(VERSION)/
- (cd ..; rpmbuild -tb munin_$(RELEASE).tar.gz)
-
-rpm-src: rpm-pre
- tar -C .. --dereference --exclude .svn -cvzf ../munin-$(RELEASE).tar.gz munin-$(VERSION)/
- (cd ..; rpmbuild -ts munin-$(RELEASE).tar.gz)
suse-pre:
(! grep MAINTAINER Makefile.config)
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/RELEASE
^
|
@@ -1 +1 @@
-1.4.1
+1.4.6
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/UPGRADING
^
|
@@ -74,3 +74,31 @@
renamed back when you upgrade the next time). Note that the plugins
will change names as you upgrade and auto-configure your nodes, not
when you upgrade the munin-master.
+
+
+Users of Munin 1.2 in combination with NMSes
+--------------------------------------------
+
+There are two issues that have been reported.
+
+Users of Munin in combination with Nagios have reported that because
+some graphs have changed their "graph_title" setting this
+dis-associates the tests from the right nagios checks.
+
+Also some plugins do not have default warning and critical levels set
+any more (e.g. "load") because the opinions on what is "normal" load
+differs widely. This means that the plugins will not send warning and
+critical events to contacts any more. The warning and critical levels
+should be settable for all of these plugins, please use the command
+"munindoc <plugin>" on the host where the plugin is installed to see
+how to set these levels.
+
+Too audit the differences in warning and critical levels you can make
+a copy of the munin file called "datafile" before upgrading (or get
+one from backup), and use egrep to get a listing of the settings prior
+to update:
+
+ egrep '(warning|critical)' datafile.old
+
+and again on the post-upgrade datafile to compare the lists so you can
+specify the ones you need.
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/common/lib/Munin/Common/Config.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Common::Config;
-# $Id: Config.pm 3139 2009-12-01 13:16:06Z janl $
+# $Id: Config.pm 3872 2010-08-20 12:12:55Z janl $
use warnings;
use strict;
@@ -31,13 +31,14 @@
"graph_period", "cgiurl_graph", "cgiurl", "tls",
"service_order", "category_order", "version",
"tls_certificate", "tls_private_key", "tls_pem",
- "tls_verify_certificate", "tls_verify_depth",
+ "tls_verify_certificate", "tls_verify_depth", "tls_match",
"tls_ca_certificate", "graph_data_size", "colour",
"graph_printf", "ok", "unknown", "palette", "realservname",
"cdef_name", "graphable", "process", "realname",
"onlynullcdef", "group_order", "pipe", "pipe_command",
- "unknown_limit", "notify_countdown", "dropdownlimit",
- "max_graph_jobs", "munin_cgi_graph_jobs" );
+ "unknown_limit", "num_unknowns", "dropdownlimit",
+ "max_graph_jobs", "max_cgi_graph_jobs", "munin_cgi_graph_jobs",
+ "max_html_jobs", );
my %bools = map { $_ => 1} qw(yes no true false on off 1 0);
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/common/lib/Munin/Common/TLS.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Common::TLS;
-# $Id: TLS.pm 2431 2009-09-16 10:04:17Z janl $
+# $Id: TLS.pm 3999 2010-11-12 19:35:38Z bldewolf $
use warnings;
use strict;
@@ -32,6 +32,7 @@
tls_priv => $args->{tls_priv} || '',
tls_vdepth => $args->{tls_vdepth} || 0,
tls_verify => $args->{tls_verify} || 0,
+ tls_match => $args->{tls_match} || '',
};
for my $args_key (keys %$args) {
@@ -209,14 +210,15 @@
Net::SSLeay::CTX_set_verify_depth ($self->{tls_context}, $self->{tls_vdepth});
my $err = &Net::SSLeay::print_errs("");
if (defined $err and length $err) {
- $self->{logger}("[WARNING] in set_verify_depth: $err");
+ $self->{logger}("[WARNING] in set_verify_depth: $err");
}
Net::SSLeay::CTX_set_verify ($self->{tls_context},
- &Net::SSLeay::VERIFY_PEER,
+ $self->{tls_verify} ? &Net::SSLeay::VERIFY_PEER :
+ &Net::SSLeay::VERIFY_NONE,
$self->_tls_verify_callback($tls_verified));
$err = &Net::SSLeay::print_errs("");
if (defined $err and length $err) {
- $self->{logger}("[WARNING] in set_verify: $err");
+ $self->{logger}("[WARNING] in set_verify: $err");
}
return 1;
@@ -229,7 +231,6 @@
return sub {
my ($ok, $subj_cert, $issuer_cert, $depth,
$errorcode, $arg, $chain) = @_;
- # $self->{logger}("ok is ${ok}");
$tls_verified->{"level"}++;
@@ -270,7 +271,7 @@
$p=Net::SSLeay::get_cipher_list($self->{tls_session},$i);
} while $p;
$cipher_list .= '\n';
- $self->{logger}("[TLS] Available cipher list: $cipher_list.");
+ $self->{logger}("[TLS] Available cipher list: $cipher_list.") if $self->{DEBUG};
}
@@ -280,12 +281,12 @@
Net::SSLeay::set_rfd($self->{tls_session}, $self->{read_fd});
my $err = &Net::SSLeay::print_errs("");
if (defined $err and length $err) {
- $self->{logger}("TLS Warning in set_rfd: $err");
+ $self->{logger}("[TLS] Warning in set_rfd: $err");
}
Net::SSLeay::set_wfd($self->{tls_session}, $self->{write_fd});
$err = &Net::SSLeay::print_errs("");
if (defined $err and length $err) {
- $self->{logger}("TLS Warning in set_wfd: $err");
+ $self->{logger}("[TLS] Warning in set_wfd: $err");
}
}
@@ -293,7 +294,7 @@
sub _accept_or_connect {
my ($self, $tls_verified) = @_;
- $self->{logger}("Accept/Connect: $self->{private_key_loaded}, " . $self->_use_key_if_present()) if $self->{DEBUG};
+ $self->{logger}("[TLS] Accept/Connect: $self->{private_key_loaded}, " . $self->_use_key_if_present()) if $self->{DEBUG};
my $res;
if ($self->_use_key_if_present()) {
$res = Net::SSLeay::accept($self->{tls_session});
@@ -301,7 +302,7 @@
else {
$res = Net::SSLeay::connect($self->{tls_session});
}
- $self->{logger}("Done Accept/Connect") if $self->{DEBUG};
+ $self->{logger}("[TLS] Done Accept/Connect") if $self->{DEBUG};
my $err = &Net::SSLeay::print_errs("");
if (defined $err and length $err)
@@ -319,11 +320,21 @@
Net::SSLeay::CTX_free ($self->{tls_context});
$self->{tls_session} = undef;
}
+ elsif ($self->{"tls_match"} and
+ Net::SSLeay::dump_peer_certificate($self->{tls_session}) !~ /$self->{tls_match}/)
+ {
+ $self->{logger}("[ERROR] Could not match pattern \"" . $self->{tls_match} .
+ "\" in dump of certificate.");
+ $self->_on_unmatched_cert();
+ Net::SSLeay::free ($self->{tls_session});
+ Net::SSLeay::CTX_free ($self->{tls_context});
+ $self->{tls_session} = undef;
+ }
else
{
- $self->{logger}("[TLS] TLS enabled.");
- $self->{logger}("[TLS] Cipher `" . Net::SSLeay::get_cipher($self->{tls_session}) . "'.");
- $self->{logger}("[TLS] client cert: " . Net::SSLeay::dump_peer_certificate($self->{tls_session}));
+ $self->{logger}("[TLS] TLS enabled.") if $self->{DEBUG};
+ $self->{logger}("[TLS] Cipher `" . Net::SSLeay::get_cipher($self->{tls_session}) . "'.") if $self->{DEBUG};
+ $self->{logger}("[TLS] client cert: " . Net::SSLeay::dump_peer_certificate($self->{tls_session})) if $self->{DEBUG};
}
}
@@ -349,6 +360,8 @@
# Redefine in sub class if needed
sub _on_unverified_cert {}
+# Redefine in sub class if needed
+sub _on_unmatched_cert {}
sub read {
my ($self) = @_;
@@ -356,19 +369,16 @@
croak "Tried to do an encrypted read, but a TLS session is not started"
unless $self->session_started();
- local $_;
-
- eval { $_ = Net::SSLeay::read($self->{tls_session}); };
+ my $read = Net::SSLeay::read($self->{tls_session});
my $err = &Net::SSLeay::print_errs("");
if (defined $err and length $err) {
- $self->{logger}("TLS Warning in read: $err");
- return;
+ $self->{logger}("[TLS] Warning in read: $err");
+ return undef;
}
- if($_ eq '') { undef $_; } #returning '' signals EOF
-
- $self->{logger}("DEBUG: < $_") if $self->{DEBUG};
+ undef $read if($read eq ''); # returning '' signals EOF
- return $_;
+ $self->{logger}("DEBUG: < $read") if $self->{DEBUG} && defined $read;
+ return $read;
}
@@ -380,10 +390,10 @@
$self->{logger}("DEBUG: > $text") if $self->{DEBUG};
- eval { Net::SSLeay::write($self->{tls_session}, $text); };
+ Net::SSLeay::write($self->{tls_session}, $text);
my $err = &Net::SSLeay::print_errs("");
if (defined $err and length $err) {
- $self->{logger}("TLS Warning in write: $err");
+ $self->{logger}("[TLS] Warning in write: $err");
return 0;
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/dists/debian/README
^
|
@@ -1,6 +1,22 @@
-For Debian packaging and init scripts, trunk/dists/debian is deprecated.
+For Debian packaging trunk/dists/debian is _deprecated_.
A branch for svn-buildpackage has been created at branches/debian,
with subdirectories for each release codename:
svn ls svn://munin.projects.linpro.no/munin/branches/debian
+
+This works with using released tarballs which are available in
+munin/branches/debian/$codename/tarballs/
+
+############################################################################
+
+For working with munin SVN trunk, the easiest way is to checkout
+squeeze/trunk/debian in the munin trunk directory as debian:
+
+$ svn co http://munin.projects.linpro.no/svn/munin/trunk/ munin-trunk
+$ cd munin-trunk
+$ svn co http://munin.projects.linpro.no/svn/munin/branches/debian/squeeze/trunk/debian/ debian
+
+Now dpkg-buildpackage should work flawlessly, but as this is trunk, it might
+not :-)
+
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/dists/sunos/README
^
|
@@ -1 +1 @@
-See also resources/solaris-init.d_munin-node for a init.d script
+See also resources/solaris-smf/ for SMF manifest and startup script
|
|
Added |
munin-1.4.6.tar.bz2/master/DejaVuSans.ttf
^
|
|
Added |
munin-1.4.6.tar.bz2/master/DejaVuSansMono.ttf
^
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/_bin/munin-cgi-graph.in
^
|
@@ -17,7 +17,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: munin-cgi-graph.in 3141 2009-12-01 13:18:11Z janl $
+# $Id: munin-cgi-graph.in 3960 2010-10-24 17:38:36Z feiner.tom $
#
# Please see http://munin.projects.linpro.no/wiki/CgiHowto for how to
# use this, and how to convert it to fastcgi which will improve speed.
@@ -25,14 +25,15 @@
use RRDs;
use Munin::Master::Utils;
+use Munin::Common::Defaults;
use strict;
use IO::Handle;
use Date::Manip;
use POSIX qw(strftime);
use IPC::SysV qw(IPC_CREAT);
-my $GRAPHER = "@@LIBDIR@@/munin-graph";
-my $conffile = "@@CONFDIR@@/munin.conf";
+my $GRAPHER = "$Munin::Common::Defaults::MUNIN_LIBDIR/munin-graph";
+my $conffile = "$Munin::Common::Defaults::MUNIN_CONFDIR/munin.conf";
my %TIMES = ( "day" => ["--noweek", "--nomonth", "--noyear", "--nosumweek", "--nosumyear"],
"week" => ["--noday", "--nomonth", "--noyear", "--nosumweek", "--nosumyear"],
@@ -87,7 +88,7 @@
# At this time the file exists. But may be old. Or not.
my @stats = stat ($filename);
-my $last_modified = strftime ("%a, %d %b %Y %H:%M:%S %Z", localtime ($stats[9]));
+my $last_modified = strftime ("%a, %d %b %Y %H:%M:%S GMT", gmtime ($stats[9]));
# "Expires" has to use last modified time as base:
my $expires = strftime ("%a, %d %b %Y %H:%M:%S GMT",
gmtime($stats[9]+($period{$scale}-($stats[9]%$period{$scale}))));
@@ -107,9 +108,12 @@
@stats = stat ($filename) unless @stats;
-$last_modified //= strftime ("%a, %d %b %Y %H:%M:%S %Z", localtime ($stats[9]));
-$expires //= strftime ("%a, %d %b %Y %H:%M:%S GMT",
- gmtime($stats[9]+($period{$scale}-($stats[9]%$period{$scale}))));
+$last_modified = strftime ("%a, %d %b %Y %H:%M:%S GMT", gmtime ($stats[9]))
+ unless defined($last_modified);
+
+$expires = strftime ("%a, %d %b %Y %H:%M:%S GMT",
+ gmtime($stats[9]+($period{$scale}-($stats[9]%$period{$scale}))))
+ unless defined($expires);
print "Content-Type: image/png\n";
print "Expires: ", strftime ("%a, %d %b %Y %H:%M:%S GMT", gmtime(time+($period{$scale}-($time%$period{$scale})))), "\n";
@@ -126,9 +130,9 @@
# Fox kindly submitted a patch to convert to SysV IPC semaphores.
# Lovely! (ticket #499).
- if(!defined($semid)) {
- semget($IPC_KEY, 0, 0 );
+ $semid = semget($IPC_KEY, 0, 0 );
+ if(!defined($semid)) {
# Or create it if needed
$semid = semget($IPC_KEY, 1 , oct(666) | IPC_CREAT );
@@ -302,6 +306,7 @@
my $IN;
sem_get();
+ # Note: This open is an implicit fork
if (! open ($IN, "-|")) {
%ENV=();
exec @params;
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/_bin/munin-check.in
^
|
@@ -155,7 +155,7 @@
norec=yes owner_ok @@LOGDIR@@ @@USER@@
norec=yes owner_ok @@DBDIR@@ @@USER@@
-norec=yes perm_ok @@DBDIR@@ 744
+norec=yes perm_ok @@DBDIR@@ 755
for dir in @@DBDIR@@/datafile @@DBDIR@@/limits \
@@DBDIR@@/*.stats; do
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/_bin/munin-fastcgi-graph.in
^
|
@@ -17,13 +17,14 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
-# $Id: munin-fastcgi-graph.in 3141 2009-12-01 13:18:11Z janl $
+# $Id: munin-fastcgi-graph.in 3960 2010-10-24 17:38:36Z feiner.tom $
#
#
use RRDs;
use Munin::Master::Utils;
+use Munin::Common::Defaults;
use strict;
use IO::Handle;
use Date::Manip;
@@ -31,8 +32,8 @@
use IPC::SysV qw(IPC_CREAT);
use CGI::Fast;
-my $GRAPHER = "@@LIBDIR@@/munin-graph";
-my $conffile = "@@CONFDIR@@/munin.conf";
+my $GRAPHER = "$Munin::Common::Defaults::MUNIN_LIBDIR/munin-graph";
+my $conffile = "$Munin::Common::Defaults::MUNIN_CONFDIR/munin.conf";
my %TIMES = ( "day" => ["--noweek", "--nomonth", "--noyear", "--nosumweek", "--nosumyear"],
"week" => ["--noday", "--nomonth", "--noyear", "--nosumweek", "--nosumyear"],
@@ -97,7 +98,7 @@
# At this time the file exists. But may be old. Or not.
my @stats = stat ($filename);
- my $last_modified = strftime ("%a, %d %b %Y %H:%M:%S %Z", localtime ($stats[9]));
+ my $last_modified = strftime ("%a, %d %b %Y %H:%M:%S GMT", gmtime ($stats[9]));
# "Expires" has to use last modified time as base:
my $expires = strftime ("%a, %d %b %Y %H:%M:%S GMT",
gmtime($stats[9]+($period{$scale}-($stats[9]%$period{$scale}))));
@@ -115,10 +116,10 @@
draw:
@stats = stat ($filename) unless @stats;
- $last_modified //= strftime ("%a, %d %b %Y %H:%M:%S %Z", localtime ($stats[9]));
+ $last_modified = strftime ("%a, %d %b %Y %H:%M:%S GMT", gmtime ($stats[9])) unless defined($last_modified);
# "Expires" has to use last modified time as base:
- $expires //= strftime ("%a, %d %b %Y %H:%M:%S GMT",
- gmtime($stats[9]+($period{$scale}-($stats[9]%$period{$scale}))));
+ $expires = strftime ("%a, %d %b %Y %H:%M:%S GMT",
+ gmtime($stats[9]+($period{$scale}-($stats[9]%$period{$scale})))) unless defined ($expires);
print "Content-Type: image/png\n";
print "Expires: ", $expires, "\n";
@@ -131,9 +132,9 @@
# END FAST-CGI LOOP
sub sem_setup {
- if(!defined($semid)) {
- semget($IPC_KEY, 0, 0 );
+ $semid = semget($IPC_KEY, 0, 0 );
+ if(!defined($semid)) {
# Or create it if needed
$semid = semget($IPC_KEY, 1 , oct(666) | IPC_CREAT );
@@ -182,7 +183,7 @@
my $service = shift;
my $scale = shift;
- return "$config->{'htmldir'}/$domain/$name-$service-$scale.png";
+ return "$config->{'htmldir'}/$domain/$name/$service-$scale.png";
}
@@ -303,6 +304,7 @@
my @params = ($GRAPHER);
push @params, @$scale;
push @params, "--skip-locking", "--skip-stats", "--nolazy";
+ push @params, "--list-images";
push @params, "--host", $host, "--service", $serv;
push @params, "STDERR>&STDOUT";
@@ -310,11 +312,13 @@
my $IN;
sem_get();
+ # Note: This open is an implicit fork
if (! open ($IN, "-|")) {
%ENV=();
exec @params;
}
$file = join (' ', <$IN>);
+ $file =~ s/\n$//;
close ($IN);
sem_release();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/_bin/munin-update.in
^
|
@@ -3,7 +3,7 @@
use warnings;
use strict;
-# $Id: munin-update.in 3088 2009-11-26 09:55:24Z feiner.tom $
+# $Id: munin-update.in 3236 2009-12-18 06:25:03Z feiner.tom $
use English qw(-no_match_vars);
use Getopt::Long;
@@ -53,8 +53,7 @@
my $DIR;
opendir($DIR, $dirname) or
WARN "[Warning] Could not open includedir directory $dirname: $OS_ERROR\n";
- my @files = grep { ! /^\.|~$/ } readdir($DIR) or
- WARN "[Warning] Error reading includedir directory $dirname: $OS_ERROR\n";
+ my @files = grep { ! /^\.|~$/ } readdir($DIR);
closedir($DIR);
@files = map { $_ = $dirname.'/'.$_; } (sort @files);
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/doc/munin.conf.pod.in
^
|
@@ -107,7 +107,7 @@
=item B<local_address> I<value>
The local address to connect any node from in case the master has
-several IP interfaces. This can be overriden by a group or global
+several IP interfaces. This can be overridden by a group or global
directive. Without this directive Munins traffic will originate from
the master server according to the IP routing table.
@@ -125,7 +125,7 @@
=item B<max_cgi_graph_jobs> <value>
-This directiuve specifies the maximum number of concurrent
+This directive specifies the maximum number of concurrent
munin-cgi-graph jobs. The web server can start a high number of
munin-cgi-graph jobs which we can't stop, but munin-cgi-graph will
throttle down how many rrdgraph calls will be running at the same time
@@ -174,6 +174,27 @@
willing to go to reach a known, trusted CA when verifying a
certificate. Default is C<5>. Affects: munin-update.
+=item B<tls_match> <value>
+
+This directive, if defined, searches a dump of the certificate provided by the
+remote host for the given regex. The dump of the certificate is two lines of
+the form:
+
+ Subject Name: /C=c/ST=st/L=l/O=o/OU=ou/CN=cn/emailAddress=email
+ Issuer Name: /C=c/ST=st/O=o/OU=ou/CN=cn/emailAddress=email
+
+So, for example, one could match the subject distinguished name by the directive:
+
+ tls_match Subject Name: /C=c/ST=st/L=l/O=o/OU=ou/CN=cn/emailAddress=email
+
+Note that the fields are dumped in the order they appear in the certificate.
+It's best to view the dump of the certificate by running munin-update in debug
+mode and reviewing the logs.
+
+Unfortunately, due to the limited functionality of the SSL module in use, it is
+not possible to provide finer-grained filtering. By default this value is not
+defined. Affects: munin-update.
+
=item FIXME: This section MAY be complete, it may be missing a directive or two.
=back
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/lib/Munin/Master/Config.pm
^
|
@@ -2,7 +2,7 @@
use base qw(Munin::Common::Config);
-# $Id: Config.pm 3052 2009-11-23 16:47:15Z janl $
+# $Id: Config.pm 4084 2011-01-14 10:31:54Z jo $
# Notes about config data structure:
#
@@ -148,7 +148,7 @@
local_address => 0,
logdir => $Munin::Common::Defaults::MUNIN_LOGDIR,
max_processes => $MAXINT,
- rundir => '/tmp',
+ rundir => $Munin::Common::Defaults::MUNIN_STATEDIR,
timeout => 180,
tls => 'disabled',
tls_ca_certificate => "$Munin::Common::Defaults::MUNIN_CONFDIR/cacert.pem",
@@ -483,19 +483,19 @@
$self->_strip_comment($line);
$self->_trim($line);
- if ( !length($line) ) {
- next;
- }
-
# Handle continuation lines (ending in \)
if ($line =~ s|\\$||) {
$continuation .= $line;
next;
} elsif ($continuation) {
- $line = $continuation;
+ $line = $continuation . $line;
$continuation = '';
}
-
+
+ # This must be handled after continuation hadling otherwise
+ # empty lines will be ignored in continuation context.
+ next if !length($line);
+
# Group/host/service configuration is saved for later persual.
# Everything else is saved at once. Note that _trim removes
# leading whitespace so section changes can only happen if a new
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/lib/Munin/Master/GraphOld.pm
^
|
@@ -28,7 +28,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-$Id: GraphOld.pm 3145 2009-12-02 10:53:55Z janl $
+$Id: GraphOld.pm 3985 2010-11-08 12:25:47Z ssm $
=end comment
@@ -495,6 +495,10 @@
munin_get($service->{$field}, "draw"));
munin_set_var_loc(
$service,
+ [$last_name, "colour"],
+ munin_get($service->{$field}, "colour"));
+ munin_set_var_loc(
+ $service,
[$last_name, "label"],
munin_get($service->{$field}, "label"));
munin_set_var_loc(
@@ -638,6 +642,7 @@
# Make my graphs
my $sname = munin_get_node_name($service);
+ my $skeypath = munin_get_keypath($service);
my $service_time = Time::HiRes::time;
my $lastupdate = 0;
my $now = time;
@@ -993,7 +998,7 @@
? "#ff0000"
: $COLOUR[($field_count - 1) % @COLOUR]));
}
- if (defined($warn_max) and $warn_min ne '') {
+ if (defined($warn_max) and $warn_max ne '') {
unshift(
@rrd,
"HRULE:"
@@ -1090,24 +1095,10 @@
# DEBUG "[DEBUG] Picture filename: $picfilename";
- my @complete = ();
- if ($RRDkludge) {
+ my @complete = get_fonts();
- # since rrdtool 1.3 with libpango the LEGEND column alignment
- # only works with monospace fonts
- if ($RRDs::VERSION >= 1.3) {
- push(@complete, '--font', 'LEGEND:7:monospace');
- }
- else {
- push(@complete, '--font', 'LEGEND:7:$libdir/VeraMono.ttf');
- }
-
- push(@complete,
- '--font', 'UNIT:7:$libdir/VeraMono.ttf',
- '--font', 'AXIS:7:$libdir/VeraMono.ttf');
- }
-
- push(@complete, '-W', $watermark) if $RRDs::VERSION >= 1.2;
+ # Watermarks introduced in RRD 1.2.13.
+ push(@complete, '-W', $watermark) if $RRDs::VERSION >= 1.2013;
# Do the header (title, vtitle, size, etc...)
push @complete, @{get_header($service, $time)};
@@ -1296,7 +1287,7 @@
} # if graph_sums
$service_time = sprintf("%.2f", (Time::HiRes::time - $service_time));
- INFO "Graphed service : $sname ($service_time sec * 4)";
+ INFO "[INFO] Graphed service $skeypath ($service_time sec)";
print $STATS "GS|$service_time\n" unless $skip_stats;
foreach (@added) {
@@ -1306,6 +1297,31 @@
}
+sub get_fonts {
+ # Set up rrdtool graph font options according to RRD version.
+
+ if ($RRDs::VERSION >= 1.2 and $RRDs::VERSION < 1.3) {
+ # RRD 1.2
+ # The RRD 1.2 documentation says you can identify font family
+ # names but I never got that to work, but full font path worked
+ return (
+ '--font', "LEGEND:7:$libdir/DejaVuSansMono.ttf",
+ '--font', "UNIT:7:$libdir/DejaVuSans.ttf",
+ '--font', "AXIS:7:$libdir/DejaVuSans.ttf",
+ );
+ } elsif ($RRDs::VERSION >= 1.3) {
+ # RRD 1.3 and up
+ return (
+ '--font', "DEFAULT:0:DejaVuSans",
+ '--font', "LEGEND:7:DejaVuSansMono",
+ );
+ }
+
+ # Prior to RRD 1.2 we use no font options.
+ return;
+};
+
+
sub graph_by_minute {
my $service = shift;
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/lib/Munin/Master/HTMLOld.pm
^
|
@@ -28,7 +28,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
-$Id: HTMLOld.pm 3095 2009-11-26 14:44:58Z janl $
+$Id: HTMLOld.pm 4130 2011-01-20 15:51:37Z jo $
This is the hierarchy of templates
@@ -89,7 +89,10 @@
my $htmldir;
my $do_dump = 0;
-my $do_fork = 0; # No effect in this program.
+my $do_fork = 1;
+my $max_running=6;
+my $running=0;
+
sub html_startup {
@@ -122,6 +125,8 @@
$tmpldir = $config->{tmpldir};
$htmldir = $config->{htmldir};
+ $max_running = &munin_get($config, "max_html_jobs", $max_running);
+
%comparisontemplates = instanciate_comparison_templates($tmpldir);
copy_web_resources($tmpldir, $htmldir);
@@ -162,14 +167,11 @@
# Preparing the group tree...
my $groups = get_group_tree($config);
-
-
if (!defined($groups) or scalar(%{$groups} eq '0')) {
LOGCROAK "[FATAL] There is nothing to do here, since there are no nodes with any plugins. Please refer to http://munin-monitoring.org/wiki/FAQ_no_graphs";
};
-
- if (defined $groups->{"name"} and $groups->{"name"} eq "root") {
+ if (defined $groups->{"name"} and $groups->{"name"} eq "#%#root") {
$groups = $groups->{"groups"}; # root->groups
}
@@ -181,8 +183,6 @@
exit 0;
}
-
-
generate_group_templates($groups);
emit_main_index($groups,$timestamp);
@@ -509,7 +509,7 @@
my $peername = munin_get_node_name($peer);
next
if $peername eq "contact"
- and munin_get_node_name($parent) eq "root";
+ and munin_get_node_name($parent) eq "#%#root";
if ($peername eq $me) {
unshift @$ret, {"name" => $peername, "link" => undef};
}
@@ -823,6 +823,54 @@
}
+sub fork_and_work {
+ my ($work) = @_;
+
+ if (!$do_fork) {
+
+ # We're not forking. Do work and return.
+ DEBUG "[DEBUG] Doing work synchrnonously";
+ &$work;
+ return;
+ }
+
+ # Make sure we don't fork too much
+ while ($running >= $max_running) {
+ DEBUG
+ "[DEBUG] Too many forks ($running/$max_running), wait for something to get done";
+ look_for_child("block");
+ --$running;
+ }
+
+ my $pid = fork();
+
+ if (!defined $pid) {
+ ERROR "[ERROR] fork failed: $!";
+ die "fork failed: $!";
+ }
+
+ if ($pid == 0) {
+
+ # This block does the real work. Since we're forking exit
+ # afterwards.
+
+ &$work;
+
+ # See?!
+
+ exit 0;
+
+ }
+ else {
+ ++$running;
+ DEBUG "[DEBUG] Forked: $pid. Now running $running/$max_running";
+ while ($running and look_for_child()) {
+ --$running;
+ }
+ }
+}
+
+
sub generate_group_templates {
my $arr = shift || return;
return unless ref($arr) eq "ARRAY";
@@ -836,7 +884,7 @@
if (defined $key->{'ngroups'} and $key->{'ngroups'}) {
# WTF: $key->{'groups'} = $key->{'groups'};
- generate_group_templates($key->{'groups'});
+ fork_and_work(sub {generate_group_templates($key->{'groups'})});
emit_group_template($key);
@@ -1064,9 +1112,9 @@
--help View this message.
--debug View debug messages.
--version View version information.
- --nofork Compatability. No effect.
- --service <service> Compatability. No effect.
- --host <host> Compatability. No effect.
+ --nofork Compatibility. No effect.
+ --service <service> Compatibility. No effect.
+ --host <host> Compatibility. No effect.
--config <file> Use <file> as configuration file.
[/etc/munin/munin.conf]
@@ -1091,15 +1139,15 @@
=item B<< --service <service> >>
-Compatability. No effect.
+Compatibility. No effect.
=item B<< --host <host> >>
-Compatability. No effect.
+Compatibility. No effect.
=item B<< --nofork >>
-Compatability. No effect.
+Compatibility. No effect.
=item B<< --config <file> >>
|
[-]
[+]
|
Changed |
munin-1.4.6.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 3086 2009-11-25 21:22:17Z ssm $
+$Id: LimitsOld.pm 4130 2011-01-20 15:51:37Z jo $
=end comment
@@ -250,7 +250,7 @@
my $parent = munin_get_parent($group);
my $name = get_notify_name($group);
- if (defined $parent and munin_get_node_name($parent) ne "root") {
+ if (defined $parent and munin_get_node_name($parent) ne "#%#root") {
return (get_full_group_path($parent) . " :: " . $name);
} else {
return $name;
@@ -330,23 +330,74 @@
if ($value eq "unknown") {
$crit->[0] ||= "";
$crit->[1] ||= "";
- $hash->{'worst'} = "UNKNOWN" if $hash->{"worst"} eq "OK";
- $hash->{'worstid'} = 3 if $hash->{"worstid"} == 0;
- munin_set_var_loc(\%notes, [@$fpath, "state"], "unknown");
- munin_set_var_loc(
- \%notes,
- [@$fpath, "unknown"], (
- defined $field->{"extinfo"}
+
+ my $state = "unknown";
+ my $extinfo = defined $field->{"extinfo"}
? "unknown: " . $field->{"extinfo"}
- : "Value is unknown."
- ));
+ : "Value is unknown.";
+ my $num_unknowns;
if ( !defined $onfield
or !defined $onfield->{"state"}
or $onfield->{"state"} ne "unknown") {
$hash->{'state_changed'} = 1;
}
+ else {
+ $hash->{'state_changed'} = 0;
+ }
+
+ # First we'll need to check whether the user wants to ignore
+ # a few UNKNOWN values before actually changing the state to
+ # UNKNOWN.
+ if ($unknown_limit > 1) {
+ if (defined $onfield and defined $onfield->{"state"}) {
+ if ($onfield->{"state"} ne "unknown") {
+ if (defined $onfield->{"num_unknowns"}) {
+ if ($onfield->{"num_unknowns"} < $unknown_limit) {
+ # Don't change the state to UNKNOWN yet.
+ $hash->{'state_changed'} = 0;
+ $state = $onfield->{"state"};
+ $extinfo = $onfield->{$state};
+
+ # Increment the number of UNKNOWN values seen.
+ $num_unknowns = $onfield->{"num_unknowns"} + 1;
+ }
+ }
+ else {
+ # Don't change the state to UNKNOWN yet.
+ $hash->{'state_changed'} = 0;
+ $state = $onfield->{"state"};
+ $extinfo = $onfield->{$state};
+
+ # Start counting the number of consecutive UNKNOWN
+ # values seen.
+ $num_unknowns = 1;
+ }
+ }
+ }
+ }
+
+ if ($state eq "unknown") {
+ $hash->{'worst'} = "UNKNOWN" if $hash->{"worst"} eq "OK";
+ $hash->{'worstid'} = 3 if $hash->{"worstid"} == 0;
+ }
+ elsif ($state eq "critical") {
+ $hash->{'worst'} = "CRITICAL";
+ $hash->{'worstid'} = 2;
+ }
+ elsif ($state eq "warning") {
+ $hash->{'worst'} = "WARNING" if $hash->{"worst"} ne "CRITICAL";
+ $hash->{'worstid'} = 1 if $hash->{"worstid"} != 2;
+ }
+
+ munin_set_var_loc(\%notes, [@$fpath, "state"], $state);
+ munin_set_var_loc(\%notes, [@$fpath, $state], $extinfo);
+ if (defined $num_unknowns) {
+ munin_set_var_loc(\%notes, [@$fpath, "num_unknowns"],
+ $num_unknowns);
+ }
}
+
elsif ((defined($crit->[0]) and $value < $crit->[0])
or (defined($crit->[1]) and $value > $crit->[1])) {
$crit->[0] ||= "";
@@ -404,7 +455,10 @@
elsif (defined $onfield and defined $onfield->{"state"} or $force) {
munin_set_var_loc(\%notes, [@$fpath, "state"], "ok");
munin_set_var_loc(\%notes, [@$fpath, "ok"], "OK");
- $hash->{'state_changed'} = 1;
+
+ if ($onfield->{'state'} ne 'ok' or $force) {
+ $hash->{'state_changed'} = 1;
+ }
}
}
generate_service_message($hash);
@@ -419,42 +473,53 @@
my @warning = (undef, undef);
my $crit = munin_get($hash, "critical", undef);
my $warn = munin_get($hash, "warning", undef);
- my $unknown_limit = munin_get($hash, "unknown_limit", 1);
+ my $unknown_limit = munin_get($hash, "unknown_limit", 3);
my $name = munin_get_node_name($hash);
if (defined $crit and $crit =~ /^\s*([-+\d.]*):([-+\d.]*)\s*$/) {
$critical[0] = $1 if length $1;
$critical[1] = $2 if length $2;
- DEBUG "[DEBUG] processing critical: $name -> $critical[0] : $critical[1]";
}
elsif (defined $crit and $crit =~ /^\s*([-+\d.]+)\s*$/) {
- $critical[1] = $1 if defined $1;
- DEBUG "[DEBUG] processing critical: $name -> : $critical[1]";
+ $critical[1] = $1;
}
elsif (defined $crit) {
@critical = (0, 0);
- DEBUG "[DEBUG] processing critical: $name -> $critical[0] : $critical[1]";
}
+ if(defined $crit) {
+ DEBUG "[DEBUG] processing critical: $name -> "
+ . (defined $critical[0]? $critical[0] : "")
+ . " : "
+ . (defined $critical[1]? $critical[1] : "");
+ }
if (defined $warn and $warn =~ /^\s*([-+\d.]*):([-+\d.]*)\s*$/) {
$warning[0] = $1 if length $1;
$warning[1] = $2 if length $2;
- DEBUG "[DEBUG] processing warning: $name -> $warning[0] : $warning[1]";
}
elsif (defined $warn and $warn =~ /^\s*([-+\d.]+)\s*$/) {
- $warning[1] = $1 if defined $1;
- DEBUG "[DEBUG] processing warning: $name -> : $warning[1]";
+ $warning[1] = $1;
}
elsif (defined $warn) {
@warning = (0, 0);
- DEBUG "[DEBUG] processing warning: $name -> $warning[0] : $warning[1]";
+ }
+ if(defined $warn) {
+ DEBUG "[DEBUG] processing warning: $name -> "
+ . (defined $warning[0]? $warning[0] : "")
+ . " : "
+ . (defined $warning[1]? $warning[1] : "");
}
- # The merge of the unknown_limit implementation was somewhat botched. Not tested. - janl
if ($unknown_limit =~ /^\s*(\d+)\s*$/) {
- $unknown_limit = $1 if defined $1;
- DEBUG "[DEBUG] processing unknown_limit: $name -> $unknown_limit";
+ $unknown_limit = $1 if defined $1;
+ if (defined $unknown_limit) {
+ if ($unknown_limit < 1) {
+ # Zero and negative numbers are not valid.
+ $unknown_limit = 1;
+ }
+ }
+ DEBUG "[DEBUG] processing unknown_limit: $name -> $unknown_limit";
}
return (\@warning, \@critical, $unknown_limit);
@@ -636,12 +701,13 @@
# NOTREACHED
}
}
- INFO "Baz?";
munin_set_var_loc($contactobj, ["pipe_command"], $cmd);
munin_set_var_loc($contactobj, ["pipe"], $pipe);
}
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++
}
@@ -654,12 +720,18 @@
my @res = ();
- while (length($text)) {
+ while (defined($text) && length($text)) {
if ($text =~ /^([^\$]+|)(?:\$(\{.*)|)$/) {
push @res, $1;
$text = $2;
}
+
my @a = extract_bracketed($text, '{}');
+ if(!defined $a[0]) {
+ $text = $a[1];
+ next;
+ }
+
if ($a[0] =~ /^\{var:(\S+)\}$/) {
$a[0] = munin_get($hash, $1, "");
}
@@ -703,8 +775,8 @@
my $t = $3;
my $res = "";
my $field = munin_get($hash, $f, 0);
- my $check = ($field ne "0" and length($field));
- $check = (!length($field) or $field eq "0") if $n;
+ my $check = (defined $field and $field ne "0" and length($field));
+ $check = (!$check) if $n;
if ($check) {
$res .= message_expand($hash, $t);
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/lib/Munin/Master/Node.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Master::Node;
-# $Id: Node.pm 3072 2009-11-25 08:29:52Z bjorn $
+# $Id: Node.pm 4156 2011-04-09 07:25:23Z bldewolf $
# This module is used by UpdateWorker to keep in touch with a node and
# parse some of the output.
@@ -17,6 +17,9 @@
my $config = Munin::Master::Config->instance()->{config};
+# Note: This timeout governs both small commands and waiting for the total
+# output of a plugin. It is reset for each read.
+
sub new {
my ($class, $address, $port, $host, $configref) = @_;
@@ -27,7 +30,7 @@
tls => undef,
socket => undef,
master_capabilities => qw(multigraph),
- io_timeout => 5,
+ io_timeout => 120,
configref => $configref,
};
@@ -88,12 +91,14 @@
# TLS should only be attempted if explicitly enabled. The default
# value is therefore "disabled" (and not "auto" as before).
- my $tls_requirement = $config->{tls};
- INFO "TLS set to \"$tls_requirement\".";
+ my $tls_requirement = exists $self->{configref}->{tls} ?
+ $self->{configref}->{tls} : $config->{tls};
+ DEBUG "TLS set to \"$tls_requirement\".";
return if $tls_requirement eq 'disabled';
+ my $logger = Log::Log4perl->get_logger("Munin::Master");
$self->{tls} = Munin::Common::TLSClient->new({
DEBUG => $config->{debug},
- logger => \&logger,
+ logger => sub { $logger->warn(@_) },
read_fd => fileno($self->{socket}),
read_func => sub { _node_read_single($self) },
tls_ca_cert => $config->{tls_ca_certificate},
@@ -102,8 +107,9 @@
tls_priv => $config->{tls_private_key},
tls_vdepth => $config->{tls_verify_depth},
tls_verify => $config->{tls_verify_certificate},
+ tls_match => $config->{tls_match},
write_fd => fileno($self->{socket}),
- write_func => sub { _write_socket_single($self, @_) },
+ write_func => sub { _node_write_single($self, @_) },
});
if (!$self->{tls}->start_tls()) {
@@ -234,7 +240,15 @@
new_service($service);
DEBUG "[CONFIG multigraph $plugin] Service is now $service";
}
- elsif ($line =~ m{\A (\w+)\.(\w+) \s+ (.+) }xms) {
+ elsif ($line =~ m{\A ([^\s\.]+) \s+ (.+) }xms) {
+ $correct++;
+
+ my $label = $self->_sanitise_fieldname($1);
+
+ push @{$global_config->{$service}}, [$label, $2];
+ DEBUG "[CONFIG graph global $plugin] $service->$label = $2";
+ }
+ elsif ($line =~ m{\A ([^\.]+)\.([^\s]+) \s+ (.+) }xms) {
$correct++;
my ($ds_name, $ds_var, $ds_val) = ($1, $2, $3);
@@ -244,12 +258,6 @@
DEBUG "[CONFIG dataseries $plugin] $service->$ds_name.$ds_var = $ds_val";
push ( @graph_order, $ds_name ) if $ds_var eq 'label';
}
- elsif ($line =~ m{\A (\w+) \s+ (.+) }xms) {
- $correct++;
-
- push @{$global_config->{$service}}, [$1, $2];
- DEBUG "[CONFIG graph global $plugin] $service->$1 = $2";
- }
else {
$errors++;
DEBUG "[DEBUG] Protocol exception: unrecognized line '$line' from $plugin on $nodedesignation.\n";
@@ -435,8 +443,8 @@
}
});
if ($timed_out) {
- WARN "[WARNING] Socket write timed out to ".$self->{host}."\n";
- return;
+ LOGCROAK "[FATAL] Socket write timed out to ".$self->{host}.
+ ". Terminating process.";
}
return 1;
}
@@ -444,7 +452,7 @@
sub _node_read_single {
my ($self) = @_;
- my $res;
+ my $res = undef;
my $timed_out = !do_with_timeout($self->{io_timeout}, sub {
if ($self->{tls} && $self->{tls}->session_started()) {
@@ -456,8 +464,13 @@
chomp $res if defined $res;
});
if ($timed_out) {
- WARN "[WARNING] Socket read timed out to ".$self->{host}."\n";
- return;
+ LOGCROAK "[FATAL] Socket read timed out to ".$self->{host}.
+ ". Terminating process.";
+ }
+ if (!defined($res)) {
+ # Probable socket not open. Why are we here again then?
+ # aren't we supposed to be in "do in session"?
+ LOGCROAK "[FATAL] Socket read from ".$self->{host}." failed. Terminating process.";
}
DEBUG "[DEBUG] Reading from socket to ".$self->{host}.": \"$res\".";
return $res;
@@ -466,23 +479,14 @@
sub _node_read {
my ($self) = @_;
- my @array = ();
+ my @array = ();
- my $timed_out = !do_with_timeout($self->{io_timeout}, sub {
- while (1) {
- my $line = $self->{tls} && $self->{tls}->session_started()
- ? $self->{tls}->read()
- : readline $self->{socket};
- last unless defined $line;
- last if $line =~ /^\.\n$/;
- chomp $line;
- push @array, $line;
- }
- });
- if ($timed_out) {
- WARN "[WARNING] Socket read timed out to ".$self->{host}.": $@\n";
- return;
+ my $line = $self->_node_read_single();
+ while($line ne ".") {
+ push @array, $line;
+ $line = $self->_node_read_single();
}
+
DEBUG "[DEBUG] Reading from socket: \"".(join ("\\n",@array))."\".";
return @array;
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/lib/Munin/Master/ProcessManager.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Master::ProcessManager;
-# $Id: ProcessManager.pm 3053 2009-11-23 17:34:34Z janl $
+# $Id: ProcessManager.pm 4169 2011-04-19 03:01:40Z bldewolf $
use warnings;
use strict;
@@ -85,8 +85,11 @@
sub _prepare_unix_socket {
my ($self) = @_;
- unlink $self->{socket_file}
- or $! ne 'No such file or directory' && croak "unlink failed: $!";
+ if ( -e $self->{socket_file} ) {
+ unlink $self->{socket_file}
+ or croak "unlink failed: $!";
+ }
+
socket my $sock, PF_UNIX, SOCK_STREAM, 0
or croak "socket failed: $!";
bind $sock, sockaddr_un($self->{socket_file})
@@ -104,7 +107,7 @@
my ($self) = @_;
while (@{$self->{workers}}) {
- DEBUG "[DEBUG] Active workers: " . scalar %{$self->{active_workers}};
+ DEBUG "[DEBUG] Active workers: " . (scalar keys %{$self->{active_workers}}) . "/" . $self->{max_concurrent};
last if scalar keys %{$self->{active_workers}} == $self->{max_concurrent};
# Here we just start'em, check results in _collect_results
$self->_start_next_worker();
@@ -137,7 +140,7 @@
sub _collect_results {
my ($self, $sock) = @_;
- while (%{$self->{result_queue}}) {
+ while (%{$self->{result_queue}} || @{$self->{workers}}) {
do {
$self->_vet_finished_workers();
@@ -145,7 +148,7 @@
} while (!%{$self->{result_queue}} && @{$self->{workers}});
my $worker_sock;
- DEBUG "[DEBUG] Active workers: " . scalar %{$self->{active_workers}};
+ DEBUG "[DEBUG] Active workers: " . (scalar keys %{$self->{active_workers}}) . "/" . $self->{max_concurrent};
if (not %{$self->{active_workers}}) {
# Nothing left do do
@@ -165,7 +168,7 @@
. " failed. This could be due to network problems/firewalled munin-node. Remaining workers: "
. join(", ", keys %{$self->{result_queue}});
} else {
- WARN "[WARNING] Call to accept timed out. Remaining workers: " . join(", ", keys %{$self->{result_queue}});
+ INFO "[INFO] Remaining workers: " . join(", ", keys %{$self->{result_queue}});
}
next;
} # if timed_out
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/lib/Munin/Master/Update.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Master::Update;
-# $Id: Update.pm 3053 2009-11-23 17:34:34Z janl $
+# $Id: Update.pm 3271 2009-12-30 11:19:05Z janl $
use warnings;
use strict;
@@ -41,7 +41,7 @@
sub run {
my ($self) = @_;
-
+
$self->_create_rundir_if_missing();
$self->_do_with_lock_and_timing(sub {
@@ -97,7 +97,7 @@
unless (-d $config->{rundir}) {
mkdir $config->{rundir}, oct(700)
or croak "Failed to create rundir (".$config->{rundir}."): $!";
-
+
}
}
@@ -135,6 +135,7 @@
LOGCROAK "[FATAL] Could not open STATS to /dev/null (fallback for not being able to open $config->{dbdir}/munin-update.stats.tmp): $!";
}
+ # Place global munin-update timeout here.
my $retval = $block->();
$update_time = sprintf("%.2f", (Time::HiRes::time - $update_time));
@@ -162,7 +163,16 @@
}
else {
for my $worker (@{$self->{workers}}) {
- my $res = $worker->do_work();
+
+ my $res ;
+
+ eval {
+ # do_work fails hard on a number of conditions
+ $res = $worker->do_work();
+ };
+
+ $res=undef if $EVAL_ERROR;
+
my $worker_id = $worker->{ID};
if (defined($res)) {
$self->_handle_worker_result([$worker_id, $res]);
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/lib/Munin/Master/UpdateWorker.pm
^
|
@@ -1,7 +1,7 @@
package Munin::Master::UpdateWorker;
use base qw(Munin::Master::Worker);
-# $Id: UpdateWorker.pm 3087 2009-11-25 21:57:25Z feiner.tom $
+# $Id: UpdateWorker.pm 4169 2011-04-19 03:01:40Z bldewolf $
use warnings;
use strict;
@@ -63,67 +63,79 @@
);
my $done = $self->{node}->do_in_session(sub {
- $self->{node}->negotiate_capabilities();
- # Note: A multigraph plugin can present multiple services.
- my @plugins = $self->{node}->list_plugins();
-
- for my $plugin (@plugins) {
- if (%{$config->{limit_services}}) {
- next unless $config->{limit_services}{$plugin};
- }
- my %service_config = $self->uw_fetch_service_config($plugin);
- unless (%service_config) {
- WARN "[WARNING] Service $plugin on $nodedesignation returned no config";
- next;
- }
+ eval {
+ # A I/O timeout results in a violent exit. Catch and handle.
- my %service_data = eval {
- $self->{node}->fetch_service_data($plugin);
- };
- if ($EVAL_ERROR) {
- ERROR $EVAL_ERROR;
- print STDERR "$EVAL_ERROR\n";
- next;
- }
+ $self->{node}->negotiate_capabilities();
+ # Note: A multigraph plugin can present multiple services.
+ my @plugins = $self->{node}->list_plugins();
+
+ for my $plugin (@plugins) {
+ if (%{$config->{limit_services}}) {
+ next unless $config->{limit_services}{$plugin};
+ }
- # Since different plugins can populate multiple positions in the
- # service namespace we'll check for collisions and warn of them.
- for my $service (keys %{$service_config{data_source}}) {
- if (defined($all_service_configs{data_source}{$service})) {
- WARN "[WARNING] Service collision: plugin $plugin on $nodedesignation reports $service which already exists on that host. Deleting new data.";
- delete($service_config{data_source}{$service});
+ my %service_config = $self->uw_fetch_service_config($plugin);
+ unless (%service_config) {
+ WARN "[WARNING] Service $plugin on $nodedesignation ".
+ "returned no config";
+ next;
+ }
+
+ my %service_data = $self->{node}->fetch_service_data($plugin);
+
+ # Since different plugins can populate multiple
+ # positions in the service namespace we'll check for
+ # collisions and warn of them.
+
+ for my $service (keys %{$service_config{data_source}}) {
+ if (defined($all_service_configs{data_source}{$service})) {
+ WARN "[WARNING] Service collision: plugin $plugin on "
+ ."$nodedesignation reports $service which already "
+ ."exists on that host. Deleting new data.";
+ delete($service_config{data_source}{$service});
delete($service_data{$service})
if defined $service_data{$service};
+ }
}
- }
- # .extinfo fields come from "fetch" but must be saved like "config".
- for my $service (keys %service_data) {
- for my $ds (keys %{$service_data{$service}}) {
- my $extinfo = $service_data{$service}{$ds}{extinfo};
- if (defined $extinfo) {
- $service_config{data_source}{$service}{$ds}{extinfo} =
- $extinfo;
- DEBUG "[DEBUG] Copied extinfo $extinfo into service_config for $service / $ds on $nodedesignation";
+ # .extinfo fields come from "fetch" but must be saved
+ # like "config".
+
+ for my $service (keys %service_data) {
+ for my $ds (keys %{$service_data{$service}}) {
+ my $extinfo = $service_data{$service}{$ds}{extinfo};
+ if (defined $extinfo) {
+ $service_config{data_source}{$service}{$ds}{extinfo} =
+ $extinfo;
+ DEBUG "[DEBUG] Copied extinfo $extinfo into "
+ ."service_config for $service / $ds on "
+ .$nodedesignation;
+ }
}
}
- }
- $self->_compare_and_act_on_config_changes(\%service_config);
+ $self->_compare_and_act_on_config_changes(\%service_config);
- %{$all_service_configs{data_source}} = (
- %{$all_service_configs{data_source}},
- %{$service_config{data_source}});
+ %{$all_service_configs{data_source}} = (
+ %{$all_service_configs{data_source}},
+ %{$service_config{data_source}});
- %{$all_service_configs{global}} = (
- %{$all_service_configs{global}},
- %{$service_config{global}});
+ %{$all_service_configs{global}} = (
+ %{$all_service_configs{global}},
+ %{$service_config{global}});
- $self->_update_rrd_files(\%service_config, \%service_data);
- }
+ $self->_update_rrd_files(\%service_config, \%service_data);
+
+ } # for @plugins
+ }; # eval
+
+ if ($EVAL_ERROR) {
+ ERROR "[ERROR] Error in node communication with $nodedesignation: "
+ .$EVAL_ERROR;
+ }
- #use Data::Dumper; warn Dumper(\@services);
}); # do_in_session
munin_removelock($lock_file);
@@ -139,25 +151,17 @@
sub uw_fetch_service_config {
- # not sure why fetch_service_config needs eval and fetch_service_data
- # does not. - janl 2009-10-22
my ($self, $plugin) = @_;
- my %service_config = eval {
- $self->{node}->fetch_service_config($plugin);
- };
- if ($EVAL_ERROR) {
- # FIX Report failed service so that we can use the old service
- # config.
- ERROR $EVAL_ERROR;
- print STDERR "$EVAL_ERROR\n";
- return;
- }
+ # Note, this can die for several reasons. Caller must eval us.
+ my %service_config = $self->{node}->fetch_service_config($plugin);
+
+ if ($self->{host}{service_config} &&
+ $self->{host}{service_config}{$plugin}) {
- # FIX for nested services
- if ($self->{host}{service_config} && $self->{host}{service_config}{$plugin}) {
%service_config
= (%service_config, %{$self->{host}{service_config}{$plugin}});
+
}
return %service_config;
@@ -350,7 +354,7 @@
= $self->_create_rrd_file_if_needed($service, $ds_name,
$service_config->{$ds_name});
- if (%$service_data and defined($service_data->{$ds_name})) {
+ if (defined($service_data) and defined($service_data->{$ds_name})) {
$self->_update_rrd_file($rrd_file, $ds_name, $service_data->{$ds_name});
}
else {
@@ -419,7 +423,7 @@
my ($self, $rrd_file, $service, $ds_name, $ds_config) = @_;
INFO "[INFO] creating rrd-file for $service->$ds_name: '$rrd_file'";
- mkpath(dirname($rrd_file), {mode => oct(777)});
+ munin_mkdir_p(dirname($rrd_file), oct(777));
my @args = (
$rrd_file,
sprintf('DS:42:%s:600:%s:%s',
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/master/lib/Munin/Master/Utils.pm
^
|
@@ -1,7 +1,7 @@
package Munin::Master::Utils;
# -*- cperl -*-
-# $Id: Utils.pm 3148 2009-12-02 12:28:09Z janl $
+# $Id: Utils.pm 4169 2011-04-19 03:01:40Z bldewolf $
use strict;
use warnings;
@@ -48,6 +48,7 @@
'munin_get_picture_filename',
'munin_get_html_filename',
'munin_get_filename',
+ 'munin_get_keypath',
'munin_graph_column_headers',
'munin_get_max_label_length',
'munin_get_field_order',
@@ -277,7 +278,7 @@
$config->{'htmldir'} ||= $Munin::Common::Defaults::MUNIN_HTMLDIR;
$config->{'spooldir'} ||= $Munin::Common::Defaults::MUNIN_SSPOOLDIR;
$config->{'#%#parent'} = undef;
- $config->{'#%#name'} = "root";
+ $config->{'#%#name'} = "#%#root";
return ($config);
}
@@ -784,8 +785,7 @@
my $DIR;
opendir($DIR, $dirname) or
WARN "[Warning] Could not open includedir directory $dirname: $OS_ERROR\n";
- my @files = grep { ! /^\.|~$/ } readdir($DIR) or
- WARN "[Warning] Error reading includedir directory $dirname: $OS_ERROR\n";
+ my @files = grep { ! /^\.|~$/ } readdir($DIR);
closedir($DIR);
@files = map { $_ = $dirname.'/'.$_; } (sort @files);
@@ -921,7 +921,7 @@
# Not sure when a #%#name node can go missing
my $name = $i->{'#%#name'} || '*BUG*';
goto gotoparent if $name eq '*BUG*';
- last if $name eq 'root';
+ last if $name eq '#%#root';
if ($host) {
# Into group land now
unshift(@group,$name);
@@ -929,6 +929,7 @@
# In service land, working towards host.
# If i or my parent has a graph_title we're still working with services
if (defined $i->{'#%#parent'}{graph_title} or defined $i->{graph_title}) {
+ $name =~ s/-/_/g; # can't handle dashes in service or below
unshift(@service,$name);
} else {
$host = 1;
@@ -1332,7 +1333,7 @@
my ($dirname, $umask) = @_;
eval {
- mkpath($dirname, {mode => $umask});
+ mkpath($dirname, 0, $umask);
};
return if $EVAL_ERROR;
return 1;
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/doc/munin-node.conf.pod
^
|
@@ -27,6 +27,17 @@
allow ^127\.0\.0\.1$
+=item B<< cidr_allow NETWORK/MASK >>
+
+An alternative to C<allow RE>. This allows the access list to be specified in
+CIDR format. For instance, C<cidr_allow 192.0.2.0/24> would allow connections
+from any IP from 192.0.2.1 to 192.0.2.254.
+
+And C<cidr_allow 127.0.0.1/32> is the equivalent to the example above. Note
+that the netmask B<must> be provided, even though it's just C</32>.
+
+This option requires that the C<Net::CIDR> perl module be installed.
+
=item B<< host IP >>
The IP number of the interface munin-node should listen on. By
@@ -60,6 +71,69 @@
Files matching E<lt>regexE<gt> in the node.d/ and node-conf.d/
directories will be overlooked.
+=item B<tls> <value>
+
+Can have four values. C<paranoid>, C<enabled>, C<auto>, and
+C<disabled>. C<Paranoid> and C<enabled> require a TLS connection,
+while C<disabled> will not attempt one at all.
+
+The current default is C<disabled> because C<auto> is broken. C<Auto>
+causes bad interaction between munin-update and munin-node if the node
+is unprepared to go to TLS.
+
+If you see data dropouts (gaps in graphs) please try to disable TLS.
+
+=item B<tls_verify_certificate> <value>
+
+This directive can be C<yes> or C<no>. It determines if the remote
+certificate needs to be signed by a CA that is known locally. Default
+is C<no>.
+
+=item B<tls_private_key> <value>
+
+This directive sets the location of the private key to be used for
+TLS. Default is @@CONFDIR@@/munin-node.pem. The private key and
+certificate can be stored in the same file.
+
+=item B<tls_certificate> <value>
+
+This directive sets the location of the TLS certificate to be used for
+TLS. Default is @@CONFDIR@@/munin-node.pem. The private key and
+certificate can be stored in the same file.
+
+=item B<tls_ca_certificate> <value>
+
+This directive sets the CA certificate to be used to verify the node's
+certificate, if tls_verify_certificate is set to C<yes>. Default is
+@@CONFDIR@@/cacert.pem.
+
+=item B<tls_verify_depth> <value>
+
+This directive sets how many signings up a chain of signatures TLS is
+willing to go to reach a known, trusted CA when verifying a
+certificate. Default is C<5>.
+
+=item B<tls_match> <value>
+
+This directive, if defined, searches a dump of the certificate provided by the
+remote host for the given regex. The dump of the certificate is two lines of
+the form:
+
+ Subject Name: /C=c/ST=st/L=l/O=o/OU=ou/CN=cn/emailAddress=email
+ Issuer Name: /C=c/ST=st/O=o/OU=ou/CN=cn/emailAddress=email
+
+So, for example, one could match the subject distinguished name by the directive:
+
+ tls_match Subject Name: /C=c/ST=st/L=l/O=o/OU=ou/CN=cn/emailAddress=email
+
+Note that the fields are dumped in the order they appear in the certificate.
+It's best to view the dump of the certificate by running munin-update in debug
+mode and reviewing the logs.
+
+Unfortunately, due to the limited functionality of the SSL module in use, it is
+not possible to provide finer-grained filtering. By default this value is not
+defined.
+
=back
=head1 EXAMPLE
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/lib/Munin/Node/Config.pm
^
|
@@ -1,7 +1,7 @@
package Munin::Node::Config;
use base qw(Munin::Common::Config);
-# $Id: Config.pm 2998 2009-11-18 00:24:34Z janl $
+# $Id: Config.pm 3516 2010-04-23 17:17:34Z ligne $
use strict;
use warnings;
@@ -23,7 +23,7 @@
sub instance {
my ($class) = @_;
-
+
$instance ||= bless {
config_file => "$Munin::Common::Defaults::MUNIN_CONFDIR/munin-node.conf",
}, $class;
@@ -51,7 +51,7 @@
next unless @var;
if ($var[0] eq 'ignore_file') {
push @{$self->{ignores}}, $var[1];
- }
+ }
elsif ($var[0] eq 'unhandled') {
next if defined $self->{sconf}{$var[1]};
$self->{sconf}{$var[1]} = $var[2];
@@ -87,6 +87,7 @@
tls_private_key
tls_verify_certificate
tls_verify_depth
+ tls_match
);
if ($config_variables{$var_name}) {
@@ -123,7 +124,7 @@
cidr_allow
cidr_deny
);
-
+
sub _handled_by_net_server {
my ($self, $var_name) = @_;
return $handled_by_net_server{$var_name};
@@ -138,23 +139,23 @@
or croak "Could not open plugin configuration directory: $!";
$self->{sconf} ||= {};
-
+
my @ignores = $self->{ignores} ? @{$self->{ignores}} : ();
push @ignores, '^\.'; # Hidden files
FILE:
- for my $file (grep { -f "$self->{sconfdir}/$_" } readdir ($DIR)) {
+ for my $file ( grep { -f "$self->{sconfdir}/$_" } sort( readdir($DIR) ) ) {
# Untaint file
next if $file !~ m/^([-\w.:]+)$/; # Skip if any weird chars
$file = $1;
-
+
for my $regex (@ignores) {
next FILE if $file =~ /$regex/;
}
$self->parse_plugin_config_file("$self->{sconfdir}/$file");
}
-
+
closedir $DIR
or carp "Failed to close directory '$self->{sconfdir}': $!";
}
@@ -167,7 +168,7 @@
my ($self, $file) = @_;
# check perms on a file also checks the directory permissions
- if (!Munin::Node::OS->check_perms($file)) {
+ if (!Munin::Node::OS->check_perms_if_paranoid($file)) {
print STDERR "Plugin configuration $file has unsafe permissions, skipping\n";
return;
}
@@ -216,7 +217,7 @@
$service = $1;
}
else {
- croak "Parse error: Clutter before section start."
+ croak "Parse error: Clutter before section start."
unless $service;
my @var = $self->_parse_plugin_line($line);
@@ -249,28 +250,8 @@
return (user => $var_value);
}
elsif ($var_name eq 'group') {
-
- # Support running with more than one group in effect. See
- # documentation on $EFFECTIVE_GROUP_ID in the perlvar(1)
- # manual page.
- my @groups = ();
- for my $group (split /\s*,\s*/, $var_value) {
- my $is_optional = $group =~ m{\A \( ([^)]+) \) \z}xms;
- $group = $1 if $is_optional;
-
- my $gid = Munin::Node::OS->get_gid($group);
- croak "Group '$group' does not exist"
- unless defined $gid || $is_optional;
-
- if (!defined $gid && $is_optional) {
- carp "DEBUG: Skipping optional nonexistent group '$group'"
- if $self->{DEBUG};
- next;
- }
-
- push @groups, $gid;
- }
- return (group => join ' ', @groups);
+ # Evaluation of group name is lazy too.
+ return (group => $var_value );
}
elsif ($var_name eq 'command') {
return (command => [split /\s+/, $var_value]);
@@ -340,7 +321,7 @@
__END__
-=head1 NAME
+=head1 NAME
Munin::Node::Config - Singleton node configuration container. Reads
configuration files.
@@ -401,7 +382,7 @@
$config->apply_wildcards();
-Applies the contents of any wildcard plugin configuration sections
+Applies the contents of any wildcard plugin configuration sections
to matching plugins.
See L<http://munin.projects.linpro.no/wiki/Priority_and_inheritance>
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/lib/Munin/Node/Configure/HostEnumeration.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Node::Configure::HostEnumeration;
-# $Id: HostEnumeration.pm 3092 2009-11-26 13:48:21Z ligne $
+# $Id: HostEnumeration.pm 3516 2010-04-23 17:17:34Z ligne $
use strict;
use warnings;
@@ -36,7 +36,7 @@
}
my $addr = _resolve($host);
-
+
die "Invalid netmask: $mask\n"
unless ($mask =~ /^\d+$/ and $mask <= 32);
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/lib/Munin/Node/Configure/Plugin.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Node::Configure::Plugin;
-# $Id: Plugin.pm 2971 2009-11-12 18:15:04Z ligne $
+# $Id: Plugin.pm 3516 2010-04-23 17:17:34Z ligne $
use strict;
use warnings;
@@ -131,7 +131,7 @@
{
my ($self) = @_;
- # no suggestions if there isn't any
+ # no suggestions if there isn't any
return [] if $self->{default} ne 'yes';
if ($self->is_wildcard or $self->{name} =~ /^snmp__/) {
@@ -391,7 +391,7 @@
=item B<suggestion_string()>
Returns a string detailing whether or not autoconf considers that the plugin
-should be installed. The string may also report the reason why the plugin
+should be installed. The string may also report the reason why the plugin
declined to be installed, or the list of suggestions it provided, if this
information is available.
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/lib/Munin/Node/Logger.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Node::Logger;
-# $Id: Logger.pm 2431 2009-09-16 10:04:17Z janl $
+# $Id: Logger.pm 3516 2010-04-23 17:17:34Z ligne $
use warnings;
use strict;
@@ -20,9 +20,9 @@
chomp ($text);
$text =~ s/\n/\\n/g;
- printf STDERR ("%d/%02d/%02d-%02d:%02d:%02d [%d] %s\n",
- $date[5]+1900,
- $date[4]+1,
+ printf STDERR ("%d/%02d/%02d-%02d:%02d:%02d [%d] %s\n",
+ $date[5]+1900,
+ $date[4]+1,
$date[3],
$date[2],
$date[1],
@@ -42,7 +42,7 @@
=head1 NAME
-Munin::Node::Logger - The logger for munin node.
+Munin::Node::Logger - The logger for munin node.
=head1 SYNOPSIS
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/lib/Munin/Node/OS.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Node::OS;
-# $Id: OS.pm 3166 2009-12-04 11:02:18Z janl $
+# $Id: OS.pm 3516 2010-04-23 17:17:34Z ligne $
use warnings;
use strict;
@@ -53,8 +53,8 @@
}
-#FIX needs a better name
-sub check_perms {
+
+sub check_perms_if_paranoid {
my ($class, $target) = @_;
my @stat;
@@ -90,7 +90,7 @@
my ($vec) = @_;
my $bits = unpack("b*", $vec);
-
+
return $bits;
}
@@ -110,7 +110,7 @@
my $output = my $errput = '';
vec($win,0,1)=0;
-
+
vec($rin,fileno($stdout),1) = 1;
vec($rin,fileno($stderr),1) = 1;
@@ -124,7 +124,7 @@
# print STDERR "Found: $nfound read ",bitsof($rout),
# " - write ",bitsof($wout)," - exceptions ",bitsof($eout),"\n"
-
+
if ($nfound == -1) {
# ! Print error somewhere?
last;
@@ -177,7 +177,7 @@
my $err;
# Give the child till the timeout to finish up
- my $read_it_and_reap = sub {
+ my $read_it_and_reap = sub {
($out,$err) = $self->read_from_child($out_read,$err_read);
waitpid($pid, 0);
};
@@ -220,10 +220,10 @@
return unless $child_pid;
return unless $class->possible_to_signal_process($child_pid);
-
+
# Negative number signals the process group
kill -1, $child_pid; # SIGHUP
- sleep 2;
+ sleep 2;
kill -9, $child_pid; # SIGKILL
}
@@ -265,7 +265,7 @@
sub _set_xid {
my ($class, $x, $id) = @_;
-
+
# According to pervar manpage, assigning to $<, $> etc results in
# a system call. So we need to check $! for errors.
$! = undef;
@@ -274,6 +274,13 @@
}
+sub set_plugin_umask {
+ # Set umask so that files created by plugins are group writable
+ # Only call right before exec-ing a pluigin.
+ umask(0002);
+}
+
+
1;
__END__
@@ -325,7 +332,7 @@
$result = run_as_child($timeout, $coderef, @arguments);
-Creates a child process to run $code and waits for up to
+Creates a child process to run $code and waits for up to
$timeout seconds for it to complete. Returns a hashref
containg the following keys:
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/lib/Munin/Node/Server.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Node::Server;
-# $Id: Server.pm 3164 2009-12-03 20:45:57Z janl $
+# $Id: Server.pm 3940 2010-10-06 16:54:45Z ligne $
use base qw(Net::Server::Fork);
@@ -23,7 +23,7 @@
my %services;
# Services that require the server to support multigraph plugins.
-my @multigraph_services;
+my (@multigraph_services, @dirtyconfig_services);
# Which hosts this node's services applies to. Typically this is the
# same as the host the node is running on, but some services query
@@ -89,15 +89,23 @@
|| (split /\s+/, ($host_name || ''))[1]
|| $config->{fqdn};
+ # hostname checks are case insensitive, so store everything in lowercase
+ $node = lc($node);
+
print STDERR "\tAdding to node $node\n" if $config->{DEBUG};
push @{$nodes{$node}}, $service;
# Note any plugins that require particular server capabilities.
if (grep /^multigraph\s+/, @response) {
- print STDERR "\tAdding to multigraph plugins\n"
- if $config->{DEBUG};
+ print STDERR "\tAdding to multigraph plugins\n" if $config->{DEBUG};
push @multigraph_services, $service;
}
+ if (grep /^[A-Za-z0-9_]+\.value /, @response) {
+ # very dirty plugins -- they do a dirtyconfig even when
+ # "not allowed" by their environment.
+ print STDERR "\tAdding to dirty plugins\n" if $config->{DEBUG};
+ push @dirtyconfig_services, $service;
+ }
}
print STDERR "Finished configuring services\n" if $config->{DEBUG};
@@ -124,12 +132,21 @@
_net_write($session, "# munin node at $config->{fqdn}\n");
+ my $line = '<no command received yet>';
+
# catch and report any system errors in a clean way.
eval {
$timed_out = !do_with_timeout($config->{'timeout'}, sub {
- while (defined (my $line = _net_read($session))) {
+ while (defined ($line = _net_read($session))) {
chomp $line;
- _process_command_line($session, $line) or last;
+ if (! _process_command_line($session, $line)) {
+ $line = "<finished '$line', ending input loop>";
+ last;
+ }
+ $line = "<waiting for input from master, previous was '$line'>";
+ # Reset timeout to wait a reasonable time for input from the master
+ # Misfeature: Plugin timeout and input timeout becomes identical.
+ reset_timeout();
}
});
};
@@ -139,7 +156,7 @@
}
if ($timed_out) {
- logger("Connection timed out");
+ logger("Node side timeout while processing: '$line'");
}
return;
@@ -163,7 +180,7 @@
logger ("DEBUG: Running command \"$_\".") if $config->{DEBUG};
if (/^list\s*([0-9a-zA-Z\.\-]+)?/i) {
- _list_services($session, $1);
+ _list_services($session, lc($1));
}
elsif (/^cap\s?(.*)/i) {
_negotiate_session_capabilities($session, $1);
@@ -212,11 +229,17 @@
sub _negotiate_session_capabilities {
my ($session, $server_capabilities) = @_;
- my @node_cap = qw( multigraph );
+ my @node_cap = qw/
+ multigraph
+ dirtyconfig
+ /;
+
$session->{server_capabilities} = {
map { $_ => 1 } split(/ /, $server_capabilities)
};
+ $ENV{MUNIN_CAP_DIRTYCONFIG} = 1 if ($session->{server_capabilities}{dirtyconfig});
+
_net_write($session, sprintf("cap %s\n",join(" ", @node_cap)));
}
@@ -233,7 +256,8 @@
my $ca_cert = $config->{tls_ca_certificate}
|| "$Munin::Common::Defaults::MUNIN_CONFDIR/cacert.pem";
my $tls_verify = $config->{tls_verify_certificate}
- || 'no';
+ || 0;
+ my $tls_match = $config->{tls_match};
my $depth = $config->{tls_verify_depth};
$depth = 5 unless defined $depth;
@@ -249,6 +273,7 @@
tls_priv => $key,
tls_vdepth => $depth,
tls_verify => $tls_verify,
+ tls_match => $tls_match,
write_fd => fileno(STDOUT),
write_func => sub { print @_ },
});
@@ -296,10 +321,13 @@
$node ||= $config->{fqdn};
if (exists $nodes{$node}) {
- # remove any plugins that require capabilities the server doesn't provide
my @services = @{$nodes{$node}};
+
+ # remove any plugins that require capabilities the master doesn't support
@services = Munin::Node::Utils::set_difference(\@services, \@multigraph_services)
unless $session->{server_capabilities}{multigraph};
+ @services = Munin::Node::Utils::set_difference(\@services, \@dirtyconfig_services)
+ unless $session->{server_capabilities}{dirtyconfig};
_net_write($session, join(" ", @services));
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/lib/Munin/Node/Service.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Node::Service;
-# $Id: Service.pm 3068 2009-11-24 18:35:14Z ligne $
+# $Id: Service.pm 3516 2010-04-23 17:17:34Z ligne $
use warnings;
use strict;
@@ -19,7 +19,7 @@
sub is_a_runnable_service {
my ($class, $file, $dir) = @_;
-
+
$dir ||= $config->{servicedir};
my $path = "$dir/$file";
@@ -41,7 +41,7 @@
foreach my $regex (@{$config->{ignores}}) {
return if $file =~ /$regex/;
}
-
+
return 1;
}
@@ -55,9 +55,9 @@
$config->{fqdn} ||= Munin::Node::OS->get_fq_hostname();
# Export some variables plugins might be interested in
- $ENV{MUNIN_DEBUG} = $config->{PIDEBUG};
+ $ENV{MUNIN_DEBUG} = $config->{PIDEBUG} if $config->{PIDEBUG};
$ENV{FQDN} = $config->{fqdn};
-
+
# munin-node will override this with the IP of the connecting master
$ENV{MUNIN_MASTER_IP} = '';
@@ -81,7 +81,7 @@
$config->process_plugin_configuration_files();
}
$config->apply_wildcards(@plugins);
-
+
return;
}
@@ -110,42 +110,68 @@
my $root_gid = 0;
if ($REAL_USER_ID == $root_uid) {
- # Need to test for defined here since a user might be
+ # Need to test for defined here since a user might be
# specified with UID = 0
- my $uid = defined $config->{sconf}{$service}{user}
+ my $uid = defined $config->{sconf}{$service}{user}
? $config->{sconf}{$service}{user}
: $config->{defuser};
-
- # Resolve unresolved UID now - as it is may not have been resolved
- # when the config was read.
+
+ # Resolve unresolved UID now - as it is not resolved when the
+ # config was read.
+
my $u = Munin::Node::OS->get_uid($uid);
- croak "User '$uid' is nonexistent." unless defined $u;
+ croak "User '$uid' required for $service does not exist."
+ unless defined $u;
+
+ # Ditto for groups
+ my $g = '';
+
+ if ( defined $config->{sconf}{$service}{group} ) {
+ # Support running with more than one group in effect. See
+ # documentation on $EFFECTIVE_GROUP_ID in the perlvar(1)
+ # manual page.
+
+ my @groups = ();
+ my $groups = $config->{sconf}{$service}{group};
+
+ for my $group (split /\s*,\s*/, $groups) {
+ my $is_optional = $group =~ m{\A \( ([^)]+) \) \z}xms;
+ $group = $1 if $is_optional;
+
+ my $gid = Munin::Node::OS->get_gid($group);
+ croak "Group '$group' required for $service does not exist"
+ unless defined $gid || $is_optional;
+
+ if (!defined $gid && $is_optional) {
+ carp "DEBUG: Skipping OPTIONAL nonexisting group '$group'"
+ if $config->{DEBUG};
+ next;
+ }
+ push @groups, $gid;
+ } # for $groups
+ $g = join(' ',@groups);
+ } # if defined group
+
my $dg = $config->{defgroup};
- my $g = '';
my $gid;
- if ( defined($gid = $config->{sconf}{$service}{group}) ) {
- $g = Munin::Node::OS->get_gid($gid);
- croak "Group '$gid' is nonexistent." if $g eq '';
- }
-
# Specify the default group twice: once for setegid(2), and once
# for setgroups(2). See perlvar for the gory details.
my $gs = "$dg $dg $g";
- print STDERR "# Set rgid/ruid/egid/euid to $dg/$u/$gs/$u\n"
+ print STDERR "# Set /rgid/ruid/egid/euid/ to /$dg/$u/$gs/$u/\n"
if $config->{DEBUG};
eval {
if ($Munin::Common::Defaults::MUNIN_HASSETR) {
- Munin::Node::OS->set_real_group_id($dg)
+ Munin::Node::OS->set_real_group_id($dg)
unless $dg == $root_gid;
Munin::Node::OS->set_real_user_id($u)
unless $u == $root_uid;
}
- Munin::Node::OS->set_effective_group_id($gs)
+ Munin::Node::OS->set_effective_group_id($gs)
unless $dg == $root_gid;
Munin::Node::OS->set_effective_user_id($u)
unless $u == $root_uid;
@@ -173,15 +199,19 @@
$class->change_real_and_effective_user_and_group($service);
- unless (Munin::Node::OS->check_perms("$dir/$service")) {
+ unless (Munin::Node::OS->check_perms_if_paranoid("$dir/$service")) {
logger ("Error: unsafe permissions on $service. Bailing out.");
exit 2;
}
$class->export_service_environment($service);
+ Munin::Node::OS::set_plugin_umask();
+
my @command = grep defined, _service_command($dir, $service, $arg);
- print STDERR "# About to run '", join (' ', @command), "'\n" if $config->{DEBUG};
+ print STDERR "# About to run '", join (' ', @command), "'\n"
+ if $config->{DEBUG};
+
exec @command;
}
@@ -214,7 +244,7 @@
{
my ($class, $dir, $service, $arg) = @_;
- my $timeout = $config->{sconf}{$service}{timeout}
+ my $timeout = $config->{sconf}{$service}{timeout}
|| $config->{timeout};
my $run_service = sub {
@@ -253,7 +283,7 @@
my $bool = Munin::Node::Service->is_a_runnable_service($file_name, $dir);
-Runs miscellaneous tests on $file_name in directory $dir. These tests are
+Runs miscellaneous tests on $file_name in directory $dir. These tests are
intended to verify that $file_name is a runnable service.
If not specified, $dir defaults to $config->{servicedir}
@@ -274,7 +304,7 @@
Munin::Node::Service->change_real_and_effective_user_and_group($service);
Changes the current process' effective group and user IDs to those specified
-in the configuration, or the default user or group otherwise. Also changes
+in the configuration, or the default user or group otherwise. Also changes
the real group and user IDs if the operating system supports it.
On failure, causes the process to exit.
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/munin-node.conf.in
^
|
@@ -16,7 +16,7 @@
ignore_file ~$
#ignore_file [#~]$ # FIX doesn't work. '#' starts a comment
-ignore_file DEADJOE$
+ignore_file DEADJOE$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
@@ -35,11 +35,13 @@
allow ^127\.0\.0\.1$
-# If you have installed the Net::CIDR perl module, you can use
-# multiple cidr_allow and cidr_deny address/mask patterns. A
-# connecting client must match any cidr_allow, and not match any
-# cidr_deny. Example:
-
+# If you have installed the Net::CIDR perl module, you can use one or more
+# cidr_allow and cidr_deny address/mask patterns. A connecting client must
+# match any cidr_allow, and not match any cidr_deny. Note that a netmask
+# *must* be provided, even if it's /32
+#
+# Example:
+#
# cidr_allow 127.0.0.1/32
# cidr_allow 192.0.2.0/24
# cidr_deny 192.0.2.42/32
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/sbin/munin-node
^
|
@@ -18,7 +18,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: munin-node 2848 2009-11-05 12:58:00Z ligne $
+# $Id: munin-node 3929 2010-10-05 12:23:33Z ligne $
#
use strict;
@@ -63,8 +63,8 @@
parse_args();
# Check permissions of configuration
- unless (Munin::Node::OS->check_perms($servicedir, $paranoia)
- && Munin::Node::OS->check_perms($conffile, $paranoia))
+ unless (Munin::Node::OS->check_perms_if_paranoid($servicedir)
+ && Munin::Node::OS->check_perms_if_paranoid($conffile))
{
die "Fatal error. Bailing out.";
}
@@ -97,17 +97,18 @@
});
Munin::Node::Server->run(
- conf_file => $conffile,
- pid_file => "$Munin::Common::Defaults::MUNIN_STATEDIR/munin-node.pid"
+ syslog_ident => 'munin-node',
+ conf_file => $conffile,
);
return 0;
}
+
sub parse_args {
my @ORIG_ARGV = @ARGV;
- print_usage_and_exit() unless GetOptions (
+ print_usage_and_exit() unless GetOptions (
"config=s" => \$conffile,
"debug!" => \$DEBUG,
"plugindebug!" => \$PIDEBUG,
@@ -115,7 +116,7 @@
"version" => \&print_version_and_exit,
"help" => \&print_usage_and_exit,
);
-
+
# Reset ARGV (for HUPing)
@ARGV = @ORIG_ARGV;
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/sbin/munin-run
^
|
@@ -17,7 +17,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: munin-run 2807 2009-11-02 13:34:02Z ligne $
+# $Id: munin-run 3461 2010-03-25 11:35:29Z janl $
#
use strict;
@@ -65,11 +65,11 @@
$paranoia = $config->{paranoia};
die "Fatal error. Bailing out.\n"
- unless Munin::Node::OS->check_perms($config->{conffile});
+ unless Munin::Node::OS->check_perms_if_paranoid($config->{conffile});
$config->parse_config_from_file($config->{conffile});
die "Fatal error. Bailing out.\n"
- unless (Munin::Node::OS->check_perms($config->{servicedir}));
+ unless (Munin::Node::OS->check_perms_if_paranoid($config->{servicedir}));
$defuser = $config->{defuser} if defined $config->{defuser};
$defgroup = $config->{defgroup} if defined $config->{defgroup};
@@ -94,7 +94,7 @@
Munin::Node::Service->exec_service($config->{servicedir}, $plugin, $arg);
# Never reached, but just in case...
- print STDERR "# FATAL: Failed to exec.";
+ print STDERR "# FATAL: Failed to exec.\n";
exit 42;
}
@@ -242,7 +242,7 @@
=item B<--paranoia >
-Only run plugins owned by root. Check permissions. [disabled]
+Only run plugins owned by root and check permissions. [disabled]
=item B<--help >
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/config/plugin-conf.d/wildcards.conf
^
|
@@ -1,5 +1,5 @@
[F*]
- env.bar zoo
+ env.bar zoo
[Foo*]
group root
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/monkeywrench/plugin-brokenconfig
^
|
@@ -24,4 +24,4 @@
eval do_$1
exit 0
-
+
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/munin-node-configure.t
^
|
@@ -136,7 +136,7 @@
],
[
[ 'require 1.3.6.1.2.1.2.2.1.5. [0-9]' ],
- {
+ {
require_root => [
[ '1.3.6.1.2.1.2.2.1.5', '[0-9]' ],
],
@@ -158,7 +158,7 @@
'require 1.3.6.1.2.1.2.2.1.10. ',
'require 1.3.6.1.2.1.2.2.2.5 2',
],
- {
+ {
require_root => [
[ '1.3.6.1.2.1.2.2.1.5', '[0-9]' ],
[ '1.3.6.1.2.1.2.2.1.10', undef ],
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/munin-run.t
^
|
@@ -47,7 +47,7 @@
@ARGV = qw(plugin);
($plugin, $argument) = parse_args();
is($argument, undef, 'No argument was given');
-
+
@ARGV = qw(plugin bad_argument);
($plugin, $argument) = parse_args();
is($argument, undef, 'Invalid argument is ignored');
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/munin_node_config.t
^
|
@@ -51,7 +51,7 @@
my @res = $conf->_parse_line("default_client_user $uname");
is_deeply(\@res, [defuser => $UID], 'Parsing default user name');
-
+
@res = $conf->_parse_line("default_client_user $UID");
is_deeply(\@res, [defuser => $UID], 'Parsing default user ID');
}
@@ -65,7 +65,7 @@
my @res = $conf->_parse_line("default_client_group $gname");
is_deeply(\@res, [defgroup => $gid], 'Parsing default group');
-
+
eval {
$conf->_parse_line("default_client_group xxxyyyzzz");
};
@@ -77,7 +77,7 @@
{
my @res = $conf->_parse_line("paranoia off");
- is_deeply(\@res, [paranoia => 0], 'Parsing paranoia');
+ is_deeply(\@res, [paranoia => 0], 'Parsing paranoia');
}
@@ -85,12 +85,12 @@
{
my @res = $conf->_parse_line('allow 127\.0\.0\.1');
- is_deeply(\@res, [], 'Parsing: allow is ignored');
+ is_deeply(\@res, [], 'Parsing: allow is ignored');
}
{
my @res = $conf->_parse_line('deny 127\.0\.0\.1');
- is_deeply(\@res, [], 'Parsing: deny is ignored');
+ is_deeply(\@res, [], 'Parsing: deny is ignored');
}
@@ -98,7 +98,7 @@
{
my @res = $conf->_parse_line('tls paranoid');
- is_deeply(\@res, [tls => 'paranoid'], 'Parsing tls');
+ is_deeply(\@res, [tls => 'paranoid'], 'Parsing tls');
}
@@ -133,7 +133,7 @@
is_deeply($conf, $expected, "Reinitialize with new values");
my $oldconf = $conf;
-
+
$conf->reinitialize();
is_deeply($conf, {}, "Reinitialize to empty state");
@@ -233,7 +233,7 @@
###############################################################################
-# P R O C E S S _ P L U G I N _ C O N F I G U R A T I O N _ F I L E S
+# P R O C E S S _ P L U G I N _ C O N F I G U R A T I O N _ F I L E S
{
# Capture STDERR in a string
@@ -276,10 +276,10 @@
sconfdir => $sconfdir,
sconf=>{
Foo => {
- user => 'root',
- group => 0,
+ user => 'root',
+ group => 0,
env => {
- baz => 'zing',
+ baz => 'zing',
bar => 'zap',
}
},
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/munin_node_configure_hostenumeration.t
^
|
@@ -87,10 +87,10 @@
[ [ 'test.example.com/24' ], [ @slash_24, ], 'FQDN-based CIDR range', ],
[ [ 'test.example.com/24', 'gateway' ], [ @slash_24, '192.168.2.1' ], 'Multiple specifications', ],
);
-
+
while (my $test = shift @tests) {
my ($hosts, $expected, $msg) = @$test;
-
+
@$hosts = Munin::Node::Configure::HostEnumeration::expand_hosts(@$hosts);
is_deeply($hosts, $expected, $msg);
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/munin_node_configure_plugin.t
^
|
@@ -162,7 +162,7 @@
is($p->suggestion_string, 'yes', 'Suggestion string - yes');
$p = gen_plugin('if_');
-
+
$p->parse_autoconf_response('no');
is($p->suggestion_string, 'no', 'Suggestion string - no');
@@ -246,7 +246,7 @@
is_deeply($wcp->_suggested_links, [ 'if_eth2' ], 'with a suggestion');
is_deeply($wcp->_suggested_wild , [ 'eth2' ], 'with a suggested wildcard');
}
-{
+{
my $sp = gen_plugin('snmp__load');
$sp->{default} = 'yes'; # it's ok to run it now
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/munin_node_configure_pluginlist.t
^
|
@@ -75,7 +75,7 @@
is_deeply([ map { $_->{name} } $plugins->list ], [ sort @plugins ],
'List is sorted');
-
+
is_deeply([ sort $plugins->names ], [ sort @plugins ], 'All plugin names are returned');
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/munin_node_server.t
^
|
@@ -36,7 +36,7 @@
capabilities => {
},
},
-
+
"No capabilities offered");
}
@@ -49,7 +49,7 @@
foo => 1,
},
},
-
+
"Ignore unknown capability");
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/no-fixes.t
^
|
@@ -27,7 +27,7 @@
#
# Check comments
#
- open my $F, '<', $file
+ open my $F, '<', $file
or warn "Couldn't open $file: $!" && return;
while (<$F>) {
if (m{#\s*FIX}) {
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/plugins/autoconf-bad-cruft-stderr
^
|
@@ -14,5 +14,5 @@
}
-do_$1
+do_$1
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/plugins/autoconf-bad-exit1-no
^
|
@@ -14,5 +14,5 @@
}
-do_$1
+do_$1
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/plugins/autoconf-bad-no-answer
^
|
@@ -11,5 +11,5 @@
}
-do_$1
+do_$1
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/plugins/autoconf-bad-signal
^
|
@@ -11,11 +11,11 @@
do_autoconf()
{
echo yes
-
- kill -PIPE $$
+
+ kill -PIPE $$
exit 0
}
-do_$1
+do_$1
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/plugins/autoconf-bad-timeout
^
|
@@ -1,6 +1,6 @@
#!/bin/sh
-# Munin test plugin:
+# Munin test plugin:
#
# autoconf says yes, but it times out
#
@@ -15,5 +15,5 @@
}
-do_$1
+do_$1
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/node/t/plugins/suggest-good-no-autoconf_
^
|
@@ -1,7 +1,7 @@
#!/bin/sh
-# Munin test plugin:
-#
+# Munin test plugin:
+#
# Suggest should never be run, because autoconf said it shouldn't
# be installed
#
@@ -21,7 +21,7 @@
echo one
echo two
echo three
-
+
exit 0
}
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/BasicMBeanConnection.java
^
|
@@ -0,0 +1,25 @@
+package org.munin.plugin.jmx;
+import javax.management.remote.JMXServiceURL;
+import javax.management.MBeanServerConnection;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import java.util.Map;
+import java.io.IOException;
+import java.net.MalformedURLException;
+
+/* Inherit from this if you need another method for jboss/glassfish/etc */
+
+public class BasicMBeanConnection {
+
+ public static MBeanServerConnection get() throws IOException, MalformedURLException
+ {
+ String[] connectionInfo = ConfReader.GetConnectionInfo();
+
+ JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
+ Map<String, Object> credentials = ConfReader.GetConnectionCredentials();
+ JMXConnector c=JMXConnectorFactory.connect(u,credentials);
+ MBeanServerConnection connection=c.getMBeanServerConnection();
+ return (connection);
+ }
+}
+
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/ClassesLoaded.java
^
|
@@ -2,9 +2,6 @@
import java.lang.management.ClassLoadingMXBean;
import java.lang.management.ManagementFactory;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class ClassesLoaded {
@@ -25,9 +22,7 @@
else {
try{
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c=JMXConnectorFactory.connect(u);
- MBeanServerConnection connection=c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
ClassLoadingMXBean classmxbean=ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.CLASS_LOADING_MXBEAN_NAME, ClassLoadingMXBean.class);
System.out.println("ClassesLoaded.value "+classmxbean.getLoadedClassCount());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/ClassesLoadedTotal.java
^
|
@@ -2,9 +2,6 @@
import java.lang.management.ClassLoadingMXBean;
import java.lang.management.ManagementFactory;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class ClassesLoadedTotal {
@@ -24,9 +21,7 @@
}
else {
try{
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c=JMXConnectorFactory.connect(u);
- MBeanServerConnection connection=c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
ClassLoadingMXBean classmxbean=ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.CLASS_LOADING_MXBEAN_NAME, ClassLoadingMXBean.class);
System.out.println("ClassesLoadedTotal.value "+classmxbean.getTotalLoadedClassCount());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/ClassesUnloaded.java
^
|
@@ -2,9 +2,6 @@
import java.lang.management.ClassLoadingMXBean;
import java.lang.management.ManagementFactory;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class ClassesUnloaded {
@@ -25,9 +22,7 @@
else {
try{
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c=JMXConnectorFactory.connect(u);
- MBeanServerConnection connection=c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
ClassLoadingMXBean classmxbean=ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.CLASS_LOADING_MXBEAN_NAME, ClassLoadingMXBean.class);
System.out.println("UnloadedClass.value "+classmxbean.getUnloadedClassCount());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/CompilationTimeTotal.java
^
|
@@ -5,9 +5,6 @@
*/
import java.lang.management.ManagementFactory;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.lang.management.CompilationMXBean;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -27,9 +24,7 @@
}
else {
try {
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
CompilationMXBean osmxbean = ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.COMPILATION_MXBEAN_NAME, CompilationMXBean.class);
System.out.println("CompilationTimeTotal.value " + osmxbean.getTotalCompilationTime() );
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/ConfReader.java
^
|
@@ -1,16 +1,29 @@
package org.munin.plugin.jmx;
+import javax.management.remote.JMXConnector;
+import java.util.HashMap;
+import java.util.Map;
public class ConfReader {
private static final String IP_PARAM = "ip";
private static final String PORT_PARAM = "port";
private static final String CATEGORY_PARAM = "category";
+ private static final String USERNAME_PARAM = "username";
+ private static final String PASSWORD_PARAM = "password";
+
+ private static String ip;
+ private static String port;
+ private static String category;
+ private static String username;
+ private static String password;
public static String[] GetConnectionInfo()
{
- String ip = System.getenv(IP_PARAM);
- String port = System.getenv(PORT_PARAM);
- String category = System.getenv(CATEGORY_PARAM);
+ ip = System.getenv(IP_PARAM);
+ port = System.getenv(PORT_PARAM);
+ category = System.getenv(CATEGORY_PARAM);
+ username = System.getenv(USERNAME_PARAM);
+ password = System.getenv(PASSWORD_PARAM);
if( ip == null || ip.equals("null") || port == null || port.equals("null") )
{
@@ -26,7 +39,25 @@
category = "jvm";
}
- return new String[]{ip , port, category};
+ return new String[]{ip , port, category, username, password};
+ }
+
+ public static Map<String, Object> GetConnectionCredentials() {
+
+ Map<String, Object> credentials = null;
+
+ if (username == null || password == null)
+ {
+ return null;
+ }
+
+ credentials = new HashMap<String, Object>();
+
+ credentials.put(JMXConnector.CREDENTIALS,
+ new String[] {username,
+ password});
+ return credentials;
}
+
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/CurrentThreadCpuTime.java
^
|
@@ -1,12 +1,7 @@
package org.munin.plugin.jmx;
-import java.lang.management.ClassLoadingMXBean;
import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryMXBean;
import java.lang.management.ThreadMXBean;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class CurrentThreadCpuTime {
@@ -26,9 +21,7 @@
else {
try {
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +connectionInfo[0] + ":" + connectionInfo[1] + "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
ThreadMXBean threadmxbean = ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.THREAD_MXBEAN_NAME, ThreadMXBean.class);
System.out.println("CurrentThreadCpuTime.value " + threadmxbean.getCurrentThreadCpuTime());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/CurrentThreadUserTime.java
^
|
@@ -1,13 +1,8 @@
package org.munin.plugin.jmx;
-import java.lang.management.ClassLoadingMXBean;
import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryMXBean;
import java.lang.management.ThreadMXBean;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class CurrentThreadUserTime {
@@ -28,9 +23,7 @@
else {
try {
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +connectionInfo[0] + ":" + connectionInfo[1] + "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
ThreadMXBean threadmxbean = ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.THREAD_MXBEAN_NAME, ThreadMXBean.class);
System.out.println("CurrentThreadUserTime.value " + threadmxbean.getCurrentThreadUserTime());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/GCCount.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -20,18 +17,18 @@
"graph_info The Sun JVM defines garbage collection in two modes: Minor copy collections and Major Mark-Sweep-Compact collections. A minor collection runs relatively quickly and involves moving live data around the heap in the presence of running threads. A major collection is a much more intrusive garbage collection that suspends all execution threads while it completes its task. In terms of performance tuning the heap, the primary goal is to reduce the frequency and duration of major garbage collections.\n" +
"CopyCount.label MinorCount\n" +
"CopyCount.type DERIVE\n" +
+ "CopyCount.min 0\n" +
"CopyCount.info The total number of collections that have occurred. This method returns -1 if the collection count is undefined for this collector. \n" +
"MarkSweepCompactCount.label MajorCount\n" +
"MarkSweepCompactCount.type DERIVE\n" +
+ "MarkSweepCompactCount.min 0\n" +
"MarkSweepCompactCount.info the total number of collections that have occurred. This method returns -1 if the collection count is undefined for this collector.\n"
);
}
else {
try {
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GCCountGet collector = new GCCountGet(connection);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/GCTime.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class GCTime {
@@ -28,10 +25,7 @@
else {
try {
-
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GCTimeGet collector = new GCTimeGet(connection);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/GetUsage.java
^
|
@@ -26,8 +26,6 @@
gcName = new ObjectName(ManagementFactory.MEMORY_POOL_MXBEAN_DOMAIN_TYPE+",*");//GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",*");
-
-
Set mbeans = connection.queryNames(gcName, null);
if (mbeans != null) {
gcmbeans = new ArrayList<MemoryPoolMXBean>();
@@ -40,17 +38,17 @@
}
}
-
-
-
-
int i = 0;
- GCresult[i++] =gcmbeans.get(memtype).getUsage().getCommitted()+ "";
- GCresult[i++] = gcmbeans.get(memtype).getUsage().getInit()+"";
- GCresult[i++] = gcmbeans.get(memtype).getUsage().getMax()+"";
- GCresult[i++] = gcmbeans.get(memtype).getUsage().getUsed()+"";
-// System.out.println(gcmbeans.get(memtype).getName());// denne printer Tenured Gen
- GCresult[i++]=gcmbeans.get(memtype).getUsageThreshold()+"";
+ GCresult[i++] = gcmbeans.get(memtype).getUsage().getCommitted()+"";
+ GCresult[i++] = gcmbeans.get(memtype).getUsage().getInit()+"";
+ GCresult[i++] = gcmbeans.get(memtype).getUsage().getMax()+"";
+ GCresult[i++] = gcmbeans.get(memtype).getUsage().getUsed()+"";
+ try {
+ GCresult[4] = gcmbeans.get(memtype).getUsageThreshold()+"";
+ }
+ catch (UnsupportedOperationException u) {
+ GCresult[4] = "U";
+ }
return GCresult;
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/GetUsageThresholdCount.java
^
|
@@ -25,8 +25,6 @@
gcName = new ObjectName(ManagementFactory.MEMORY_POOL_MXBEAN_DOMAIN_TYPE+",*");//GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",*");
-
-
Set mbeans = connection.queryNames(gcName, null);
if (mbeans != null) {
gcmbeans = new ArrayList<MemoryPoolMXBean>();
@@ -39,13 +37,19 @@
}
}
+ try {
+ GCresult[0] = gcmbeans.get(0).getUsageThresholdCount()+ "";
+ }
+ catch (UnsupportedOperationException u) {
+ GCresult[0] = "U";
+ }
-
-
-
- int i = 0;
- GCresult[i++] =gcmbeans.get(0).getUsageThresholdCount()+ "";
- GCresult[i++] = gcmbeans.get(1).getUsageThresholdCount()+ "";
+ try {
+ GCresult[1] = gcmbeans.get(1).getUsageThresholdCount()+ "";
+ }
+ catch (UnsupportedOperationException u) {
+ GCresult[1] = "U";
+ }
return GCresult;
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemoryAllocatedHeap.java
^
|
@@ -2,9 +2,6 @@
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemoryAllocatedHeap {
@@ -18,27 +15,28 @@
"graph_title JVM (port " + connectionInfo[1] + ") MemoryAllocatedHeap\n" +
"graph_args --base 1024 -l 0\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
- "Committed.label Committed\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management.\n" +
"Max.label Max\n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
+ "Committed.label Committed\n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n" +
"Init.label Init\n" +
"Used.info represents the amount of memory currently used (in bytes).\n" +
- "Used.label Used\n"
- );
+ "Used.label Used\n" +
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n"
+ );
}
else {
try {
+ MBeanServerConnection connection = BasicMBeanConnection.get();
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
-
- MemoryMXBean mbean = ManagementFactory.newPlatformMXBeanProxy(connection,ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
+ MemoryMXBean mbean = ManagementFactory.newPlatformMXBeanProxy(connection,ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
System.out.println("Committed.value " + mbean.getHeapMemoryUsage().getCommitted());
System.out.println("Max.value " + mbean.getHeapMemoryUsage().getMax());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemoryAllocatedNonHeap.java
^
|
@@ -3,9 +3,6 @@
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemoryAllocatedNonHeap {
@@ -19,27 +16,28 @@
"graph_title JVM (port " + connectionInfo[1] + ") MemoryAllocatedNonHeap\n" +
"graph_args --base 1024 -l 0\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
- "Committed.label Committed\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management.\n" +
"Max.label Max\n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
+ "Committed.label Committed\n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n" +
"Init.label Init\n" +
"Used.info represents the amount of memory currently used (in bytes).\n" +
- "Used.label Used\n"
+ "Used.label Used\n" +
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n"
);
}
else {
try {
+ MBeanServerConnection connection = BasicMBeanConnection.get();
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
-
- MemoryMXBean mbean = ManagementFactory.newPlatformMXBeanProxy(connection,ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
+ MemoryMXBean mbean = ManagementFactory.newPlatformMXBeanProxy(connection,ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
System.out.println("Committed.value " + mbean.getNonHeapMemoryUsage().getCommitted());
System.out.println("Max.value " + mbean.getNonHeapMemoryUsage().getMax());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemoryEdenPeak.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemoryEdenPeak {
@@ -15,29 +12,30 @@
if (args[0].equals("config")) {
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") MemoryEdenPeak\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"graph_info The peak memory usage of this memory pool since the Java virtual machine was started or since the peak was reset.\n" +
- "Committed.label Committed\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine. \n" +
"Max.label Max\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management.\n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
- "Init.label Init\n" +
+ "Committed.label Committed\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine. \n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
+ "Init.label Init\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n" +
"Used.label Used\n" +
"Used.info The amount of memory currently used (in bytes).\n"+
- "Threshold.label Threshold\n" +
+ "Threshold.label Threshold\n" +
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n" +
"Threshold.info The usage threshold value of this memory pool in bytes.\n"
);
}
else {
try {
-
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetPeakUsage collector = new GetPeakUsage(connection, 3);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemoryEdenUsage.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemoryEdenUsage {
@@ -15,27 +12,29 @@
if (args[0].equals("config")) {
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") MemoryEdenUsage\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"graph_info Returns an estimate of the memory usage of this memory pool.\n" +
- "Committed.label Comitted\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
"Max.label Max\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management.\n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
- "Init.label Init\n" +
+ "Committed.label Comitted\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
+ "Init.label Init\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n" +
- "Used.label Used\n" +
+ "Used.label Used\n" +
"Used.info The amount of memory currently used (in bytes).\n" +
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n" +
"Threshold.label Threshold\n" +
"Threshold.info The usage threshold value of this memory pool in bytes.\n"
);
}
else {
try {
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetUsage collector = new GetUsage(connection, 3);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemoryEdenUsagePostGC.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -16,27 +13,29 @@
if (args[0].equals("config")) {
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") MemoryEdenUsagePostGC\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"graph_info Pool from which memory is initially allocated for most objects.\n" +
- "Committed.label Committed\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
"Max.label Max\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management.\n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
- "Init.label Init\n" +
+ "Committed.label Committed\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
+ "Init.label Init\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n" +
- "Used.label Used\n" +
+ "Used.label Used\n" +
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n" +
"Used.info The amount of memory currently used (in bytes).\n" +
- "Threshold.label Threshold\n" +
+ "Threshold.label Threshold\n" +
"Threshold.info The usage threshold value of this memory pool in bytes. The default value is zero.\n"
- );
+ );
}
else {
try {
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +connectionInfo[0] + ":" + connectionInfo[1] + "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetCollectionUsage collector = new GetCollectionUsage(connection, 3);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemoryObjectsPending.java
^
|
@@ -2,9 +2,6 @@
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemoryObjectsPending {
@@ -25,12 +22,9 @@
else {
try {
+ MBeanServerConnection connection = BasicMBeanConnection.get();
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
-
- MemoryMXBean mbean = ManagementFactory.newPlatformMXBeanProxy(connection,ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
+ MemoryMXBean mbean = ManagementFactory.newPlatformMXBeanProxy(connection,ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
System.out.println("Objects.value " + mbean.getObjectPendingFinalizationCount());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemoryPermGenPeak.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemoryPermGenPeak {
@@ -15,18 +12,22 @@
if (args[0].equals("config")) {
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") MemoryPermGenPeak\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"graph_info Returns the peak memory usage of this memory pool since the Java virtual machine was started or since the peak was reset.\n" +
- "Committed.label Committed\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
"Max.label Max\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management.\n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
- "Init.label Init\n" +
+ "Committed.label Committed\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
+ "Init.label Init\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n" +
- "Used.label Used\n" +
+ "Used.label Used\n" +
"Used.info The amount of memory currently used (in bytes).\n" +
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n" +
"Threshold.label Threshold\n" +
"Threshold.info The usage threshold value of this memory pool in bytes.\n"
);
@@ -34,10 +35,7 @@
else {
try {
-
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetPeakUsage collector = new GetPeakUsage(connection, 1);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemoryPermGenUsage.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemoryPermGenUsage {
@@ -15,28 +12,29 @@
if (args[0].equals("config")) {
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") MemoryPermGenUsage\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"graph_info Returns an estimate of the memory usage of this memory pool.\n" +
- "Committed.label Committed\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
"Max.label Max\n" +
"Max.info Test. \n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
+ "Committed.label Committed\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
"Init.label Init\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n" +
"Used.label Used\n" +
"Used.info The amount of memory currently used (in bytes).\n" +
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n" +
"Threshold.label Threshold\n" +
"Threshold.info The usage threshold value of this memory pool in bytes.\n"
);
}
else {
try {
-
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetUsage collector = new GetUsage(connection, 1);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemoryPermGenUsagePostGC.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemoryPermGenUsagePostGC {
@@ -15,28 +12,29 @@
if (args[0].equals("config")) {
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") MemoryPermGenUsagePostGC\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"graph_info Contains reflective data of the JVM itself, including class and memory objects\n" +
- "Committed.label Committed\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
- "Max.label Max\n" +
+ "Max.label Max\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management. \n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
- "Init.label Init\n" +
+ "Committed.label Committed\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
+ "Init.label Init\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n" +
- "Used.label Used\n" +
+ "Used.label Used\n" +
"Used.info represents the amount of memory currently used (in bytes).\n" +
- "Threshold.label Threshold\n" +
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n" +
+ "Threshold.label Threshold\n" +
"Threshold.info The usage threshold value of this memory pool in bytes. The default value is zero.\n"
);
}
else {
try {
-
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +connectionInfo[0] + ":" + connectionInfo[1] + "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetCollectionUsage collector = new GetCollectionUsage(connection, 1);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemorySurvivorPeak.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemorySurvivorPeak {
@@ -15,18 +12,22 @@
if (args[0].equals("config")) {
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") MemorySurvivorPeak\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"graph_info Returns the peak memory usage of this memory pool since the Java virtual machine was started or since the peak was reset.\n" +
- "Committed.label Committed\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
"Max.label Max\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management.\n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
+ "Committed.label Committed\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
"Init.label Init\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n" +
- "Used.label Used\n" +
+ "Used.label Used\n" +
"Used.info The amount of memory currently used (in bytes).\n" +
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n" +
"Threshold.label Threshold\n" +
"Threshold.info The usage threshold value of this memory pool in bytes.\n"
);
@@ -34,10 +35,7 @@
else {
try {
-
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetPeakUsage collector = new GetPeakUsage(connection, 4);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemorySurvivorUsage.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemorySurvivorUsage {
@@ -15,28 +12,29 @@
if (args[0].equals("config")) {
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") MemorySurvivorUsage\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"graph_info Returns an estimate of the memory usage of this memory pool.\n" +
- "Committed.label Committed\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
"Max.label Max\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management.\n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
+ "Committed.label Committed\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
"Init.label Init\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n" +
"Used.label Used\n" +
"Used.info represents the amount of memory currently used (in bytes).\n" +
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n" +
"Threshold.label Threshold\n" +
"Threshold.info Returns the usage threshold value of this memory pool in bytes.\n"
);
}
else {
try {
-
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetUsage collector = new GetUsage(connection, 4);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemorySurvivorUsagePostGC.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemorySurvivorUsagePostGC {
@@ -15,28 +12,29 @@
if (args[0].equals("config")) {
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") MemorySurvivorUsagePostGC\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"graph_info Pool containing objects that have survived Eden space garbage collection.\n" +
- "Committed.label Committed\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
"Max.label Max\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management.\n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
- "Init.label Init\n" +
+ "Committed.label Committed\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
+ "Init.label Init\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n"+
- "Used.label Used\n" +
+ "Used.label Used\n" +
"Used.info The amount of memory currently used (in bytes).\n" +
- "Threshold.label Threshold\n" +
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n" +
+ "Threshold.label Threshold\n" +
"Threshold.info The usage threshold value of this memory pool in bytes. The default value is zero..\n"
- );
+ );
}
else {
try {
-
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +connectionInfo[0] + ":" + connectionInfo[1] + "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetCollectionUsage collector = new GetCollectionUsage(connection, 4);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemoryTenuredGenPeak.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemoryTenuredGenPeak {
@@ -15,30 +12,31 @@
if (args[0].equals("config")) {
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") MemoryTenuredGenPeak\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"graph_info The peak memory usage of this memory pool since the Java virtual machine was started or since the peak was reset.\n" +
- "Committed.label Committed\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
- "Committed.draw AREA\n" +
"Max.label Max\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management.\n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
- "Used.label Used\n" +
+ "Committed.label Committed\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
+ "Used.label Used\n" +
"Used.info The amount of memory currently used (in bytes).\n"+
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n" +
"Init.label Init\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n" +
"Init.draw AREA\n"+
- "Threshold.label Threshold\n" +
+ "Threshold.label Threshold\n" +
"Threshold.info The usage threshold value of this memory pool in bytes.\n"
);
}
else {
try {
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetPeakUsage collector = new GetPeakUsage(connection, 0);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemoryTenuredGenUsage.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemoryTenuredGenUsage {
@@ -15,16 +12,20 @@
if (args[0].equals("config")) {
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") MemoryTenuredGenUsage\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"graph_info Returns an estimate of the memory usage of this memory pool.\n" +
- "Committed.label Committed\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
"Max.label Max\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management.\n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
+ "Committed.label Committed\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
"Used.label Used\n" +
"Used.info represents the amount of memory currently used (in bytes). \n"+
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n" +
"Init.label Init\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n" +
"Threshold.label Threshold\n" +
@@ -33,10 +34,7 @@
}
else {
try {
-
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetUsage collector = new GetUsage(connection, 0);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemoryTenuredGenUsagePostGC.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class MemoryTenuredGenUsagePostGC {
@@ -15,17 +12,21 @@
if (args[0].equals("config")) {
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") MemoryTenuredGenUsagePostGC\n" +
"graph_vlabel bytes\n" +
- "graph_category " + connectionInfo[2] + "\n" +
+ "graph_category " + connectionInfo[2] + "\n" +
"graph_info Pool containing long-lived objects.\n" +
- "Committed.label Committed\n" +
- "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine. \n" +
- "Max.label Max\n" +
+ "Max.label Max\n" +
"Max.info The maximum amount of memory (in bytes) that can be used for memory management.\n" +
"Max.draw AREA\n" +
"Max.colour ccff00\n" +
- "Used.label Used\n" +
+ "Committed.label Committed\n" +
+ "Committed.info The amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine. \n" +
+ "Committed.draw LINE2\n" +
+ "Committed.colour 0033ff\n" +
+ "Used.label Used\n" +
"Used.info The amount of memory currently used (in bytes).\n" +
- "Init.label Init\n" +
+ "Used.draw LINE3\n" +
+ "Used.colour 33cc00\n" +
+ "Init.label Init\n" +
"Init.info The initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.\n"+
"Threshold.label Threshold\n" +
"Threshold.info The usage threshold value of this memory pool in bytes. The default value is zero.\n"
@@ -33,10 +34,7 @@
}
else {
try {
-
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +connectionInfo[0] + ":" + connectionInfo[1] + "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetCollectionUsage collector = new GetCollectionUsage(connection, 0);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemorythresholdPostGCCount.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.lang.management.MemoryPoolMXBean;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -31,9 +28,7 @@
else {
try {
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +connectionInfo[0] + ":" + connectionInfo[1] + "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetMemoryPoolThresholdCount collector = new GetMemoryPoolThresholdCount(connection);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/MemorythresholdUsageCount.java
^
|
@@ -1,9 +1,6 @@
package org.munin.plugin.jmx;
import java.lang.management.ManagementFactory.*;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.lang.management.MemoryPoolMXBean;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -26,9 +23,7 @@
}
else {
try {
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +connectionInfo[0] + ":" + connectionInfo[1] + "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
GetUsageThresholdCount collector = new GetUsageThresholdCount(connection);
String[] temp = collector.GC();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/ProcessorsAvailable.java
^
|
@@ -2,9 +2,6 @@
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
public class ProcessorsAvailable {
@@ -21,9 +18,7 @@
}
else {
try {
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +connectionInfo[0] + ":" + connectionInfo[1] + "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
OperatingSystemMXBean osmxbean = ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME, OperatingSystemMXBean.class);
System.out.println("ProcessorsAvailable.value " + osmxbean.getAvailableProcessors());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/Threads.java
^
|
@@ -2,9 +2,6 @@
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadMXBean;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class Threads {
@@ -24,9 +21,7 @@
}
else {
try{
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c=JMXConnectorFactory.connect(u);
- MBeanServerConnection connection=c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
ThreadMXBean threadmxbean=ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.THREAD_MXBEAN_NAME, ThreadMXBean.class);
System.out.println("Threads.value "+threadmxbean.getThreadCount());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/ThreadsDaemon.java
^
|
@@ -3,14 +3,9 @@
*
* @author Diyar
*/
-import java.lang.management.ClassLoadingMXBean;
import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryMXBean;
import java.lang.management.ThreadMXBean;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class ThreadsDaemon
@@ -31,9 +26,7 @@
}
else {
try{
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +connectionInfo[0] + ":" + connectionInfo[1] + "/jmxrmi");
- JMXConnector c=JMXConnectorFactory.connect(u);
- MBeanServerConnection connection=c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
ThreadMXBean threadmxbean=ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.THREAD_MXBEAN_NAME, ThreadMXBean.class);
System.out.println("ThreadsDaemon.value "+threadmxbean.getDaemonThreadCount());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/ThreadsDeadlocked.java
^
|
@@ -2,9 +2,6 @@
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadMXBean;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
public class ThreadsDeadlocked {
@@ -16,14 +13,12 @@
System.out.println("graph_title JVM (port " + connectionInfo[1] + ") ThreadsDeadlocked\n" +
"graph_vlabel threads\n" +
"graph_category " + connectionInfo[2] + "\n" +
- "graph_info Returns the number of deadlocked threads for the JVM.\n" +
+ "graph_info Returns the number of deadlocked threads for the JVM. Usually not available at readonly access level.\n" +
"ThreadsDeadlocked.label ThreadsDeadlocked");
}
else {
try {
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +connectionInfo[0] + ":" + connectionInfo[1] + "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
ThreadMXBean mxbean=ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.THREAD_MXBEAN_NAME, ThreadMXBean.class);
System.out.print("ThreadsDeadlocked.value ");
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/ThreadsPeak.java
^
|
@@ -2,9 +2,6 @@
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadMXBean;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class ThreadsPeak {
@@ -25,9 +22,7 @@
else {
try{
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c=JMXConnectorFactory.connect(u);
- MBeanServerConnection connection=c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
ThreadMXBean threadmxbean=ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.THREAD_MXBEAN_NAME, ThreadMXBean.class);
System.out.println("ThreadsPeak.value "+threadmxbean.getPeakThreadCount());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/ThreadsStartedTotal.java
^
|
@@ -2,9 +2,6 @@
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadMXBean;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class ThreadsStartedTotal {
@@ -24,9 +21,7 @@
}
else {
try{
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c=JMXConnectorFactory.connect(u);
- MBeanServerConnection connection=c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
ThreadMXBean threadmxbean=ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.THREAD_MXBEAN_NAME, ThreadMXBean.class);
System.out.println("ThreadsStartedTotal.value "+threadmxbean.getTotalStartedThreadCount());
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/javalib/org/munin/plugin/jmx/Uptime.java
^
|
@@ -2,13 +2,12 @@
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
import java.io.FileNotFoundException;
import java.io.IOException;
public class Uptime {
+ private static final double MILLISECONDS_PER_DAY = 1000*60*60*24;
+
public static void main(String args[])throws FileNotFoundException,IOException {
String[] connectionInfo = ConfReader.GetConnectionInfo();
if (args.length == 1) {
@@ -22,12 +21,10 @@
}
else {
try {
- JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + connectionInfo[0] + ":" + connectionInfo[1]+ "/jmxrmi");
- JMXConnector c = JMXConnectorFactory.connect(u);
- MBeanServerConnection connection = c.getMBeanServerConnection();
+ MBeanServerConnection connection = BasicMBeanConnection.get();
RuntimeMXBean osmxbean = ManagementFactory.newPlatformMXBeanProxy(connection, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class);
- System.out.println("Uptime.value " + osmxbean.getUptime()/(1000*60*60*24));
+ System.out.println("Uptime.value " + osmxbean.getUptime()/MILLISECONDS_PER_DAY);
} catch (Exception e) {
System.out.print(e);
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/lib/Munin/Plugin.pm
^
|
@@ -16,7 +16,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: Plugin.pm 3142 2009-12-01 14:03:04Z janl $
+# $Id: Plugin.pm 3955 2010-10-11 23:46:31Z bldewolf $
#
package Munin::Plugin;
@@ -60,7 +60,7 @@
our @EXPORT = qw(
clean_fieldname
set_state_name save_state restore_state
- get_thresholds print_thresholds
+ get_thresholds print_thresholds adjust_threshold
tail_open tail_close
scaleNumber
need_multigraph
@@ -119,10 +119,17 @@
=head3 $Munin::Plugin::statefile
-The automatically calculated name for the plugins state file. This is
-simply a concatenation of the $statedir and the $me variables (with a
-slash between). To change the value of this please use the
-C<set_state_name($)> procedure (see below).
+The automatically calculated name for the plugins state file. The
+name is supplied by munin-node or munin-run (in the MUNIN_STATEFILE
+environment variable). The file name contains the plugin name and the
+ip-number of the munin-master the node is talking to (munin-run leaves
+the master part blank) to enable stateful plugins that calculate
+gauguges and assumes a 5 minute run interval to work in munin-setups
+with multiple munin-masters (this is not a uncommon way to set up
+Munin).
+
+To change the value of this please use the C<set_state_name($)>
+procedure (see below).
=cut
@@ -168,7 +175,9 @@
=head3 set_state_name($statefile_name)
Override the default statefile name. This only modifies the filename
-part, not the directory name.
+part, not the directory name. The function unconditionally appends
+"-$MUNIN_MASTER_IP" to the file name to support multiple masters as
+described in the documentation for the statefile variable (above).
Calling this function is not normally needed and is not recommended.
@@ -239,8 +248,7 @@
and absolutely no objects or references. The strings may contain
newlines without ill effect.
-If the file cannot be opened for writing the plugin will abort the
-program.
+If the file cannot be opened for writing the plugin will be aborted.
The state file name is determined automatically based on the
name of the process we're running as. See L<$Munin::Plugin::me>,
@@ -253,6 +261,10 @@
'%MUNIN-STATE1.0\n'. Files with this magic number will contain the
vector verbatim with \r, \n and % URL encoded.
+The function takes security precautions, like protesting fataly if the
+state file is a symbolic link (symbolic link overwriting can have
+unfortunate security ramifications).
+
=cut
sub save_state (@) {
@@ -279,8 +291,8 @@
everything is OK the state vector will be returned.
undef will be returned if the file cannot be opened. Likewise if it
-does not have a recognized magic number (in this case a warning will also
-be printed, which will appear in the munin-node logs).
+does not have a recognized magic number (in this case a warning will
+also be printed, which will appear in the munin-node logs).
=cut
@@ -358,6 +370,22 @@
print "$field.critical $critical\n" if defined($critical);
}
+=head3 adjust_threshold($threshold, $base)
+
+If $threshold contains % signs, return a new threshold with adjusted values for
+these percentages against $base.
+
+=cut
+
+sub adjust_threshold {
+ my ($threshold, $base) = @_;
+
+ return undef if(!defined $threshold or !defined $base);
+
+ $threshold =~ s!(\d+\.?\d*)%!$1*$base/100!eg;
+
+ return $threshold;
+}
=head3 ($file_handle,$rotated) = tail_open($file_name, $position)
@@ -519,9 +547,33 @@
=cut
-sub need_multigraph
-{
- return if $ENV{MUNIN_CAP_MULTIGRAPH};
+sub need_multigraph {
+ return if $ENV{MUNIN_CAP_MULTIGRAPH};
+
+ if (-t and (!$ARGV[0] or ($ARGV[0] eq 'config'))) {
+
+ # Catch people running the plugin on the command line. Note
+ # that munin-node-configure may also be detected as "command
+ # line" so be very conditional and careful about it.
+
+ # Observation: Munin-node-configure will first try "autoconf"
+ # which will fail so all other modes of running in combination
+ # with a tty on STDIN means that it's a human running us.
+
+ print "
+Please use at least munin-run 1.4.0 to run this plugin at the command
+line. You are probably looking for the command
+
+ munin-run --servicedir \$PWD $me
+
+This should by preference be run as root, but other users can also be
+used as long as the plugin doesn not use a state file and does not
+need to be run as a special user or need special priveliges.
+
+";
+
+ exit 1;
+ }
if (! $ARGV[0]) {
print "multigraph.value 0\n";
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/lib/Munin/Plugin/Pgsql.pm
^
|
@@ -21,7 +21,7 @@
# perlpod.
-# $Id: Pgsql.pm 3079 2009-11-25 12:59:45Z feiner.tom $
+# $Id: Pgsql.pm 4063 2010-12-16 14:46:08Z mha $
=head1 NAME
@@ -103,6 +103,8 @@
use strict;
use warnings;
+use Munin::Plugin;
+
=head2 Initialization
use Munin::Plugin::Pgsql;
@@ -221,7 +223,13 @@
$self->ensure_version();
- print "graph_title $self->{title}\n";
+ my $w = $self->wildcard_parameter();
+ if ($w) {
+ print "graph_title $self->{title} ($w)\n";
+ }
+ else {
+ print "graph_title $self->{title}\n";
+ }
print "graph_vlabel $self->{vlabel}\n";
print "graph_category PostgreSQL\n";
print "graph_info $self->{info}\n";
@@ -236,7 +244,7 @@
= $self->replace_wildcard_parameters(
$self->get_versioned_query($self->{configquery}));
foreach my $row (@{$self->runquery($q, \@p)}) {
- my $l = $row->[0];
+ my $l = Munin::Plugin::clean_fieldname($row->[0]);
print "$l.label $row->[1]\n";
print "$l.info $row->[2]\n" if (defined $row->[2]);
print "$l.type $self->{graphtype}\n";
@@ -255,7 +263,7 @@
sub Autoconf {
my ($self) = @_;
- if (!$self->connect(1)) {
+ if (!$self->connect(1, 1)) {
print "no ($self->{connecterror})\n";
return 1;
}
@@ -278,7 +286,7 @@
sub Suggest {
my ($self) = @_;
- if (!$self->connect(1)) {
+ if (!$self->connect(1, 1)) {
return 0;
}
@@ -302,8 +310,8 @@
$self->get_versioned_query($self->{basequery}));
my $r = $self->runquery($q, \@p, $self->{pivotquery});
foreach my $row (@$r) {
- my $l = $row->[0];
- print $row->[0] . ".value " . $row->[1] . "\n";
+ my $l = Munin::Plugin::clean_fieldname($row->[0]);
+ print $l . ".value " . $row->[1] . "\n";
}
return;
}
@@ -343,9 +351,9 @@
# Internal useful functions
sub connect() {
- my ($self, $noexit) = @_;
+ my ($self, $noexit, $nowildcard) = @_;
- my $r = $self->_connect();
+ my $r = $self->_connect($nowildcard);
return 1 if ($r); # connect successful
return 0 if ($noexit); # indicate failure but don't exit
print "Failed to connect to database: $self->{connecterror}\n";
@@ -353,7 +361,7 @@
}
sub _connect() {
- my ($self) = @_;
+ my ($self, $nowildcard) = @_;
return 1 if ($self->{dbh});
@@ -365,7 +373,7 @@
# All other connection parameters are controlled by the libpq environment
# variables.
my $dbname = "template1";
- $dbname = $self->wildcard_parameter(0) if ($self->{paramdatabase});
+ $dbname = $self->wildcard_parameter(0) if ($self->{paramdatabase} && !defined($nowildcard));
$self->{dbh} = DBI->connect("DBI:Pg:dbname=$dbname");
unless ($self->{dbh}) {
$self->{connecterror} = "$DBI::errstr";
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/lib/Munin/Plugin/SNMP.pm
^
|
@@ -24,7 +24,7 @@
# pattern. Please maintain it in the same way.
-# $Id: SNMP.pm 3090 2009-11-26 12:49:27Z runesk $
+# $Id: SNMP.pm 3868 2010-08-19 09:19:37Z mha $
=head1 NAME
@@ -32,7 +32,7 @@
=head1 SYNOPSIS
-The Munin::Plugin::SNMP module extends Net::SNMP with methods useful for
+The Munin::Plugin::SNMP module extends L<Net::SNMP> with methods useful for
Munin plugins.
=head1 SNMP CONFIGURATION
@@ -45,34 +45,29 @@
=head1 DEBUGGING
-This module fetches the global symbol $DEBUG ($::DEBUG) from the
-calling program and prints debugging messages based on this.
+Additional debugging messages can be enabled by setting
+C<$Munin::Plugin::SNMP::DEBUG>, C<$Munin::Plugin::DEBUG>, or by exporting
+the C<MUNIN_DEBUG> environment variable before running the plugin (by
+passing the C<--pidebug> option to C<munin-run>, for instance).
=cut
package Munin::Plugin::SNMP;
-# This file uses subroutine prototypes. This is concidered a bad
-# practice according to PBP (see page 194).
-
-## no critic Prototypes
-
use strict;
+use warnings;
use Net::SNMP;
+use Munin::Plugin;
-use vars qw(@ISA);
-@ISA = qw(Net::SNMP);
+our (@ISA, $DEBUG);
-# This is a internal function to "push" more elements onto a hash
-
-sub _pushhash ($$) {
- my ($pushtarget,$pushees) = @_;
+@ISA = qw(Net::SNMP);
+
+# Alias $Munin::Plugin::SNMP::DEBUG to $Munin::Plugin::DEBUG, so SNMP
+# plugins don't need to import the latter module to get debug output.
+*DEBUG = \$Munin::Plugin::DEBUG;
- while (my ($key,$value) = each %{$pushees}) {
- $pushtarget->{$key}=$value;
- }
-}
=head1 METHODS
@@ -245,7 +240,7 @@
my $object;
my $error;
- print STDERR "Setting up a SNMPv$version session\n" if $::DEBUG;
+ print STDERR "Setting up a SNMPv$version session\n" if $DEBUG;
($object, $error) = $class->SUPER::session(@options);
@@ -287,9 +282,10 @@
=item env.v3authpassword
-SNMPv3 authentication password. Authentication requires a
-v3authprotocol, but this defaults to "md5" and may therefore be left
-unspecified.
+SNMPv3 authentication password. Optional when encryption is also
+enabled, in which case defaults to the privacy password.
+Authentication requires a v3authprotocol, but this defaults to "md5"
+and may therefore be left unspecified.
The password is sent encrypted (one way hash) over the network.
@@ -301,16 +297,13 @@
=item env.v3privpassword
-SNMPv3 privacy password to enable encryption. A empty ('') password
+SNMPv3 privacy password to enable encryption. An empty ('') password
is considered as no password and will not enable encryption.
-Privacy requires a v3privprotocol as well as a v3authprotocol but both
-are defaulted (to 'des' and 'md5' respectively) and may therefore be
-left unspecified.
-
-(Note: the v3privpassword will be used for both authentication and
-privacy, if you know any context where this is wrong please contact
-us).
+Privacy requires a v3privprotocol as well as a v3authprotocol and a
+v3authpassword, but all of these are defaulted (to 'des', 'md5', and
+the v3privpassword value, respectively) and may therefore be left
+unspecified.
=item env.v3privprotocol
@@ -321,8 +314,8 @@
The implementing perl module (Net::SNMP) also supports '3des'
(CBC-3DES-EDE aka Triple-DES, NIST FIPS 46-3) as specified in IETF
-draft-reeder-snmpv3-usm-3desede. If this works or not with any
-particular device we do not know.
+draft-reeder-snmpv3-usm-3desede. Whether or not this works with any
+particular device, we do not know.
=back
@@ -336,14 +329,15 @@
my $username = $ENV{'v3username'};
if (defined($username)) {
+ # FIXME: isn't it an error if no username was specified?
push( @options, (-username => $username));
}
if ($privpw) {
# Privacy is a stronger demand and should be checked first.
- push( @options, ( -privpassword => $privpw
+ push( @options, ( -privpassword => $privpw,
-privprotocol => $privproto,
- -authpassword => $privpw,
+ -authpassword => ($authpw || $privpw),
-authprotocol => $authproto ));
# Note how Net::SNMP demands authentication options when
@@ -358,13 +352,13 @@
my ($object, $error) = $class->SUPER::session(@options);
if (!defined($object)) {
- die "Could not set up SNMPv3 seesion to $host: $error\n";
+ die "Could not set up SNMPv3 session to $host: $error\n";
}
return $object;
-
+
} else {
- die "Unknown SNMP version: '$version'. Do not know how to set up a session object for this.";
+ die "Unknown SNMP version: '$version'.";
}
}
@@ -479,13 +473,13 @@
my $handle = shift;
my $oid = shift;
- print STDERR "# Getting single $oid...\n" if $::DEBUG;
+ print STDERR "# Getting single $oid...\n" if $DEBUG;
my $response = $handle->get_request($oid);
- if (!defined $response->{$oid} or $handle->error_status) {
+ if (!defined $response->{$oid} or $handle->error_status or $response->{$oid} eq 'noSuchObject') {
print STDERR "# Error getting $oid: ",$handle->error(),"\n"
- if $::DEBUG;
+ if $DEBUG;
return;
}
return $response->{$oid};
@@ -503,43 +497,33 @@
=cut
-# (It might (or might not) be a good idea to rewrite this to use
-# get_table and use perl's grep to filter).
+sub get_by_regex
+{
+ my ($self, $baseoid, $regex) = @_;
+ my %result;
+
+ print "# Starting browse of table at $baseoid\n" if $DEBUG;
+
+ $baseoid =~ s/\.$//; # no trailing dots
+ my $response = $self->get_table(-baseoid => $baseoid);
+ unless ($response) {
+ print "# Failed to get table at $baseoid\n" if $DEBUG;
+ return;
+ }
-sub get_by_regex {
- my $handle = shift;
- my $oid = shift;
- my $regex = shift;
- my $result = {};
- my $num = 0;
- my $ret = $oid . "0";
- my $response;
-
- print "# Starting browse of $oid...\n" if $::DEBUG;
-
- while (1) {
- if ($num == 0) {
- print "# Checking for $ret...\n" if $::DEBUG;
- $response = $handle->get_request ($ret);
- }
- if ($num or !defined $response) {
- print "# Checking for sibling of $ret...\n" if $::DEBUG;
- $response = $handle->get_next_request ($ret);
- }
- if (!$response) {
- return;
- }
- my @keys = keys %$response;
- $ret = $keys[0];
- print "# Analyzing $ret (compared to $oid)...\n" if $::DEBUG;
- last unless ($ret =~ /^$oid/);
- $num++;
- next unless ($response->{$ret} =~ /$regex/);
- @keys = split (/\./, $ret);
- $result->{$keys[-1]} = $response->{$ret};;
- print "# Index $num: ", $keys[-1], " (", $response->{$ret}, ")\n" if $::DEBUG;
- };
- return $result;
+ while (my ($oid, $value) = each %$response) {
+ unless ($value =~ /$regex/) {
+ print "# '$value' doesn't match /$regex/. Ignoring\n" if $DEBUG;
+ next;
+ }
+ my ($index) = ($oid =~ m{^\Q$baseoid.\E(.*)})
+ or die "$oid doesn't appear to be a descendent of $baseoid";
+
+ $result{$index} = $value;
+ print "# Index '$index', value $value\n" if $DEBUG;
+ }
+
+ return \%result;
}
1;
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.darwin/if_.in
^
|
@@ -153,13 +153,15 @@
echo 'graph_category network'
echo "graph_info This graph shows the traffic of the $INTERFACE network interface. Please note that the traffic is shown in bits per second, not bytes. IMPORTANT: Since the data source for this plugin use 32bit counters, this plugin is really unreliable and unsuitable for most 100Mb (or faster) interfaces, where bursts are expected to exceed 50Mbps. This means that this plugin is unsuitable for most production environments. To avoid this problem, use the ip_ plugin instead."
echo 'down.label received'
- echo 'down.type COUNTER'
+ echo 'down.type DERIVE'
echo 'down.graph no'
echo 'down.cdef down,8,*'
+ echo 'down.min 0'
echo 'up.label bps'
- echo 'up.type COUNTER'
+ echo 'up.type DERIVE'
echo 'up.negative down'
echo 'up.cdef up,8,*'
+ echo 'up.min 0'
findspeed
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.darwin/load.in
^
|
@@ -93,5 +93,5 @@
# real work - i.e. display the data. Almost always this will be
# "value" subfield for every data field.
-echo -n "load.value "
+printf "load.value "
uptime | sed -e 's/^.*load averages: [^ ]* //' -e 's/ [^ ]*$//'
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.freebsd/coretemp.in
^
|
@@ -75,7 +75,7 @@
reqcpus
for cpu in $cpus ; do
echo -n "CPU$cpu.value "
- sysctl -n dev.cpu.$cpu.temperature
+ sysctl -n dev.cpu.$cpu.temperature | tr -d C
done
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.freebsd/if_.in
^
|
@@ -49,13 +49,15 @@
echo 'graph_category network'
echo "graph_info This graph shows the traffic of the $INTERFACE network interface. Please note that the traffic is shown in bits per second, not bytes. IMPORTANT: Since the data source for this plugin use 32bit counters, this plugin is really unreliable and unsuitable for most 100Mb (or faster) interfaces, where bursts are expected to exceed 50Mbps. This means that this plugin is unsuitable for most production environments."
echo 'rbytes.label received'
- echo 'rbytes.type COUNTER'
+ echo 'rbytes.type DERIVE'
echo 'rbytes.graph no'
echo 'rbytes.cdef rbytes,8,*'
+ echo 'rbytes.min 0'
echo 'obytes.label bps'
- echo 'obytes.type COUNTER'
+ echo 'obytes.type DERIVE'
echo 'obytes.negative rbytes'
echo 'obytes.cdef obytes,8,*'
+ echo 'obytes.min 0'
echo "obytes.info Traffic sent (+) and received (-) on the $INTERFACE network interface."
exit 0
fi
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.hp-ux/if_.in
^
|
@@ -59,15 +59,15 @@
echo 'graph_vlabel bits per ${graph_period} in (-) / out (+)'
echo 'graph_category network'
echo 'inbound.label received'
- echo 'inbound.type COUNTER'
- echo 'inbound.max 2000000000'
+ echo 'inbound.type DERIVE'
echo 'inbound.graph no'
echo 'inbound.cdef inbound,8,*'
+ echo 'inbound.min 0'
echo 'outbound.label bps'
- echo 'outbound.type COUNTER'
+ echo 'outbound.type DERIVE'
echo 'outbound.negative inbound'
echo 'outbound.cdef outbound,8,*'
- echo 'outbound.max 2000000000'
+ echo 'outbound.min 0'
exit 0
fi
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/apt.in
^
|
@@ -40,6 +40,12 @@
Link this plugin in @@CONFDIR@@/plugins/ and restart the munin-node.
+=head1 NOTES
+
+This plugin does not actually draw graphs; it is rather designed to
+generated warnings. To get a graph showing the number of available
+packages, please see the "apt_all" plugin.
+
=head1 MAGIC MARKERS
#%# family=manual
@@ -51,7 +57,7 @@
=head1 VERSION
-$Id: apt.in 2314 2009-08-03 11:28:34Z ssm $
+$Id: apt.in 3371 2010-02-22 11:36:13Z ssm $
=head1 AUTHOR
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/bonding_err_.in
^
|
@@ -47,6 +47,9 @@
EOF
+# Source plugin library functions
+. $MUNIN_LIBDIR/plugins/plugin.sh
+
PROCDIR="/proc/net/bonding"
MYSELF=$(basename $0)
FILENAME="bonding_err_"
@@ -75,10 +78,11 @@
echo "graph_category Network"
echo "graph_args --base 1000 -l 0"
grep "^Slave Interface:" ${PROCDIR}/${BONDINGIF} | while read a b if; do
- echo "if_${if}.label ${if}"
- echo "if_${if}.type DERIVE"
- echo "if_${if}.min 0"
- echo "if_${if}.warning 0"
+ fieldname=$(clean_fieldname "$if")
+ echo "if_${fieldname}.label ${if}"
+ echo "if_${fieldname}.type DERIVE"
+ echo "if_${fieldname}.min 0"
+ echo "if_${fieldname}.warning 0"
done
fi
exit 0
@@ -91,8 +95,10 @@
BONDINGIF=$(echo $MYSELF | sed "s/^$FILENAME//")
grep "^Slave Interface:" ${PROCDIR}/${BONDINGIF} | while read a b if; do
- # echo "if_${if}.label ${if}"
- echo -n "if_${if}.value "
+ fieldname=$(clean_fieldname "$if")
+ echo -n "if_${fieldname}.value "
grep -A 2 "^Slave Interface: ${if}" ${PROCDIR}/${BONDINGIF} | grep "Link Failure Count:" | cut -d " " -f 4
done
+
+# vim: syntax=sh ts=2 et
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/node.d.linux/buddyinfo.in
^
|
@@ -0,0 +1,150 @@
+#!@@PERL@@ -w
+
+=pod
+
+=encoding UTF-8
+
+=head1 NAME
+
+buddyinfo - Plugin to monitor memory fragmentation on Linux systems.
+
+=head1 APPLICABLE SYSTEMS
+
+Linux 2.5.40+, 2.6.x
+
+=head1 CONFIGURATION
+
+None needed.
+
+=head1 INTERPRETATION
+
+Linux manages virtual memory on a page granularity. There are some operations
+however that require physically contiguous pages to be allocated by the kernel.
+Such allocations may fail if the memory gets fragmented and even though there
+are enough pages free, but they are not contiguous.
+
+This plugin monitors the amount of contiguous areas, called higher order pages.
+The order means the exponent of two of the size of the area, so order 2 means
+2^2 = 4 pages.
+
+=head1 SEE ALSO
+
+See C<Documentation/filesystems/proc.txt> in the Linux source tree for the
+description of the buddyinfo file.
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+ #%# capabilities=autoconf
+
+=head1 AUTHOR
+
+Gábor Gombás <gombasg@sztaki.hu>
+
+=head1 LICENSE
+
+GPLv2 or later
+
+=cut
+
+use strict;
+use Munin::Plugin;
+use POSIX;
+use Carp;
+
+need_multigraph();
+
+if ($ARGV[0] and $ARGV[0] eq 'autoconf') {
+ if (-f "/proc/buddyinfo") {
+ print "yes\n";
+ }
+ else {
+ print "no (/proc/buddyinfo is missing)\n";
+ }
+ exit 0;
+}
+
+# The most common page size is 4k, but it is not universal
+my $pagesize = POSIX::sysconf(&POSIX::_SC_PAGESIZE) / 1024;
+
+my $zones = {};
+
+open(FH, '< /proc/buddyinfo')
+ or croak "Failed to open '/proc/buddyinfo': $!";
+while (my $line = <FH>) {
+ chomp $line;
+
+ $line =~ m/Node (\d+), zone\s+(\S+)\s+(\S.*)$/;
+ my $name = "Node $1, zone $2";
+ my @cnt = split(/ +/, $3);
+ $zones->{$name} = \@cnt;
+}
+close FH;
+
+my $totals = [];
+foreach my $zone (keys %$zones) {
+ for my $i (0 .. $#{$zones->{$zone}}) {
+ $totals->[$i] += $zones->{$zone}->[$i]
+ }
+}
+
+sub do_config {
+ print "multigraph buddyinfo\n";
+ print "graph_title Memory fragmentation\n";
+ print "graph_args --base 1024 --lower-limit 0\n";
+ print "graph_vlabel pages free\n";
+ print "graph_category system\n";
+ print "graph_info This graph shows the number of free pages of different size\n";
+ print "graph_order " . join(' ', map { "order$_" } (0 .. $#{$totals})) . "\n";
+ for my $i (0 .. $#{$totals}) {
+ print "order$i.label Order $i\n";
+ print "order$i.info Number of order $i (" . ($pagesize * 2 ** $i) . " KiB) pages\n";
+ print "order$i.type GAUGE\n";
+ print "order$i.draw LINE2\n";
+ print "order$i.min 0\n";
+ }
+ for my $zone (sort keys %$zones) {
+ my $zoneid = $zone;
+ $zoneid = clean_fieldname($zone);
+
+ print "multigraph buddyinfo.$zoneid\n";
+ print "graph_title Memory fragmentation in $zone\n";
+ print "graph_args --base 1024 --lower-limit 0\n";
+ print "graph_vlabel pages free\n";
+ print "graph_category system\n";
+ print "graph_info This graph shows the number of free pages in $zone\n";
+ print "graph_order " .
+ join(' ', map { "order$_" } (0 .. $#{$zones->{$zone}})) . "\n";
+ for my $i (0 .. $#{$zones->{$zone}}) {
+ print "order$i.label Order $i\n";
+ print "order$i.info Number of order $i (" .
+ ($pagesize * 2 ** $i) . " KiB) pages\n";
+ print "order$i.type GAUGE\n";
+ print "order$i.draw LINE2\n";
+ print "order$i.min 0\n";
+ }
+ }
+}
+
+sub do_fetch {
+ print "multigraph buddyinfo\n";
+ for my $i (0 .. $#{$totals}) {
+ print "order$i.value " . $totals->[$i] . "\n";
+ }
+ for my $zone (sort keys %$zones) {
+ my $zoneid = $zone;
+ $zoneid =~ tr/ ,/__/;
+
+ print "multigraph buddyinfo.$zoneid\n";
+ for my $i (0 .. $#{$zones->{$zone}}) {
+ print "order$i.value " . $zones->{$zone}->[$i] . "\n";
+ }
+ }
+}
+
+if ($ARGV[0] and $ARGV[0] eq 'config') {
+ do_config();
+ exit 0;
+}
+
+do_fetch();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/cpu.in
^
|
@@ -17,14 +17,53 @@
[cpu]
env.HZ 100
-Some combinations of hardware and Linux (probably only
-2.4 kernels) use 1000 units/second in /proc/stat
-corresponding to the systems HZ. (see /usr/src/linux/include/asm/param.h). But Almost all systems use 100 units/second and this is our default. Even if Documentation/proc.txt in the kernel source says
-otherwise. - Finding and fix by dz@426.ch
+See "BUGS" for a explanation of this setting.
+
+=head2 EXAMPLE WARNING AND CRITICAL SETTINGS
+
+You can also set warning and critical levels for each of the data
+series the plugin reports. The following environment variables are
+used as default for all fields:
+
+ env.warning
+ env.critical
+
+But each field can be controlled separately:
+
+ env.system_warning
+ env.system_critical
+
+ env.user_warning
+ env.user_critical
+
+ env.nice_warning
+ env.nice_critical
+
+ env.idle_warning
+ env.idle_critical
+
+For some kernels there is also the following settings:
+
+ env.iowait_warning
+ env.iowait_critical
+ env.irq_warning
+ env.irq_critical
+ env.softirq_warning
+ env.softirq_critical
+ env.steal_warning
+ env.steal_critical
+
=head1 INTERPRETATION
-The plugin shows cpu usage in percent. In case of more than one core it displays 100% for each core.
+The plugin shows cpu usage in percent. In case of more than one core
+it displays 100% for each core.
+
+If a core is 100% busy there will be no "iowait" showing, that only
+shows if the CPU has nothing else to do while it waits on IO.
+Therefore a 100% busy core can hide a lot of iowait. Please refer to
+the IO latency and other disk related graphs for further information
+about IO performance.
=head1 MAGIC MARKERS
@@ -34,11 +73,18 @@
=head1 VERSION
- $Id: cpu.in 2352 2009-08-17 23:58:18Z bldewolf $
+ $Id: cpu.in 4007 2010-11-17 23:23:48Z bldewolf $
=head1 BUGS
-None known
+Some combinations of hardware and Linux (probably only 2.4 kernels)
+use 1000 units/second in /proc/stat corresponding to the systems
+HZ. (see /usr/src/linux/include/asm/param.h). But Almost all systems
+use 100 units/second and this is our default. Even if
+Documentation/proc.txt in the kernel source says otherwise. - Finding
+and fix by dz@426.ch
+
+Otherwise none known
=head1 AUTHOR
@@ -112,8 +158,7 @@
echo 'idle.info Idle CPU time'
for field in system user nice idle; do
- print_warning "$field"
- print_critical "$field"
+ print_adjusted_thresholds "$field" "$graphlimit"
done
if [ "$scaleto100" = "yes" ]; then
@@ -145,8 +190,7 @@
echo "softirq.cdef softirq,$NCPU,/"
fi
for field in iowait irq softirq; do
- print_warning "$field"
- print_critical "$field"
+ print_adjusted_thresholds "$field" "$graphlimit"
done
fi
@@ -161,8 +205,7 @@
echo "steal.cdef steal,$NCPU,/"
fi
for field in steal; do
- print_warning "$field"
- print_critical "$field"
+ print_adjusted_thresholds "$field" "$graphlimit"
done
fi
exit 0
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/cpuspeed.in
^
|
@@ -73,7 +73,7 @@
if [ "$1" = "config" ]; then
echo graph_title CPU frequency scaling
echo graph_args --base 1000
- echo graph_info This graph shows the speeds at which the CPUs are running
+ echo graph_info This graph shows the average speeds at which the CPUs are running
echo graph_category system
if [ "$scaleto100" = "yes" ]; then
@@ -115,6 +115,7 @@
for c in /sys/devices/system/cpu/cpu[0-9]*; do
N=${c##*/cpu}
- awk -v cpu=$N '{ cycles += $1 * $2 } END { print "cpu" cpu ".value", cycles / 100 }' \
+ awk -v cpu=$N '{ cycles += $1 * $2 }
+ END { printf "cpu%d.value %.0f\n", cpu, cycles / 100; }' \
$c/cpufreq/stats/time_in_state
done
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/df.in
^
|
@@ -12,7 +12,7 @@
=head1 CONFIGURATION
The plugin excludes per default the following special, read-only or
-dynamically allocating file systems from graphing:
+dynamically allocating file systems from graphing:
none unknown iso9660 squashfs udf romfs ramfs
@@ -24,7 +24,7 @@
This configuration snipplet is an example with the defaults:
[df]
- env.exclude none unknown iso9660 squashfs udf romfs ramfs
+ env.exclude none unknown iso9660 squashfs udf romfs ramfs debugfs
env.warning 92
env.critical 98
@@ -35,7 +35,25 @@
env._dev_sda2_warning 98
env._dev_sda2_critical 99
-=head1 USAGE
+Devices can be explicitly included or excluded based on their mountpoint or
+device name using the include_re and exclude_re environment variables. These
+environment variables are parsed as whitespace separated regular expressions.
+For example, if you wish to ignore the filesystem on /dev/sda2 and all
+filesystems mounted under /var except /var/tmp, these rules would achieve this:
+
+ env.include_re ^/var/tmp$
+ env.exclude_re /dev/sda2 ^/var/
+
+Please note that these expressions are tried against both mountpoints and
+device names, therefore broad matches could potentially filter out desired
+devices. Anchoring is also useful for avoiding false positives (as seen in the
+example), but not strictly necessary. Testing with munin-run is always a good
+idea.
+
+Also note that a mountpoint that is excluded by filesystem type but included by
+RE will not be included.
+
+=head1 USAGE
Link this plugin to @@CONFDIR@@/plugins/ and restart the munin-node.
@@ -51,7 +69,7 @@
=head1 VERSION
-$Id: df.in 3142 2009-12-01 14:03:04Z janl $
+ $Id: df.in 4169 2011-04-19 03:01:40Z bldewolf $
=head1 AUTHOR
@@ -69,74 +87,83 @@
# For these devices use the mount point, the device is useless
my %usemntpt = ( tmpfs => 1, none => 1, udev => 1 );
-my $exclude=$ENV{'exclude'} || 'none unknown iso9660 squashfs udf romfs ramfs';
-my $dfopts = "-P -l ".join(' -x ',('',split('\s+',$exclude)));
-
-sub print_values() {
-
- # Read from df
- open (DF,"df $dfopts |") or die "Could not open pipe from df, $!";
- <DF>; # Skip the header
- while (<DF>) {
- chomp;
- next if /\/\//; # Ignore lines containing //? Samba?
-
- # Parse the output
- my ($name,undef,$used,$avail,undef,$mountpt,undef)=split(/\s+/,$_,7);
+my $exclude = $ENV{'exclude'} || 'none unknown iso9660 squashfs udf romfs ramfs debugfs simfs';
+my $dfopts = "-P -l ".join(' -x ',('',split('\s+',$exclude)));
- $name = $mountpt if defined($usemntpt{$name}) && $usemntpt{$name};
+my $mode = ($ARGV[0] or "print");
- $name=clean_fieldname($name);
+# Compile REs from env
+my @include_re;
+if (defined $ENV{include_re}) {
+ foreach my $re (split m{\s+}, $ENV{include_re}) {
+ push @include_re, qr/$re/;
+ }
+}
+my @exclude_re;
+if (defined $ENV{exclude_re}) {
+ foreach my $re (split m{\s+}, $ENV{exclude_re}) {
+ push @exclude_re, qr/$re/;
+ }
+}
- my $ps = 0;
+sub skip {
+ my $name = shift;
+ my $mountpt = shift;
- $ps = ( $used / ($used+$avail) ) * 100 if $used;
+ foreach my $re (@include_re) {
+ return 0 if ($name =~ $re or $mountpt =~ $re);
+ }
- print $name, ".value ", $ps, "\n";
+ foreach my $re (@exclude_re) {
+ return 1 if ($name =~ $re or $mountpt =~ $re);
}
- close DF;
- die "Error executing df. Exit code $?\n" if $?;
+
+ return 0;
}
-if ( defined($ARGV[0]) and $ARGV[0] eq "autoconf" ) {
- if (`@@PERL@@ $0` eq "" ) {
- print "no\n";
- exit 0;
+if ($mode eq 'autoconf' ) {
+ if (`@@PERL@@ $0` eq '' ) {
+ print "no (no devices to monitor)\n";
} else {
- print "yes\n";
- exit 0;
+ print "yes\n";
}
+ exit 0;
}
-if ( defined($ARGV[0]) and $ARGV[0] eq "config" ) {
+if ($mode eq 'config' ) {
# The headers
print "graph_title Disk usage in percent\n";
print "graph_args --upper-limit 100 -l 0\n";
print "graph_vlabel %\n";
print "graph_scale no\n";
print "graph_category disk\n";
-
- # Read from df
- open (DF,"df $dfopts |") or die "Unable to open pipe from df: $!";
- <DF>; # Skip the header
- while (<DF>) {
- next if /\/\//;
-
- # Parse the output
- my ($name,undef,undef,undef,$ps,$mountpt,undef)=split(/\s+/,$_,7);
-
- $name = $mountpt if defined($usemntpt{$name}) && $usemntpt{$name};
-
- $name=clean_fieldname($name);
-
- # Create and print labels
- print $name, ".label ", $mountpt, "\n";
+}
- print_thresholds($name,undef,undef,92,98);
+# Read from df
+open (DF,"df $dfopts 2>/dev/null |") or die "Unable to open pipe from df: $!";
+<DF>; # Skip the header
+while (<DF>) {
+ next if m{//};
+
+ # Parse the output
+ my ($name, undef, $used, $avail, undef, $mountpt, undef) = split(/\s+/, $_, 7);
+
+ next if skip($name, $mountpt);
+
+ # Calculate percentage used
+ my $ps = 0;
+ $ps = ($used / ($used+$avail)) * 100 if $used;
+
+ $name = $mountpt if defined($usemntpt{$name}) && $usemntpt{$name};
+ $name = clean_fieldname($name);
+
+ if($mode eq 'config') {
+ print $name, ".label ", $mountpt, "\n";
+ print_thresholds($name,undef,undef,92,98);
+ } else {
+ print $name, ".value ", $ps, "\n";
}
- close DF;
- die "Error executing df. Exit code $?\n" if $?;
- exit 0;
}
+close DF;
-print_values();
+# vim: ft=perl : sw=4 : ts=4 : et
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/df_abs.in
^
|
@@ -15,6 +15,7 @@
env.exclude - space separated list of file system types to exclude
env.warning - Warning percentage
env.critical - Critical percentage
+ env.total - Enable/Disable graph total [on|off]
=head2 DEFAULT CONFIGURATION
@@ -22,6 +23,7 @@
env.exclude iso9660
env.warning 92
env.critical 98
+ env.total on
=head1 AUTHORS
@@ -54,9 +56,10 @@
exit 0
fi
-exclude=${exclude:-iso9660}
+total=${total:-on}
-exclude=$(echo $exclude | sed -e 's/ +/ -x /g' -e 's/^/-x /')
+exclude=${exclude:-iso9660}
+exclude=$(echo $exclude | sed -r -e 's/ +/ -x /g' -e 's/^/-x /')
if [ "$1" = "config" ]; then
@@ -64,7 +67,9 @@
echo 'graph_args --base 1024 --lower-limit 0'
echo 'graph_vlabel bytes'
echo 'graph_category disk'
- echo 'graph_total Total'
+ if [ "$total" = "on" ]; then
+ echo 'graph_total Total'
+ fi
df -P -l $exclude | sed 1d | grep -v "//" |
while read dev size used avail cap mnt; do
name="$(clean_fieldname $dev)"
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/df_inode.in
^
|
@@ -1,22 +1,75 @@
-#!@@PERL@@
-# -*- perl -*-
+#!@@PERL@@ -w
+# -*- perl -*-
=head1 NAME
-df_inode - Plugin to monitor inode-usage.
+df_inode - Munin plugin to monitor inode usage
+
+=head1 APPLICABLE SYSTEMS
+
+Every Linux system with df installed.
=head1 CONFIGURATION
-This configuration snipplet is an example with the default configuration:
+The plugin excludes per default the following special, read-only or
+dynamically allocating file systems from graphing:
+
+ none unknown iso9660 squashfs udf romfs ramfs
+
+To change this set the environment variable "exclude" with a list of
+space separated fs types. The environment variables "warning" and
+"critical" sets the percentage from which Munin starts to warn about
+the disk usage.
+
+This configuration snipplet is an example with the defaults:
- [df]
- env.exclude none unknown iso9660 squashfs udf romfs ramfs
+ [df_inode]
+ env.exclude none unknown iso9660 squashfs udf romfs ramfs debugfs
env.warning 92
env.critical 98
-=head1 NOTES
+Put it in a file in @@CONFDIR@@/plugin-conf.d/ and restart the munin-node.
+
+You may specify filesystem specific warning and critical levels:
+
+ env._dev_sda2_warning 98
+ env._dev_sda2_critical 99
+
+Devices can be explicitly included or excluded based on their mountpoint or
+device name using the include_re and exclude_re environment variables. These
+environment variables are parsed as whitespace separated regular expressions.
+For example, if you wish to ignore the filesystem on /dev/sda2 and all
+filesystems mounted under /var except /var/tmp, these rules would achieve this:
+
+ env.include_re ^/var/tmp$
+ env.exclude_re /dev/sda2 ^/var/
+
+Please note that these expressions are tried against both mountpoints and
+device names, therefore broad matches could potentially filter out desired
+devices. Anchoring is also useful for avoiding false positives (as seen in the
+example), but not strictly necessary. Testing with munin-run is always a good
+idea.
+
+Also note that a mountpoint that is excluded by filesystem type but included by
+RE will not be included.
+
+=head1 USAGE
+
+Link this plugin to @@CONFDIR@@/plugins/ and restart the munin-node.
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=head1 BUGS
-Rewrite based on original shell-based version
+Uses device names instead of mount points to identify mounted
+filesystems.
+
+=head1 VERSION
+
+ $Id: df_inode.in 4169 2011-04-19 03:01:40Z bldewolf $
=head1 AUTHOR
@@ -26,11 +79,6 @@
GPLv2
-=head1 MAGIC MARKERS
-
- #%# family=auto
- #%# capabilities=autoconf
-
=cut
use strict;
@@ -39,75 +87,83 @@
# For these devices use the mount point, the device is useless
my %usemntpt = ( tmpfs => 1, none => 1, udev => 1 );
-my $exclude=$ENV{'exclude'} || 'none unknown iso9660 squashfs udf romfs ramfs vfat';
-my $dfopts = "-P -l -i ".join(' -x ',('',split('\s+',$exclude)));
+my $exclude = $ENV{'exclude'} || 'none unknown iso9660 squashfs udf romfs ramfs vfat debugfs simfs';
+my $dfopts = "-P -l -i ".join(' -x ',('',split('\s+',$exclude)));
-sub print_values() {
+my $mode = ($ARGV[0] or "print");
- # Read from df
- open (DF,"df $dfopts |") or die "Could not open pipe from df: $!";
- <DF>; # Skip the header
- while (<DF>) {
- next if /\/\//;
-
- # Parse the output
- if ( /^(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\S+)\s+(\S+)/ ) {
- my $ps=$5;
+# Compile REs from env
+my @include_re;
+if (defined $ENV{include_re}) {
+ foreach my $re (split m{\s+}, $ENV{include_re}) {
+ push @include_re, qr/$re/;
+ }
+}
+my @exclude_re;
+if (defined $ENV{exclude_re}) {
+ foreach my $re (split m{\s+}, $ENV{exclude_re}) {
+ push @exclude_re, qr/$re/;
+ }
+}
- my $name = $1;
- $name = $6 if defined($usemntpt{$name}) && $usemntpt{$name};
- $name=clean_fieldname($name);
+sub skip {
+ my $name = shift;
+ my $mountpt = shift;
- $ps =~ s/\%//;
+ foreach my $re (@include_re) {
+ return 0 if ($name =~ $re or $mountpt =~ $re);
+ }
- print $name . ".value " . $ps . "\n";
- }
+ foreach my $re (@exclude_re) {
+ return 1 if ($name =~ $re or $mountpt =~ $re);
}
- close DF;
- die "Error executing df. Exit code $?\n" if $?;
+
+ return 0;
}
-if ( $ARGV[0] eq "autoconf" ) {
- if (`@@PERL@@ $0` eq "" ) {
- print "no\n";
- exit 0;
- } else {
- print "yes\n";
+if ($mode eq 'autoconf' ) {
+ if (`@@PERL@@ $0` eq '' ) {
+ print "no (no devices to monitor)\n";
+ } else {
+ print "yes\n";
+ }
exit 0;
- }
}
-if ( $ARGV[0] eq "config" ) {
-
+if ($mode eq 'config' ) {
# The headers
print "graph_title Inode usage in percent\n";
print "graph_args --upper-limit 100 -l 0\n";
print "graph_vlabel %\n";
print "graph_scale no\n";
print "graph_category disk\n";
+}
- # Read from df
- open (DF,"df $dfopts |") or die "Unable to open pipe from df: $!";
- <DF>; # Skip the header
- while (<DF>) {
- next if /\/\//;
-
- # Parse the output
- if ( /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/ ) {
- my $dir=$6;
-
- my $name = $1;
- $name = $dir if defined($usemntpt{$name}) && $usemntpt{$name};
- $name=clean_fieldname($name);
-
- # Create and print labels
- print "$name.label $dir\n";
- print_thresholds($name,undef,undef,92,98);
- }
+# Read from df
+open (DF,"df $dfopts 2>/dev/null |") or die "Unable to open pipe from df: $!";
+<DF>; # Skip the header
+while (<DF>) {
+ next if m{//};
+
+ # Parse the output
+ my ($name, undef, $used, $avail, undef, $mountpt, undef) = split(/\s+/, $_, 7);
+
+ next if skip($name, $mountpt);
+
+ # Calculate percentage used
+ my $ps = 0;
+ $ps = ($used / ($used+$avail)) * 100 if $used;
+
+ $name = $mountpt if defined($usemntpt{$name}) && $usemntpt{$name};
+ $name = clean_fieldname($name);
+
+ if($mode eq 'config') {
+ print $name, ".label ", $mountpt, "\n";
+ print_thresholds($name,undef,undef,92,98);
+ } else {
+ print $name, ".value ", $ps, "\n";
}
- close DF;
- die "Error executing df. Exit code $?\n" if $?;
- exit 0;
}
+close DF;
-print_values();
+# vim: ft=perl : sw=4 : ts=4 : et
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/node.d.linux/diskstats.in
^
|
@@ -0,0 +1,1235 @@
+#!@@PERL@@
+# -*- perl -*-
+# vim: sts=4 sw=4 ts=8
+
+# Docs at the bottom
+
+use strict;
+use warnings;
+
+use File::Basename;
+use Carp;
+use POSIX;
+use Munin::Plugin;
+use MIME::Base64;
+use Storable qw(freeze thaw);
+
+# Hardcoded pollinterval of 300 seconds
+my $poll_interval = 300;
+
+# Graph width defaults to 400 in Munin 1.4
+my $graph_width = $ENV{'graph_width'} ? $ENV{'graph_width'} : 400;
+
+# Should lables be trimmed to fit graph width?
+my $trim_labels = $ENV{'trim_labels'};
+
+my $plugin_name = $Munin::Plugin::me;
+
+# Check for multigraph capabilities
+need_multigraph();
+
+# Handle munin 'autoconf' command
+do_autoconf() if ( $ARGV[0] && $ARGV[0] eq 'autoconf' );
+
+# Fetch current counter values
+my %cur_diskstats = fetch_device_counters();
+
+# Weed out unwanted devices
+filter_device_list( \%cur_diskstats );
+
+# Handle munin 'config' command
+# This can only be done after getting the device data
+if ( defined $ARGV[0] && $ARGV[0] eq 'config' ) {
+ do_config();
+}
+
+# Restore data from previous run
+my ( $prev_time, %prev_diskstats ) = choose_old_state();
+
+# Persist state from current run
+add_new_state( time(), %cur_diskstats );
+
+# Probably the first run for the given device, we need state to do our job,
+# so let's wait for the next run.
+exit if ( not defined $prev_time or not %prev_diskstats );
+
+# Here happens the magic
+generate_multigraph_data( $prev_time, \%prev_diskstats, \%cur_diskstats );
+
+exit 0;
+
+########
+# SUBS #
+########
+
+# generate_multigraph_data
+#
+# Creates the data which is needed by munin's fetch command
+
+sub generate_multigraph_data {
+
+ my ( $prev_time, $prev_diskstats, $cur_diskstats ) = @_;
+
+ my %results;
+
+ for my $device ( keys %{$cur_diskstats} ) {
+ $results{$device} =
+ calculate_values( $prev_time, $prev_diskstats{$device},
+ $cur_diskstats{$device} );
+ }
+
+ print_values_root( \%results );
+
+ for my $device ( keys %results ) {
+ print_values_device( $device, $results{$device} );
+ }
+ return;
+}
+
+# choose_old_state
+#
+# Look through the list of old states and choose the one which is closest
+# to the poll interval
+
+sub choose_old_state {
+
+ my (%states) = restore_state();
+
+ return unless ( keys %states );
+
+ my $now = time();
+
+ my $old_delta;
+ my $return_timestamp;
+
+ for my $timestamp ( sort keys %states ) {
+
+ # Calculate deviation from ideal interval
+ my $delta = abs( $now - $timestamp - $poll_interval );
+
+ # Safe initial delta
+ $old_delta = $delta + 1 unless defined $old_delta;
+
+ # Bail out and use previous result if it was closer to the interval
+ last if ( $delta > $old_delta );
+
+ $old_delta = $delta;
+ $return_timestamp = $timestamp;
+ }
+ return $return_timestamp,
+ %{ thaw decode_base64 $states{$return_timestamp} };
+}
+
+# add_new_state
+#
+# Add the current state to the list of states
+# Discard any state that is noticeable older than the poll interval
+
+sub add_new_state {
+ my ( $cur_time, %cur_diskstats ) = @_;
+
+ my (%states) = restore_state();
+ my $now = time();
+
+ for my $timestamp ( sort keys %states ) {
+ last if ( ( $now - $timestamp ) <= $poll_interval * 1.5 );
+ delete $states{$timestamp};
+ }
+
+ # FIXME: There ought to be a better way to do this.
+ $states{$cur_time} = encode_base64 freeze \%cur_diskstats;
+
+ save_state(%states);
+ return;
+}
+
+# calculate_values
+#
+# Calculates all data that get's graphed
+
+sub calculate_values {
+ my ( $prev_time, $prev_stats, $cur_stats ) = @_;
+
+ my $bytes_per_sector = 512;
+
+ my $interval = time() - $prev_time;
+
+ my $read_ios = $cur_stats->{'rd_ios'} - $prev_stats->{'rd_ios'};
+ my $write_ios = $cur_stats->{'wr_ios'} - $prev_stats->{'wr_ios'};
+
+ my $rd_ticks = $cur_stats->{'rd_ticks'} - $prev_stats->{'rd_ticks'};
+ my $wr_ticks = $cur_stats->{'wr_ticks'} - $prev_stats->{'wr_ticks'};
+
+ my $rd_sectors = $cur_stats->{'rd_sectors'} - $prev_stats->{'rd_sectors'};
+ my $wr_sectors = $cur_stats->{'wr_sectors'} - $prev_stats->{'wr_sectors'};
+
+ my $tot_ticks = $cur_stats->{'tot_ticks'} - $prev_stats->{'tot_ticks'};
+
+ my $read_io_per_sec = $read_ios / $interval;
+ my $write_io_per_sec = $write_ios / $interval;
+
+ my $read_bytes_per_sec = $rd_sectors / $interval * $bytes_per_sector;
+ my $write_bytes_per_sec = $wr_sectors / $interval * $bytes_per_sector;
+
+ my $total_ios = $read_ios + $write_ios;
+ my $total_ios_per_sec = $total_ios / $interval;
+
+ # Utilization - or "how busy is the device"?
+ # If the time spent for I/O was close to 1000msec for
+ # a given second, the device is nearly 100% saturated.
+ my $utilization = $tot_ticks / $interval;
+
+ # Average time an I/O takes on the block device
+ my $servicetime_in_sec =
+ $total_ios_per_sec ? $utilization / $total_ios_per_sec / 1000 : 0;
+
+ # Average wait time for an I/O from start to finish
+ # (includes queue times et al)
+ my $average_wait_in_sec =
+ $total_ios ? ( $rd_ticks + $wr_ticks ) / $total_ios / 1000 : 0;
+ my $average_rd_wait_in_sec = $read_ios ? $rd_ticks / $read_ios / 1000 : 0;
+ my $average_wr_wait_in_sec = $write_ios ? $wr_ticks / $write_ios / 1000 : 0;
+
+ my $average_rd_rq_size_in_kb =
+ $read_ios ? $rd_sectors * $bytes_per_sector / 1024 / $read_ios : 0;
+ my $average_wr_rq_size_in_kb =
+ $write_ios
+ ? $wr_sectors * $bytes_per_sector / 1024 / $write_ios
+ : 0;
+
+ my $util_print = $utilization / 10;
+
+ return {
+ utilization => $util_print,
+ servicetime => $servicetime_in_sec,
+ average_wait => $average_wait_in_sec,
+ average_rd_wait => $average_rd_wait_in_sec,
+ average_wr_wait => $average_wr_wait_in_sec,
+ read_bytes_per_sec => $read_bytes_per_sec,
+ write_bytes_per_sec => $write_bytes_per_sec,
+ read_io_per_sec => $read_io_per_sec,
+ write_io_per_sec => $write_io_per_sec,
+ average_rd_rq_size_in_kb => $average_rd_rq_size_in_kb,
+ average_wr_rq_size_in_kb => $average_wr_rq_size_in_kb,
+ };
+
+}
+
+# print_values_root
+#
+# Return multigraph values for root graphs
+
+sub print_values_root {
+
+ my ($result) = @_;
+
+ print "multigraph ${plugin_name}_latency\n";
+
+ for my $device ( keys %{$result} ) {
+
+ next unless ( $cur_diskstats{$device}->{'does_latency'} );
+ my $graph_id = $cur_diskstats{$device}->{'graph_id'};
+
+ print "${graph_id}_avgwait.value "
+ . $result->{$device}->{'average_wait'} . "\n";
+ }
+
+ print "\nmultigraph ${plugin_name}_utilization\n";
+
+ for my $device ( keys %{$result} ) {
+
+ next unless ( $cur_diskstats{$device}->{'does_latency'} );
+ my $graph_id = $cur_diskstats{$device}->{'graph_id'};
+
+ print "${graph_id}_util.value "
+ . $result->{$device}->{'utilization'} . "\n";
+ }
+
+ print "\nmultigraph ${plugin_name}_throughput\n";
+
+ for my $device ( keys %{$result} ) {
+ my $graph_id = $cur_diskstats{$device}->{'graph_id'};
+ print "${graph_id}_rdbytes.value "
+ . $result->{$device}->{'read_bytes_per_sec'} . "\n";
+ print "${graph_id}_wrbytes.value "
+ . $result->{$device}->{'write_bytes_per_sec'} . "\n";
+ }
+
+ print "\nmultigraph ${plugin_name}_iops\n";
+
+ for my $device ( keys %{$result} ) {
+ my $graph_id = $cur_diskstats{$device}->{'graph_id'};
+ print "${graph_id}_rdio.value "
+ . $result->{$device}->{'read_io_per_sec'} . "\n";
+ print "${graph_id}_wrio.value "
+ . $result->{$device}->{'write_io_per_sec'} . "\n";
+ }
+ return;
+}
+
+# print_values_device
+#
+# Return multigraph values for device graphs
+
+sub print_values_device {
+
+ my ( $device, $result ) = @_;
+ my $graph_id = $cur_diskstats{$device}->{'graph_id'};
+
+ if ( $cur_diskstats{$device}->{'does_latency'} ) {
+ print <<"EOF";
+
+multigraph ${plugin_name}_latency.$graph_id
+svctm.value $result->{'servicetime'}
+avgwait.value $result->{'average_wait'}
+avgrdwait.value $result->{'average_rd_wait'}
+avgwrwait.value $result->{'average_wr_wait'}
+EOF
+
+ print <<"EOF";
+
+multigraph ${plugin_name}_utilization.$graph_id
+util.value $result->{'utilization'}
+EOF
+
+ }
+
+ print <<"EOF";
+
+multigraph ${plugin_name}_throughput.$graph_id
+rdbytes.value $result->{'read_bytes_per_sec'}
+wrbytes.value $result->{'write_bytes_per_sec'}
+EOF
+
+ print <<"EOF";
+
+multigraph ${plugin_name}_iops.$graph_id
+rdio.value $result->{'read_io_per_sec'}
+wrio.value $result->{'write_io_per_sec'}
+avgrdrqsz.value $result->{'average_rd_rq_size_in_kb'}
+avgwrrqsz.value $result->{'average_wr_rq_size_in_kb'}
+EOF
+
+ return;
+}
+
+# read_procfs
+#
+# Pull diskstat information from procfs
+
+sub read_procfs {
+
+ my $statfh;
+
+ open $statfh, '<', '/proc/diskstats'
+ or croak "Failed to open '/proc/diskstats': $!\n";
+
+ my @lines;
+
+ while ( my $line = <$statfh> ) {
+
+ # Strip trailing newline and leading whitespace
+ chomp $line;
+ $line =~ s/^\s+//;
+
+ my @elems = split /\s+/, $line;
+
+ # We explicitly don't support old-style diskstats
+ # There are situations where only _some_ lines (e.g.
+ # partitions on older 2.6 kernels) have fewer stats
+ # numbers, therefore we'll skip them silently
+ if ( @elems != 14 ) {
+ next;
+ }
+ push @lines, \@elems;
+ }
+
+ close $statfh or croak "Failed to close '/proc/diskstats': $!";
+ return @lines;
+}
+
+# read_sysfs
+#
+# Pull diskstat information from sysfs
+
+sub read_sysfs {
+
+ my @devices;
+ my @lines;
+
+ @devices = glob "/sys/block/*/stat";
+ @devices = map { m!/sys/block/([^/]+)/stat! } @devices;
+
+ for my $cur_device (@devices) {
+ my $stats_file = "/sys/block/$cur_device/stat";
+
+ my $statfh;
+
+ open $statfh, '<', $stats_file
+ or croak "Failed to open '$stats_file': $!\n";
+
+ my $line = <$statfh>;
+
+ close $statfh or croak "Failed to close '$stats_file': $!\n";
+
+ # Trimming whitespace
+ $line =~ s/^\s+//;
+ chomp $line;
+
+ my @elems = split /\s+/, $line;
+
+ croak "'$stats_file' doesn't contain exactly 11 values. Aborting"
+ if ( @elems != 11 );
+
+ # Translate the devicename back before storing the information
+ $cur_device =~ tr#!#/#;
+
+ # Faking missing diskstats values
+ unshift @elems, ( '', '', $cur_device );
+
+ push @lines, \@elems;
+ }
+
+ return @lines;
+}
+
+# parse_diskstats
+#
+# Pulls diskstat information eitehr from procfs or sysfs, parses them and provides
+# helper information.
+
+sub parse_diskstats {
+
+ my @stats;
+
+ if ( glob "/sys/block/*/stat" ) {
+
+ @stats = read_sysfs();
+ }
+ else {
+ @stats = read_procfs();
+ }
+
+ my %diskstats;
+
+ for my $entry (@stats) {
+
+ my %devstat;
+
+ # Hash-Slicing for fun and profit
+ @devstat{
+ qw(major minor devname
+ rd_ios rd_merges rd_sectors rd_ticks
+ wr_ios wr_merges wr_sectors wr_ticks
+ ios_in_prog tot_ticks rq_ticks)
+ }
+ = @{$entry};
+
+ # Resolve devicemapper names to their LVM counterparts
+ my $device = $devstat{'devname'};
+ my $pretty_device;
+
+ if ( $device =~ /^dm-\d+$/ ) {
+ $pretty_device = translate_devicemapper_name($device);
+ }
+
+ $pretty_device ||= $device;
+
+ $devstat{'pretty_device_name'} = $pretty_device;
+
+ # Short device name only containing the stuff after the last '/'
+ # for graph labels et al.
+
+ ( $devstat{'short_pretty_device_name'} ) =
+ $pretty_device =~ m#/?([^/]+)$#;
+
+ if ($trim_labels) {
+
+ $devstat{'pretty_device_name'} =
+ trim_label( 'pos', $devstat{'pretty_device_name'} );
+ $devstat{'short_pretty_device_name'} =
+ trim_label( 'posneg', $devstat{'short_pretty_device_name'} );
+ }
+
+ # The graph identifier needs to be cleaned up because munin will
+ # complain about strange characters in the name otherwise
+ #
+ # The LVM <-> device mapper id mapping isn't stable across reboots,
+ # use the LVM volume name instead
+
+ $devstat{'graph_id'} = clean_fieldname($pretty_device);
+
+ # Does the device provide latency information?
+ $devstat{'does_latency'} =
+ $devstat{'rd_ticks'} + $devstat{'wr_ticks'} ? 1 : 0;
+
+ $diskstats{ $devstat{'devname'} } = \%devstat;
+ }
+
+ return %diskstats;
+}
+
+# fetch_device_counters
+#
+# Filters partitions and devices without IOs from diskstats
+# and returns them
+
+sub fetch_device_counters {
+
+ my %diskstats = parse_diskstats();
+
+ my @valid_devices;
+ DEVICE:
+
+# We need to see the devices before the partitions to make the partition filter work
+#
+# Sorting by the length of the device name gives us this certainty
+
+ for my $devname ( sort { length($a) <=> length($b) } keys %diskstats ) {
+
+ # Remove devices without traffic
+ if ( $diskstats{$devname}->{'rd_ios'} == 0
+ && $diskstats{$devname}->{'wr_ios'} == 0 )
+ {
+ delete $diskstats{$devname};
+ next DEVICE;
+ }
+
+# Filter out partitions, since we only want to track the data of the parent devices
+#
+# We skip:
+# - sda1 -> sda
+# - c0d0p1 -> c0d0
+# - md1p1 -> md1
+# - etherd/e1.1p1 -> etherd/e1.1
+#
+# But we don't want to filter:
+# - dm-100 -> dm-1
+# - etherd/e1.10 -> etherd/e1.1
+#
+# To achieve this we skip a device if
+# - it looks like a device we use with a "p\d" suffix
+# - it looks like a device we use with a "\d" suffix, and the device didn't
+# have a numeric suffix in the first place
+
+ for my $valid_device (@valid_devices) {
+
+ if (
+ $devname =~ m/^${valid_device}p\d+$/
+ || ( $valid_device !~ /\d$/
+ && $devname =~ m/^$valid_device\d+$/ )
+ )
+ {
+ delete $diskstats{$devname};
+ next DEVICE;
+ }
+ }
+
+ push @valid_devices, $devname;
+ }
+
+ return %diskstats;
+}
+
+# translate_devicemapper_name
+#
+# Tries to find a devicemapper name based on a minor number
+# Returns either a resolved LVM path or the original devicename
+
+sub translate_devicemapper_name {
+ my ($device) = @_;
+
+ my ($want_minor) = $device =~ m/^dm-(\d+)$/;
+
+ croak "Failed to extract devicemapper id" unless defined($want_minor);
+
+ my $dm_major = find_devicemapper_major();
+ croak "Failed to get device-mapper major number\n"
+ unless defined $dm_major;
+
+ for my $entry ( glob "/dev/mapper/\*" ) {
+
+ my $rdev = ( stat($entry) )[6];
+ my $major = floor( $rdev / 256 );
+ my $minor = $rdev % 256;
+
+ if ( $major == $dm_major && $minor == $want_minor ) {
+
+ my $pretty_name = translate_lvm_name($entry);
+
+ $entry =~ s|/dev/||;
+
+ return defined $pretty_name ? $pretty_name : $entry;
+ }
+ }
+
+ # Return original string if the device can't be found.
+ return $device;
+}
+
+# translate_lvm_name
+#
+# Translates devicemapper names to their nicer LVM counterparts
+# e.g. /dev/mapper/VGfoo-LVbar -> /dev/VGfoo/LVbar
+
+sub translate_lvm_name {
+
+ my ($entry) = @_;
+
+ my $device_name = basename($entry);
+
+# Check for single-dash-occurence to see if this could be a lvm devicemapper device.
+ if ( $device_name =~ m/(?<!-)-(?!-)/ ) {
+
+ # split device name into vg and lv parts
+ my ( $vg, $lv ) = split /(?<!-)-(?!-)/, $device_name, 2;
+ return unless ( defined($vg) && defined($lv) );
+
+ # remove extraneous dashes from vg and lv names
+ $vg =~ s/--/-/g;
+ $lv =~ s/--/-/g;
+
+ $device_name = "$vg/$lv";
+
+ # Sanity check - does the constructed device name exist?
+ # Breaks unless we are root.
+ if ( stat("/dev/$device_name") ) {
+ return "$device_name";
+ }
+
+ }
+ return;
+}
+
+# find_devicemapper_major
+#
+# Searches for the major number of the devicemapper device
+
+sub find_devicemapper_major {
+
+ my $devicefh;
+
+ open( $devicefh, '<', '/proc/devices' )
+ or croak "Failed to open '/proc/devices': $!";
+
+ my $dm_major;
+
+ while ( my $line = <$devicefh> ) {
+ chomp $line;
+
+ my ( $major, $name ) = split /\s+/, $line, 2;
+
+ next unless defined $name;
+
+ if ( $name eq 'device-mapper' ) {
+ $dm_major = $major;
+ last;
+ }
+ }
+ close($devicefh);
+
+ return $dm_major;
+}
+
+sub do_autoconf {
+
+ my %stats;
+
+ # Capture any croaks on the way
+ if ( eval { %stats = parse_diskstats() } && keys %stats ) {
+
+ print "yes\n";
+ exit 0;
+ }
+ else {
+ print "no\n";
+ exit 1;
+ }
+}
+
+sub do_config {
+
+ do_config_root();
+ do_config_device();
+
+ exit 0;
+}
+
+# do_config_root
+#
+# Print the configuration for the root graphs
+
+sub do_config_root {
+
+ my $config_graph_width = $graph_width;
+
+ my @sorted_devices = sort_by_dm_last( keys %cur_diskstats );
+
+ # If we don't trim labels, we have to find the correct graph width to
+ # accomodate all labels
+ unless ($trim_labels) {
+
+ my @short_labels =
+ map { $cur_diskstats{$_}->{'short_pretty_device_name'} }
+ keys %cur_diskstats;
+ my @long_labels =
+ map { $cur_diskstats{$_}->{'pretty_device_name'} }
+ keys %cur_diskstats;
+
+ my $graph_width_short =
+ find_required_graph_width( 'posneg', @short_labels );
+ my $graph_width_long = find_required_graph_width( 'pos', @long_labels );
+
+ $config_graph_width =
+ $graph_width_short > $graph_width_long
+ ? $graph_width_short
+ : $graph_width_long;
+ }
+
+ # Print config for latency
+
+ print <<"EOF";
+multigraph ${plugin_name}_latency
+graph_title Disk latency per device
+graph_args --base 1000
+graph_vlabel Average IO Wait (seconds)
+graph_category disk
+graph_width $config_graph_width
+
+EOF
+
+ for my $device (@sorted_devices) {
+ next unless $cur_diskstats{$device}->{'does_latency'};
+ my $graph_id = $cur_diskstats{$device}->{'graph_id'};
+
+ print <<"EOF";
+${graph_id}_avgwait.label $cur_diskstats{$device}->{'pretty_device_name'}
+${graph_id}_avgwait.type GAUGE
+${graph_id}_avgwait.info Average wait time for an I/O request
+${graph_id}_avgwait.min 0
+${graph_id}_avgwait.draw LINE1
+EOF
+ }
+
+ # Print config for utilization
+
+ print <<"EOF";
+
+multigraph ${plugin_name}_utilization
+graph_title Disk utilization per device
+graph_args --base 1000 --lower-limit 0 --upper-limit 100 --rigid
+graph_vlabel Percent
+graph_category disk
+graph_width $config_graph_width
+
+EOF
+
+ for my $device (@sorted_devices) {
+ next unless $cur_diskstats{$device}->{'does_latency'};
+ my $graph_id = $cur_diskstats{$device}->{'graph_id'};
+
+ print <<"EOF";
+${graph_id}_util.label $cur_diskstats{$device}->{'pretty_device_name'}
+${graph_id}_util.type GAUGE
+${graph_id}_util.info Utilization of the device
+${graph_id}_util.min 0
+${graph_id}_util.draw LINE1
+EOF
+ }
+
+ # Print config for throughput
+
+ print <<"EOF";
+
+multigraph ${plugin_name}_throughput
+graph_title Disk throughput per device
+graph_args --base 1024
+graph_vlabel Bytes/\${graph_period} read (-) / write (+)
+graph_category disk
+graph_width $config_graph_width
+
+EOF
+
+ for my $device (@sorted_devices) {
+ my $graph_id = $cur_diskstats{$device}->{'graph_id'};
+
+ print <<"EOF";
+${graph_id}_rdbytes.label $cur_diskstats{$device}->{'short_pretty_device_name'}
+${graph_id}_rdbytes.type GAUGE
+${graph_id}_rdbytes.min 0
+${graph_id}_rdbytes.draw LINE1
+${graph_id}_rdbytes.graph no
+${graph_id}_wrbytes.label $cur_diskstats{$device}->{'short_pretty_device_name'}
+${graph_id}_wrbytes.type GAUGE
+${graph_id}_wrbytes.min 0
+${graph_id}_wrbytes.draw LINE1
+${graph_id}_wrbytes.negative ${graph_id}_rdbytes
+EOF
+ }
+
+ # Print config for iops
+
+ print <<"EOF";
+
+multigraph ${plugin_name}_iops
+graph_title Disk IOs per device
+graph_args --base 1000
+graph_vlabel IOs/\${graph_period} read (-) / write (+)
+graph_category disk
+graph_width $config_graph_width
+
+EOF
+
+ for my $device (@sorted_devices) {
+ my $graph_id = $cur_diskstats{$device}->{'graph_id'};
+
+ print <<"EOF";
+${graph_id}_rdio.label $cur_diskstats{$device}->{'short_pretty_device_name'}
+${graph_id}_rdio.type GAUGE
+${graph_id}_rdio.min 0
+${graph_id}_rdio.draw LINE1
+${graph_id}_rdio.graph no
+${graph_id}_wrio.label $cur_diskstats{$device}->{'short_pretty_device_name'}
+${graph_id}_wrio.type GAUGE
+${graph_id}_wrio.min 0
+${graph_id}_wrio.draw LINE1
+${graph_id}_wrio.negative ${graph_id}_rdio
+EOF
+ }
+ print "\n";
+ return;
+}
+
+# do_config_device
+#
+# Print the configuration for all device graphs
+
+sub do_config_device {
+
+ for my $device ( sort keys %cur_diskstats ) {
+
+ # Nice name for graph
+ my $pretty_device = $cur_diskstats{$device}->{'pretty_device_name'};
+ my $graph_id = $cur_diskstats{$device}->{'graph_id'};
+
+ if ( $cur_diskstats{$device}->{'does_latency'} ) {
+
+ print <<"EOF";
+multigraph ${plugin_name}_latency.$graph_id
+graph_title Disk latency for /dev/$pretty_device
+graph_args --base 1000
+graph_vlabel seconds
+graph_category disk
+
+svctm.label Average device IO time
+svctm.type GAUGE
+svctm.info Average time an I/O takes on the block device
+svctm.min 0
+svctm.draw LINE1
+avgwait.label Average IO Wait time
+avgwait.type GAUGE
+avgwait.info Average wait time for an I/O from request start to finish (includes queue times et al)
+avgwait.min 0
+avgwait.draw LINE1
+avgrdwait.label Average Read IO Wait time
+avgrdwait.type GAUGE
+avgrdwait.info Average wait time for a read I/O from request start to finish (includes queue times et al)
+avgrdwait.min 0
+avgrdwait.draw LINE1
+avgwrwait.label Average Write IO Wait time
+avgwrwait.type GAUGE
+avgwrwait.info Average wait time for a write I/O from request start to finish (includes queue times et al)
+avgwrwait.min 0
+avgwrwait.draw LINE1
+
+EOF
+
+ print <<"EOF";
+multigraph ${plugin_name}_utilization.$graph_id
+graph_title Disk utilization for /dev/$pretty_device
+graph_args --base 1000 --lower-limit 0 --upper-limit 100 --rigid
+graph_vlabel Percent
+graph_category disk
+
+util.label Device utilization
+util.type GAUGE
+util.info Utilization of the device. If the time spent for I/O is close to 1000msec for a given second, the device is nearly 100% saturated.
+util.min 0
+util.draw LINE1
+
+EOF
+
+ }
+
+ print <<"EOF";
+multigraph ${plugin_name}_throughput.$graph_id
+graph_title Disk throughput for /dev/$pretty_device
+graph_args --base 1024
+graph_vlabel Bytes/\${graph_period} read (-) / write (+)
+graph_category disk
+
+rdbytes.label Read Bytes
+rdbytes.type GAUGE
+rdbytes.min 0
+rdbytes.draw LINE1
+rdbytes.graph no
+wrbytes.label Write Bytes
+wrbytes.type GAUGE
+wrbytes.min 0
+wrbytes.draw LINE1
+wrbytes.negative rdbytes
+
+EOF
+
+ print <<"EOF";
+multigraph ${plugin_name}_iops.$graph_id
+graph_title Disk IOs for /dev/$pretty_device
+graph_args --base 1000
+graph_vlabel Units read (-) / write (+)
+graph_category disk
+
+rdio.label dummy
+rdio.type GAUGE
+rdio.min 0
+rdio.draw LINE1
+rdio.graph no
+wrio.label IO/sec
+wrio.type GAUGE
+wrio.min 0
+wrio.draw LINE1
+wrio.negative rdio
+avgrdrqsz.label dummy
+avgrdrqsz.type GAUGE
+avgrdrqsz.min 0
+avgrdrqsz.draw LINE1
+avgrdrqsz.graph no
+avgwrrqsz.label Avg Req Size (KiB)
+avgwrrqsz.info Average Request Size in Kibibyte
+avgwrrqsz.type GAUGE
+avgwrrqsz.min 0
+avgwrrqsz.draw LINE1
+avgwrrqsz.negative avgrdrqsz
+
+EOF
+
+ }
+ return;
+}
+
+# sort_by_dm_last
+#
+# Sort a given list, move devicemapper devices (dm-xx) to the end of the list
+
+sub sort_by_dm_last {
+
+ my @devices = @_;
+ my $re = qr/^dm-\d+/;
+ my ( @dm, @non_dm );
+
+ for my $device (@devices) {
+ if ( $device =~ m/$re/ ) {
+ push @dm, $device;
+ }
+ else {
+ push @non_dm, $device;
+ }
+ }
+
+ return ( sort @non_dm ), ( sort @dm );
+}
+
+# filter_device_list
+#
+# Filter unwanted devices from given hash
+
+sub filter_device_list {
+
+ my ($devices) = @_;
+
+ my $include = $ENV{'include_only'};
+ my $exclude = $ENV{'exclude'};
+
+ croak
+ "include_only and exclude are mutually exclusive. Please specify only one"
+ if ( $include && $exclude );
+ return unless ( $include || $exclude );
+
+ my $mode = $include ? 0 : 1;
+
+ # Pull data from environment variable
+ my @filter_list =
+ map { my $dev = $_; $dev =~ s!^/dev/!!; $dev; } split /\s*,\s*/,
+ $include ? $include : $exclude;
+
+ for my $device ( keys %{$devices} ) {
+
+# Check if one of the user-provided names matches the current device-name or "pretty" LVM name
+ my $match = map {
+ $device =~ m!\Q$_\E!
+ || $devices->{$device}->{'pretty_device_name'} =~ m!\Q$_\E!;
+ } @filter_list;
+
+# Delete the device when it matches and mode is exclude or when it doesn't match and mode is include(_only)
+ delete $devices->{$device} unless ( $match xor $mode );
+ }
+ return;
+}
+
+# calculate_pixels
+#
+# Calculates either
+# the amount of available label-characters for $graph_width
+# or
+# the necessary $graph_width for a given label length
+#
+# type refers to the graph being positive only or positive/negative
+
+sub calculate_pixels {
+
+ my ( $mode, $type, $data ) = @_;
+
+ # These values are probably wrong, but a good approximation
+ # $graph_width + $graph_border_width == real image width
+ my $graph_border_width = 97;
+
+ # ($data_characters + $max_label_length + $padding_characters)
+ # * $pixels_per_character == real image width
+ my $padding_characters = 10;
+ my $pixels_per_character = 6;
+
+ my $data_characters;
+
+ if ( $type eq 'posneg' ) {
+
+ # nnn.nnU/nnn.nnU_ times 4
+ $data_characters = 64;
+ }
+ elsif ( $type eq 'pos' ) {
+
+ # nnn.nnU_ times 4
+ $data_characters = 32;
+ }
+ else {
+ croak "Wrong $type in calculate_pixels";
+ }
+
+ my $return_data;
+
+ if ( $mode eq 'required_width' ) {
+ $return_data =
+ $pixels_per_character *
+ ( $padding_characters + $data_characters + $data ) -
+ $graph_border_width;
+ }
+ elsif ( $mode eq 'available_characters' ) {
+ $return_data =
+ abs( ( $graph_width + $graph_border_width ) / $pixels_per_character )
+ - $padding_characters - $data_characters;
+
+ }
+ else {
+ croak "Wrong $mode in calculate_pixels";
+ }
+ return $return_data;
+}
+
+# find_required_graph_width
+#
+# Returns the necessary graph width for a list of labels and a type of graph
+
+sub find_required_graph_width {
+
+ my ( $type, @labels ) = @_;
+
+ my $longest_label_length = 0;
+
+ for my $label (@labels) {
+ if ( length $label > $longest_label_length ) {
+ $longest_label_length = length $label;
+ }
+ }
+
+ my $required_graph_width =
+ calculate_pixels( 'required_width', $type, $longest_label_length );
+ return $graph_width if ( $required_graph_width <= $graph_width );
+
+ # Return sufficient graph_width in 50 pixel increments
+ return $graph_width +
+ ( ceil( ( $required_graph_width - $graph_width ) / 50 ) * 50 );
+}
+
+# trim_label
+#
+# Trims a given label to it's non-wrapping size
+
+sub trim_label {
+
+ my ( $type, $label ) = @_;
+
+ my $available_characters =
+ calculate_pixels( 'available_characters', $type );
+
+ if ( $available_characters < length $label ) {
+ $label = '..' . substr $label, ( $available_characters - 2 ) * -1;
+ }
+
+ return $label;
+}
+
+__END__
+
+=head1 NAME
+
+diskstats - Munin multigraph plugin to monitor various values provided
+via C</proc/diskstats> or C</sys/block/*/stat>
+
+=head1 APPLICABLE SYSTEMS
+
+Linux 2.6 systems with extended block device statistics enabled.
+
+=head1 CONFIGURATION
+
+None needed.
+
+=head2 device-mapper names
+
+This plugin displays nicer device-mapper device names if it is run as
+root, but it functions as needed without root privilege. To configure
+for running as root enter this in a plugin configuration file:
+
+ [diskstats]
+ user root
+
+=head2 Monitor specific devices
+
+You can specify which devices should get monitored by the plugin via
+environment variables. The variables are mutually exclusive and should
+contain a comma-separated list of device names. Partial names
+(e.g. 'sd' or 'dm-') are okay.
+
+ [diskstats]
+ env.include_only sda,sdb,cciss/c0d0
+
+or
+
+ [diskstats]
+ env.exclude sdc,VGroot/LVswap
+
+LVM volumes can be filtered either by their canonical names or their
+internal device-mapper based names (e.g. 'dm-3', see dmsetup(8) for
+further information).
+
+=head2 Graph width and labels
+
+This plugin will increase the graph_width dynamically to accomodate
+longer-than-normal device names. You can disable this behavior by
+setting the B<trim_labels> environment variable. Additionally, you can
+specify a fixed graph_width for the graphs.
+
+ [diskstats]
+ # Set graph_width to 450, device names which are longer get trimmed
+ env.trim_labels yes
+ env.graph_width 450
+
+
+=head1 INTERPRETATION
+
+Among the more self-describing or well-known values like C<throughput>
+(Bytes per second) there are a few which might need further
+introduction.
+
+
+=head2 Device Utilization
+
+Linux provides a counter which increments in a millisecond-interval
+for as long as there are outstanding I/O requests. If this counter is
+close to 1000msec in a given 1 second timeframe the device is nearly
+100% saturated. This plugin provides values averaged over a 5 minute
+time frame per default, so it can't catch short-lived saturations, but
+it'll give a nice trend for semi-uniform load patterns as they're
+expected in most server or multi-user environments.
+
+
+=head2 Device IO Time
+
+The C<Device IO Time> takes the counter described under C<Device
+Utilization> and divides it by the number of I/Os that happened in the
+given time frame, resulting in an average time per I/O on the
+block-device level.
+
+This value can give you a good comparison base amongst different
+controllers, storage subsystems and disks for similiar workloads.
+
+
+=head2 Syscall Wait Time
+
+These values describe the average time it takes between an application
+issuing a syscall resulting in a hit to a blockdevice to the syscall
+returning to the application.
+
+The values are bound to be higher (at least for read requests) than
+the time it takes the device itself to fulfill the requests, since
+calling overhead, queuing times and probably a dozen other things are
+included in those times.
+
+These are the values to watch out for when an user complains that
+C<the disks are too slow!>.
+
+
+=head3 What causes a block device hit?
+
+A non-exhaustive list:
+
+=over
+
+=item * Reads from files when the given range is not in the page cache or the O_DIRECT
+flag is set.
+
+=item * Writes to files if O_DIRECT or O_SYNC is set or sys.vm.dirty_(background_)ratio
+is exceeded.
+
+=item * Filesystem metadata operations (stat(2), getdents(2), file creation,
+modification of any of the values returned by stat(2), etc.)
+
+=item * The pdflush daemon writing out dirtied pages
+
+=item * (f)sync
+
+=item * Swapping
+
+=item * raw device I/O (mkfs, dd, etc.)
+
+=back
+
+=head1 ACKNOWLEDGEMENTS
+
+The core logic of this script is based on the B<iostat> tool of the
+B<sysstat> package written and maintained by Sebastien Godard.
+
+=head1 SEE ALSO
+
+See C<Documentation/iostats.txt> in your Linux source tree for further
+information about the C<numbers> involved in this module.
+
+L<http://www.westnet.com/~gsmith/content/linux-pdflush.htm> has a nice
+writeup about the pdflush daemon.
+
+=head1 VERSION
+
+ $Id$
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=head1 AUTHOR
+
+Michael Renner <michael.renner@amd.co.at>
+
+=head1 LICENSE
+
+GPLv2
+
+
+=cut
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/fw_conntrack.in
^
|
@@ -107,9 +107,9 @@
total.graph no
EOF
if [ -f /proc/sys/net/ipv4/ip_conntrack_max ] ; then
- read MAX </proc/sys/net/ipv4/ip_conntrack_max
+ MAX=$(cat /proc/sys/net/ipv4/ip_conntrack_max)
elif [ -f /proc/sys/net/ipv4/netfilter/ip_conntrack_max ]; then
- read MAX < /proc/sys/net/ipv4/netfilter/ip_conntrack_max
+ MAX=$(cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max)
fi
if [ -n "$MAX" ]; then
echo total.warning `expr $MAX \* 8 / 10`
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/fw_forwarded_local.in
^
|
@@ -32,7 +32,7 @@
=cut
if [ "$1" = "autoconf" ]; then
- if [ -r /proc/net/ip_conntrack ]
+ if [ -r /proc/net/ip_conntrack -o -r /proc/net/nf_conntrack ]
then
echo yes
else
@@ -53,6 +53,13 @@
exit 0
fi
+if [ -r /proc/net/ip_conntrack ]; then
+ _conntrack_file=/proc/net/ip_conntrack
+else
+ _conntrack_file=/proc/net/nf_conntrack
+fi
+
+
perl -ne '
BEGIN { $forward=0; $local=0; }
@@ -65,5 +72,5 @@
}
}
END { print "forward.value $forward\nlocal.value $local\n" }
-' </proc/net/ip_conntrack
+' < $_conntrack_file
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/if_.in
^
|
@@ -56,7 +56,7 @@
=head1 VERSION
- $Id: if_.in 3142 2009-12-01 14:03:04Z janl $
+ $Id: if_.in 4163 2011-04-15 04:42:08Z bldewolf $
=cut
@@ -133,8 +133,15 @@
;;
esac
+ # sysfs can report the speed if the driver supports it
+ SYSFS="$(cat /sys/class/net/$INTERFACE/speed 2>/dev/null)"
+ # If it can't, it fails on I/O, so we check cat's return value
+ if [ $? -eq 0 -a "$SPEED" = "U" -a -n "$SYSFS" ]; then
+ SPEED="$SYSFS"
+ fi
+
case $SPEED in
- U) echo "up.info Traffic of the $INTERFACE interface. Unable to determine interface speed. Please install ethtool, wireless-tools (or mii-tool), whatever is apropriate for the interface."
+ U) echo "up.info Traffic of the $INTERFACE interface. Unable to determine interface speed. Please install ethtool, wireless-tools (or mii-tool), whatever is appropriate for the interface."
return;;
esac
@@ -179,13 +186,15 @@
echo 'graph_category network'
echo "graph_info This graph shows the traffic of the $INTERFACE network interface. Please note that the traffic is shown in bits per second, not bytes. IMPORTANT: On 32 bit systems the data source for this plugin uses 32bit counters, which makes the plugin unreliable and unsuitable for most 100Mb (or faster) interfaces, where traffic is expected to exceed 50Mbps over a 5 minute period. This means that this plugin is unsuitable for most 32 bit production environments. To avoid this problem, use the ip_ plugin instead. There should be no problems on 64 bit systems running 64 bit kernels."
echo 'down.label received'
- echo 'down.type COUNTER'
+ echo 'down.type DERIVE'
echo 'down.graph no'
echo 'down.cdef down,8,*'
+ echo 'down.min 0'
echo 'up.label bps'
- echo 'up.type COUNTER'
+ echo 'up.type DERIVE'
echo 'up.negative down'
echo 'up.cdef up,8,*'
+ echo 'up.min 0'
print_warning down
print_warning up
print_critical down
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/iostat_ios.in
^
|
@@ -37,7 +37,7 @@
=head1 VERSION
- $Id: iostat_ios.in 3050 2009-11-23 16:31:43Z feiner.tom $
+ $Id: iostat_ios.in 3297 2010-01-09 00:07:11Z bldewolf $
=head1 BUGS
@@ -94,12 +94,16 @@
sub filter {
my ($major, $minor, $tmpnam) = @_;
- return 0 if ($major == 1); # RAM devices
- return 0 if ($major == 9); # MD devices
- return 0 if ($major == 58); # LVM devices
- return 0 if ($major == 254); # LVM2 devices
- return 0 if ($tmpnam =~ /part\d+$/);
- return 0 if ($tmpnam =~ /^\s*(?:sd|hd)[a-z]\d+\s*$/);
+ if(defined($major)) {
+ return 0 if ($major == 1); # RAM devices
+ return 0 if ($major == 9); # MD devices
+ return 0 if ($major == 58); # LVM devices
+ return 0 if ($major == 254); # LVM2 devices
+ }
+ if(defined($tmpnam)) {
+ return 0 if ($tmpnam =~ /part\d+$/);
+ return 0 if ($tmpnam =~ /^\s*(?:sd|hd)[a-z]\d+\s*$/);
+ }
return 1;
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/ip_.in
^
|
@@ -1,4 +1,4 @@
-#!@@GOODSH@@
+#!@@BASH@@
# -*- sh -*-
: << =cut
@@ -68,8 +68,6 @@
=head3 IPv6
-Please note: IPv6 support is not working.
-
If the IP number in the link contains a ":", it is assumed to be a ip6
IP number and ip6tables are used instead of iptables to read the
counters.
@@ -84,17 +82,7 @@
=head1 BUGS
-munin-node does not accept plugins with ":"s in the name and therefore
-IPv6 monitoring will not work. It needs to be patched in a couple of
-ways: 1. Accept these plugins. 2. Translate the ":" to something
-else, most likely "_" so that the munin master never sees the ":". 3.
-Make the : named plugin configurable through standard config files.
-
-This was fixed and worked in Munin 1.2 in Debian but the patch was
-rejected from the 1.3 series due to the use of ":" in the
-configuration "language" for munin.
-
-Until then the suggest code for ip6tables has been commented out.
+None known.
=head1 NOTES
@@ -105,6 +93,14 @@
#%# family=auto
#%# capabilities=autoconf suggest
+=head1 AUTHOR
+
+Unknown. Suspected to be some Linpro employee.
+
+=head1 LICENSE
+
+Unknown.
+
=cut
. $MUNIN_LIBDIR/plugins/plugin.sh
@@ -141,9 +137,9 @@
if [ "$1" = "suggest" ]; then
iptables -L ${INPUT} -v -n -x 2>/dev/null | awk --posix '$8 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}$/ { if (done[$8]!=1) {print $8; done[$8]=1;}}'
-# if [ -x /sbin/ip6tables ]; then
-# ip6tables -L ${INPUT} -v -n -x 2>/dev/null | awk --posix '$7 ~ /\/128$/ { if (done[$7]!=1) {a=$7;gsub(/\/128$/, "", a); print a; done[$7]=1;}}'
-# fi
+ if [ -x /sbin/ip6tables ]; then
+ ip6tables -L ${INPUT} -v -n -x 2>/dev/null | awk --posix '$7 ~ /\/128$/ { if (done[$7]!=1) {a=$7;gsub(/\/128$/, "", a); print a; done[$7]=1;}}'
+ fi
exit 0
fi
@@ -173,8 +169,10 @@
exit 0
fi;
-iptables -L ${INPUT} -v -n -x | grep -m1 "$IP " |
- awk "{ print \"in.value \" \$2 }"
-iptables -L ${OUTPUT} -v -n -x | grep -m1 "$IP " |
- awk "{ print \"out.value \" \$2 }"
+# Escape .'s so they don't match _everything_?
+IP="$( echo $IP | sed 's~\.~\\.~g' )"
+
+iptables -L ${INPUT} -v -n -x | awk "/$IP"'[ /]/ { print "in.value " $2; exit 0; }'
+
+iptables -L ${OUTPUT} -v -n -x | awk "/$IP"'[ /]/ { print "out.value " $2; exit 0; }'
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/load.in
^
|
@@ -27,7 +27,7 @@
[load]
env.load_warning 5
- env.load_criting 10
+ env.load_critical 10
=head1 NOTES
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/node.d.linux/lpar_cpu.in
^
|
@@ -0,0 +1,95 @@
+#!@@PERL@@ -w
+#
+# Plugin to monitor physical cpu usage in an IBM POWER P5 / OpenPower LPAR
+#
+# Usage: Place in /etc/munin/plugins (or make a symlink to it there)
+#
+# Parameters understood:
+#
+# config
+# autoconf
+#
+# This should be run as root, so drop a file with something like this in
+# /etc/munin/plugin-conf.d/lpar_cpu:
+# [lpar_cpu]
+# user root
+#
+# Great thanks to Nigel Griffith of IBM for the magic to get these values
+#
+# Author: Ingvar Hagelund <ingvar(at)linpro.no>
+#
+# Licence: GNU General Public Licence v2.0,
+# see http://www.gnu.org/copyleft/gpl.html
+
+use strict;
+
+my $stats="/proc/ppc64/lparcfg";
+my $cpuinfo="/proc/cpuinfo";
+my $seconds=2;
+my $counter="";
+my $after="";
+my $timebase="";
+
+sub readstats {
+ my $stats=shift;
+ my $purr;
+
+ open (STATS,"$stats") or die "Unable to read $stats, $!";
+ while (<STATS>) {
+ if ( /^purr\=(\d+)$/ ) { $purr = $1; }
+ }
+ close STATS;
+ return $purr;
+}
+
+sub error {
+ print "something horrible happened\n";
+ exit 2;
+}
+
+
+################
+#
+# Main
+#
+#
+
+if ( defined $ARGV[0] ) {
+
+ if ( $ARGV[0] eq 'autoconf' ) {
+ if ( -x $stats && -e $cpuinfo ) {
+ print "yes\n";
+ exit 0;
+ }
+ else {
+ print "no (I need $stats and $cpuinfo)\n";
+ exit 0;
+ }
+ }
+ elsif ( $ARGV[0] eq 'config' ) {
+ print "graph_title LPAR physical CPU usage\n";
+ print "graph_vlabel percent\n";
+ print "graph_category system\n";
+ print "cpu.label cpu\n";
+ print "cpu.type DERIVE\n";
+ print "cpu.min 0\n";
+ exit 0;
+ }
+}
+
+$counter=readstats($stats);
+
+open (CPUINFO,$cpuinfo) or die "Unable to read $cpuinfo, $!";
+while (<CPUINFO>) {
+ if (/^timebase\s+\:\s+(\d+)/) { $timebase=$1; }
+}
+close CPUINFO;
+
+error() if $cpuinfo eq "";
+error() if $counter eq "";
+error() if $timebase eq "";
+
+my $val=100*$counter/$timebase;
+$val =~ s/(\d+)\..+/$1/;
+print "cpu.value " . $val . "\n";
+exit 0;
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/memory.in
^
|
@@ -9,6 +9,20 @@
No configuration
+=head2 Warning and Critical Values
+
+Warning and critical values can be passed in environment variables as byte
+values or they can be percentages using a % sign and the value will be
+calculated dynamically by the plugin. Thus, to warn on swap at 50% the
+configuration is:
+
+ [memory]
+ env.swap_warning 50%
+
+Note that swap is calculated against the total swap amount (SwapTotal), and all
+other fields are calculated against the total amount of memory (MemTotal).
+
+
=head1 AUTHORS
Original Author: Jimmy Olsen
@@ -173,7 +187,15 @@
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) {
- print_thresholds($field);
+ my ($warning, $critical) = get_thresholds($field);
+ my $total = $mems{MemTotal};
+ $total = $mems{SwapTotal} if($field eq "swap");
+
+ $warning = adjust_threshold($warning, $total);
+ $critical = adjust_threshold($critical, $total);
+
+ print "$field.warning $warning\n" if defined $warning;
+ print "$field.critical $critical\n" if defined $critical;
}
exit 0;
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/nfs_client.in
^
|
@@ -31,7 +31,7 @@
proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"
if [ "$1" = "autoconf" ]; then
- if [ -x "$NFS" ]; then
+ if [ -f "$NFS" ]; then
echo yes
exit 0
else
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/node.d.linux/selinux_avcstat.in
^
|
@@ -0,0 +1,111 @@
+#!@@GOODSH@@
+#
+# Plugin to monitor SELinux' Access Vector Cache (AVC).
+#
+# config (required)
+# autoconf (optional - used by munin-config)
+#
+# GNU GPL, Lars Strand
+#
+#
+# Magic markers (used by munin-config and some installation scripts (i.e.
+# optional)):
+#%# family=auto
+#%# capabilities=autoconf
+
+
+AVCSTATS="/selinux/avc/cache_stats"
+
+if [ "$1" = "autoconf" ]; then
+ if [ -r $AVCSTATS ]; then
+ echo yes
+ else
+ echo "no (missing $AVCSTATS file)"
+ fi
+ exit 0
+fi
+
+if [ "$1" = "config" ]; then
+
+ echo "graph_title SELinux' Access Vector Cache"
+ echo 'graph_args -l 0 --base 1000'
+ echo 'graph_vlabel AVC operations'
+ echo 'graph_category system'
+ echo 'graph_order lookups hits misses allocations reclaims frees'
+
+ echo 'lookups.label lookups'
+ echo 'lookups.type DERIVE'
+ echo 'lookups.min 0'
+ echo 'lookups.max 1000000000'
+ echo 'lookups.draw AREA'
+ echo 'lookups.colour ff0000' # Red
+ echo 'lookups.info Number of access vector lookups. This number is a good indicator of the load beeing placed on the AVC.'
+
+ echo 'hits.label hits'
+ echo 'hits.type DERIVE'
+ echo 'hits.min 0'
+ echo 'hits.max 1000000000'
+ echo 'hits.draw STACK'
+ echo 'hits.colour 0022ff' # Blue
+ echo 'hits.info Number of access vector hits.'
+
+ echo 'misses.label misses'
+ echo 'misses.type DERIVE'
+ echo 'misses.min 0'
+ echo 'misses.max 1000000000'
+ echo 'misses.draw STACK'
+ echo 'misses.colour 990000' # Darker red
+ echo 'misses.info Number of cache misses.'
+
+ echo 'allocations.label allocations'
+ echo 'allocations.type DERIVE'
+ echo 'allocations.min 0'
+ echo 'allocations.max 100000000'
+ echo 'allocations.draw STACK'
+ echo 'allocations.colour ffa500' # Orange
+ echo 'allocations.info Number of AVC entries allocated.'
+
+ echo 'reclaims.label reclaims'
+ echo 'reclaims.type DERIVE'
+ echo 'reclaims.min 0'
+ echo 'reclaims.max 1000000000'
+ echo 'reclaims.draw STACK'
+ echo 'reclaims.colour 00aaaa' # Darker turquoise
+ echo 'reclaims.info Number of current total reclaimed AVC entries. If this keeps changing, you may need to increase the cache size (/selinux/avc/cache_threshold).'
+
+ echo 'frees.label frees'
+ echo 'frees.type DERIVE'
+ echo 'frees.min 0'
+ echo 'frees.max 1000000000'
+ echo 'frees.draw STACK'
+ echo 'frees.colour 00ff7f' # Spring green
+ echo 'frees.info Number of free AVC entries.'
+
+ exit 0
+fi
+
+if [ -r $AVCSTATS ]; then
+ { read
+ while read lookups hits misses allocations reclaims frees; do
+ LOOKUPS=$(($LOOKUPS + $lookups))
+ HITS=$(($HITS + $hits))
+ MISSES=$(($MISSES + $misses))
+ ALLOCATIONS=$(($ALLOCATIONS + $allocations))
+ RECLAIMS=$(($RECLAIMS + $reclaims))
+ FREES=$(($FREES + $frees))
+ done
+ } < $AVCSTATS
+ echo "lookups.value $LOOKUPS"
+ echo "hits.value $HITS"
+ echo "misses.value $MISSES"
+ echo "allocations.value $ALLOCATIONS"
+ echo "reclaims.value $RECLAIMS"
+ echo "frees.value $FREES"
+else
+ echo "lookups.value U"
+ echo "hits.value U"
+ echo "misses.value U"
+ echo "allocations.value U"
+ echo "reclaims.value U"
+ echo "frees.value U"
+fi
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/sensors_.in
^
|
@@ -1,64 +1,231 @@
#!@@PERL@@ -w
# -*- perl -*-
-# Wildcard plugin to monitor sensors.
-#
-# Requirements:
-# - i2c and lm_sensors modules installed and loaded
-# - sensors program installed and in path
-#
-# Note:
-# - Sensor names are read from the output of the sensors program.
-# Change them in /etc/sensors.conf if you don't like them.
-#
-# Parameters supported:
-#
-# config
-# autoconf
-# suggest
-#
-# Configurable variables
-#
-# sensors - Override default program
-# ignore_temp<n> - Temperature <n> will not be plotted
-# ignore_fan<n> - Fan <n> will not be plotted
-# ignore_volt<n> - Voltage <n> will not be plotted
-# fan_warn_percent - Percentage over mininum for warning
-# volt_warn_percent - Percentage over mininum/under maximum for warning
-# Narrow the voltage bracket by this.
-#
-# Magic markers:
-#%# family=manual
-#%# capabilities=autoconf suggest
+=head1 NAME
+sensors_ - Wildcard-plugin to monitor information from temperature, voltage,
+ and fan speed sensors.
+
+=head1 CONFIGURATION
+
+The plugins needs the following components configured:
+
+ - i2c and lm_sensors modules installed and loaded.
+ - sensors program installed and in path.
+ Note:
+ - Sensor names are read from the output of the sensors program.
+ Change them in /etc/sensors.conf if you don't like them.
+
+ [sensors_*]
+ env.sensors - Override default sensors program path
+ env.ignore_temp<n> - Temperature <n> will not be plotted
+ env.ignore_fan<n> - Fan <n> will not be plotted
+ env.ignore_volt<n> - Voltage <n> will not be plotted
+ env.fan_warn_percent - Percentage over mininum for warning
+ env.volt_warn_percent - Percentage over mininum/under maximum for warning
+
+=head1 VERSION
+
+$Id: sensors_.in 3431 2010-03-16 20:22:20Z feiner.tom $
+
+=head1 AUTHOR
+
+Unknown author
+
+=head1 LICENSE
+
+Unknown license
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+ #%# capabilities=autoconf suggest
+
+=cut
use strict;
$ENV{'LANG'} = "C"; # Force parseable output from sensors.
$ENV{'LC_ALL'} = "C"; # Force parseable output from sensors.
my $SENSORS = $ENV{'sensors'} || 'sensors';
+
+# Example outputs from sensors & matching regex parts:
+
+# Fan output example from sensors:
+# --------------------------------
+# Case Fan: 1268 RPM (min = 3750 RPM, div = 8) ALARM
+# CPU Fan: 0 RPM (min = 1171 RPM, div = 128) ALARM
+# Aux Fan: 0 RPM (min = 753 RPM, div = 128) ALARM
+# fan4: 3375 RPM (min = 774 RPM, div = 8)
+# fan5: 0 RPM (min = 1054 RPM, div = 128) ALARM
+#
+# ^^^^ ^^^^ ^^^^
+# $1 $2 $3
+#
+# --------------------------------
+#
+# Temperature output example from sensors:
+# * Note that the iso-8859-1 degree character is not printed, as we are running
+# with LC_ALL=C & LANG=C.
+# ---------------------------------------
+# Sys Temp: +41.0 C (high = -128.0 C, hyst = +24.0 C) ALARM sensor = thermistor
+# CPU Temp: +40.5 C (high = +80.0 C, hyst = +75.0 C) sensor = thermistor
+# AUX Temp: +39.0 C (high = +80.0 C, hyst = +75.0 C) sensor = thermistor
+#
+# ^^^^^^^^ ^^ ^^ ^^
+# $1 $2 $3 $4
+#
+# ---------------------------------------
+#
+# Voltage output example from sensors:
+# ------------------------------------
+#
+# VCore: +1.09 V (min = +0.00 V, max = +1.74 V)
+# in1: +12.14 V (min = +10.51 V, max = +2.38 V) ALARM
+#
+# ^^^ ^^^ ^^^ ^^
+# $1 $2 $3 $4
+#
+#
+# ------------------------------------
+
+
my %config = (
- fan => {
- regex => qr/^(\S[^:]*)\s*:\s*\+?(\d+) RPM.*?(\d+) RPM/m,
- title => 'Fans',
- vtitle => 'RPM',
- print_threshold => \&fan_threshold,
- graph_args => '--base 1000 -l 0'
- },
- temp => {
- regex => qr/^(\S[^:]*)\s*:\s*\+?(-?\d+(?:\.\d+)?)[° ]C(?:\s+\((?:high|limit)\s*=\s*\+?(\d+(?:\.\d+)?)[° ]C,\s*hyst(?:eresis)?\s*=\s*\+?(\d+(?:\.\d+)?)[° ]C\))?/m,
-
- title => 'Temperatures',
- vtitle => 'Celsius',
- print_threshold => \&temp_threshold,
- graph_args => '--base 1000 -l 0'
- },
- volt => {
- regex => qr/^(\S[^:]*)\s*:\s*\+?(-?\d+(?:\.\d+)?) V(?:\s+\(min\s*=\s*\+?(-?\d+(?:\.\d+)?) V,\s*max\s*=\s*\+?(-?\d+(?:\.\d+)?) V\))/m,
- title => 'Voltages',
- vtitle => 'Volt',
- print_threshold => \&volt_threshold,
- graph_args => '--base 1000 --logarithmic'
- },
- );
+ fan => {
+ regex => qr/
+ ^ # String must start with:
+ (\S[^:]*) # Match any non-whitespace char, except ':'
+ # (Match label as \$1)
+ \s* # Zero or more spaces followed by
+ : # : characheter
+ \s* # Zero or more spaces followed by
+ \+? # Zero or one '+' char. Note: This might not be needed
+ # as FAN speeds don't have + signs in front of them.
+ # This can be probably be removed as the
+ # sensors program never prints a + char in front of
+ # RPM values. Verified in lm-sensors-3-3.1.2
+ (\d+) # Match one or more digits (Match current value as \$2)
+ \s # Exactly one space followed by
+ RPM.*? # RPM string, and then any chars
+ (\d+) # Match one or more digits (Match minimum value as \$3)
+ \s # Exactly one space followed by
+ RPM # RPM string
+ /xms,
+ title => 'Fans',
+ vtitle => 'RPM',
+ print_threshold => \&fan_threshold,
+ graph_args => '--base 1000 -l 0'
+ },
+
+ temp => {
+ regex => qr/
+ ^ # String must start with:
+ (\S[^:]*) # Match any non-whitespace char, except ':'
+ # (Match label as \$1)
+ \s* # Zero or more spaces followed by
+ : # ':' characheter
+ \s* # Zero or more spaces followed by
+ \+? # Zero or one '+' char followed by
+
+ (-? # Match zero or one '-' char
+ \d+ # Match one or more digits
+ # (Match current value as \$2) followed by
+
+ (?:\.\d+)?)# Zero or one match of '.' char followd by one or more
+ # digits. '?:' means it doesn't spit out the field.
+ [°\s] # Match degree char or space char
+ C # Match 'C' char
+
+ (?: # >>>>Match the following statement zero or one time.
+ # '?:' means it doesn't spit out the field.
+ \s+ # One or more space followed by
+ \( # '(' char
+ (?:high|limit) # 'high' or 'limit' string.
+ # '?:' means it doesn't spit out the field.
+ \s*=\s* # Match zero or more spaces and then '=' char and then
+ # zero or more spaces, followed by
+ \+? # Zero or one '+' char
+ (\d+ # Match one or more digits
+ # (Match high value as \$3) followed by
+
+ (?:\.\d+)?)# Zero or one match of '.' char followd by one or more
+ # digits. '?:' means it doesn't spit out the field.
+ [°\s] # Match degree char or space char
+ C,\s* # 'C,' string followd by zero or more spaces
+ hyst # 'hyst' string followed by
+ (?:eresis)?# zero or one 'eresis' string.
+ # '?:' means it doesn't spit out the field.
+ \s*=\s* # Match zero or more spaces and then '=' char and then
+ # zero or more spaces, followed by
+ \+? # Zero or one '+' char
+ (\d+ # Match one or more digits
+ # (Match hyst value as \$4) followed by
+ (?:\.\d+)?)# Zero or one match of '.' char followd by one or more
+ # digits. '?:' means it doesn't spit out the field.
+ [°\s]C # Match degree char or space char, and then 'C' char
+ \) # ')' char
+ )? # >>>>end of statement
+ /xms,
+ title => 'Temperatures',
+ vtitle => 'Celsius',
+ print_threshold => \&temp_threshold,
+ graph_args => '--base 1000 -l 0'
+ },
+
+ volt => {
+ regex => qr/
+ ^ # String must start with:
+ (\s?\S[^:]*)# Match any non-whitespace char, except ':'
+ # but allow an optional whitespace at the begining.
+ # This is needed as voltages are sometimes printed with
+ # one space in front of them.
+ # (match the label as \$1)
+
+ \s*:\s* # Zero or more spaces followed by ':' char and
+ # the zero or more spaces followed by
+ \+? # Zero or one '+' char followed by
+ (-? # Match zero or one '-' char
+ \d+ # Match one or more digits
+ # (match the current voltage as \$2) followed by
+ (?:\.\d+)?) # Zero or one match of '.' char followd by one or more digits.
+ # '?:' means it doesn't spit out the field.
+ \sV # one space, 'V' char
+
+ (?: # >>>>Match the following statement.
+ # '?:' means it doesn't spit out the field.
+ \s+ # One or more space followed by
+ \( # '(' char
+ min # Match min string
+ \s*=\s* # Match zero or more spaces and then '=' char and
+ # then zero or more spaces, followed by
+ \+? # Zero or one '+' char
+ (-? # Match zero or one '-' char
+ \d+ # Match one or more digits
+ # (Match the minimum value as \$3) followed by
+ (?:\.\d+)?) # Zero or one match of '.' char followd by one or more
+ # digits. '?:' means it doesn't spit out the field.
+ \sV,\s* # One space char, 'V,' string followd by zero or
+ # more spaces
+
+ max # Match 'max' string
+ \s*=\s* # Match zero or more spaces and then '=' char and
+ # then zero or more spaces, followed by
+ \+? # Zero or one '+' char
+ (-? # Match zero or one '-' char
+ \d+ # Match one or more digits
+ # (Match the max value as \$4) followed by
+ (?:\.\d+)?) # Zero or one match of '.' char followd by one or more digits.
+ # '?:' means passive group (does not match)
+ \sV # one space, 'V' char
+ \) # ')' char
+ ) # >>>>end of statement
+
+ /xms,
+
+ title => 'Voltages',
+ vtitle => 'Volt',
+ print_threshold => \&volt_threshold,
+ graph_args => '--base 1000 --logarithmic'
+ },
+);
if ( defined $ARGV[0] and $ARGV[0] eq 'autoconf' ) {
# Now see if "sensors" can run
@@ -120,6 +287,7 @@
sub fan_threshold {
my $name = shift;
my $min = shift;
+
my $warn_percent = exists $ENV{fan_warn_percent} ? $ENV{fan_warn_percent} : 5;
return unless defined $min;
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/node.d.linux/tcp.in
^
|
@@ -0,0 +1,96 @@
+#!@@GOODSH@@
+
+: <<EOF
+
+=head1 NAME
+
+tcp - Plugin to monitor IPV4/6 TCP socket status on a Linux host.
+
+=head1 AUTHOR
+
+Copyright 2009 Tim Small <tim@seoss.co.uk>
+
+=head1 LICENSE
+
+GPLv2
+
+=begin comment
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 dated June, 1991.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA.
+
+=end comment
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+ #%# capabilities=autoconf
+
+=cut
+
+EOF
+
+case $1 in
+ config)
+ cat <<EOF
+graph_title TCP
+graph_vlabel TCP Sockets
+graph_category network
+graph_args -l 0
+graph_info TCP socket states for the local machine
+EOF
+
+ for i in established syn_sent syn_recv fin_wait1 \
+ fin_wait2 time_wait close close_wait last_ack \
+ listen closing
+ do
+ echo ${i}.label $i
+ echo ${i}.draw LINE2
+ echo ${i}.info Sockets in state $i
+ done
+
+ exit 0
+ ;;
+ autoconf)
+ if [ -f /proc/net/tcp -o -f /proc/net/tcp6 ]
+ then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+esac
+
+# See #include <netinet/tcp.h>
+
+cat /proc/net/tcp* | awk '
+
+ match ($4, /0[0-9A-B]/) {
+ STATE[$4]++;
+ }
+
+ END {
+ printf "established.value %d\n", STATE["01"];
+ printf "syn_sent.value %d\n", STATE["02"];
+ printf "syn_recv.value %d\n", STATE["03"];
+ printf "fin_wait1.value %d\n", STATE["04"];
+ printf "fin_wait2.value %d\n", STATE["05"];
+ printf "time_wait.value %d\n", STATE["06"];
+ printf "close.value %d\n", STATE["07"];
+ printf "close_wait.value %d\n", STATE["08"];
+ printf "last_ack.value %d\n", STATE["09"];
+ printf "listen.value %d\n", STATE["0A"];
+ printf "closing.value %d\n", STATE["0B"];
+ }'
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/uptime.in
^
|
@@ -37,6 +37,7 @@
echo 'graph_title Uptime'
echo 'graph_args --base 1000 -l 0 '
+ echo 'graph_scale no'
echo 'graph_vlabel uptime in days'
echo 'graph_category system'
echo 'uptime.label uptime'
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/vserver_cpu_.in
^
|
@@ -1,7 +1,7 @@
#!@@BASH@@
# -*- sh -*-
-: <<EOF
+: <<'=cut'
=head1 NAME
@@ -10,12 +10,12 @@
=head1 CONFIGURATION
[vserver_cpu_*]
- env.vservers - List of vservers to include in the graph, or "all"
+ env.vservers - List of vservers to include in the graph, or "all"
=head2 DEFAULT CONFIGURATION
[vserver_cpu_*]
- env.vservers all
+ env.vservers all
=head1 USAGE
@@ -64,6 +64,11 @@
=over 4
+=item Less shell subprocesses
+
+The plugin uses lots and lots of shell subprocesses. Maybe factor
+common vserver plugin code into Munin::Plugin::Linux::Vserver?
+
=item Comments
Comment the code or go mad
@@ -80,18 +85,38 @@
=item Less use of /proc
use /proc less often (100 times more overhead than talking to the
-kernel directly) i.e. use something like pagesize=`perl -MPOSIX -e
-'print POSIX::sysconf(_SC_PAGESIZE), "\n";'`
+kernel directly) i.e. use something like pagesize=\`perl -MPOSIX -e
+'print POSIX::sysconf(_SC_PAGESIZE), "\n";'\`
+
+(Accoding to many using /proc is a feature not a bug - Nicoali
+Langfeldt 2009-12-23)
=back
=head1 MAGIC MARKERS
- #%# family=contrib
+ #%# family=auto
+ #%# capabilities=autoconf suggest
=cut
-EOF
+if [ "$1" = "autoconf" ]; then
+ if [ -r /proc/virtual/info ]; then
+ echo yes
+ else
+ echo "no (/proc/virtual/info not found)"
+ fi
+ exit 0
+fi
+
+if [ "$1" = "suggest" ]; then
+ if [ ! -r /proc/virtual/info ]; then
+ exit 1
+ fi
+ #
+ # 'else' clause is after XIDS definition
+ #
+fi
VSERVERS="$vservers"
@@ -124,6 +149,16 @@
done
fi
+if [ "$1" = "suggest" ]; then
+ if [ -r /proc/virtual/info ]; then
+ for i in $XIDS ; do
+ LABEL=`cat /proc/virtual/$i/$NAMELOC |grep NodeName |cut -f2`
+ echo $LABEL
+ done
+ exit 0
+ fi
+fi
+
BASEPARAM=`basename $0 | sed 's/^vserver_//'`
MODE=`echo $BASEPARAM | sed 's/^hold.*//'`
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/vserver_loadavg.in
^
|
@@ -1,7 +1,7 @@
#!@@BASH@@
# -*- sh -*-
-: <<EOF
+: <<'=cut'
=head1 NAME
@@ -53,27 +53,28 @@
=head1 BUGS
-Autoconf always answers yes.
+None known.
=head1 MAGIC MARKERS
- #%# family=contrib
+ #%# family=auto
+ #%# capabilities=autoconf
=cut
-EOF
-
# If run with the "autoconf"-parameter, give our opinion on whether we
# should be run on this system or not. This is optional, and only used by
-# munin-config. In the case of this plugin, we should most probably
-# always be included whwn there is a vserver kernel.
+# munin-node-config.
if [ "$1" = "autoconf" ]; then
- echo yes
- exit 0
+ if [ -r /proc/virtual/info ]; then
+ echo yes
+ else
+ echo "no (/proc/virtual/info not found)"
+ fi
+ exit 0
fi
-
# if vservers are specified, use them; the default is to use all.
VSERVERS="$vservers"
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/vserver_resources.in
^
|
@@ -1,7 +1,7 @@
#!@@BASH@@
# -*- sh -*-
-: <<EOF
+: <<'=cut'
=head1 NAME
@@ -137,6 +137,11 @@
=over 4
+=item Less shell subprocesses
+
+The plugin uses lots and lots of shell subprocesses. Maybe factor
+common vserver plugin code into Munin::Plugin::Linux::Vserver?
+
=item Multigraph
make it so you can specify more than one resource to be graphed?
@@ -151,8 +156,8 @@
=item Use /proc less often
use /proc less often (100 times more overhead than talking to the
-kernel directly) i.e. use something like pagesize=`perl -MPOSIX -e
-'print POSIX::sysconf(_SC_PAGESIZE), "\n";'`
+kernel directly) i.e. use something like pagesize=\`perl -MPOSIX -e
+'print POSIX::sysconf(_SC_PAGESIZE), "\n";'\`
=back
@@ -162,11 +167,19 @@
=head1 MAGIC MARKERS
- #%# family=contrib
+ #%# family=auto
+ #%# capabilities=autoconf
=cut
-EOF
+if [ "$1" = "autoconf" ]; then
+ if [ -r /proc/virtual/info ]; then
+ echo yes
+ else
+ echo "no (/proc/virtual/info not found)"
+ fi
+ exit 0
+fi
VSERVERS="$vservers"
LIMITS="$limits"
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.linux/yum.in
^
|
@@ -27,8 +27,9 @@
=cut
use strict;
+use Munin::Common::Defaults;
-my $statefile = '@@PLUGSTATE@@/yum.state';
+my $statefile = "$Munin::Common::Defaults::MUNIN_PLUGSTATE/yum.state";
sub update {
if (-l $statefile) {
@@ -78,7 +79,8 @@
my @packages;
open my $state, '<', $statefile
- or die "Can't open $statefile for reading: $!\n";
+ or die "Can't open $statefile for reading: $!
+Please read 'munindoc yum' to understand why if the file does not exist.\n";
chomp(@packages = <$state>);
close $state;
@@ -98,11 +100,9 @@
if (exists $funcs{$arg}) {
$funcs{$arg}->();
- }
- else {
+ } else {
die "Unknown argument '$arg'\n";
}
-}
-else {
+} else {
report();
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.netbsd/if_.in
^
|
@@ -61,14 +61,16 @@
echo "graph_info This graph shows the traffic of the $INTERFACE network interface. Please note that the traffic is shown in bits per second, not bytes."
echo 'rbytes.label received'
- echo 'rbytes.type COUNTER'
+ echo 'rbytes.type DERIVE'
echo 'rbytes.graph no'
echo 'rbytes.cdef rbytes,8,*'
+ echo 'rbytes.min 0'
echo 'obytes.label bps'
- echo 'obytes.type COUNTER'
+ echo 'obytes.type DERIVE'
echo 'obytes.negative rbytes'
echo 'obytes.cdef obytes,8,*'
+ echo 'obytes.min 0'
echo "obytes.info Traffic sent (+) and received (-) on the $INTERFACE network interface."
exit 0
fi;
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.sunos/cpu.in
^
|
@@ -58,29 +58,25 @@
echo 'system.type DERIVE'
echo 'system.min 0'
echo "system.max $cpumax"
- print_warning system
- print_critical system
+ print_adjusted_thresholds system "$graphlimit"
echo 'user.label user'
echo 'user.draw STACK'
echo 'user.type DERIVE'
echo 'user.min 0'
echo "user.max $cpumax"
- print_warning user
- print_critical user
+ print_adjusted_thresholds user "$graphlimit"
echo "waitio.max $cpumax"
echo 'waitio.label waitio'
echo 'waitio.draw STACK'
echo 'waitio.type DERIVE'
echo 'waitio.min 0'
- print_warning waitio
- print_critical waitio
+ print_adjusted_thresholds waitio "$graphlimit"
echo 'idle.label idle'
echo 'idle.draw STACK'
echo 'idle.type DERIVE'
echo 'idle.min 0'
echo "idle.max $cpumax"
- print_warning idle
- print_critical idle
+ print_adjusted_thresholds idle "$graphlimit"
if [ "$scaleto100" = "yes" ]; then
echo "system.cdef system,$ncpu,/"
echo "user.cdef user,$ncpu,/"
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.sunos/df.in
^
|
@@ -20,6 +20,12 @@
the munin label (shown in the plugin display page) and append _warning
or _critical respectively to get the (environment variable) name.
+To limit the monitored filesystems, configure the "only" environment variable.
+For example, to only monitor /, one would add to plugin-conf.d:
+
+ [df*]
+ env.only /
+
=back
=head1 AUTHOR
@@ -51,7 +57,7 @@
if [ "$1" = "config" ]; then
- echo 'graph_title Filesystem usage (bytes in %)'
+ echo 'graph_title Filesystem usage (in %)'
echo 'graph_args --upper-limit 100'
echo 'graph_category disk'
echo 'graph_scale no'
@@ -61,7 +67,7 @@
# device name. Since the plugin already changed names this
# should be ok.
- $DF -k -l | $TAIL +2 | while read dev size used avail pct mnt; do
+ $DF -k -l $only | $TAIL +2 | while read dev size used avail pct mnt; do
case $dev:$mnt in
/usr/lib*|ctfs:*|objfs:*|mnttab:*|sharefs:*|*:/cdrom/*|*:/media/*) continue;;
@@ -75,7 +81,7 @@
exit 0
fi
-$DF -k -l | $TAIL +2 | while read dev size used avail pct mnt; do
+$DF -k -l $only | $TAIL +2 | while read dev size used avail pct mnt; do
case $dev:$mnt in
/usr/lib*|ctfs:*|objfs:*|mnttab:*|sharefs:*|*:/cdrom/*|*:/media/*) continue;;
swap:*) name=$(clean_fieldname $mnt);;
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.sunos/df_inode.in
^
|
@@ -20,6 +20,13 @@
the munin label (shown in the plugin display page) and append _warning
or _critical respectively to get the (environment variable) name.
+To limit the monitored filesystems, configure the "only" environment variable.
+For example, to only monitor /, one would add to plugin-conf.d:
+
+ [df*]
+ env.only /
+
+
=back
=head1 AUTHOR
@@ -45,11 +52,11 @@
critical=${critical:-98}
# Figure out correct way to invoke df and what output to use
-if $DF -P -l -i >/dev/null 2>&1; then
- DF="$DF -P -l -i"
+if $DF -P -l -i $only >/dev/null 2>&1; then
+ DF="$DF -P -l -i $only"
FSNAME=6
else
- DF="$DF -oi 2>/dev/null"
+ DF="$DF -oi $only 2>/dev/null"
FSNAME=5
PCNT=4
fi
@@ -62,7 +69,7 @@
if [ "$1" = "config" ]; then
- echo 'graph_title Filesystem usage (inodes in %)'
+ echo 'graph_title Inode usage (in %)'
echo 'graph_args --upper-limit 100'
echo 'graph_category disk'
echo 'graph_scale no'
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.sunos/if_.in
^
|
@@ -56,7 +56,7 @@
if [ "$1" = "suggest" ]; then
if [ -x /usr/bin/kstat ]; then
- kstat -m link -p -s '/^rbytes$/' | awk -F: '{ print $3 }'
+ kstat -p -m '/^(?!unix)/' -n '/^(?!mac$)/' -s rbytes64 | awk -F: '{ print $3 }'
exit 0
else
exit 1
@@ -71,24 +71,21 @@
echo 'graph_vlabel bits per ${graph_period} in (-) / out (+)'
echo 'graph_category network'
echo 'rbytes.label received'
- echo 'rbytes.type COUNTER'
- echo 'rbytes.max 2000000000'
- echo 'rbytes.graph no'
- echo 'rbytes.cdef rbytes,8,*'
+ echo 'rbytes.type DERIVE'
+ echo 'rbytes.graph no'
+ echo 'rbytes.cdef rbytes,8,*'
+ echo 'rbytes.min 0'
print_warning rbytes
print_critical rbytes
- echo 'obytes.label bps'
- echo 'obytes.type COUNTER'
+ echo 'obytes.label bps'
+ echo 'obytes.type DERIVE'
echo 'obytes.negative rbytes'
echo 'obytes.cdef obytes,8,*'
- echo 'obytes.max 2000000000'
+ echo 'obytes.min 0'
print_warning obytes
print_critical obytes
exit 0
fi;
-kstat -p -n $INTERFACE -m link -s '/^[ro]bytes$/' | awk -F: '
-{
- split($4, four, "\t")
- print four[1] ".value", four[2]
-}'
+kstat -p -m '/^(?!unix)/' -n $INTERFACE -s '*bytes64' | sed \
+ 's/.*\(.bytes\)64./\1.value /'
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.sunos/if_err_.in
^
|
@@ -56,7 +56,7 @@
if [ "$1" = "suggest" ]; then
if [ -x /usr/bin/kstat ]; then
- kstat -m link -p -s '/^ierrors$/' | awk -F: '{ print $3 }'
+ kstat -p -m '/^(?!unix)/' -n '/^(?!mac$)/' -s ierrors | awk -F: '{ print $3 }'
exit 0
else
exit 1
@@ -88,7 +88,7 @@
exit 0
fi;
-kstat -p -n $INTERFACE -m link -s '/^([io]errors|collisions)$/' | awk -F: '
+kstat -p -m '/^(?!unix)/' -n $INTERFACE -s '/^([io]errors|collisions)$/' | awk -F: '
{
split($4, four, "\t")
print four[1] ".value", four[2]
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d.sunos/memory.in
^
|
@@ -74,8 +74,8 @@
fi
if [ "$1" = "config" ]; then
- echo "graph_title Memory usage (in MB)"
- echo 'graph_category system'
+ echo "graph_title Memory usage (in MB)"
+ echo 'graph_category system'
echo "real.label Physical mem"
echo "used.label Mem used"
echo "swapt.label Total swap"
@@ -105,15 +105,17 @@
}
/^Memory/ {
real = scale($2);
- free = scale($4);
- swapu = scale($6);
- swapf = scale($10);
+ free = scale($5);
+ swapt = scale($8);
+ swapf = scale($11);
memused = real - free
- swaptot = swapu + swapf
+ swapu = swapt - swapf
print "real.value", real
print "used.value", memused
- print "swapt.value", swaptot
+ print "swapt.value", swapt
print "swapu.value", swapu
}'
+
+# vim: syntax=sh ts=2 et
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/amavis.in
^
|
@@ -1,5 +1,6 @@
#!@@GOODSH@@
# -*- sh -*-
+# vim: ft=sh
: <<=cut
@@ -57,7 +58,7 @@
=head1 VERSION
- $Id: amavis.in 3105 2009-11-26 18:58:46Z feiner.tom $
+ $Id: amavis.in 3441 2010-03-18 20:07:35Z feiner.tom $
=head1 BUGS
@@ -76,7 +77,7 @@
=cut
mktempfile () {
- cmd=$(echo $MUNIN_MKTEMP | sed s/\\$1/$1/)
+ cmd=`echo $MUNIN_MKTEMP | sed s/\\$1/$1/`
$cmd
}
@@ -105,7 +106,7 @@
if [ "$1" = "config" ]; then
echo 'graph_title Amavis filter statistics'
- echo 'graph_vlabel #'
+ echo 'graph_vlabel \#'
echo 'graph_category antivirus'
echo 'virus.label virus'
echo 'virus.info Number of viruses caught in email'
@@ -132,10 +133,10 @@
else
$LOGTAIL ${AMAVIS_LOG} ${STATEFILE} | grep 'amavis\[.*\]:' > ${TEMP_FILE}
fi
- total=$(cat ${TEMP_FILE} | wc -l)
- virus=$(grep INFECTED ${TEMP_FILE} | wc -l)
- spamm=$(grep 'Passed.*Hits: 1[0-9][.]' ${TEMP_FILE} | wc -l)
- spams=$(grep 'Passed.*Hits: [2-9][0-9][0-9]*[.]' ${TEMP_FILE} | wc -l)
+ total=$(grep -c 'Passed' ${TEMP_FILE})
+ virus=$(grep -c 'INFECTED' ${TEMP_FILE})
+ spamm=$(grep -c 'Passed.*Hits: 1[0-9][.]' ${TEMP_FILE})
+ spams=$(grep -c 'Passed.*Hits: [2-9][0-9][0-9]*[.]' ${TEMP_FILE})
/bin/rm -f $TEMP_FILE
fi
@@ -144,3 +145,4 @@
echo "spam_maybe.value ${spamm}"
echo "spam_sure.value ${spams}"
echo "total.value ${total}"
+
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/apache_accesses.in
^
|
@@ -57,7 +57,7 @@
=head1 VERSION
- $Id: apache_accesses.in 2957 2009-11-11 13:43:12Z feiner.tom $
+ $Id: apache_accesses.in 3192 2009-12-05 21:11:54Z feiner.tom $
=head1 BUGS
@@ -82,6 +82,9 @@
if (! eval "require LWP::UserAgent;")
{
$ret = "LWP::UserAgent not found";
+ if ( ! defined $ARGV[0] ) {
+ die $ret;
+ }
}
my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto";
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/apache_processes.in
^
|
@@ -68,7 +68,7 @@
=head1 VERSION
- $Id: apache_processes.in 2957 2009-11-11 13:43:12Z feiner.tom $
+ $Id: apache_processes.in 3192 2009-12-05 21:11:54Z feiner.tom $
=head1 AUTHOR
@@ -88,6 +88,9 @@
if (! eval "require LWP::UserAgent;")
{
$ret = "LWP::UserAgent not found";
+ if ( ! defined $ARGV[0] ) {
+ die $ret;
+ }
}
my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto";
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/apache_volume.in
^
|
@@ -58,7 +58,7 @@
=head1 VERSION
- $Id: apache_volume.in 2957 2009-11-11 13:43:12Z feiner.tom $
+ $Id: apache_volume.in 3192 2009-12-05 21:11:54Z feiner.tom $
=head1 BUGS
@@ -82,6 +82,9 @@
if (! eval "require LWP::UserAgent;")
{
$ret = "LWP::UserAgent not found";
+ if ( ! defined $ARGV[0] ) {
+ die $ret;
+ }
}
my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto";
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/bind9.in
^
|
@@ -31,14 +31,19 @@
=cut
use strict;
+use Munin::Common::Defaults;
my $QUERYLOG = $ENV{logfile} || '/var/log/bind9/query.log';
-my $STATEFILE= $ENV{MUNIN_PLUGSTATE}.'/bind9.state';
+my $STATEFILE= $Munin::Common::Defaults::MUNIN_PLUGSTATE.'/bind9.state';
my $OTHER=0;
my %IN;
sub get_state {
- open(Q,"< $STATEFILE") or die;
+ if (! -f $STATEFILE) {
+ open(Q, ">", $STATEFILE);
+ close(Q);
+ }
+ open(Q,"< $STATEFILE") or die ("Cannot open state file");
while (<Q>) {
chomp;
my ($q,$n) = split(/\s+/,$_,2);
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/bind9_rndc.in
^
|
@@ -63,7 +63,7 @@
# check to see if we're running bind 9.6
if ( open VERSION, "$rndc 2>&1 |" ) {
while ( my $line = <VERSION> ) {
- if ( $line =~ m/^Version:\s+9\.(\d+)\./o ) {
+ if ( $line =~ m/^Version:\s+9\.(\d+)\D/o ) {
$version96 = 1 if $1 >= 6;
}
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/dhcpd3.in
^
|
@@ -42,11 +42,14 @@
=head1 VERSION
- $Id: dhcpd3.in 3063 2009-11-24 10:25:49Z runesk $
+ $Id: dhcpd3.in 3267 2009-12-30 07:42:50Z janl $
=head1 BUGS
-None known
+If a DHCP config file contains multiple subnets but none of them has a
+dynamic range, the dhcp3 plugin only detects this situation for the
+last subnet. Need to to improve the parser to properly detect the end
+of a subnet definition (Munin trac ticket #829)
=head1 AUTHOR
@@ -89,7 +92,7 @@
if($ARGV[0] and $ARGV[0] eq "autoconf" ) {
if($ret) {
print "no ($ret)\n";
- exit 1;
+ exit 0;
}
if(-f $LEASEFILE) {
if(-r $LEASEFILE) {
@@ -109,7 +112,7 @@
} else {
print "no (leasefile not found)\n";
}
- exit 1;
+ exit 0;
}
print "# DEBUG: CONFIGFILE == $CONFIGFILE\n# DEBUG: LEASEFILE == $LEASEFILE\n" if $DEBUG;
@@ -136,7 +139,8 @@
$name =~ s/($FILTER)//;
print "$network.label $name\n";
print "$network.min 0\n";
- print "$network.max " . $limits{$network} ."\n";
+ print "$network.max " . $limits{$network} ."\n"
+ if ($limits{$network} > 0);
my $warn = int($limits{$network} * 0.9);
my $crit = int($limits{$network} * 0.95);
print "$network.warning $warn\n" if $warn;
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/exim_mailstats.in
^
|
@@ -46,7 +46,7 @@
=head1 VERSION
- $Id: exim_mailstats.in 3019 2009-11-20 10:44:42Z janl $
+ $Id: exim_mailstats.in 4101 2011-01-14 15:26:21Z jo $
=head1 AUTHOR
@@ -106,8 +106,8 @@
my ($LOGFILE, $rotated) = tail_open($fname, $start);
- if ($rotated) {
- # Reset everything if the log has been rotated
+ if ($rotated || $received eq 'U') {
+ # Reset everything if the log has been rotated or we've just initialised
$pos = $received = $completed = $rejected = 0;
}
@@ -117,7 +117,7 @@
if (/ <= /) {
$received++;
}
- elsif (/ Completed /) {
+ elsif (m/ Completed$/) {
$completed++;
}
elsif (/ rejected /) {
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/node.d/freeradius_acct.in
^
|
@@ -0,0 +1,108 @@
+#!@@GOODSH@@
+: << =cut
+
+=head1 NAME
+
+freeradius_acct - Plugin to count the daily amount of freeradius accounting packets.
+
+=head1 APPLICABLE SYSTEMS
+
+FreeRADIUS 2.1.0 or later.
+
+=head1 CONFIGURATION
+
+This plugin uses the following configuration variables:
+
+ [freeradius_acct]
+ env.radmin - Path to "radmin" executable.
+ env.socketfile - Path to administration socket.
+
+=head1 AUTHOR
+
+Copyright (C) 2008 Alan DeKok <aland@deployingradius.com>
+
+=head1 LICENSE
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+
+=cut
+
+RADMIN=${radmin:-`which radmin 2>/dev/null`}
+RADMIN=${RADMIN:-/usr/sbin/radmin}
+SOCKETFILE=${socketfile:-/var/run/radiusd/radiusd.sock}
+
+if [ "$1" = "autoconf" ]; then
+ #
+ # FIXME: Check if FreeRADIUS is running.
+ #
+ echo yes
+ exit 0
+fi
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title FreeRADIUS Accounting Requests'
+ echo 'graph_args --base 1000 -l 0 '
+ echo 'graph_period second'
+ echo 'graph_vlabel requests / ${graph_period}'
+ echo 'graph_category Other'
+
+ echo 'requests.label Accounting-Requests'
+ echo 'requests.info total received request packets'
+ echo 'requests.type DERIVE'
+ echo 'requests.min 0'
+
+ echo 'responses.label Accounting-Responses'
+ echo 'responses.info total sent response packets'
+ echo 'responses.type DERIVE'
+ echo 'responses.min 0'
+
+ echo 'dup.label Duplicate requests'
+ echo 'dup.info total duplicate request packets'
+ echo 'dup.type DERIVE'
+ echo 'dup.min 0'
+
+ echo 'invalid.label Invalid requests'
+ echo 'invalid.info total invalid request packets'
+ echo 'invalid.type DERIVE'
+ echo 'invalid.min 0'
+
+ echo 'malformed.label Malformed requests'
+ echo 'malformed.info total malformed request packets'
+ echo 'malformed.type DERIVE'
+ echo 'malformed.min 0'
+
+ echo 'bad_signature.label Requests with bad signature'
+ echo 'bad_signature.info total request packets with a bad signature'
+ echo 'bad_signature.type DERIVE'
+ echo 'bad_signature.min 0'
+
+ echo 'dropped.label Dropped requests'
+ echo 'dropped.info total request packets dropped for other reasons'
+ echo 'dropped.type DERIVE'
+ echo 'dropped.min 0'
+
+ echo 'unknown_types.label Unknown type'
+ echo 'unknown_types.info total request packets of unknown type'
+ echo 'unknown_types.type DERIVE'
+ echo 'unknown_types.min 0'
+
+ exit 0
+fi
+
+$RADMIN -f $SOCKETFILE -e "stats client acct" | awk '{print $1".value " $2}'
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/node.d/freeradius_auth.in
^
|
@@ -0,0 +1,123 @@
+#!@@GOODSH@@
+: << =cut
+
+=head1 NAME
+
+freeradius_auth - Plugin to count the daily amount of freeradius authentication packets.
+
+=head1 APPLICABLE SYSTEMS
+
+FreeRADIUS 2.1.0 or later.
+
+=head1 CONFIGURATION
+
+This plugin uses the following configuration variables:
+
+ [freeradius_auth]
+ env.radmin - Path to "radmin" executable.
+ env.socketfile - Path to administration socket.
+
+=head1 AUTHOR
+
+Copyright (C) 2008 Alan DeKok <aland@deployingradius.com>
+
+=head1 LICENSE
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+
+=cut
+
+RADMIN=${radmin:-`which radmin 2>/dev/null`}
+RADMIN=${RADMIN:-/usr/sbin/radmin}
+SOCKETFILE=${socketfile:-/var/run/radiusd/radiusd.sock}
+
+if [ "$1" = "autoconf" ]; then
+ #
+ # FIXME: Check if FreeRADIUS is running.
+ #
+ echo yes
+ exit 0
+fi
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title FreeRADIUS Authentication Requests'
+ echo 'graph_args --base 1000 -l 0 '
+ echo 'graph_period second'
+ echo 'graph_vlabel requests / ${graph_period}'
+ echo 'graph_category Other'
+
+ echo 'requests.label Access-Requests'
+ echo 'requests.info total received request packets'
+ echo 'requests.type DERIVE'
+ echo 'requests.min 0'
+
+ echo 'responses.label responses (all types)'
+ echo 'responses.info total sent response packets'
+ echo 'responses.type DERIVE'
+ echo 'responses.min 0'
+
+ echo 'accepts.label Access-Accepts'
+ echo 'accepts.info total sent Access-Accept packets'
+ echo 'accepts.type DERIVE'
+ echo 'accepts.min 0'
+
+ echo 'rejects.label Access-Rejects'
+ echo 'rejects.info total sent Access-Reject packets'
+ echo 'rejects.type DERIVE'
+ echo 'rejects.min 0'
+
+ echo 'challenges.label Access-Challenges'
+ echo 'challenges.info total sent Access-Challenge packets'
+ echo 'challenges.type DERIVE'
+ echo 'challenges.min 0'
+
+ echo 'dup.label Duplicate requests'
+ echo 'dup.info total duplicate request packets'
+ echo 'dup.type DERIVE'
+ echo 'dup.min 0'
+
+ echo 'invalid.label Invalid requests'
+ echo 'invalid.info total invalid request packets'
+ echo 'invalid.type DERIVE'
+ echo 'invalid.min 0'
+
+ echo 'malformed.label Malformed requests'
+ echo 'malformed.info total malformed request packets'
+ echo 'malformed.type DERIVE'
+ echo 'malformed.min 0'
+
+ echo 'bad_signature.label Requests with bad signature'
+ echo 'bad_signature.info total request packets with a bad signature'
+ echo 'bad_signature.type DERIVE'
+ echo 'bad_signature.min 0'
+
+ echo 'dropped.label Dropped requests'
+ echo 'dropped.info total request packets dropped for other reasons'
+ echo 'dropped.type DERIVE'
+ echo 'dropped.min 0'
+
+ echo 'unknown_types.label Unknown type'
+ echo 'unknown_types.info total request packets of unknown type'
+ echo 'unknown_types.type DERIVE'
+ echo 'unknown_types.min 0'
+
+ exit 0
+fi
+
+$RADMIN -f $SOCKETFILE -e "stats client auth" | awk '{print $1".value " $2}'
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/node.d/freeradius_proxy_acct.in
^
|
@@ -0,0 +1,108 @@
+#!@@GOODSH@@
+: << =cut
+
+=head1 NAME
+
+freeradius_proxy_acct - Plugin to count the daily amount of freeradius proxied accounting packets.
+
+=head1 APPLICABLE SYSTEMS
+
+FreeRADIUS 2.1.0 or later.
+
+=head1 CONFIGURATION
+
+This plugin uses the following configuration variables:
+
+ [freeradius_proxy_acct]
+ env.radmin - Path to "radmin" executable.
+ env.socketfile - Path to administration socket.
+
+=head1 AUTHOR
+
+Copyright (C) 2008 Alan DeKok <aland@deployingradius.com>
+
+=head1 LICENSE
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+
+=cut
+
+RADMIN=${radmin:-`which radmin 2>/dev/null`}
+RADMIN=${RADMIN:-/usr/sbin/radmin}
+SOCKETFILE=${socketfile:-/var/run/radiusd/radiusd.sock}
+
+if [ "$1" = "autoconf" ]; then
+ #
+ # FIXME: Check if FreeRADIUS is running.
+ #
+ echo yes
+ exit 0
+fi
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title FreeRADIUS Proxied Accounting Requests'
+ echo 'graph_args --base 1000 -l 0 '
+ echo 'graph_period second'
+ echo 'graph_vlabel requests / ${graph_period}'
+ echo 'graph_category Other'
+
+ echo 'requests.label Accounting-Requests'
+ echo 'requests.info total sent request packets'
+ echo 'requests.type DERIVE'
+ echo 'requests.min 0'
+
+ echo 'responses.label Accounting-Responses'
+ echo 'responses.info total received response packets'
+ echo 'responses.type DERIVE'
+ echo 'responses.min 0'
+
+ echo 'dup.label Duplicate requests'
+ echo 'dup.info total duplicate request packets'
+ echo 'dup.type DERIVE'
+ echo 'dup.min 0'
+
+ echo 'invalid.label Invalid requests'
+ echo 'invalid.info total invalid request packets'
+ echo 'invalid.type DERIVE'
+ echo 'invalid.min 0'
+
+ echo 'malformed.label Malformed requests'
+ echo 'malformed.info total malformed request packets'
+ echo 'malformed.type DERIVE'
+ echo 'malformed.min 0'
+
+ echo 'bad_signature.label Requests with bad signature'
+ echo 'bad_signature.info total request packets with a bad signature'
+ echo 'bad_signature.type DERIVE'
+ echo 'bad_signature.min 0'
+
+ echo 'dropped.label Dropped requests'
+ echo 'dropped.info total request packets dropped for other reasons'
+ echo 'dropped.type DERIVE'
+ echo 'dropped.min 0'
+
+ echo 'unknown_types.label Unknown type'
+ echo 'unknown_types.info total request packets of unknown type'
+ echo 'unknown_types.type DERIVE'
+ echo 'unknown_types.min 0'
+
+ exit 0
+fi
+
+$RADMIN -f $SOCKETFILE -e "stats home_server acct" | awk '{print $1".value " $2}'
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/node.d/freeradius_proxy_auth.in
^
|
@@ -0,0 +1,123 @@
+#!@@GOODSH@@
+: << =cut
+
+=head1 NAME
+
+freeradius_proxy_auth - Plugin to count the daily amount of freeradius proxied authentication packets.
+
+=head1 APPLICABLE SYSTEMS
+
+FreeRADIUS 2.1.0 or later.
+
+=head1 CONFIGURATION
+
+This plugin uses the following configuration variables:
+
+ [freeradius_proxy_auth]
+ env.radmin - Path to "radmin" executable.
+ env.socketfile - Path to administration socket.
+
+=head1 AUTHOR
+
+Copyright (C) 2008 Alan DeKok <aland@deployingradius.com>
+
+=head1 LICENSE
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+
+=cut
+
+RADMIN=${radmin:-`which radmin 2>/dev/null`}
+RADMIN=${RADMIN:-/usr/sbin/radmin}
+SOCKETFILE=${socketfile:-/var/run/radiusd/radiusd.sock}
+
+if [ "$1" = "autoconf" ]; then
+ #
+ # FIXME: Check if FreeRADIUS is running.
+ #
+ echo yes
+ exit 0
+fi
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title FreeRADIUS Proxied Authentication Requests'
+ echo 'graph_args --base 1000 -l 0 '
+ echo 'graph_period second'
+ echo 'graph_vlabel requests / ${graph_period}'
+ echo 'graph_category Other'
+
+ echo 'requests.label Access-Requests'
+ echo 'requests.info total sent request packets'
+ echo 'requests.type DERIVE'
+ echo 'requests.min 0'
+
+ echo 'responses.label responses (all types)'
+ echo 'responses.info total received response packets'
+ echo 'responses.type DERIVE'
+ echo 'responses.min 0'
+
+ echo 'accepts.label Access-Accepts'
+ echo 'accepts.info total received Access-Accept packets'
+ echo 'accepts.type DERIVE'
+ echo 'accepts.min 0'
+
+ echo 'rejects.label Access-Rejects'
+ echo 'rejects.info total received Access-Reject packets'
+ echo 'rejects.type DERIVE'
+ echo 'rejects.min 0'
+
+ echo 'challenges.label Access-Challenges'
+ echo 'challenges.info total received Access-Challenge packets'
+ echo 'challenges.type DERIVE'
+ echo 'challenges.min 0'
+
+ echo 'dup.label Duplicate requests'
+ echo 'dup.info total duplicate request packets'
+ echo 'dup.type DERIVE'
+ echo 'dup.min 0'
+
+ echo 'invalid.label Invalid requests'
+ echo 'invalid.info total invalid request packets'
+ echo 'invalid.type DERIVE'
+ echo 'invalid.min 0'
+
+ echo 'malformed.label Malformed requests'
+ echo 'malformed.info total malformed request packets'
+ echo 'malformed.type DERIVE'
+ echo 'malformed.min 0'
+
+ echo 'bad_signature.label Requests with bad signature'
+ echo 'bad_signature.info total request packets with a bad signature'
+ echo 'bad_signature.type DERIVE'
+ echo 'bad_signature.min 0'
+
+ echo 'dropped.label Dropped requests'
+ echo 'dropped.info total request packets dropped for other reasons'
+ echo 'dropped.type DERIVE'
+ echo 'dropped.min 0'
+
+ echo 'unknown_types.label Unknown type'
+ echo 'unknown_types.info total request packets of unknown type'
+ echo 'unknown_types.type DERIVE'
+ echo 'unknown_types.min 0'
+
+ exit 0
+fi
+
+$RADMIN -f $SOCKETFILE -e "stats home_server auth" | awk '{print $1".value " $2}'
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/hddtemp_smartctl.in
^
|
@@ -8,11 +8,15 @@
=head1 CONFIGURATION
+This plugin needs to run as root or some other user that has access to
+the harddrive devices.
+
The following environment variables are used
smartctl - path to smartctl executable
drives - List drives to monitor. E.g. "env.drives hda hdc".
type_$dev - device type for one drive, e.g. "env.type_sda 3ware,0"
+ or more typically "env.type_sda ata" if sda is a SATA disk.
args_$dev - additional arguments to smartctl for one drive,
e.g. "env.args_hda -v 194,10xCelsius". Use this to make
the plugin use the --all or -a option if your disk will
@@ -20,10 +24,9 @@
used.
dev_$dev - monitoring device for one drive, e.g. twe0
-If the "smartctl" enviroment variable is not set, or points to a
-non-existing file, the plugin will search /usr/bin, /usr/sbin,
-/usr/local/bin and /usr/local/sbin for a file called "smartctl", and
-use that.
+If the "smartctl" enviroment variable is not set the plugin will
+search your $PATH, /usr/bin, /usr/sbin, /usr/local/bin and
+/usr/local/sbin for a file called "smartctl", and use that.
If the "drives" environment variable is not set, the plugin will
attempt to search for drives to probe.
@@ -90,6 +93,8 @@
use strict;
+my $DEBUG = $ENV{'MUNIN_DEBUG'} || 0;
+
my $smartctl = exists $ENV{smartctl} ? $ENV{smartctl} : '';
# If the envvar is not set, look for smartctl
@@ -103,16 +108,22 @@
my $path = $dir.'/smartctl';
$smartctl = $path if -x $path;
}
+} elsif (! -x $smartctl) {
+ # If it is set, verify it
+ warn "Predefined smartctl ($smartctl) is not a executable\n";
+ undef $smartctl;
}
# Check version of smartctl to determine --nocheck capabilities
my $use_nocheck = 0;
if ($smartctl and `$smartctl --version` =~ / version (\d+\.\d+) /i) {
$use_nocheck = $1 >= 5.37;
+ warn "[DEBUG] Smartctl supports --nocheck\n" if $DEBUG;
}
# hdparm is used as a fallback
my $hdparm = `which hdparm 2>/dev/null`;
+chomp $hdparm;
my @drives;
@@ -139,6 +150,8 @@
# Sort list of drives
@drives = sort @drives;
+warn "[DEBUG] Drives: ",join(', ',@drives),"\n" if $DEBUG;
+
if (defined $ARGV[0]) {
if ($ARGV[0] eq 'autoconf') {
if ($smartctl and -x $smartctl) {
@@ -170,6 +183,45 @@
}
}
+foreach my $drive (@drives) {
+ warn "[DEBUG] Processing $drive\n" if $DEBUG;
+ my $fulldev = device_for_drive($drive);
+
+ # Fall back to using hdparm for detecting disks in stand-by only if nocheck
+ # isn't supported (hdparm isn't available on all platforms).
+ if (!$use_nocheck && $hdparm && $fulldev =~ /\/dev\/[sh]d?/) {
+ if (`$hdparm -C $fulldev 2>/dev/null` =~ /standby/) {
+ warn "[DEBUG] Drive $fulldev is in standby mode, not checking\n"
+ if $DEBUG;
+ next;
+ }
+ }
+
+ my $cmd = command_for_drive_device($drive, $fulldev, $use_nocheck);
+ warn "[DEBUG] Command for $drive is % $cmd %\n" if $DEBUG;
+
+ my $output = `$cmd`;
+ if ($? ne 0) {
+ print "$drive.value U\n";
+ print "$drive.extinfo Command $cmd on drive $drive failed: $?. The plugin needs to have read permission on all monitored devices.\n";
+ warn "[ERROR] Command $cmd on drive $drive failed: $?. The plugin needs to have read permission on all monitored devices.\n";
+ next;
+ }
+ if ($output =~ /Current Drive Temperature:\s*(\d+)/) {
+ print "$drive.value $1\n";
+ } elsif ($output =~ /^(194 Temperature_Celsius.*)/m) {
+ my @F = split /\s+/, $1;
+ print "$drive.value $F[9]\n";
+ } elsif ($output =~ /^(231 Temperature_Celsius.*)/m) {
+ my @F = split ' ', $1;
+ print "$drive.value $F[9]\n";
+ } else {
+ print "$drive.value U\n";
+ print "$drive.extinfo Temperature not detected in smartctl output\n";
+ }
+}
+
+
sub device_for_drive {
my ($drive) = @_;
@@ -193,25 +245,3 @@
}
-foreach my $drive (@drives) {
- my $fulldev = device_for_drive($drive);
-
- # Fall back to using hdparm for detecting disks in stand-by only if nocheck
- # isn't supported (hdparm isn't available on all platforms).
- if (!$use_nocheck && $hdparm && $fulldev =~ /\/dev\/[sh]d?/) {
- next if `$hdparm -C $fulldev 2>/dev/null` =~ /standby/;
- }
-
- my $cmd = command_for_drive_device($drive, $fulldev, $use_nocheck);
-
- my $output = `$cmd`;
- if ($output =~ /Current Drive Temperature:\s*(\d+)/) {
- print "$drive.value $1\n";
- } elsif ($output =~ /^(194 Temperature_Celsius.*)/m) {
- my @F = split ' ', $1;
- print "$drive.value $F[9]\n";
- } elsif ($output =~ /^(231 Temperature_Celsius.*)/m) {
- my @F = split ' ', $1;
- print "$drive.value $F[9]\n";
- }
-}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/jmx_.in
^
|
@@ -20,6 +20,10 @@
env.ip 127.0.0.1
env.port 5400
env.category jvm
+ env.username monitorRole
+ env.password SomethingSecret
+
+ env.JRE_HOME /usr/lib/jvm/java-6-sun/jre
Needed configuration on the Tomcat side: add
@@ -30,9 +34,22 @@
to CATALINA_OPTS in your startup scripts.
+Replace authenticate=false with
+ -Dcom.sun.management.jmxremote.password.file=/etc/tomcat/jmxremote.password \
+ -Dcom.sun.management.jmxremote.access.file=/etc/tomcat/jmxremote.access
+ ...if you want authentication.
+
+jmxremote.password:
+ monitorRole SomethingSecret
+
+jmxremote.access:
+ monitorRole readonly
+
+You may need higher access levels for some counters, notably ThreadsDeadlocked.
+
=head1 BUGS
-No authentication or encryption supported in the JMX connection.
+No encryption supported in the JMX connection.
The plugins available reflect the most interesting aspects of a
JVM runtime. This should be extended to cover things specific to
@@ -48,7 +65,8 @@
Shell script wrapper and integration by Erik Inge Bolsø, Redpill
Linpro AS.
-Previous work on JMX plugin by Aleksey Studnev.
+Previous work on JMX plugin by Aleksey Studnev. Support for
+authentication added by Ingvar Hagelund, Redpill Linpro AS.
=head1 LICENSE
@@ -63,6 +81,15 @@
MUNIN_JAR="@@JAVALIBDIR@@/munin-jmx-plugins.jar"
+if [ "x$JRE_HOME" != "x" ] ; then
+ JRE=$JRE_HOME/bin/java
+ export JRE_HOME=$JRE_HOME
+fi
+JAVA_BIN=${JRE:-@@JAVARUN@@}
+
+ip=${ip:-127.0.0.1}
+port=${port:-5400}
+
if [ "x$1" = "xsuggest" ] ; then
cat <<__EOF
ClassesLoaded
@@ -102,16 +129,6 @@
fi
if [ "x$1" = "xautoconf" ] ; then
- if [ "x$ip" = "x" ]; then
- echo "no (ip not configured)"
- exit 0
- fi
-
- if [ "x$port" = "x" ] ; then
- echo "no (port not configured)"
- exit 0
- fi
-
NC=`which nc 2>/dev/null`
if [ "x$NC" = "x" ] ; then
echo "no (nc not found)"
@@ -120,7 +137,6 @@
$NC -n -z $ip $port >/dev/null 2>&1
CONNECT=$?
- JAVA_BIN="@@JAVARUN@@"
$JAVA_BIN -? >/dev/null 2>&1
JAVA=$?
if [ $JAVA -ne 0 ] ; then
@@ -156,4 +172,4 @@
exit 1
fi
-@@JAVARUN@@ -cp $MUNIN_JAR org.munin.plugin.jmx.$jmxfunc $param
+ip=$ip port=$port $JAVA_BIN -cp $MUNIN_JAR org.munin.plugin.jmx.$jmxfunc $param
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/lpstat.in
^
|
@@ -46,14 +46,38 @@
my $n_jobs;
my @exclude; # Should take this from environment.
+# Force C output from lpstat
+$ENV{'LC_MESSAGES'} = "C";
+
# This is a dumb-down. Should take hostname(s) from environment or
# as wildcard plugin.
my $host = '127.0.0.1';
-$ENV{PATH}="/bin:/usr/bin";
+my $lpstat = exists $ENV{lpstat} ? $ENV{lpstat} : '';
+
+# If the envvar is not set, look for lpstat
+if (!$lpstat) {
+ # Still not found? Check obvious places
+ my @dirs = split(':',$ENV{PATH});
+ push (@dirs, qw(/usr/bin /usr/sbin /usr/local/bin /usr/local/sbin) );
+
+ until ($lpstat or @dirs == 0) {
+ my $dir = shift @dirs;
+ my $path = $dir.'/lpstat';
+ $lpstat = $path if -x $path;
+ }
+} elsif (! -x $lpstat) {
+ # If it is set, verify it
+ warn "Predefined lpstat ($lpstat) is not a executable\n";
+ undef $lpstat;
+}
if ($ARGV[0] eq 'autoconf') {
- if( ! open(LPSTAT_R, "lpstat $host -r 2>/dev/null |") ) {
+ if( ! -x $lpstat ) {
+ print "no (lpstat not found)\n";
+ exit 0;
+ }
+ if( ! open(LPSTAT_R, "$lpstat $host -r 2>/dev/null |") ) {
print "no (could not execute lpstat)\n";
exit 0;
}
@@ -70,7 +94,7 @@
# Check printers are accepting jobs
####################################################
# Get list of printers, showing which are accepting jobs...
-if( ! open(LPSTAT_A, "lpstat $host -a|") ) {
+if( ! open(LPSTAT_A, "$lpstat $host -a|") ) {
print "graph_title Could not execute lpstat command\n";
exit -1;
}
@@ -93,7 +117,7 @@
# Check printers are enabled
####################################################
# Get list of printers, showing which are enabled/disabled...
-if( ! open(LPSTAT_P, "lpstat $host -p|") ) {
+if( ! open(LPSTAT_P, "$lpstat $host -p|") ) {
print "graph_title Could not execute lpstat command\n";
exit -1;
}
@@ -116,8 +140,8 @@
next;
}
- if( ! open(LPSTAT, "lpstat $host -o $printer|") ) {
- print STDERR "Could not execute command: 'lpstat -o $printer' \n";
+ if( ! open(LPSTAT, "$lpstat $host -o $printer|") ) {
+ print STDERR "Could not execute command: '$lpstat -o $printer' \n";
exit 2;
}
@jobs = ( <LPSTAT> );
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/mailman.in
^
|
@@ -12,7 +12,7 @@
=head1 AUTHOR
-Author unknown
+Author unknown. Source code strongly related to the Exim plugin of old.
=head1 LICENSE
@@ -24,7 +24,9 @@
=cut
-$statefile = "@@PLUGSTATE@@/munin-mailman-log.state";
+use Munin::Common::Defaults;
+
+$statefile = "$Munin::Common::Defaults::MUNIN_PLUGSTATE/munin-mailman-log.state";
$pos = undef;
$posts = 0;
$members = 0;
@@ -67,12 +69,13 @@
! -x $lister &&
! -f $rotlogfile) {
print "posts.value U\n";
+ print "posts.extinfo Can't find any log files\n";
print "members.value U\n";
exit 0;
}
if(-f $statefile) {
- open(IN, "<$statefile") or exit 4;
+ open(IN, "<$statefile") or die "Can't open $statefile for reading: $!";
if(<IN> =~ /^(\d+):(\d+)/) {
($pos,$posts) = ($1, $2);
}
@@ -85,9 +88,7 @@
# Initial run.
$pos = $startsize;
$startsize = 0;
-}
-
-if($startsize < $pos) {
+} elsif($startsize < $pos) {
# Log rotated
parseMailmanLog($rotlogfile, $pos, (stat $rotlogfile)[7]);
$pos = 0;
@@ -101,14 +102,14 @@
print "posts.value $posts\n";
print "members.value $members\n";
-open (OUT, ">$statefile") or exit 4;
+open (OUT, ">$statefile") or die "Can't open $statefile for writing: $!";
print OUT "$pos:$posts\n";
close OUT;
sub parseMailmanLog {
my($fname, $start, $stop) = @_;
- open(LOGFILE, $fname) or exit 3;
- seek(LOGFILE, $start, 0) or exit 2;
+ open(LOGFILE, $fname) or die "Can't open $fname for reading: $!";
+ seek(LOGFILE, $start, 0) or die "Can't seek in $fname: $!";
while(tell(LOGFILE) < $stop) {
my $line = <LOGFILE>;
if($line =~ / post to/) {
@@ -133,8 +134,10 @@
if (-e "$libdir/data") {
@domains = (".");
} else {
- opendir(DOMAINS, $libdir) or exit 3;
- @domains = grep { !/^\@/ && !/^\./ && -d "$libdir/$_" } readdir(DOMAINS);
+ opendir(DOMAINS, $libdir) or
+ die "Can't open directory $libdir for reading: $!";
+ @domains = grep ( { !/^\@/ && !/^\./ && -d "$libdir/$_" }
+ readdir(DOMAINS) );
closedir(DOMAINS);
}
return @domains;
@@ -142,8 +145,10 @@
sub mailmanLists {
my ($domain) = @_;
- opendir(LISTS, "$libdir/$domain/lists") or exit 3;
- my @lists = grep { !/^\@/ && !/^\./ && -d "$libdir/$domain/lists/$_" } readdir(LISTS);
+ opendir(LISTS, "$libdir/$domain/lists") or
+ die "Can't open directory $libdir/$domain/lists for reading: $!";
+ my @lists = grep ( { !/^\@/ && !/^\./ && -d "$libdir/$domain/lists/$_" }
+ readdir(LISTS) );
closedir(LISTS);
return @lists;
}
@@ -153,7 +158,8 @@
return 0 unless $domain;
return 0 unless $list;
my $cnt = 0;
- open(MEMBERS, "DOMAIN=$domain $lister $list|") or exit 3;
+ open(MEMBERS, "DOMAIN=$domain $lister $list|") or
+ die "Cannot execute pipe: $lister $list: $!";
while(<MEMBERS>) {
$cnt++;
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/multigraph_tester.in
^
|
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@@BASH@@
#%# family=test
#%# capabilities=autoconf
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/node.d/multips_memory.in
^
|
@@ -0,0 +1,145 @@
+#!@@GOODSH@@
+# -*- sh -*-
+
+: <<=cut
+
+=head1 NAME
+
+multips_memory - Munin plugin to monitor memory usage of processes. Which
+processes are configured in a file in plugin-conf.d.
+
+=head1 APPLICABLE SYSTEMS
+
+Any system with a compatible SysV style ps command that understands
+
+ ps -eo rss,comm
+
+=head1 CONFIGURATION
+
+You must specify what process names to monitor:
+
+ [multips_memory]
+ env.names apache2 mysqld php-cgi
+
+The names are are matched with awk. Any regular expression meta
+characters in each of the words on the names list are "active" in the
+regular expression.
+
+
+The by default RSS is monitored, but other sizes provided by your ps
+is directly usable (the plugin assumes all sizes reported by ps is in
+KB). Candidates on Linux are rss, size, resident, share, vsize. See
+your ps man page for more information especially with regards to
+interpretation of the values. You can change what is monitored by
+
+ [multips_memory]
+ env.monitor vsize
+
+You cannot specify multiple sizes. The plugin handles only one.
+
+If for some reason you want separate graphs, you can make separately
+named symlinks in the plugins directory on the node (most often either
+/etc/munin/plugins or /etc/opt/munin/plugins), eg. multips_memory_rss and
+multips_memory_vsize as symlinks to multips_memory and configure them thus:
+
+ [multips_memory*]
+ env.names apache2 mysqld php-cgi
+
+ [multips_memory_rss]
+ env.monitor rss
+
+ [multips_memory_vsize]
+ env.monitor vsize
+
+They can of course also have different process names as well. Eg. one
+list for the "LAMP" stack and one for the Java/Oracle stack in
+separate graphs.
+
+
+=head1 INTERPRETATION
+
+This plugin adds up the RSS (or other memory size if configured) of
+all processes matching the process name, as reported by ps.
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+ #%# capabilities=autoconf
+
+=head1 VERSION
+
+ 0.1 first release, based on multips as distributed in Debian.
+
+ $Id $
+
+=head1 BUGS AND RESTRICTIONS
+
+Only the executable name is matched against (ps -eo comm)1, and it must
+be a full string match to the executable base name, not substring,
+unless you enter a name such as ".*apache" since RE meta characters in
+the names are active.
+
+You cannot specify multiple sizes. The plugin handles only one.
+
+=head1 AUTHOR
+
+Originally: Unknown.
+
+Made into multimemory by: github.com/dominics github.com/yhager.
+
+Renamed to multips_memory when included in official munin trunk.
+
+Thanks to: wix
+
+Some further work to make more generic by Nicolai Langfeldt
+
+=head1 LICENSE
+
+GPLv2
+
+=cut
+
+. $MUNIN_LIBDIR/plugins/plugin.sh
+
+if [ "$1" = "autoconf" ]; then
+ if [ -z "$names" ]; then
+ echo "no (Configuration required)"
+ exit 0
+ fi
+
+ echo yes
+ exit 0
+fi
+
+if [ -z "$names" ]; then
+ echo "(Configuration required)"
+ exit 1
+fi
+
+monitor=${monitor:-rss}
+
+if [ "$1" = "config" ]; then
+ echo graph_title Process $monitor summed by name
+ echo 'graph_category processes'
+ echo 'graph_args --base 1024 -l 0'
+ echo 'graph_vlabel memory'
+ echo "graph_info This plugin shows $monitor memory usage for commands matching the respective regular expressions"
+ for name in $names; do
+ fieldname="$(clean_fieldname "$name")"
+ eval REGEX='^$name$';
+
+ echo "$fieldname.label $name"
+ echo "$fieldname.info For /$REGEX/"
+ done
+ exit 0
+fi
+
+for name in $names; do
+ fieldname="$(clean_fieldname "$name")"
+
+ ps -eo $monitor,comm | gawk '
+BEGIN { total = "U"; } # U = Unknown.
+/grep/ { next; }
+$2 ~ /^'"$name"'$/ { total = total + ($1*1024); }
+END { print "'"$fieldname"'.value", total; }'
+done
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/munin_stats.in
^
|
@@ -1,7 +1,7 @@
#!@@PERL@@
# -*- perl -*-
#
-# Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
+# Copyright (C) 2006-2009 Rodolphe Quiedeville <rodolphe@quiedeville.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -17,7 +17,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: munin_stats.in 2940 2009-11-10 14:22:08Z feiner.tom $
+# $Id: munin_stats.in 3263 2009-12-27 15:25:23Z lupe $
#
# Magic markers (used by munin-node-configure and some installation scripts):
#%# family=auto
@@ -36,7 +36,7 @@
"$Munin::Common::Defaults::MUNIN_LIBDIR/munin-update";
if (! -e $munin_update_location) {
- print "no (munin-update was not found at $munin_update_location).\n";
+ print "no (munin-update was not found at $munin_update_location)\n";
exit 0;
}
@@ -52,14 +52,19 @@
if ($ARGV[0] and $ARGV[0] eq "config") {
print "graph_title Munin processing time\n",
+ "graph_info This graph shows the run time of the four different processes making up a munin-master run. Munin-master is run from cron every 5 minutes and we want each of the programmes in munin-master to complete before the next instance starts. Especially munin-update and munin-graph are time consuming and their run time bears watching. If munin-update uses too long time to run please see the munin-update graph to determine which host is slowing it down. If munin-graph is running too slow you need to get clever (email the munin-users mailing list) unless you can buy a faster computer with better disks to run munin on.",
"graph_args --base 1000 -l 0\n",
"graph_scale yes\n",
"graph_vlabel seconds\n",
"graph_category munin\n";
foreach my $log (@logs) {
- print("$log.label munin $log\n");
- print("$log.draw AREASTACK\n");
+ print "$log.label munin $log\n";
+ print "$log.draw AREASTACK\n";
}
+ print "update.warning 240\n";
+ print "update.critical 285\n";
+ print "graph.warning 240\n";
+ print "graph.critical 285\n";
exit 0;
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/munin_update.in
^
|
@@ -1,53 +1,132 @@
#!@@GOODSH@@
# -*- sh -*-
-#
-# Script to monitor Munin-update
-#
-# Parameters understood:
-#
-# config (required)
-# autoconf (optional - used by munin-config)
-#
-# Magic markers (optional - used by munin-config and installation
-# scripts):
-#
-# Family set to manual, plugin superseeded by munin_stats.
-#%# family=manual
-#%# capabilities=autoconf
-if [ ! "$UPDATE_STATSFILE" ]; then
- UPDATE_STATSFILE=$MUNIN_DBDIR/munin-update.stats
+: <<=cut
+
+=head1 NAME
+
+munin_update - Munin plugin to graph the time to query about each host from the nodes.
+
+=head1 APPLICABLE SYSTEMS
+
+Munin master servers.
+
+=head1 CONFIGURATION
+
+Normaly needs no configuration. You may configure it with the
+following parameter:
+
+ [muin*]
+ env.UPDATE_STATSFILE .../munin-update.stats
+ env.MUNIN_UPDATE_LOCACTION .../munin-update
+
+The first is the statistics file for munin update.
+
+The exact location of this file is package/site specific, but
+munin_update will know where it is unless you have made changes.
+
+=head1 INTERPRETATION
+
+The script reads the munin-update "stats" file to determine how long
+it takes to query the nodes about each host configured in Munin.
+
+Munin is run from cron every 5 minutes and before the next run of
+munin-update the previous run needs to be done. Each run of
+munin-update forks one process pr. host that needs to get data
+collected, so all collection runs in paralell.
+
+Any host that is slow, for example slower than 4 miniutes, causes a
+risk that the next run of munin-update must be cancled due to the
+lateness of the previous run. In such cases there will be single line
+gaps in the "by day" graph.
+
+Keep your hosts updating quickly and all will be well.
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+ #%# capabilities=autoconf
+
+=head1 BUGS
+
+Munin-update is always run at the same time as this plugin runs -
+therefore the stats file may be incompletely written and the plugin
+will likely show a incomplete list of hosts. It should be using
+munin-update.old-stats, which is not currently even made.
+
+Munin-update removes the "domain" information on all hosts. If there
+are two hosts with the same host name in different domains then one of
+them will be disappeared by the munin-update collection process.
+
+=head1 VERSION
+
+ $Id: munin_update.in 3585 2010-05-11 11:31:08Z feiner.tom $
+
+=head1 AUTHOR
+
+The munin_update plugin has been included in munin for many years (at
+least 2004). The most likely author is one of the original munin team.
+
+Documentation and updating to 2009 for Munin 1.4 by Nicolai Langfeldt.
+
+(C) 2004-2009 The Munin Team, Redpill Linpro AS
+
+=head1 LICENSE
+
+GPLv2
+
+=cut
+
+. $MUNIN_LIBDIR/plugins/plugin.sh
+
+if [ -z "$UPDATE_STATSFILE" ]; then
+ UPDATE_STATSFILE="$MUNIN_DBDIR/munin-update.stats"
+fi
+
+if [ -z "$MUNIN_UPDATE_LOCATION" ]; then
+ MUNIN_UPDATE_LOCATION="$MUNIN_LIBDIR/munin-update";
fi
if [ "$1" = "autoconf" ]; then
- if [ -r $UPDATE_STATSFILE ]; then
- echo "yes"
- exit 0
+ if [ -e "$MUNIN_UPDATE_LOCATION" ] ; then
+ echo "yes";
+ else
+ echo "no ($MUNIN_UPDATE_LOCATION is not present so this is not a munin-master)"
fi
- echo "no (logfile not readable)"
exit 0
fi
if [ "$1" = "config" ]; then
+ [ -f "$UPDATE_STATSFILE" ] || {
+ echo 'graph_title Plugin error'
+ echo "graph_info Plugin cannot read stats file $UPDATE_STATSFILE"
+ echo 'error.label Error'
+ echo 'error.critical 1'
+ exit 0
+ }
echo 'graph_title Munin-update'
echo 'graph_vlabel seconds'
echo 'graph_category munin'
- [ -f $UPDATE_STATSFILE ] || exit 0
- cat $UPDATE_STATSFILE | grep "UD" | while read i; do
- name=`echo $i | cut -d"|" -f2 |tr '.-' '__'`
- printf "$name.label "
- echo $i | cut -d"|" -f2
- echo "$name.warning 100"
- echo "$name.critical 180"
+ echo 'graph_info This graph shows the time it takes to collect data from each hosts that munin collects data on. Munin-master is run from cron every 5 minutes and we want each of the munin-update runs to complete before the next one starts. If munin-update uses too long time to run on one host run it with --debug to determine which plugin(s) are slow and solve the problem with them if possible.'
+ sed '/^UD|/!d; s/.*;//; s/|/ /;' < $UPDATE_STATSFILE |
+ while read i j; do
+ name="$(clean_fieldname "$i")"
+ echo "$name.label $i"
+ echo "$name.warning 240"
+ echo "$name.critical 285"
done
exit 0
fi
-[ -f $UPDATE_STATSFILE ] || exit 0
-
-cat $UPDATE_STATSFILE | grep "UD" | while read i; do
- name=`echo $i | cut -d"|" -f2 | tr '.-' '__'`
- printf "$name.value "
- echo $i | cut -d"|" -f3
+[ -f $UPDATE_STATSFILE ] || {
+ echo 'error.value 1'
+ echo "error.extinfo Plugin cannot read stats file $UPDATE_STATSFILE"
+ exit 0
+}
+
+sed '/^UD|/!d; s/.*;//; s/|/ /;' < $UPDATE_STATSFILE |
+while read i j; do
+ name="$(clean_fieldname "$i")"
+ echo "$name.value $j"
done
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/mysql_.in
^
|
@@ -35,6 +35,15 @@
env.mysqluser root
env.mysqlpassword geheim
+Warning and critical values can be set via the environment in the usual way.
+For example:
+
+ [mysql_replication]
+ env.slave_io_running_warning 0.5
+ env.slave_sql_running_warning 0.5
+ env.seconds_behind_master_warning 300
+ env.seconds_behind_master_critical 600
+
=head1 DEPENDENCIES
@@ -45,7 +54,7 @@
The plugin uses shared memory to cache the statistics gathered from
MySQL. This ensures minimal inpact on the MySQL server.
-=item DBD::Mysql
+=item DBD::mysql
=back
@@ -69,9 +78,10 @@
=item mysql_replication
-slave_running and slave_stopped creates an alterning color under the
-seconds_behind_master line. It will have the color of slave_running
-when the SQL thread runs and the color of slave_stopped otherwise.
+slave_io_running and slave_sql_running both translate the "Yes" values to 0 and
+anything else to 1 for their respective fields in the "SHOW SLAVE STATUS" output.
+This can be used to warn on slave failure if the warning and critical values
+are set as seen in a previous section.
=back
@@ -117,6 +127,8 @@
# think the tiny performance boost is worth the
# debugging effort.
+use Munin::Plugin;
+
my $has_cache;
BEGIN {
@@ -283,7 +295,8 @@
{name => 'Open_files', label => 'Open files'},
{name => 'Open_tables', label => 'Open tables'},
{name => 'Opened_tables', label => 'Opened tables',
- type => 'GAUGE'},
+ type => 'DERIVE',
+ min => 0},
],
};
@@ -294,7 +307,7 @@
global_attrs => {
title => 'InnoDB Buffer Pool',
vlabel => 'Pages',
- base => '1024',
+ args => '--base 1024',
},
data_source_attrs => {
draw => 'LINE2',
@@ -305,10 +318,10 @@
{name => 'ib_bpool_size', label => 'Buffer pool size',
draw => 'AREA',
colour => 'ffd660'},
- {name => 'ib_bpool_free', label => 'Free pages'},
{name => 'ib_bpool_dbpages', label => 'Database pages',
draw => 'AREA',
colour => 'cdcfc4'},
+ {name => 'ib_bpool_free', label => 'Free pages'},
{name => 'ib_bpool_modpages', label => 'Modified pages'},
],
};
@@ -567,10 +580,10 @@
},
},
data_sources => [
- {name => 'slave_running', label => 'Slave Running',
+ {name => 'slave_io_running', label => 'Slave IO Running',
type => 'GAUGE',
draw => 'AREA'},
- {name => 'slave_stopped', label => 'Slave Stopped',
+ {name => 'slave_sql_running', label => 'Slave SQL Running',
type => 'GAUGE',
draw => 'AREA'},
{name => 'Slave_retried_transactions', label => 'Retried Transactions'},
@@ -711,14 +724,14 @@
# C O M M A N D H A N D L E R S
#---------------------------------------------------------------------
-# Each command handler should return an apropriate exit code
+# Each command handler should return an appropriate exit code
# http://munin.projects.linpro.no/wiki/ConcisePlugins#autoconf
sub autoconf {
unless ($has_cache) {
print "no (Missing dependency Cache::Cache)\n";
- return 1;
+ return 0;
}
eval {
@@ -728,7 +741,7 @@
my $err = $@;
$err =~ s{\s at \s \S+ \s line .*}{}xms;
print "no ($err)\n";
- return 1;
+ return 0;
}
print "yes\n";
return 0;
@@ -756,8 +769,9 @@
#
# SHOW SLAVE STATUS
- local $_;
- print "mysql_$_\n" for (sort keys(%graphs));
+ foreach my $graph (sort keys(%graphs)) {
+ print "$graph\n";
+ }
return 0;
}
@@ -836,6 +850,7 @@
}
$i++;
}
+ print_thresholds(clean_fieldname($ds->{name}));
}
return 0;
@@ -995,12 +1010,12 @@
# this problem.)
$data->{seconds_behind_master} ||= 0;
- # Scale slave_running and slave_stopped relative to the slave lag.
- $data->{slave_running} = ($data->{slave_sql_running} eq 'Yes')
- ? $data->{seconds_behind_master} : 0;
- $data->{slave_stopped} = ($data->{slave_sql_running} eq 'Yes')
- ? 0 : $data->{seconds_behind_master};
-
+ # Track these two fields so we can trigger warnings if the slave stops
+ # running
+ $data->{slave_sql_running} = ($data->{slave_sql_running} eq 'Yes')
+ ? 0 : 1;
+ $data->{slave_io_running} = ($data->{slave_io_running} eq 'Yes')
+ ? 0 : 1;
}
@@ -1020,25 +1035,6 @@
: Math::BigInt->new("0x$x");
}
-#
-# Can't use variable names longer than 19 characters:
-# http://munin.projects.linpro.no/wiki/notes_on_datasource_names
-#
-sub clean_fieldname {
- my $name = shift;
-
- # Replace a sequence of illegal leading chars with a single _
- $name =~ s/^[^A-Za-z_]+/_/;
- # Replace remaining illegals with _
- $name =~ s/[^A-Za-z0-9_]/_/g;
-
- # And use only the last 19 chars
- $name = substr($name,-19);
-
- return $name;
-}
-
-
#---------------------------------------------------------------------
# P A R S E 'SHOW ENGINE INNODB STATUS' O U T P U T
#---------------------------------------------------------------------
@@ -1102,7 +1098,7 @@
my $innodb_bigint_rx = qr{([[a-fA-F\d]+)(?: (\d+))?};
-sub match_dashes { return m/\G-+\n/gc; }
+sub match_dashes { return m/\G-+\n(?!-)/gc;}
sub skip_line { return m/\G.*\n/gc; }
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/mysql_isam_space_.in
^
|
@@ -6,9 +6,6 @@
mysql_isam_space_ - Wildcard plugin to monitor the percent of table space used
on isam and myisam tables on a mysql server.
-Note that this is a old plugin which is no longer installed by
-default. It is retained for compatability with old installations.
-
=head1 CONFIGURATION
Configuration parameters for @@CONFDIR@@/PLUGIN,
@@ -45,8 +42,8 @@
=end comment
- #%# family=manual
- #%# capabilities=suggest autoconf
+ #%# family=contrib
+ #%# capabilities=suggest autoconf
=cut
@@ -54,17 +51,19 @@
my $DB = `basename $0 | sed 's/^mysql_isam_space_//g' | tr '_' '-'` ;
chomp $DB;
my $STATEFILE = $ENV{'statefile'} || "@@PLUGSTATE@@/plugin-mysql_isam_space.state";
-my $MYSQLSHOW = $ENV{'mysqlshow'} || 'mysqlshow';
+my $MYSQLSHOW = $ENV{'mysqlshow'} || `which mysqlshow`;
my $ABSOLUTE = $ENV{'absolute'} || 0;
my @mysql_opts = ();
+chomp $MYSQLSHOW;
+
if (exists $ENV{'mysqlopts'})
{
@mysql_opts = split /\s+/, $ENV{'mysqlopts'};
}
my $tables = undef;
-my $databses = undef;
+my $databases = undef;
&print_autoconf () if ($ARGV[0] and $ARGV[0] eq "autoconf");
@@ -93,7 +92,6 @@
print "graph_title MySQL \"$DB\" isam/myisam table-space usage\n";
print "graph_args --base 1000\n";
print "graph_vlabel percent\n";
- print "graph_info Note that this is a old plugin which is no longer installed by default. It is retained for compatability with old installations.\n";
print "graph_category mysql\n";
foreach my $t (keys %{$tables})
{
@@ -223,13 +221,18 @@
while (<IN>)
{
my @fields = split (/\s*\|\s*/);
- next if @fields > 2; # Separator line
+ next if @fields < 2; # Separator line
if (! $headerseen and $fields[1] eq "Name")
{ # Header line, grab field names
%index = map {($fields[$_], $_)} 0..$#fields;
}
else
{
+ # mysqlshow says many fun things sometimes, sanity-check
+ next if $fields[$index{Data_length}] eq "";
+ next if ($fields[$index{Max_data_length}] eq "") && ( ! $ABSOLUTE );
+ next if ($fields[$index{Max_data_length}] == 0) && ( ! $ABSOLUTE );
+
my $value =
$ABSOLUTE ? $fields[$index{Data_length}]
: (100*$fields[$index{Data_length}]/$fields[$index{Max_data_length}]);
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/ntp_offset.in
^
|
@@ -71,6 +71,7 @@
graph_title NTP timing statistics for system peer
graph_args --base 1000 --vertical-label seconds --lower-limit 0
graph_category time
+graph_info Currently our peer is $peer. Please refer to ntp docs and ntpc docs for further explanations of these numbers.
delay.label Delay
delay.draw LINE2
delay.cdef delay,1000,/
@@ -80,7 +81,6 @@
jitter.label Jitter
jitter.draw LINE2
jitter.cdef jitter,1000,/
-info Currently our peer is $peer. Please refer to ntp docs and ntpc docs for further explanations of these numbers.
EOF
case $nodelay in
1) echo "delay.graph no";;
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/nvidia_.in
^
|
@@ -43,7 +43,7 @@
=head1 VERSION
- $Id: nvidia_.in 2431 2009-09-16 10:04:17Z janl $
+ $Id: nvidia_.in 3283 2010-01-04 13:26:14Z knan $
Tested with nvclock version 0.8b3a on a nVidia Geforce 8600GT.
@@ -212,7 +212,7 @@
exit 0;
}
} elsif ($ARGV[0] eq 'suggest') {
- print join(" ",@suggest),"\n";
+ print join("\n",@suggest),"\n";
exit 0;
} elsif ($ARGV[0] eq 'config') {
collect_and_print('config',$function);
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/ping_.in
^
|
@@ -90,5 +90,5 @@
fi
-${ping:-ping} ${ping_args:-'-c 2'} ${host} ${ping_args2} | perl -n -e 'print "ping.value ", $1 / 1000, "\n" if m@min/avg/max.*\s\d+(?:\.\d+)?/(\d+(?:\.\d+)?)/\d+(?:\.\d+)?@; print "packetloss.value $1\n" if /(\d+)% packet loss/;'
+${PING:-ping} ${ping_args:-'-c 2'} ${host} ${ping_args2} | perl -n -e 'print "ping.value ", $1 / 1000, "\n" if m@min/avg/max.*\s\d+(?:\.\d+)?/(\d+(?:\.\d+)?)/\d+(?:\.\d+)?@; print "packetloss.value $1\n" if /(\d+)% packet loss/;'
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/postfix_mailstats.in
^
|
@@ -51,7 +51,7 @@
=cut
-my $statefile = "$ENV{MUNIN_PLUGSTATE}/munin-plugin-postfix_mailstats.state";
+my $statefile = $ENV{'MUNIN_PLUGSTATE'} . "/munin-plugin-postfix_mailstats.state";
my $pos;
my $delivered = 0;
my $rejects = {};
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/postgres_locks_.in
^
|
@@ -60,15 +60,36 @@
use Munin::Plugin::Pgsql;
my $pg = Munin::Plugin::Pgsql->new(
- basename => 'postgres_locks_',
- title => 'PostgreSQL locks',
- info => 'PostgreSQL locks',
- vlabel => 'Locks',
- basequery =>
- "SELECT lower(mode),count(*) FROM pg_locks WHERE database IS NOT NULL %%FILTER%% GROUP BY lower(mode) ORDER BY 1",
- wildcardfilter =>
- "AND database=(SELECT oid FROM pg_database WHERE datname=?)",
- configquery => [
+ basename => 'postgres_locks_',
+ title => 'PostgreSQL locks',
+ info => 'PostgreSQL locks',
+ vlabel => 'Locks',
+ basequery => [
+ "SELECT tmp.mode,COALESCE(count,0) FROM
+ (VALUES ('accesssharelock'),('rowsharelock'),('rowexclusivelock'),('shareupdateexclusivelock'),('sharelock'),('sharerowexclusivelock'),('exclusivelock'),('accessexclusivelock')) AS tmp(mode)
+ LEFT JOIN
+ (SELECT lower(mode) AS mode,count(*) AS count
+ FROM pg_locks WHERE database IS NOT NULL %%FILTER%%
+ GROUP BY lower(mode)
+ ) AS tmp2
+ ON tmp.mode=tmp2.mode ORDER BY 1", [
+ 8.1,
+ "SELECT tmp.mode,COALESCE(count,0) FROM
+ (SELECT 'accesssharelock' AS mode UNION ALL SELECT 'rowsharelock'
+ UNION ALL SELECT 'rowexclusivelock' UNION ALL SELECT 'shareupdateexclusivelock'
+ UNION ALL SELECT 'sharelock' UNION ALL SELECT 'sharerowexclusivelock'
+ UNION ALL SELECT 'exclusivelock' UNION ALL SELECT 'accessexclusivelock'
+ ) AS tmp
+ LEFT JOIN
+ (SELECT lower(mode) AS mode,count(*) AS count
+ FROM pg_locks WHERE database IS NOT NULL %%FILTER%%
+ GROUP BY lower(mode)
+ ) AS tmp2
+ ON tmp.mode=tmp2.mode ORDER BY 1"
+ ],
+ ],
+ wildcardfilter => "AND database=(SELECT oid FROM pg_database WHERE datname=?)",
+ configquery => [
"VALUES
('accesssharelock','AccessShareLock','Used by read only queries'),
('rowsharelock','RowShareLock','Used by SELECT FOR SHARE and SELECT FOR UPDATE queries'),
@@ -77,8 +98,7 @@
('sharelock','ShareLock','Used by CREATE INDEX queries'),
('sharerowexclusivelock','ShareRowExclusiveLock','Only issued explicitly from applications'),
('exclusivelock','ExclusiveLock','Infrequently issued on system tables, or by applications'),
- ('accessexclusivelock','AccessExclusiveLock','Used by ALTER TABLE, DROP TABLE, TRUNCATE, REINDEX, CLUSTER and VACUUM FULL queries')",
- [
+ ('accessexclusivelock','AccessExclusiveLock','Used by ALTER TABLE, DROP TABLE, TRUNCATE, REINDEX, CLUSTER and VACUUM FULL queries')", [
8.1,
"SELECT 'accesssharelock','AccessShareLock','Used by read only queries' UNION ALL
SELECT 'rowsharelock','RowShareLock','Used by SELECT FOR SHARE and SELECT FOR UPDATE queries' UNION ALL
@@ -90,10 +110,9 @@
SELECT 'accessexclusivelock','AccessExclusiveLock','Used by ALTER TABLE, DROP TABLE, TRUNCATE, REINDEX, CLUSTER and VACUUM FULL queries'"
]
],
- suggestquery =>
- "SELECT datname FROM pg_database WHERE datallowconn AND NOT datistemplate AND NOT datname='postgres' UNION ALL SELECT 'ALL' ORDER BY 1 LIMIT 10",
- graphdraw => 'AREA',
- stack => 1,
+ suggestquery => "SELECT datname FROM pg_database WHERE datallowconn AND NOT datistemplate AND NOT datname='postgres' UNION ALL SELECT 'ALL' ORDER BY 1 LIMIT 10",
+ graphdraw => 'AREA',
+ stack => 1,
);
$pg->Process();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/postgres_querylength_.in
^
|
@@ -67,7 +67,7 @@
basequery => [
"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 %%FILTER%%",
+ 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-1.4.6.tar.bz2/plugins/node.d/postgres_users.in
^
|
@@ -62,7 +62,7 @@
vlabel => 'Connections',
basequery =>
"SELECT usename,count(*) FROM pg_stat_activity WHERE procpid != pg_backend_pid() GROUP BY usename ORDER BY 1",
- configquery => "SELECT usename,usename FROM pg_stat_activity ORDER BY 1",
+ configquery => "SELECT DISTINCT usename,usename FROM pg_stat_activity ORDER BY 1",
);
$pg->Process();
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/node.d/proxy_plugin.in
^
|
@@ -0,0 +1,123 @@
+#!@@PERL@@ -w
+# -*- perl -*-
+
+=head1 NAME
+
+proxy_plugin - Plugin to proxy connections to another process speaking the
+ munin-node protocol.
+
+The typical use-case for this is to proxy requests to for example a JBoss
+application server, without giving up the ability to run local plugins from
+munin-node as well.
+
+=head1 CONFIGURATION
+
+The following environment settings are the default configuration.
+
+ [<pluginname>]
+ env.proxyto localhost
+ env.proxyport 4950
+ env.proxyservice <pluginname>
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+
+=head1 VERSION
+
+ $Id$
+
+=head1 BUGS
+
+The plugin is currently hardcoded to require multigraph. There may be usecases
+in the future where a non-multigraph version is useful.
+
+There is no detection of loops - if the plugin is pointed back at itself,
+infinite recursion is assured.
+
+There is no timeout for sending and receiving data. The plugin relies on
+munin-node to properly kill it if it runs too long.
+
+=head1 AUTHOR
+
+ Magnus Hagander <magnus.hagander@redpill-linpro.com>, Redpill Linpro AB
+
+=head1 LICENSE
+
+GPLv2
+
+=cut
+
+use strict;
+use Munin::Plugin;
+use IO::Socket;
+use File::Basename;
+
+# We are only going to support multigraph...
+need_multigraph();
+
+my $pluginname = basename($0);
+
+if($ARGV[0] and $ARGV[0] eq "autoconf") {
+ print "no\n"; # Might want to probe in the future?
+ exit 0;
+}
+
+my $what = '';
+if ($ARGV[0]) {
+ if ($ARGV[0] eq "config") {
+ $what = "config";
+ }
+ else {
+ die "Unknown command $ARGV[0]\n";
+ }
+}
+else {
+ $what = "fetch";
+}
+
+# Get the configured parameters
+my $server = $ENV{proxyto} || "localhost";
+my $port = $ENV{proxyport} || 4950;
+my $service = $ENV{proxyservice} || $pluginname;
+
+# Make the connection
+my $sock = new IO::Socket::INET (
+ PeerAddr => $server,
+ PeerPort => $port,
+ Proto => 'tcp',
+ Timeout => 10, # only for connection it seems
+) or die "Could not connect to server $server on port $port\n";
+$sock->autoflush();
+
+my $hdr = $sock->getline();
+if ($hdr !~ /^# /) {
+ $sock->close();
+ die "Got invalid header from plugin: $hdr\n";
+}
+
+# Attempt to negotiate multigraph
+$sock->print("cap multigraph\n");
+my $r = $sock->getline();
+if ($r !~ /^cap.*multigraph/) {
+ $sock->close();
+ die "Remote does not speak multigraph: $r\n";
+}
+
+# Check if the plugin config is compatible
+$sock->print("list\n");
+$r = $sock->getline();
+unless (grep(/^$service$/, split(/ /, $r))) {
+ $sock->close();
+ die "Remote does know know of plugin $service (remote plugin list: $r)\n";
+}
+
+# Pass along the command and send back the results
+$sock->print("$what $service\n");
+while ($r = $sock->getline()) {
+ last if $r =~ /^\.\n$/;
+ print $r;
+}
+
+$sock->close();
+
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/slapd_.in
^
|
@@ -37,7 +37,7 @@
# Change these to reflect your LDAP ACL. The given DN must have
# read access to the Monitor branch.
my $basedn = "cn=Monitor";
-my $server = "localhost";
+my $server = ($ENV{'server'} || 'localhost');
my $userdn = ($ENV{'binddn'} || '');
my $userpw = ($ENV{'bindpw'} || '');
@@ -149,10 +149,21 @@
print "$name.type GAUGE\n";
}
} elsif ($action =~ /^operations(?:_diff)?$/) {
- my $ldap = Net::LDAP->new ($server) or die "$@";
- $ldap->bind ($userdn, password => $userpw) or die "$@";
+ my $ldap = Net::LDAP->new ($server)
+ or die "Failed to connect to server $server: $@";
+ my $mesg;
+ if ($userdn ne '') {
+ $mesg = $ldap->bind ($userdn, password => $userpw)
+ or die "Failed to bind with $userdn: $@";
+ } else {
+ $mesg = $ldap->bind
+ or die "Failed to bind anonymously: $@";
+ }
+ if ($mesg->code) {
+ die "Failed to bind: " . $mesg->error;
+ }
my $searchdn = $ops{$action}->{'search'} . "," . $basedn;
- my $mesg =
+ $mesg =
$ldap->search (
base => $searchdn,
scope => 'one',
@@ -179,6 +190,8 @@
print "$name.warning 1\n";
}
}
+
+ $ldap->unbind;
} else {
print "$action.label $ops{$action}->{'label'}\n";
print "$action.type DERIVE\n";
@@ -196,10 +209,34 @@
# Check for LDAP version 3
my $ldap = Net::LDAP->new ($server, version => 3)
- or do { print "no (Needs LDAPv3)\n"; exit 0; };
- $ldap->bind ($userdn, password => $userpw)
- or do { print "no (Can't log in, check env file)\n"; exit 0; };
+ or do { print "no ($@)\n"; exit 0; };
+
+ my $mesg;
+ if ($userdn ne '') {
+ $mesg = $ldap->bind ($userdn, password => $userpw)
+ or do { print "no ($@)\n"; exit 0; };
+ } else {
+ $mesg = $ldap->bind
+ or do { print "no ($@)\n"; exit 0; };
+ }
+ if ($mesg->code) {
+ print "no (" . $mesg->error . ")\n";
+ exit 0;
+ }
+ $mesg =
+ $ldap->search (
+ base => $basedn,
+ scope => 'one',
+ filter => '(objectClass=monitorServer)',
+ attrs => 'cn',
+ );
+ if ($mesg->code) {
+ print "no (" . $mesg->error . ")\n";
+ exit 0;
+ }
+ print "yes\n";
+ exit 0;
} elsif ($ARGV[0] eq "config") {
if ($0 =~ /slapd_([\w\d_]+)$/) {
my $action = $1;
@@ -225,9 +262,18 @@
# Net::LDAP variant
my $ldap = Net::LDAP->new ($server, version => 3)
- or die "$@";
-$ldap->bind ($userdn,password => $userpw)
- or die "$@";
+ or die "Failed to connect to server $server: $@";
+my $mesg;
+if ($userdn ne '') {
+ $mesg = $ldap->bind ($userdn, password => $userpw)
+ or die "Failed to bind with $userdn: $@";
+} else {
+ $mesg = $ldap->bind
+ or die "Failed to bind anonymously: $@";
+}
+if ($mesg->code) {
+ die "Failed to bind: " . $mesg->error;
+}
my $searchdn = $ops{$action}->{'search'} . "," . $basedn;
my $searchattrs;
@@ -250,7 +296,7 @@
$scope = $ops{$action}->{'scope'};
}
-my $mesg =
+$mesg =
$ldap->search (
base => $searchdn,
scope => $scope,
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/snmp__df.in
^
|
@@ -146,7 +146,9 @@
my $stor_id;
-if (defined $partitions{""})
+my $foundpartitions = keys %partitions;
+
+if ($foundpartitions == 0 or defined $partitions{""})
{ # Oh bugger. Some (or all) mountpoints were undeterminable. The backup
# solution is to just graph everything that claims to be a FixedDisk,
# without checking if it's removable etc
@@ -170,6 +172,20 @@
$stor_id = get_by_regex ($session, $hrStorageDesc, '(^'.join('$|^',keys(%partitions)).'$)');
}
+foreach my $storage (keys %$stor_id)
+{
+ $partitions{$stor_id->{$storage}}{storage} = $storage;
+ $partitions{$stor_id->{$storage}}{size} = get_single ($session, $hrStorageSize . $storage);
+ if ($partitions{$stor_id->{$storage}}{size} == 0) {
+ delete $stor_id->{$storage} ;
+ }
+}
+
+foreach my $part (keys %partitions)
+{
+ if ($partitions{$part}{size} == 0) { delete $partitions{$part} ; }
+}
+
if (defined $ARGV[0] and $ARGV[0] eq "config")
{
print "host_name $host\n" unless $host eq 'localhost';
@@ -193,8 +209,6 @@
foreach my $storage (keys %$stor_id)
{
- $partitions{$stor_id->{$storage}}{storage} = $storage;
- $partitions{$stor_id->{$storage}}{size} = get_single ($session, $hrStorageSize . $storage);
$partitions{$stor_id->{$storage}}{used} = get_single ($session, $hrStorageUsed . $storage);
}
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/plugins/node.d/snmp__df_ram.in
^
|
@@ -0,0 +1,274 @@
+#!@@PERL@@ -w
+# -*- perl -*-
+
+=head1 NAME
+
+snmp__df_ram - Plugin to check ram/flash usage of a remote host via SNMP
+
+=head1 CONFIGURATION
+
+The following environment variables are used
+
+ host - SNMP hostname to probe (default undef)
+ port - SNMP port to use (default 161)
+ community - SNMP community string (default "public")
+ interface - (default undef)
+
+=head1 AUTHOR
+
+=encoding UTF-8
+
+Copyright (C) 2011 Erik Inge Bolsø, Redpill Linpro AS for OSL
+
+Based on snmp__df (C) 2004 Jimmy Olsen
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; version 2 dated June,
+1991.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+=head1 MAGIC MARKERS
+
+ #%# family=snmpauto
+ #%# capabilities=snmpconf
+
+=cut
+
+use strict;
+use Net::SNMP;
+
+my $DEBUG = 0;
+my $MAXLABEL = 20;
+
+my $host = $ENV{host} || undef;
+my $port = $ENV{port} || 161;
+my $community = $ENV{community} || "public";
+
+my $response;
+
+if (defined $ARGV[0] and $ARGV[0] eq "snmpconf")
+{
+ print "index 1.3.6.1.2.1.25.2.3.1.1.\n";
+ print "require 1.3.6.1.2.1.25.2.3.1.2. 1.3.6.1.2.1.25.2.1.(1|2|3|9)\n"; # Type=Other/Ram/VirtualMemory/FlashMemory
+ print "require 1.3.6.1.2.1.25.2.3.1.5. [1-9]\n"; # Size > 0
+ exit 0;
+}
+
+if ($0 =~ /^(?:|.*\/)snmp_([^_]+)_df_ram$/)
+{
+ $host = $1;
+ if ($host =~ /^([^:]+):(\d+)$/)
+ {
+ $host = $1;
+ $port = $2;
+ }
+}
+elsif (!defined($host))
+{
+ print "# Debug: $0 -- $1\n" if $DEBUG;
+ 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 $hrFSMountPoint = "1.3.6.1.2.1.25.3.8.1.2."; # Used to look up filesystem
+
+# Filesystem level
+my $hrStorageType = "1.3.6.1.2.1.25.2.3.1.2."; # Backup for hrFS*
+my $hrStorageDesc = "1.3.6.1.2.1.25.2.3.1.3."; # Used as key from partitions
+my $hrStorageSize = "1.3.6.1.2.1.25.2.3.1.5."; # Data point 1
+my $hrStorageUsed = "1.3.6.1.2.1.25.2.3.1.6."; # Data point 2
+
+
+my ($session, $error) = Net::SNMP->session(
+ -hostname => $host,
+ -community => $community,
+ -port => $port
+ );
+
+if (!defined ($session))
+{
+ 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 $DEBUG;
+
+# Then we 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]");
+
+ foreach my $partition (keys %$parts)
+ {
+ my $mp = get_single ($session, $hrFSMountPoint . $partition);
+ $partitions{$mp}{partition} = $partition;
+ print "# Added partition \"$mp\" as $partition...\n" if $DEBUG
+ }
+}
+
+my $stor_id;
+
+my $foundpartitions = keys %partitions;
+
+if ($foundpartitions == 0 or defined $partitions{""})
+{ # Oh bugger. Some (or all) mountpoints were undeterminable. The backup
+ # solution is to just graph everything that claims to be Other/Ram/VirtualMemory/FlashMemory,
+ # without checking if it's removable etc
+
+ print "# Unable to map mountpoints from filesystems to storages. Bugger.\n" if $DEBUG;
+ $stor_id = get_by_regex ($session, $hrStorageType, "1.3.6.1.2.1.25.2.1.(1|2|3|9)");
+ %partitions = ();
+
+ foreach my $id (keys %$stor_id)
+ {
+ my $part = get_single ($session, $hrStorageDesc . $id);
+ my $spart = $part;
+ $spart =~ s/:\\ Label:.*/:/;
+ $partitions{$spart}{storage} = $id;
+ $partitions{$spart}{extinfo} = $part;
+ $stor_id->{$id} = $spart;
+ }
+} else
+{ # Get the ones we're sure about
+
+ $stor_id = get_by_regex ($session, $hrStorageDesc, '(^'.join('$|^',keys(%partitions)).'$)');
+}
+
+if (defined $ARGV[0] and $ARGV[0] eq "config")
+{
+ print "host_name $host\n" unless $host eq 'localhost';
+ print "graph_title Memory usage (in %)\n";
+ print "graph_args --upper-limit 100 -l 0\n";
+ print "graph_vlabel %\n";
+ print "graph_category system\n";
+ print "graph_info This graph shows memory usage in percent.\n";
+
+ foreach my $part (keys %partitions)
+ {
+ print (&get_name_by_mp ($part), ".label ");
+ print (length($part)<=$MAXLABEL ? $part : "...".substr($part,-($MAXLABEL-3)));
+ print ("\n");
+ print (&get_name_by_mp ($part), ".warning 92\n");
+ print (&get_name_by_mp ($part), ".critical 98\n");
+ print (&get_name_by_mp ($part), ".info Usage for ". ($partitions{$part}{extinfo}||$part)."\n");
+ }
+ exit 0;
+}
+
+foreach my $storage (keys %$stor_id)
+{
+ $partitions{$stor_id->{$storage}}{storage} = $storage;
+ $partitions{$stor_id->{$storage}}{size} = get_single ($session, $hrStorageSize . $storage);
+ $partitions{$stor_id->{$storage}}{used} = get_single ($session, $hrStorageUsed . $storage);
+}
+
+foreach my $part (keys %partitions)
+{
+ print (&get_name_by_mp ($part), ".value ", ($partitions{$part}{used}*100/$partitions{$part}{size}), "\n");
+}
+
+sub get_single
+{
+ my $handle = shift;
+ my $oid = shift;
+
+ print "# Getting single $oid..." if $DEBUG;
+
+ $response = $handle->get_request ($oid);
+
+ if (!defined $response->{$oid})
+ {
+ print "undef\n" if $DEBUG;
+ return undef;
+ }
+ else
+ {
+ print "\"$response->{$oid}\"\n" if $DEBUG;
+ return $response->{$oid};
+ }
+}
+
+sub get_by_regex
+{
+ my $handle = shift;
+ my $oid = shift;
+ my $regex = shift;
+ my $result = {};
+ my $num = 0;
+ my $ret = $oid . "0";
+ my $response;
+
+ print "# Starting browse of $oid...\n" if $DEBUG;
+
+ while (1)
+ {
+ if ($num == 0)
+ {
+ print "# Checking for $ret...\n" if $DEBUG;
+ $response = $handle->get_request ($ret);
+ }
+ if ($num or !defined $response)
+ {
+ print "# Checking for sibling of $ret...\n" if $DEBUG;
+ $response = $handle->get_next_request ($ret);
+ }
+ if (!$response)
+ {
+ return undef;
+ }
+ my @keys = keys %$response;
+ $ret = $keys[0];
+ print "# Analyzing $ret (compared to $oid)...\n" if $DEBUG;
+ last unless ($ret =~ /^$oid/);
+ $num++;
+ next unless ($response->{$ret} =~ /$regex/);
+ @keys = split (/\./, $ret);
+ $result->{$keys[-1]} = $response->{$ret};;
+ print "# Index $num: ", $keys[-1], " (", $response->{$ret}, ")\n" if $DEBUG;
+ };
+ return $result;
+}
+
+sub get_name_by_mp
+{
+ my $mp = shift;
+ $mp =~ s/[^a-z0-9_]/_/gi;
+ $mp =~ tr/A-Z/a-z/;
+ return "p" . $mp;
+}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/snmp__if_multi.in
^
|
@@ -21,6 +21,7 @@
[snmp_*]
env.version 2
env.community public
+ env.ifTypeOnly ethernetCsmacd
In general SNMP is not very secure at all unless you use SNMP version
3 which supports authentication and privacy (encryption). But in any
@@ -29,6 +30,28 @@
Please see 'perldoc Munin::Plugin::SNMP' for further configuration
information.
+The ifTypeOnly is a space separated list of media types to show. By
+default the plugin shows only interfaces identified as
+'ethernetCsmacd'. To see what interface types your switch, router, or
+other net thing uses you can use this command:
+
+ snmpwalk -c public -v 2c switch 1.3.6.1.2.1.2.2.1.3
+
+It may show something like this:
+
+ IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)
+ IF-MIB::ifType.4 = INTEGER: mplsTunnel(150)
+ IF-MIB::ifType.5 = INTEGER: other(1)
+ IF-MIB::ifType.6 = INTEGER: softwareLoopback(24)
+ IF-MIB::ifType.8 = INTEGER: tunnel(131)
+ IF-MIB::ifType.13 = INTEGER: propVirtual(53)
+ IF-MIB::ifType.123 = INTEGER: l2vlan(135)
+
+propVirtual or l2vlan is usualy used for VLAN interfaces. Tunnel
+would normaly be for VPNs. A minor horde of different interface types
+are supposted, please see IANAifType-MIB (on your system or find with
+Google) for a full list.
+
=head1 INTERPRETATION
The graph shows a stright forward "bits per second" incomming and
@@ -88,10 +111,10 @@
less than 5 minutes making the graph for the interface show random
results.
-If you have a switch/device that supports 64 bit byte counters this plugin
-will use them and the graph will be fine. The graph information will
-inform about this. You must use SNMPv2c or SNMPv3 to be able to use
-64 bit counters - if the device supports them.
+If you have a switch/device that supports 64 bit byte counters this
+plugin will use them and the graph will be fine. The graph
+information will inform about this. You must use SNMPv2c or SNMPv3 to
+be able to use 64 bit counters - if the device supports them.
This problem is a feature of the device SNMP implementation or your
usage of it, it is nothing the plugin can fix. In the future Munin
@@ -100,7 +123,7 @@
=head1 AUTHOR
-Copyright (C) 2004-2009 Jimmy Olsen, Dagfinn Ilmari Mannsaaker,
+Copyright (C) 2004-2010 Jimmy Olsen, Dagfinn Ilmari Mannsaaker,
Nicolai Langfeldt, Redpill Linpro AS and others.
Original snmp__if_ plugin: Copyright (C) 2004-2009 Jimmy Olsen, Dagfinn
@@ -156,8 +179,6 @@
if (defined $ARGV[0] and $ARGV[0] eq "snmpconf") {
print "number 1.3.6.1.2.1.2.1.0\n";
print "index 1.3.6.1.2.1.2.2.1.1.\n";
- print "require 1.3.6.1.2.1.2.2.1.3. ^(6|23)\$\n"; # Type
- print "require 1.3.6.1.2.1.2.2.1.5. [1-9]\n"; # Speed
exit 0;
}
@@ -169,60 +190,365 @@
my $ifOIDBase = "1.3.6.1.2.1.2.2.1"; # ifEntry
my $ifv2OIDBase = "1.3.6.1.2.1.31.1.1.1"; # ifXEntry
-my ($session, $error);
+my %ifTypes = (
+ other => 1,
+ regular1822 => 2,
+ hdh1822 => 3,
+ ddnX25 => 4,
+ rfc877x25 => 5,
+ ethernetCsmacd => 6,
+ iso88023Csmacd => 7,
+ iso88024TokenBus => 8,
+ iso88025TokenRing => 9,
+ iso88026Man => 10,
+ starLan => 11,
+ proteon10Mbit => 12,
+ proteon80Mbit => 13,
+ hyperchannel => 14,
+ fddi => 15,
+ lapb => 16,
+ sdlc => 17,
+ ds1 => 18,
+ e1 => 19,
+ basicISDN => 20,
+ primaryISDN => 21,
+ propPointToPointSerial => 22,
+ ppp => 23,
+ softwareLoopback => 24,
+ eon => 25,
+ ethernet3Mbit => 26,
+ nsip => 27,
+ slip => 28,
+ ultra => 29,
+ ds3 => 30,
+ sip => 31,
+ frameRelay => 32,
+ rs232 => 33,
+ para => 34,
+ arcnet => 35,
+ arcnetPlus => 36,
+ atm => 37,
+ miox25 => 38,
+ sonet => 39,
+ x25ple => 40,
+ iso88022llc => 41,
+ localTalk => 42,
+ smdsDxi => 43,
+ frameRelayService => 44,
+ v35 => 45,
+ hssi => 46,
+ hippi => 47,
+ modem => 48,
+ aal5 => 49,
+ sonetPath => 50,
+ sonetVT => 51,
+ smdsIcip => 52,
+ propVirtual => 53,
+ propMultiplexor => 54,
+ ieee80212 => 55,
+ fibreChannel => 56,
+ hippiInterface => 57,
+ frameRelayInterconnect => 58,
+ aflane8023 => 59,
+ aflane8025 => 60,
+ cctEmul => 61,
+ fastEther => 62,
+ isdn => 63,
+ v11 => 64,
+ v36 => 65,
+ g703at64k => 66,
+ g703at2mb => 67,
+ qllc => 68,
+ fastEtherFX => 69,
+ channel => 70,
+ ieee80211 => 71,
+ ibm370parChan => 72,
+ escon => 73,
+ dlsw => 74,
+ isdns => 75,
+ isdnu => 76,
+ lapd => 77,
+ ipSwitch => 78,
+ rsrb => 79,
+ atmLogical => 80,
+ ds0 => 81,
+ ds0Bundle => 82,
+ bsc => 83,
+ async => 84,
+ cnr => 85,
+ iso88025Dtr => 86,
+ eplrs => 87,
+ arap => 88,
+ propCnls => 89,
+ hostPad => 90,
+ termPad => 91,
+ frameRelayMPI => 92,
+ x213 => 93,
+ adsl => 94,
+ radsl => 95,
+ sdsl => 96,
+ vdsl => 97,
+ iso88025CRFPInt => 98,
+ myrinet => 99,
+ voiceEM => 100,
+ voiceFXO => 101,
+ voiceFXS => 102,
+ voiceEncap => 103,
+ voiceOverIp => 104,
+ atmDxi => 105,
+ atmFuni => 106,
+ atmIma => 107,
+ pppMultilinkBundle => 108,
+ ipOverCdlc => 109,
+ ipOverClaw => 110,
+ stackToStack => 111,
+ virtualIpAddress => 112,
+ mpc => 113,
+ ipOverAtm => 114,
+ iso88025Fiber => 115,
+ tdlc => 116,
+ gigabitEthernet => 117,
+ hdlc => 118,
+ lapf => 119,
+ v37 => 120,
+ x25mlp => 121,
+ x25huntGroup => 122,
+ trasnpHdlc => 123,
+ interleave => 124,
+ fast => 125,
+ ip => 126,
+ docsCableMaclayer => 127,
+ docsCableDownstream => 128,
+ docsCableUpstream => 129,
+ a12MppSwitch => 130,
+ tunnel => 131,
+ coffee => 132,
+ ces => 133,
+ atmSubInterface => 134,
+ l2vlan => 135,
+ l3ipvlan => 136,
+ l3ipxvlan => 137,
+ digitalPowerline => 138,
+ mediaMailOverIp => 139,
+ dtm => 140,
+ dcn => 141,
+ ipForward => 142,
+ msdsl => 143,
+ ieee1394 => 144,
+ 'if-gsn' => 145,
+ dvbRccMacLayer => 146,
+ dvbRccDownstream => 147,
+ dvbRccUpstream => 148,
+ atmVirtual => 149,
+ mplsTunnel => 150,
+ srp => 151,
+ voiceOverAtm => 152,
+ voiceOverFrameRelay => 153,
+ idsl => 154,
+ compositeLink => 155,
+ ss7SigLink => 156,
+ propWirelessP2P => 157,
+ frForward => 158,
+ rfc1483 => 159,
+ usb => 160,
+ ieee8023adLag => 161,
+ bgppolicyaccounting => 162,
+ frf16MfrBundle => 163,
+ h323Gatekeeper => 164,
+ h323Proxy => 165,
+ mpls => 166,
+ mfSigLink => 167,
+ hdsl2 => 168,
+ shdsl => 169,
+ ds1FDL => 170,
+ pos => 171,
+ dvbAsiIn => 172,
+ dvbAsiOut => 173,
+ plc => 174,
+ nfas => 175,
+ tr008 => 176,
+ gr303RDT => 177,
+ gr303IDT => 178,
+ isup => 179,
+ propDocsWirelessMaclayer => 180,
+ propDocsWirelessDownstream => 181,
+ propDocsWirelessUpstream => 182,
+ hiperlan2 => 183,
+ propBWAp2Mp => 184,
+ sonetOverheadChannel => 185,
+ digitalWrapperOverheadChannel => 186,
+ aal2 => 187,
+ radioMAC => 188,
+ atmRadio => 189,
+ imt => 190,
+ mvl => 191,
+ reachDSL => 192,
+ frDlciEndPt => 193,
+ atmVciEndPt => 194,
+ opticalChannel => 195,
+ opticalTransport => 196,
+ propAtm => 197,
+ voiceOverCable => 198,
+ infiniband => 199,
+ teLink => 200,
+ q2931 => 201,
+ virtualTg => 202,
+ sipTg => 203,
+ sipSig => 204,
+ docsCableUpstreamChannel => 205,
+ econet => 206,
+ pon155 => 207,
+ pon622 => 208,
+ bridge => 209,
+ linegroup => 210,
+ voiceEMFGD => 211,
+ voiceFGDEANA => 212,
+ voiceDID => 213,
+ mpegTransport => 214,
+ sixToFour => 215,
+ gtp => 216,
+ pdnEtherLoop1 => 217,
+ pdnEtherLoop2 => 218,
+ opticalChannelGroup => 219,
+ homepna => 220,
+ gfp => 221,
+ ciscoISLvlan => 222,
+ actelisMetaLOOP => 223,
+ fcipLink => 224,
+ rpr => 225,
+ qam => 226,
+ lmp => 227,
+ cblVectaStar => 228,
+ docsCableMCmtsDownstream => 229,
+ adsl2 => 230,
+ macSecControlledIF => 231,
+ macSecUncontrolledIF => 232,
+ aviciOpticalEther => 233,
+ atmbond => 234,
+ voiceFGDOS => 235,
+ mocaVersion1 => 236,
+ ieee80216WMAN => 237,
+ adsl2plus => 238,
+ dvbRcsMacLayer => 239,
+ dvbTdm => 240,
+ dvbRcsTdma => 241,
+ x86Laps => 242,
+ wwanPP => 243,
+ wwanPP2 => 244
+ );
+
+my %ifTypeByNum = map { $ifTypes{$_} => $_; } keys %ifTypes;
+
+# Needed as globals
+my $snmpinfo;
+my $snmpinfoX;
+
+sub do_collect {
+ # Collect information from SNMP agent
+
+ my $session = Munin::Plugin::SNMP->session();
+
+ $snmpinfo = $session->get_hash(
+ -baseoid => $ifOIDBase,
+ -cols =>
+ { 2 => 'ifDescr',
+ # Type: See above
+ 3 => 'ifType',
+ 4 => 'ifMtu',
+ 5 => 'ifSpeed',
+ 6 => 'ifMac',
+ 7 => 'ifAdminStatus',
+ # Oper: 1) up 2) down 3) testing
+ # 4) unknown, 5) dormant 6) not present
+ # 7) lowerLayerDown
+ 8 => 'ifOperStatus',
+ 10 => 'ifInOctets',
+ 11 => 'ifInUcastPkts',
+ 13 => 'ifInDiscards',
+ 14 => 'ifInErrors',
+ 15 => 'ifUnUnknownProtos',
+ 16 => 'ifOutOctets',
+ 18 => 'ifOutNUcastPkts',
+ 19 => 'ifOutDiscards',
+ 20 => 'ifOutErrors',
+ });
+
+ # ifXEntry - SNMP v2 and up only - on some devices
+ $snmpinfoX = $session->get_hash(
+ -baseoid => $ifv2OIDBase,
+ -cols =>
+ { 2 => 'ifInMulticastPkts',
+ 3 => 'ifInBroadcastPkts',
+ 4 => 'ifOutMulticastPkts',
+ 5 => 'ifOutBroadcastPkts',
+ 6 => 'ifHCInOctets',
+ 10 => 'ifHCOutOctets',
+ 15 => 'ifHighSpeed',
+ 18 => 'ifAlias',
+ });
+}
+
+
+
+sub do_preprocess_if {
+ my ($mediatype, $if) = @_;
+
+ my $response = $snmpinfo->{$if}->{ifType} || 1;
+
+ if (defined($mediatype)) {
+ if (defined($mediatype->{$response})) {
+ # This is one of the interesting media types
+ } else {
+ # This media type is not interesting. Remove.
+ delete $snmpinfo->{$if} if exists $snmpinfo->{$if};
+ delete $snmpinfoX->{$if} if exists $snmpinfoX->{$if};
+ return;
+ }
+ }
+
+ if (defined ($response = $snmpinfo->{$if}->{ifOperStatus})) {
+ # 1 = up, 2 = down, 7 = lowerLayerDown
+ if ($response == 2 or $response == 7) {
+ # Fold recognized down states into one.
+ $response = $snmpinfo->{$if}->{ifOperStatus} = 2;
+ } elsif ($response != 1) {
+ # This interface is fishy, remove and forget.
+ delete $snmpinfo->{$if} if exists $snmpinfo->{$if};
+ delete $snmpinfoX->{$if} if exists $snmpinfoX->{$if};
+ return;
+ }
+ }
+}
+
+
+sub do_preprocess {
+ my $mediatypes = 'ethernetCsmacd';
+
+ if (exists( $ENV{'ifTypeOnly'} )) {
+ $mediatypes = $ENV{'ifTypeOnly'};
+ }
+
+ my @mediatypes = split(/[ ,]+/,$mediatypes);
-# SNMP needed for both config and fetch.
-$session = Munin::Plugin::SNMP->session();
+ # Hash of numerical media types the user finds interesting.
+ my $mediatype={};
-my $snmpinfo = $session->get_hash(
- -baseoid => $ifOIDBase,
- -cols =>
- { 2 => 'ifDescr',
- # Type: 6) ethernetCsmacd 23) ppp
- # 32) frameRelay(DTE) 37) adm
- # 44) FrameRelayService 49) aal5
- # 53) propVirtual
- # 56) fibreChannel 94) adsl 95) radsl
- # 96) sdsl 97) vdsl 105) atmDxi
- # 106) atmFuni 107) atmIma
- # 108) pppMultilinkBundle
- # 114) ipOverAtm 131) tunnel
- # 125) fast - depreciated
- # 149) atmVirtual 150) mplsTunnel
- # 160) usb 166) mpls 168) hdsl2
- # 169) shdsl 199) infiniband 230) adsl2
- 3 => 'ifType',
- 4 => 'ifMtu',
- 5 => 'ifSpeed',
- 6 => 'ifMac',
- 7 => 'ifAdminStatus',
- # Oper: 1) up 2) down 3) testing
- # 4) unknown, 5) dormant 6) not present
- # 7) lowerLayerDown
- 8 => 'ifOperStatus',
- 10 => 'ifInOctets',
- 11 => 'ifInUcastPkts',
- 13 => 'ifInDiscards',
- 14 => 'ifInErrors',
- 15 => 'ifUnUnknownProtos',
- 16 => 'ifOutOctets',
- 18 => 'ifOutNUcastPkts',
- 19 => 'ifOutDiscards',
- 20 => 'ifOutErrors',
- });
-
-
-my $snmpinfoX = $session->get_hash( # ifXEntry - SNMP v2 and up only
- -baseoid => $ifv2OIDBase,
- -cols =>
- { 2 => 'ifInMulticastPkts',
- 3 => 'ifInBroadcastPkts',
- 4 => 'ifOutMulticastPkts',
- 5 => 'ifOutBroadcastPkts',
- 6 => 'ifHCInOctets',
- 10 => 'ifHCOutOctets',
- 18 => 'ifAlias',
- });
+ if ($mediatypes eq 'ALL') {
+ $mediatype = undef;
+ } else {
+ foreach my $type (@mediatypes) {
+ if (exists($ifTypes{$type})) {
+ $mediatype->{$ifTypes{$type}} = 1;
+ } else {
+ die "Unknown media type '$type' specified in ifTypeOnly\n";
+ }
+ }
+ }
+
+ foreach my $if (keys %{$snmpinfo}) {
+ do_preprocess_if($mediatype, $if);
+ }
+}
sub do_config_root {
@@ -251,21 +577,20 @@
print "multigraph if_errors\n";
print "graph_title $host interface errors\n";
print "graph_order recv send\n";
+ print "graph_scale no\n";
print "graph_args --base 1000\n";
print "graph_vlabel errors in (-) / out (+) per \${graph_period}\n";
print "graph_category network\n";
print "graph_info This graph shows the total errors for $host\n";
- print "send.info Errors in outgoing/incomming traffic on $host\n";
+ print "send.info Errors in outgoing/incoming traffic on $host\n";
print "recv.label recv\n";
print "recv.type DERIVE\n";
print "recv.graph no\n";
- print "recv.cdef recv,8,*\n";
print "recv.min 0\n";
- print "send.label bps\n";
+ print "send.label Errors\n";
print "send.type DERIVE\n";
print "send.negative recv\n";
- print "send.cdef send,8,*\n";
print "send.min 0\n";
}
@@ -286,21 +611,26 @@
if ($response == 2) {
# Interface is down
$extrainfo .= ' The interface is currently down.'
- } elsif ($response != 1) {
- # This interface is fishy
- delete $snmpinfo->{$if} if exists $snmpinfo->{$if};
- delete $snmpinfoX->{$if} if exists $snmpinfoX->{$if};
- return;
}
}
my $warn = undef;
- my $speed = undef;
+ my $speed = 0;
- if (defined ($speed = $snmpinfo->{$if}->{ifSpeed})) {
+ if (defined ($speed = $snmpinfoX->{$if}->{ifHighSpeed}) and $speed) {
+ # Speed in 1,000,000 bits per second
+ $speed = $speed * 1000000;
+ $warn = $speed / 75 * 100;
+
+ my $textspeed = scaleNumber($speed,'bps','',
+ 'The interface speed is %.1f%s%s.');
+
+ $extrainfo .= ' '.$textspeed if $textspeed;
+ } elsif (defined ($speed = $snmpinfo->{$if}->{ifSpeed}) and $speed) {
+ # Speed in bits pr. second
$warn = $speed*100/75;
- my $textspeed = scaleNumber($speed,,'bps','',
+ my $textspeed = scaleNumber($speed,'bps','',
'The interface speed is %.1f%s%s.');
$extrainfo .= " ".$textspeed if $textspeed;
@@ -320,6 +650,9 @@
if $version == 1;
}
+ $response = $snmpinfo->{$if}->{ifType};
+ $extrainfo .= " This is a '".$ifTypeByNum{$response}."' interface.";
+
print "multigraph if_bytes.if_$if\n";
print "graph_title Interface $alias traffic\n";
@@ -333,39 +666,35 @@
print "recv.type DERIVE\n";
print "recv.graph no\n";
print "recv.cdef recv,8,*\n";
- print "recv.max $speed\n";
+ print "recv.max $speed\n" if $speed;
print "recv.min 0\n";
print "recv.warning ", (-$warn), "\n" if defined $warn;
print "send.label bps\n";
print "send.type DERIVE\n";
print "send.negative recv\n";
print "send.cdef send,8,*\n";
- print "send.max $speed\n";
+ print "send.max $speed\n" if $speed;
print "send.min 0\n";
print "send.warning $warn\n" if defined $warn;
-
print "multigraph if_errors.if_$if\n";
print "graph_title Interface $alias errors\n";
print "graph_order recv send\n";
print "graph_args --base 1000\n";
- print "graph_vlabel bits in (-) / out (+) per \${graph_period}\n";
+ print "graph_scale no\n";
+ print "graph_vlabel errors in (-) / out (+) per \${graph_period}\n";
print "graph_category network\n";
print "graph_info This graph shows errors for the \"$alias\" network interface.$extrainfo\n";
- print "send.info Errors in outgoing/incomming traffic on this interface.\n";
+ print "send.info Errors in outgoing/incoming traffic on this interface.\n";
print "recv.label recv\n";
print "recv.type DERIVE\n";
print "recv.graph no\n";
- print "recv.cdef recv,8,*\n";
- print "recv.max $speed\n";
print "recv.min 0\n";
print "recv.warning 1\n";
- print "send.label bps\n";
+ print "send.label errors\n";
print "send.type DERIVE\n";
print "send.negative recv\n";
- print "send.cdef send,8,*\n";
- print "send.max $speed\n";
print "send.min 0\n";
print "send.warning 1\n";
}
@@ -388,10 +717,10 @@
# interfaces with a "fishy" status. That is a possible bug.
# Or a feature. We'll see.
- $in += $response = $snmpinfo->{$if}->{ifHCInOctets} ||
+ $in += $snmpinfoX->{$if}->{ifHCInOctets} ||
$snmpinfo->{$if}->{ifInOctets};
- $out += $snmpinfo->{$if}->{ifHCOutOctets} ||
+ $out += $snmpinfoX->{$if}->{ifHCOutOctets} ||
$snmpinfo->{$if}->{ifOutOctets};
$inerr += ( $snmpinfo->{$if}->{ifInErrors} || 0 ) +
@@ -423,23 +752,17 @@
# 2 means set to down
# Everything else we ignore.
- if ($status < 1 or $status > 2) {
- delete $snmpinfo->{$if} if exists $snmpinfo->{$if};
- delete $snmpinfoX->{$if} if exists $snmpinfoX->{$if};
- return;
- }
-
print "multigraph if_bytes.if_$if\n";
if ($status == 2) {
# Interface is down
print "recv.value U\n";
print "send.value U\n";
- print "send.extinfo This interface is down\n";
+ print "send.extinfo This interface is currently down.\n";
goto if_errors;
}
- if (defined ($response = $snmpinfo->{$if}->{ifHCInOctets} ||
+ if (defined ($response = $snmpinfoX->{$if}->{ifHCInOctets} ||
$snmpinfo->{$if}->{ifInOctets})) {
print "recv.value ", $response, "\n";
} else {
@@ -447,7 +770,7 @@
print "recv.value U\n";
}
- if (defined ($response = $snmpinfo->{$if}->{ifHCOutOctets} ||
+ if (defined ($response = $snmpinfoX->{$if}->{ifHCOutOctets} ||
$snmpinfo->{$if}->{ifOutOctets})) {
print "send.value ", $response, "\n";
} else {
@@ -505,6 +828,10 @@
do_fetch_root();
}
+# ############################## MAIN ################################
+
+do_collect;
+do_preprocess;
if ($ARGV[0] and $ARGV[0] eq "config") {
do_config();
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/snmp__netstat.in
^
|
@@ -1,89 +1,122 @@
#!@@PERL@@ -w
# -*- perl -*-
-#
-# Copyright (C) 2006 Lars Strand
-#
-# Munin plugin to monitor network connection by use of SNMP.
-# Based on snmp__df plugin.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; version 2 dated June,
-# 1991.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# $Id: snmp__netstat.in 2431 2009-09-16 10:04:17Z janl $
-#
-#%# family=snmpauto
-#%# capabilities=snmpconf
+# vim: ft=perl
+
+=head1 NAME
+
+snmp__netstat - Munin plugin to monitor the number of TCP network
+connections on an SNMP device.
+
+=head1 APPLICABLE SYSTEMS
+
+Any SNMP-capable device that reports the TCP-MIB::tcpConnState
+column of tcpConnTable.
+
+=head1 CONFIGURATION
+
+As a rule SNMP plugins need site specific configuration. The default
+configuration (shown here) will only work on insecure sites/devices.
+
+ [snmp_*]
+ env.version 2
+ env.community public
+
+In general SNMP is not very secure at all unless you use SNMP version
+3 which supports authentication and privacy (encryption). But in any
+case the community string for your devices should not be "public".
+
+Please see 'perldoc Munin::Plugin::SNMP' for further configuration
+information.
+
+=head1 INTERPRETATION
+
+The total number of TCP connections in each state. See RFC 793 or the
+detailed information on the graph page for the meaning of each state.
+
+=head1 MIB INFORMATION
+
+This plugin requires support for the TCP-MIB (RFC 4022). It reports
+the contents of the tcpConnState column of tcpConnTable.
+
+=head1 MAGIC MARKERS
+
+ #%# family=snmpauto
+ #%# capabilities=snmpconf
+
+=head1 VERSION
+
+ $Id: snmp__netstat.in 3459 2010-03-25 11:31:33Z janl $
+
+=head1 BUGS
+
+None known.
+
+=head1 AUTHOR
+
+Copyright (C) 2006 Lars Strand
+
+Tidied and documented by Matthew Boyle in 2010.
+
+=head1 LICENSE
+
+GPLv2.
+
+=cut
use strict;
use Munin::Plugin::SNMP;
-my $DEBUG = $ENV{'MUNIN_DEBUG'};
-
-my $response;
+my $oid = '1.3.6.1.2.1.6.13.1.1';
-my %tcpStates = ( 1 => [0, "GAUGE", "closed", "Connections waiting for a termination request acknowledgment from the remote TCP."],
- 2 => [0, "GAUGE", "listen", "Connections waiting for a request from any remote TCP and port."],
- 3 => [0, "GAUGE", "synSent", "Connections waiting for a matching request after having sent a connection request."],
- 4 => [0, "GAUGE", "synReceived", "Connections waiting for a confirming request acknowledgment after having both received and sent a connection request."],
- 5 => [0, "GAUGE", "established", "Connections opened and data received can be delivered to the user. The normal state for the data transfer phase of the connection."],
- 6 => [0, "GAUGE", "finWait1", "Connections waiting for a termination request from the remote TCP, or an acknowledgment of the connection termination request previously sent."],
- 7 => [0, "GAUGE", "finWait2", "Connections waiting for a termination request from the remote TCP."],
- 8 => [0, "GAUGE", "closeWait", "Connections waiting for a termination request from the local user."],
- 9 => [0, "GAUGE", "lastAck", "Connections waiting for an acknowledgment of the termination request previously sent to the remote TCP (which includes an acknowledgment of its connection termination request)."],
- 10 => [0, "GAUGE", "closing", "Connections waiting for a termination request acknowledgment from the remote TCP."],
- 11 => [0, "GAUGE", "timeWait", "Connections waiting for enough time to pass to be sure the remote TCP received the acknowledgment of its termination request."],
- 12 => [0, "GAUGE", "deleteTCP", "Connections terminated by a SNMP Managment Station (put)"]
- );
+my @tcpStates = (
+ [ 0, 'closed', 'Connections waiting for a termination request acknowledgment from the remote TCP.' ],
+ [ 0, 'listen', 'Connections waiting for a request from any remote TCP and port.' ],
+ [ 0, 'synSent', 'Connections waiting for a matching request after having sent a connection request.' ],
+ [ 0, 'synReceived', 'Connections waiting for a confirming request acknowledgment after having both received and sent a connection request.' ],
+ [ 0, 'established', 'Connections opened and data received can be delivered to the user. The normal state for the data transfer phase of the connection.' ],
+ [ 0, 'finWait1', 'Connections waiting for a termination request from the remote TCP, or an acknowledgment of the connection termination request previously sent.' ],
+ [ 0, 'finWait2', 'Connections waiting for a termination request from the remote TCP.' ],
+ [ 0, 'closeWait', 'Connections waiting for a termination request from the local user.' ],
+ [ 0, 'lastAck', 'Connections waiting for an acknowledgment of the termination request previously sent to the remote TCP (which includes an acknowledgment of its connection termination request).' ],
+ [ 0, 'closing', 'Connections waiting for a termination request acknowledgment from the remote TCP.' ],
+ [ 0, 'timeWait', 'Connections waiting for enough time to pass to be sure the remote TCP received the acknowledgment of its termination request.' ],
+ [ 0, 'deleteTCP', 'Connections terminated by a SNMP Managment Station (put)' ]
+);
-if (defined $ARGV[0] and $ARGV[0] eq "snmpconf") {
- print "require 1.3.6.1.2.1.6.13.1.1. [0-9]\n";
+if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf') {
+ print "require ${oid}. [0-9]\n";
exit 0;
}
-
-
-if (defined $ARGV[0] and $ARGV[0] eq "config") {
+if (defined $ARGV[0] and $ARGV[0] eq 'config') {
my ($host) = Munin::Plugin::SNMP->config_session();
+
print "host_name $host\n" unless $host eq 'localhost';
print "graph_title Netstat\n";
print "graph_args --base 1000 --logarithmic\n";
print "graph_period seconds\n";
print "graph_category network\n";
- print "graph_order closed listen synSent synReceived established finWait1 finWait2 closeWait lastAck closing timeWait deleteTCP\n";
print "graph_vlabel active connection\n";
print "graph_info This graph shows the TCP activity of all the network interfaces combined.\n";
- foreach my $state (keys %tcpStates) {
- print "$tcpStates{$state}[2].label $tcpStates{$state}[2]\n";
- print "$tcpStates{$state}[2].type $tcpStates{$state}[1]\n";
- print "$tcpStates{$state}[2].info $tcpStates{$state}[3]\n";
+ foreach my $state (@tcpStates) {
+ print "$state->[1].label $state->[1]\n";
+ print "$state->[1].info $state->[2]\n";
}
exit 0;
}
-my $tcpConnState = "1.3.6.1.2.1.6.13.1.1.";
-
my ($session, $error) = Munin::Plugin::SNMP->session();
-my $connections = $session->get_by_regex($tcpConnState, "[1-9]");
+my $connections = $session->get_entries(-columns => [ $oid ]);
-# the values
-while (my ($id, $state) = each(%$connections)) {
- $tcpStates{$state}[0] += 1;
+# sum up the rows
+foreach my $state (values %$connections) {
+ $tcpStates[$state-1]->[0]++; # states are counted from 1, not 0
}
-foreach my $state (keys %tcpStates) {
- print "$tcpStates{$state}[2].value $tcpStates{$state}[0]\n";
+foreach my $state (@tcpStates) {
+ print "$state->[1].value $state->[0]\n";
}
+
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/snort_alerts.in
^
|
@@ -1,19 +1,94 @@
#!@@GOODSH@@
+# -*- sh -*-
-# Proof of concept snort plugin written by Edward Bjarte Fjellskål.
+: << =cut
+
+=head1 NAME
+
+snort_alerts - Plugin to monitor the number of alerts in Snort
+
+=head1 CONFIGURATION
+
+The following configuration variables are used by this plugin
+
+ [snort_alerts]
+ env.statsfile - Logfile to Snort's perfmonitor logfile
+ env.warning - Warning percentage
+ env.critical - Critical percentage
+
+=head2 DEFAULT CONFIGURATION
+
+ [snort_alerts]
+ env.statsfile=/var/snort/snort.stats
+
+=head1 AUTHORS
+
+Copyright (C) 2009 Edward Bjarte Fjellskål
+
+Copyright (C) 2010 Rado Rovny
+
+=head1 LICENSE
+
+GNU GPLv2
+
+=begin comment
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; version 2 dated June,
+1991.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+=end comment
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=cut
+
+
+if [ -z $statsfile ]; then
+ _target=/var/snort/snort.stats
+else
+ _target=$statsfile
+fi
+
+if [ "$1" = "autoconf" ]; then
+ if [ -f $_target ]; then
+ echo yes
+ else
+ echo "no ($_target not readable)"
+ fi
+ exit 0
+fi
if [ "$1" = "config" ]; then
echo 'graph_title Snort Alerts'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel Alerts / second'
echo 'graph_scale no'
- echo 'alerts.label Alerts /second'
- #echo 'alerts.warning 10'
- #echo 'alerts.critical 50'
+ echo 'alerts.label Alerts/second'
+ if [ -n "$warning" ]; then
+ echo "alerts.warning $warning"
+ fi
+ if [ -n "$critical" ]; then
+ echo "alerts.critical $critical"
+ fi
+ echo 'alerts.info The number of alerts per second'
echo 'graph_category Snort'
exit 0
fi
echo -n "alerts.value "
-echo $( tail -n1 /your/path/to/snort.stats| awk -F, '{ print $4 }')
+echo $(tail -n1 $_target| awk -F, '{ print $4 }')
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/snort_bytes_pkt.in
^
|
@@ -1,19 +1,94 @@
#!@@GOODSH@@
+# -*- sh -*-
-# Proof of concept snort plugin written by Edward Bjarte Fjellskål.
+: << =cut
+
+=head1 NAME
+
+snort_bytes_pkt - Plugin to monitor average size in KBytes per packet
+
+=head1 CONFIGURATION
+
+The following configuration variables are used by this plugin
+
+ [snort_bytes_pkt]
+ env.statsfile - Logfile to Snort's perfmonitor logfile
+ env.warning - Warning percentage
+ env.critical - Critical percentage
+
+=head2 DEFAULT CONFIGURATION
+
+ [snort_bytes_pkt]
+ env.statsfile=/var/snort/snort.stats
+
+=head1 AUTHORS
+
+Copyright (C) 2009 Edward Bjarte Fjellskål
+
+Copyright (C) 2010 Rado Rovny
+
+=head1 LICENSE
+
+GNU GPLv2
+
+=begin comment
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; version 2 dated June,
+1991.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+=end comment
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=cut
+
+
+if [ -z $statsfile ]; then
+ _target=/var/snort/snort.stats
+else
+ _target=$statsfile
+fi
+
+if [ "$1" = "autoconf" ]; then
+ if [ -f $_target ]; then
+ echo yes
+ else
+ echo "no ($_target not readable)"
+ fi
+ exit 0
+fi
if [ "$1" = "config" ]; then
echo 'graph_title Snort Avg KBytes per pkt'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel KBytes / pkt'
echo 'graph_scale no'
- echo 'bytespkt.label KBytes/pkt'
- #echo 'bytespkt.warning 80'
- #echo 'bytespkt.critical 92'
+ echo 'bytes_pkt.label KBytes/pkt'
+ if [ -n "$warning" ]; then
+ echo "bytes_pkt.warning $warning"
+ fi
+ if [ -n "$critical" ]; then
+ echo "bytes_pkt.critical $critical"
+ fi
+ echo 'bytes_pkt.info Average size per packet'
echo 'graph_category Snort'
exit 0
fi
-echo -n "bytespkt.value "
-echo $( tail -n1 /your/path/to/snort.stats| awk -F, '{ print $6 }')
+echo -n "bytes_pkt.value "
+echo $(tail -n1 $_target| awk -F, '{ print $6 }')
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/snort_drop_rate.in
^
|
@@ -1,6 +1,76 @@
#!@@GOODSH@@
+# -*- sh -*-
-# Proof of concept snort plugin written by Edward Bjarte Fjellskål.
+: << =cut
+
+=head1 NAME
+
+snort_droprate - Plugin to monitor Snort packet drop rate
+
+=head1 CONFIGURATION
+
+The following configuration variables are used by this plugin
+
+ [snort_droprate]
+ env.statsfile - Logfile to Snort's perfmonitor logfile
+ env.warning - Warning percentage
+ env.critical - Critical percentage
+
+=head2 DEFAULT CONFIGURATION
+
+ [snort_drop_rate]
+ env.statsfile=/var/snort/snort.stats
+
+=head1 AUTHORS
+
+Copyright (C) 2009 Edward Bjarte Fjellskål
+
+Copyright (C) 2010 Rado Rovny
+
+=head1 LICENSE
+
+GNU GPLv2
+
+=begin comment
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; version 2 dated June,
+1991.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+=end comment
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=cut
+
+
+if [ -z $statsfile ]; then
+ _target=/var/snort/snort.stats
+else
+ _target=$statsfile
+fi
+
+if [ "$1" = "autoconf" ]; then
+ if [ -f $_target ]; then
+ echo yes
+ else
+ echo "no ($_target not readable)"
+ fi
+ exit 0
+fi
if [ "$1" = "config" ]; then
echo 'graph_title Snort Drop Rate'
@@ -8,13 +78,17 @@
echo 'graph_vlabel % percent'
echo 'graph_scale no'
echo 'droprate.label % percent'
- # To tell Nagios
- echo 'droprate.warning 1'
- echo 'droprate.critical 2'
+ if [ -n "$warning" ]; then
+ echo "droprate.warning $warning"
+ fi
+ if [ -n "$critical" ]; then
+ echo "droprate.critical $critical"
+ fi
+ echo 'droprate.info Packet drop rate in %'
echo 'graph_category Snort'
exit 0
fi
echo -n "droprate.value "
-echo $( tail -n1 /your/path/to/snort.stats| awk -F, '{ print $2 }')
+echo $(tail -n1 $_target| awk -F, '{ print $2 }')
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/snort_pattern_match.in
^
|
@@ -1,6 +1,77 @@
#!@@GOODSH@@
+# -*- sh -*-
-# Proof of concept snort plugin written by Edward Bjarte Fjellskål.
+: << =cut
+
+=head1 NAME
+
+snort_pattmatch - Plugin to monitor percent of data received that
+ Snort processes in pattern matching.
+
+=head1 CONFIGURATION
+
+The following configuration variables are used by this plugin
+
+ [snort_pattern_match]
+ env.statsfile - Logfile to Snort's perfmonitor logfile
+ env.warning - Warning percentage
+ env.critical - Critical percentage
+
+=head2 DEFAULT CONFIGURATION
+
+ [snort_pattern_match]
+ env.statsfile=/var/snort/snort.stats
+
+=head1 AUTHORS
+
+Copyright (C) 2009 Edward Bjarte Fjellskål
+
+Copyright (C) 2010 Rado Rovny
+
+=head1 LICENSE
+
+GNU GPLv2
+
+=begin comment
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; version 2 dated June,
+1991.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+=end comment
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=cut
+
+
+if [ -z $statsfile ]; then
+ _target=/var/snort/snort.stats
+else
+ _target=$statsfile
+fi
+
+if [ "$1" = "autoconf" ]; then
+ if [ -f $_target ]; then
+ echo yes
+ else
+ echo "no ($_target not readable)"
+ fi
+ exit 0
+fi
if [ "$1" = "config" ]; then
echo 'graph_title Snort Pattern Match'
@@ -8,13 +79,17 @@
echo 'graph_vlabel % percent'
echo 'graph_scale no'
echo 'pattmatch.label % percent'
- #For Nagios
- #echo 'pattmatch.warning 14'
- #echo 'pattmatch.critical 25'
+ if [ -n "$warning" ]; then
+ echo "pattmatch.warning $warning"
+ fi
+ if [ -n "$critical" ]; then
+ echo "pattmatch.critical $critical"
+ fi
+ echo 'pattmatch.info The percent of data received that Snort processes in pattern matching'
echo 'graph_category Snort'
exit 0
fi
echo -n "pattmatch.value "
-echo $( tail -n1 /your/path/to/snort.stats| awk -F, '{ print $7 }')
+echo $(tail -n1 $_target| awk -F, '{ print $7 }')
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/snort_pkts.in
^
|
@@ -1,19 +1,95 @@
-#!/bin/sh
+#!@@GOODSH@@
+# -*- sh -*-
-# Proof of concept snort plugin written by Edward Bjarte Fjellskål.
+: << =cut
+
+=head1 NAME
+
+snort_pktsec - Plugin to monitor the number of packets per second
+ passed through Snort filters
+
+=head1 CONFIGURATION
+
+The following configuration variables are used by this plugin
+
+ [snort_pkts]
+ env.statsfile - Logfile to Snort's perfmonitor logfile
+ env.warning - Warning percentage
+ env.critical - Critical percentage
+
+=head2 DEFAULT CONFIGURATION
+
+ [snort_pkts]
+ env.statsfile=/var/snort/snort.stats
+
+=head1 AUTHORS
+
+Copyright (C) 2009 Edward Bjarte Fjellskål
+
+Copyright (C) 2010 Rado Rovny
+
+=head1 LICENSE
+
+GNU GPLv2
+
+=begin comment
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; version 2 dated June,
+1991.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+=end comment
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=cut
+
+
+if [ -z $statsfile ]; then
+ _target=/var/snort/snort.stats
+else
+ _target=$statsfile
+fi
+
+if [ "$1" = "autoconf" ]; then
+ if [ -f $_target ]; then
+ echo yes
+ else
+ echo "no ($_target not readable)"
+ fi
+ exit 0
+fi
if [ "$1" = "config" ]; then
echo 'graph_title Snort Avg packets/s'
echo 'graph_args --base 1000 -l 0'
- echo 'graph_vlabel Packets / sec'
+ echo 'graph_vlabel Packets / second'
echo 'graph_scale no'
echo 'pktsec.label Packets/second'
- #echo 'pktsec.warning 80'
- #echo 'pktsec.critical 92'
+ if [ -n "$warning" ]; then
+ echo "pktsec.warning $warning"
+ fi
+ if [ -n "$critical" ]; then
+ echo "pktsec.critical $critical"
+ fi
+ echo 'pktsec.info The number of packets per second'
echo 'graph_category Snort'
exit 0
fi
echo -n "pktsec.value "
-echo $( tail -n1 /your/path/to/snort.stats| awk -F, '{ print $5 }') \* 1000|bc -l
+echo $( tail -n1 $_target| awk -F, '{ print $5 }') \* 1000|bc -l
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/snort_traffic.in
^
|
@@ -1,6 +1,76 @@
#!@@GOODSH@@
+# -*- sh -*-
-# Proof of concept snort plugin written by Edward Bjarte Fjellskål.
+: << =cut
+
+=head1 NAME
+
+snort_traffic - Plugin to monitor Snort traffic in Mbites per second
+
+=head1 CONFIGURATION
+
+The following configuration variables are used by this plugin
+
+ [snort_traffic]
+ env.statsfile - Logfile to Snort's perfmonitor logfile
+ env.warning - Warning percentage
+ env.critical - Critical percentage
+
+=head2 DEFAULT CONFIGURATION
+
+ [snort_traffic]
+ env.statsfile=/var/snort/snort.stats
+
+=head1 AUTHORS
+
+Copyright (C) 2009 Edward Bjarte Fjellskål
+
+Copyright (C) 2010 Rado Rovny
+
+=head1 LICENSE
+
+GNU GPLv2
+
+=begin comment
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; version 2 dated June,
+1991.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+=end comment
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=cut
+
+
+if [ -z $statsfile ]; then
+ _target=/var/snort/snort.stats
+else
+ _target=$statsfile
+fi
+
+if [ "$1" = "autoconf" ]; then
+ if [ -f $_target ]; then
+ echo yes
+ else
+ echo "no ($_target not readable)"
+ fi
+ exit 0
+fi
if [ "$1" = "config" ]; then
echo 'graph_title Snort Traffic'
@@ -8,10 +78,17 @@
echo 'graph_vlabel Mbits / second'
echo 'graph_scale no'
echo 'traffic.label Mbits/second'
+ if [ -n "$warning" ]; then
+ echo "traffic.warning $warning"
+ fi
+ if [ -n "$critical" ]; then
+ echo "traffic.critical $critical"
+ fi
+ echo 'traffic.info Traffic in Mbites per second'
echo 'graph_category Snort'
exit 0
fi
echo -n "traffic.value "
-echo $( tail -n1 /your/path/to/snort.stats| awk -F, '{ print $3 }')
+echo $(tail -n1 $_target| awk -F, '{ print $3 }')
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/tomcat_access.in
^
|
@@ -102,10 +102,11 @@
my $ua = LWP::UserAgent->new(timeout => $TIMEOUT);
my $xs = new XML::Simple;
my $response = $ua->request(HTTP::Request->new('GET',$url));
-my $xml = $xs->XMLin($response->content);
+my %options = ( KeyAttr => { connector => 'name' }, ForceArray => 1 );
+my $xml = $xs->XMLin($response->content, %options);
-if($xml->{'connector'}->{'http-'.$PORT}->{'requestInfo'}->{'requestCount'}) {
- print "accesses.value " . $xml->{'connector'}->{'http-'.$PORT}->{'requestInfo'}->{'requestCount'} . "\n";
+if($xml->{'connector'}->{'http-'.$PORT}->{'requestInfo'}->[0]->{'requestCount'}) {
+ print "accesses.value " . $xml->{'connector'}->{'http-'.$PORT}->{'requestInfo'}->[0]->{'requestCount'} . "\n";
} else {
print "accesses.value U\n";
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/tomcat_threads.in
^
|
@@ -103,14 +103,15 @@
my $ua = LWP::UserAgent->new(timeout => $TIMEOUT);
my $xs = new XML::Simple;
my $response = $ua->request(HTTP::Request->new('GET',$url));
-my $xml = $xs->XMLin($response->content);
+my %options = ( KeyAttr => { connector => 'name' }, ForceArray => 1 );
+my $xml = $xs->XMLin($response->content, %options);
-if($xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->{'currentThreadsBusy'} &&
- $xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->{'currentThreadCount'}) {
- print "busy.value " . $xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->{'currentThreadsBusy'} . "\n";
+if($xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->[0]->{'currentThreadsBusy'} &&
+ $xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->[0]->{'currentThreadCount'}) {
+ print "busy.value " . $xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->[0]->{'currentThreadsBusy'} . "\n";
print "idle.value " .
- ($xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->{'currentThreadCount'} -
- $xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->{'currentThreadsBusy'}) . "\n";
+ ($xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->[0]->{'currentThreadCount'} -
+ $xml->{'connector'}->{'http-'.$PORT}->{'threadInfo'}->[0]->{'currentThreadsBusy'}) . "\n";
} else {
print "busy.value U\n";
print "idle.value U\n";
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/tomcat_volume.in
^
|
@@ -122,10 +122,12 @@
my $ua = LWP::UserAgent->new(timeout => $TIMEOUT);
my $xs = new XML::Simple;
my $response = $ua->request(HTTP::Request->new('GET',$url));
-my $xml = $xs->XMLin($response->content);
+my %options = ( KeyAttr => { connector => 'name' }, ForceArray => 1 );
+my $xml = $xs->XMLin($response->content, %options);
-if($xml->{'connector'}->{'http-'.$PORT}->{'requestInfo'}->{'bytesSent'}) {
- print "volume.value " . $xml->{'connector'}->{'http-'.$PORT}->{'requestInfo'}->{'bytesSent'} . "\n";
+
+if($xml->{'connector'}->{'http-'.$PORT}->{'requestInfo'}->[0]->{'bytesSent'}) {
+ print "volume.value " . $xml->{'connector'}->{'http-'.$PORT}->{'requestInfo'}->[0]->{'bytesSent'} . "\n";
} else {
print "volume.value U\n";
}
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/node.d/varnish_.in
^
|
@@ -56,7 +56,7 @@
ln -s @@LIBDIR@@/plugins/varnish_ \
@@CONFDIR@@/plugins/varnish_data_structures
-=head1 INTERPERTATION
+=head1 INTERPRETATION
Each graph uses data from varnishstat.
@@ -74,6 +74,13 @@
The hit_rate graph requires munin r2040 or newer to display
correctly.
+=head1 PATCHES-TO
+
+The varnish-tools repository is the canonical upstream for this plugin.
+Please send patches to Kristian Lyngstol <kristian@redpill-linpro.com>
+and/or varnish-misc@projects.linpro.no for inclusion before adding to
+munin trunk.
+
=head1 AUTHOR
Kristian Lyngstol <kristian@redpill-linpro.com>
@@ -84,8 +91,6 @@
=cut
-# FIXME: License?
-
use strict;
@@ -184,8 +189,9 @@
'min' => '0'
},
'backend_unhealthy' => {
- 'colour' => 'FF55FF',
- 'type' => 'GAUGE'
+ 'type' => 'DERIVE',
+ 'min' => '0',
+ 'colour' => 'FF55FF'
},
's_pipe' => {
'type' => 'DERIVE',
@@ -240,7 +246,7 @@
'min' => '0'
},
'backend_unhealthy' => {
- 'type' => 'GAUGE',
+ 'type' => 'DERIVE',
'min' => '0',
'warning' => ':1'
},
@@ -281,7 +287,7 @@
'type' => 'GAUGE',
'label' => 'Number of object heads',
'info' => 'Each object head can have one '
- . 'or more ojbect attached, '
+ . 'or more object attached, '
. 'typically based on the Vary: header'
}
}
@@ -695,7 +701,7 @@
# Returns false if non-existant.
#
# Output is formatted for plugins if arg4 is blank, otherwise arg4 is used
-# as the title/name of the field (ie: arg4=graph_titel).
+# as the title/name of the field (ie: arg4=graph_title).
sub print_if_exist
{
my %values = %{$_[0]};
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/plugin.sh.in
^
|
@@ -68,6 +68,71 @@
fi
}
+# adjust_threshold() takes a threshold string and a base value in, and returns
+# the threshold string adjusted for percentages if percent sizes are present.
+# If not, the threshold is left unchanged.
+# Usage:
+# adjust_threshold "50%:50%" 200
+# Returns:
+# 100:100
+#
+adjust_threshold () {
+
+ if [ -n "$1" -a -n "$2" ]; then
+ echo "$1" | awk "BEGIN { FS=\":\"; OFS=\":\" }
+ \$1 ~ /.*%/ {\$1 = $2 * substr(\$1, 0, length(\$1) - 1) / 100}
+ \$2 ~ /.*%/ {\$2 = $2 * substr(\$2, 0, length(\$2) - 1) / 100}
+
+ { print }"
+ fi
+
+}
+
+# print_thresholds() takes three arguments. The first is the field name, the
+# second is the default environment variable for warnings (see the second
+# argument to get_warning), and the third is the default environment variable
+# for criticals (see the second argument to get_critical).
+#
+# This is a convenience function for plugins that don't need to do anything
+# special for warnings vs criticals.
+#
+# Usage:
+# warning='20' critical='40' print_thresholds user
+# Returns:
+# user.warning 20
+# user.critical 40
+
+print_thresholds() {
+ print_warning $1 $2
+ print_critical $1 $3
+}
+
+# print_adjusted_thresholds() takes four arguments. The first is the field
+# name, the second is the base value (see the second argument to
+# adjust_threshold), the third is the default environment variable for
+# warnings (see the second argument to get_warning), and the fourth is the
+# default environment variable for criticals (see the second argument to
+# get_critical).
+#
+# Usage:
+# warning=20% critical=40% print_adjusted_thresholds "user" 800
+# Returns:
+# user.warning 160
+# user.critical 320
+#
+print_adjusted_thresholds () {
+ tempthresh=$(get_warning $1 $3)
+ if [ -n "$tempthresh" ]; then
+ echo "$1.warning $(adjust_threshold "$tempthresh" "$2")"
+ fi
+ tempthresh=$(get_critical $1 $4)
+ if [ -n "$tempthresh" ]; then
+ echo "$1.critical $(adjust_threshold "$tempthresh" "$2")"
+ fi
+ unset tempthresh
+}
+
+
is_multigraph () {
# Multigraph feature is available in Munin 1.4.0 and later.
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/plugins.history.in
^
|
@@ -235,7 +235,6 @@
jmx_
fail2ban
zimbra_
-linux/diskstat_
tomcat_
squeezebox_
snmp__netapp_diskusage_
@@ -315,3 +314,17 @@
[1.4.1]
sunos/iostat
+
+[1.4.2]
+munin_update
+
+[1.4.3]
+linux/diskstats
+
+[1.4.4]
+linux/selinux_avcstat.in
+linux/lpar_cpu.in
+linux/buddyinfo.in
+linux/tcp.in
+node.d/proxy_plugin.in
+
|
[-]
[+]
|
Changed |
munin-1.4.6.tar.bz2/plugins/t/munin_plugin_snmp.t
^
|
@@ -1,7 +1,7 @@
use warnings;
use strict;
-use Test::More tests => 12;
+use Test::More tests => 25;
use_ok('Munin::Plugin::SNMP');
@@ -62,9 +62,9 @@
is_deeply(
[ Munin::Plugin::SNMP->config_session() ],
[ 'araucaria', 161, 2, 'graham' ],
- 'port set in environment'
- );
- }
+ 'host set in environment'
+ );
+ }
{
local $ENV{port} = '162';
local $0 = 'snmp_john_graham',
@@ -72,8 +72,8 @@
[ Munin::Plugin::SNMP->config_session() ],
[ 'john', 162, 2, 'graham' ],
'port set in environment'
- );
- }
+ );
+ }
{
local $ENV{version} = '3';
local $0 = 'snmp_john_graham',
@@ -81,8 +81,8 @@
[ Munin::Plugin::SNMP->config_session() ],
[ 'john', 161, 3, 'graham' ],
'version set in v2 plugin environment'
- );
- }
+ );
+ }
{
local $ENV{version} = '2';
local $0 = 'snmpv3_john_graham',
@@ -90,8 +90,242 @@
[ Munin::Plugin::SNMP->config_session() ],
[ 'john', 161, 2, 'graham' ],
'version 2 set in v3 plugin environment'
- );
- }
+ );
+ }
+}
+
+
+### session
+{
+ # defaults for config_session to return (hostname, port, version, tail)
+ my @DEFAULT_CONFIG = qw( localhost 161 2 if_1 );
+
+ # catch the arguments passed to Net::SNMP->session
+ our %NET_SNMP_ARGUMENTS;
+
+ no warnings;
+ local *Munin::Plugin::SNMP::config_session = sub { return @DEFAULT_CONFIG };
+ local *Net::SNMP::session = sub { shift; %NET_SNMP_ARGUMENTS = @_ };
+ use warnings;
+
+ ### start the tests proper
+
+ # version 1
+ {
+ local $DEFAULT_CONFIG[2] = 1;
+ Munin::Plugin::SNMP->session();
+ is_deeply(
+ \%NET_SNMP_ARGUMENTS,
+ {
+ -hostname => 'localhost',
+ -port => '161',
+ -version => '1',
+ -community => 'public',
+ },
+ 'version 1 session (no community string in environment)',
+ );
+ }
+ {
+ local $DEFAULT_CONFIG[2] = 1;
+ local $ENV{community} = 's33kr1t';
+ Munin::Plugin::SNMP->session();
+ is_deeply(
+ \%NET_SNMP_ARGUMENTS,
+ {
+ -hostname => 'localhost',
+ -port => '161',
+ -version => '1',
+ -community => 's33kr1t',
+ },
+ 'version 1 session (with community string in environment)',
+ );
+ }
+
+ # version 2
+ {
+ Munin::Plugin::SNMP->session();
+ is_deeply(
+ \%NET_SNMP_ARGUMENTS,
+ {
+ -hostname => 'localhost',
+ -port => '161',
+ -version => '2',
+ -community => 'public',
+ },
+ 'version 2 session (no community string in environment)',
+ );
+ }
+ {
+ local $ENV{community} = 's33kr1t';
+ Munin::Plugin::SNMP->session();
+ is_deeply(
+ \%NET_SNMP_ARGUMENTS,
+ {
+ -hostname => 'localhost',
+ -port => '161',
+ -version => '2',
+ -community => 's33kr1t',
+ },
+ 'version 2 session (with community string in environment)',
+ );
+ }
+
+ # version 3 (noAuthNoPriv)
+ {
+ local $DEFAULT_CONFIG[2] = 3;
+ local $ENV{v3username} = 'jeff';
+ Munin::Plugin::SNMP->session();
+ is_deeply(
+ \%NET_SNMP_ARGUMENTS,
+ {
+ -hostname => 'localhost',
+ -port => '161',
+ -version => '3',
+ -username => 'jeff',
+ },
+ 'version 3 session, noAuthNoPriv',
+ );
+ }
+
+ # version 3 (authNoPriv)
+ {
+ local $DEFAULT_CONFIG[2] = 3;
+
+ local $ENV{v3username} = 'jeff';
+ local $ENV{v3authpassword} = 'swordfish';
+ Munin::Plugin::SNMP->session();
+ is_deeply(
+ \%NET_SNMP_ARGUMENTS,
+ {
+ -hostname => 'localhost',
+ -port => '161',
+ -version => '3',
+ -username => 'jeff',
+ -authpassword => 'swordfish',
+ -authprotocol => 'md5',
+ },
+ 'version 3 session, authNoPriv, protocol defaults to MD5',
+ );
+ }
+ {
+ local $DEFAULT_CONFIG[2] = 3;
+
+ local $ENV{v3username} = 'jeff';
+ local $ENV{v3authpassword} = 'swordfish';
+ local $ENV{v3authprotocol} = 'sha';
+
+ Munin::Plugin::SNMP->session();
+ is_deeply(
+ \%NET_SNMP_ARGUMENTS,
+ {
+ -hostname => 'localhost',
+ -port => '161',
+ -version => '3',
+ -username => 'jeff',
+ -authpassword => 'swordfish',
+ -authprotocol => 'sha',
+ },
+ 'version 3 session, authNoPriv, set protocol to SHA1',
+ );
+ }
+
+ # version 3 (authPriv, same auth and priv keys)
+ {
+ local $DEFAULT_CONFIG[2] = 3;
+
+ local $ENV{v3username} = 'jeff';
+ local $ENV{v3privpassword} = 'hedgerows';
+
+ Munin::Plugin::SNMP->session();
+ is_deeply(
+ \%NET_SNMP_ARGUMENTS,
+ {
+ -hostname => 'localhost',
+ -port => '161',
+ -version => '3',
+ -username => 'jeff',
+ -authpassword => 'hedgerows',
+ -authprotocol => 'md5',
+ -privpassword => 'hedgerows',
+ -privprotocol => 'des',
+ },
+ 'version 3 (authPriv, same auth and priv keys)',
+ );
+ }
+
+ # version 3 (authPriv, different auth and priv keys)
+ {
+ local $DEFAULT_CONFIG[2] = 3;
+
+ local $ENV{v3username} = 'jeff';
+ local $ENV{v3authpassword} = 'swordfish';
+ local $ENV{v3privpassword} = 'hedgerows';
+
+ Munin::Plugin::SNMP->session();
+ is_deeply(
+ \%NET_SNMP_ARGUMENTS,
+ {
+ -hostname => 'localhost',
+ -port => '161',
+ -version => '3',
+ -username => 'jeff',
+ -authpassword => 'swordfish',
+ -authprotocol => 'md5',
+ -privpassword => 'hedgerows',
+ -privprotocol => 'des',
+ },
+ 'version 3 (authPriv, different auth and priv keys)',
+ );
+ }
+
+ # user-defined options
+ {
+ Munin::Plugin::SNMP->session(-retries => 10);
+ is_deeply(
+ \%NET_SNMP_ARGUMENTS,
+ {
+ -hostname => 'localhost',
+ -port => '161',
+ -version => '2',
+ -community => 'public',
+ -retries => '10'
+ },
+ 'Arguments to session() are propagated to Net::SNMP',
+ );
+ }
+
+ # timeout
+ {
+ local $ENV{timeout} = 30;
+ Munin::Plugin::SNMP->session();
+ is_deeply(
+ \%NET_SNMP_ARGUMENTS,
+ {
+ -hostname => 'localhost',
+ -port => '161',
+ -version => '2',
+ -community => 'public',
+ -timeout => '30'
+ },
+ 'Arguments to session() are propagated to Net::SNMP',
+ );
+ }
+
+ # unknown SNMP version
+ {
+ local $DEFAULT_CONFIG[2] = 17;
+ eval { Munin::Plugin::SNMP->session(); };
+ like($@, qr/./, 'Unknown SNMP version causes an exception.');
+ }
+
+ # Unable to create session
+ {
+ no warnings;
+ local *Net::SNMP::session = sub { return (undef, 'fake error') };
+ use warnings;
+ eval { Munin::Plugin::SNMP->session(); };
+ like($@, qr/fake error/, 'Error creating SNMP session causes an exception.');
+ }
}
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/resources/solaris-smf
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/resources/solaris-smf/munin-node.in
^
|
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Setup
+install -d -u munin -g munin @@STATEDIR@@
+
+# Main
+exec @@SBINDIR@@/munin-node
|
[-]
[+]
|
Added |
munin-1.4.6.tar.bz2/resources/solaris-smf/munin-node.xml.in
^
|
@@ -0,0 +1,69 @@
+<?xml version='1.0'?>
+<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
+
+<!--
+
+ Solaris SMF method for site/munin-node
+
+ 2010-06-02 Stig Sandbeck Mathisen <ssm@fnord.no>
+
+ Usage
+ =====
+
+ Copy the munin-node script to /lib/svc/method/, and
+ make it executale
+
+ Copy the munin-node.xml manifest to /var/svc/manifest/site/, and
+ then run:
+
+ # svccfg import /var/svc/manifest/site/munin-node.xml
+
+ Check
+ =====
+
+ Check the status of your running munin-node with:
+
+ # svcs site/munin-node
+
+ -->
+
+<service_bundle type='manifest' name='export'>
+ <service name='site/munin-node' type='service' version='0'>
+
+ <create_default_instance enabled='true'/>
+ <single_instance/>
+
+ <dependency name='fs' grouping='require_all' restart_on='refresh' type='service'>
+ <service_fmri value='svc:/system/filesystem/local'/>
+ </dependency>
+
+ <dependency name='net' grouping='require_all' restart_on='refresh' type='service'>
+ <service_fmri value='svc:/milestone/network'/>
+ </dependency>
+
+ <dependency name='config' grouping='require_all' restart_on='none' type='path'>
+ <service_fmri value='file://localhost@@CONFDIR@@/munin-node.conf'/>
+ </dependency>
+
+ <exec_method name='start' type='method' exec='/lib/svc/method/munin-node start' timeout_seconds='30'>
+ <method_context>
+ <method_credential user='root' group='root'/>
+ </method_context>
+ </exec_method>
+
+ <exec_method name='stop' type='method' exec=':kill' timeout_seconds='30'/>
+
+ <stability value='Unstable'/>
+
+ <template>
+ <common_name>
+ <loctext xml:lang='C'>munin-node</loctext>
+ </common_name>
+ <documentation>
+ <manpage title='munin-node' section='1' manpath='@@MANDIR@@'/>
+ <doc_link name='Munin Documentation' uri='http://munin-monitoring.org/wiki/Documentation'/>
+ </documentation>
+ </template>
+
+ </service>
+</service_bundle>
|
|
Deleted |
munin-1.4.tar.bz2
^
|