[-]
[+]
|
Changed |
munin.spec
|
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/ChangeLog
^
|
@@ -1,5 +1,544 @@
-*- text -*-
+Some stats on 1.4.0:
+* Over 1430 changesets
+* More than 100 new plugins
+* Commits from 13 different people (**FIXME** Check again at release)
+* Way too much time since the last major stable release
+
+
+munin (1.4.0-alpha2, r2899:2981, 2009-11-13)
+
+* set obsoleted tomcat_* plugins to family=manual
+* smart_ - fix autoconf yes and suggest empty
+* openvpn and misc ntp_* plugins: fix some nonzero autoconfs
+* mysql_: fix autoconf for missing Cache::Cache
+* zimbra_: fix autoconf when missing perl modules
+* Fix brokem munin-cgi-graph, which was : missing : --list-images param
+ for munin-graph, a missing chomp($file), and a wrong path to the
+ generated png. Also fix HTMLOld passing an array ref instead of an array
+* a bit more debug output for the node server -- note which node each
+ plugin is associated with, and whether it requires multigraph.
+* report when plugins are being ignored due to errors when they were
+ being configured. not very detailed, but better than nothing. also
+ delete them from the list of plugins, so they're not included in the list.
+* Munin-node: fix logic in _suggested_links():
+ + never return any suggested links when the plugin shouldn't be installed.
+ + correctly handle SNMP plugins whose only wildcard parameter is the host.
+ (thanks to janl for spotting this was broken.)
+* Add proof of concept snort plugins
+* snmp__if_multi: Update to acutuall implementation of multigraph and some
+ further testing and corrections
+* INSTALL: Update w.r.t. support for SNMP v3
+* munin.conf: Correct "includedir" example
+* postfix_mailqueue: Fix autoconf for the negative case, pretty sure it
+ still works for the positive case O:-)
+* Fix various autoconf problems with slapd and ifx plugins
+* mysql_* plugins: Now obsoleted by new mysql_ plugin. Set family=manual
+* Asterisk_* plugins: None of these support autoconf so remove magicmarker
+* HTML: Border on graphs in critical and warning state for nodeview.
+ Comparison views (hopefully) to follow
+* M::M::Utils: End the pod section with =cut, so that the last line,
+ # vim: syntax=perl ts=8 wont slip into the man page
+* M::M::ProcessManager: documentation typo fix
+* bind9_rndc: reinstate @@PERL@@ substitution marker, which broke in r2958
+* Get the BIND logfile's size before rndc is run, rather than taking a
+ guess at where it might have been. Fix for #746, thanks to guillomovitch
+ for the patch.
+* Clean up a typo, add use strict, use warnings to all 3 apache_* plugins,
+ add an info explanation for apache_accesses
+* HTML: munin-serviceview: add column header on 6th column in legend table
+* M::M::HTMLOld: removes underscore from top navigation element describing
+ the plugin name for the service page emission. you know for the visual
+ touch
+* HTML: added variable to set the text for the dropdown for each of the
+ template emitting functions.
+* Refactoring templates into partials (with include) to avod a lot of
+ duplication. There is some left. Better look on the legend table for
+ service-biew and dropdown with 'other' links with config
+ value. Default is 1 at the moment. Makefile adds install steps for
+ new partial folder
+* M::M::UpdateWorker: Typo--;
+* linux/df_inode: vfat doesn't have any inodes either.
+* More documentation of plugins
+* Graphs: Fix cur: values for .stack and .sum.
+* Graphs: ADDNAN in expand_specials cdefs
+* Remove .label requirement on .stack fields.
+* Changed munin_stats to check for
+ $Munin::Common::Defaults::MUNIN_LIBDIR/munin-update existance +
+ executable in order to autoconf it as previously it checked for the
+ existance of the munin master logs, which did not exist in a clean
+ installation. Also added a check + extinfo message in case any of the
+ log files are not readable
+* Fix copying of subhashes (#%#parent was broken in old version). Fixed
+ various issues in a couple of programs.
+* M::M::ProcessManager: clarify what the numbers at the end of the log
+ message mean.
+* M::P::SNMP: for some reason, Net::SNMP doesn't consider 'No Such
+ Object' to be a real error. Handle better in get_single.
+* linux/ip_: Use env.hostname to replace ip-number in graph_title.
+* pm3users_ : we can do colour now
+* ipmi_sensor_ - fix autoconf for missing ipmitool
+* M::M::Config: Handle continued lines (ending in \)
+* M::M::GraphOld: Comment out utime call that interferes with rrd's
+ --lazy option
+* M::M::Node: A missing .label isn't as fatal as all that. Insert a
+ value and supply .extinfo to explain more
+* Make the linux/diskstat_ plugin work better w/o root access,
+ document a bit better
+* Remove obsolete nagios specific munin-limits commands from crontabs all over.
+* M::M::Update: Load datafile relative to the configured dbdir, not
+ the default dbdir
+* squeezebox_: Various enhancements
+* M::M::Node: More specific location of the missing label from the config output
+* M::M::LimitsOld: Forgot to actually make this into a exporter
+ module. Thanks to Kevin Fenzi for pointing this out
+* mysql_ plugin: Update vlabels for concistency
+* Give the BIND plugins a graph_category as pointed out in email by Rado Rovny
+* Update mysql_ plugin from upstream
+* Get rid of munindoc.in from the installation (closes #742)
+* INSTALL: More modules, and a section on using CPAN-shell
+* Implement dropdown boxes for peers when there are more than
+ "dropdownlimit" number of peers. Implemented for all views except
+ overview, which is a special kind of, ehm, view. Also removes
+ underscores from names for graph peers to clean them up a bit
+
+
+munin (1.4.0-alpha, r1560:2898, 2009-11-06)
+
+* squeezebox_: Changes to support several players
+* smart_: Exit 0 on autoconf as the doctor ordered
+* Make munin-graph recognize --help
+* Quite a bit of work on error messages and log messages
+* munin_stats plugin: Accept logdir setting from plugin-conf.d
+* processes and linux/proc_pri plugins: Add vlabel
+* Handle domain_order as group_order.
+* Sort peers properly (fixes #577)
+* Fix handling of group_order and node_order (partial fix for #579)
+* Munin-update: soften up the protocol error handling a bit
+* Make munin-html tolerate --nofork - even if it has no effect. Document.
+* mysql_ plugin: Fix "suggest" bug
+* Add multigraph_tester plugin to test (and show off) multigraph features
+* Add extinfo_tester plugin for developer aid
+* Make use_node_name work again (fixes #739)
+* One single instance of "includedir" in munin.conf is now obeyed to
+ implement a "drop directory" for munin-master configuration.
+ Example in munin.conf
+* Add python-plugin OO framework as python-plugin
+* Make M::M::Logger a bit more subtle about warnings when the logs are not
+ open (so that they appear somewhere instead of nowhere)
+* Update plugin configuration for varnish_
+* Make notifications work again
+* munin.conf: Set HTML and CGI dir consistently
+* Added new mysql_ by Kjell-Magne Øierud plugin, document origin, and
+ sentence the others to exile (family=contrib)
+* Fix "make/make install" problems, document the other
+* Change <img> framing a bit to allow coloured frames (once the templates are updated)
+* Add multigraph support to all programs in the munin-suite
+* mysql_innodb plugin: The "new way" of detecting InnoDB free space was changed
+ in 5.1.24, add a case to compare correctly.
+* linux/bonding_err_: it's a counter not a gauge
+* Perltidy quite a bit
+* Retire fieldname.warn and fieldname.crit. The documentation has been
+ saying .warning and .critical for a number of years. Mass fix plugins
+ accordingly.
+* Service view: Add hopefuly helpful explanatory text about
+ warn/crit/unknown states in the graph-info field.
+* Get the HTML templates and CSS validating.
+* Updated templates and CSS with stylish new elements, fonts and such.
+ Thanks to Knut Haugen.
+* Switch to Log4perl on the master side. Node still has to use
+ old logging to avoid node-installation-dependency-hell.
+* Ever more corrections to INSTALL
+* Basic modularisation of munin-limits
+* Move favicon.ico to templates, some of us need the HTMLDIR to be fully
+ re-generatable from the templates directory (in order to be FHS complaint)
+* Commented some templates to make them easier to read and understand
+* munin.conf: include cgiurl_graph example
+* memcached_: New wildcard plugin
+* Refactoring of munin-update, munin-node and munin-node-configure
+ by Kjell-Mangne Øierud and Matthew Boyle. Actuall tests for testing
+ the programs were added too!
+* templates:
+* html templates: The timestamp can't really be ISO8601 with the support
+ of portable strftime % formats so remove the T, and cover the
+ eventuallity that strftime does not support %z
+* Make templates @@ free - less processing - change Makefile and
+ M::M::HTMLOld accordingly
+* Put INFO and DEBUG statements into the locking code to make it debugable
+* Fix bashisms in nutups_.in : function is useless
+* Introduced some actuall debugging output to munin-html
+* Cleaned up logging in munin-html and M::M::Utils
+* munin-master: make getopt::long dependency explicit at build-time
+* linux/df*: Ubuntu Karmic uses "none" as device a lot, so handle that
+* HACKING.pod: Revert "Note to do 'make build' before trying the install
+ script."
+* testplugin: Testplugin for various failure modes - developer support
+* Node.pm: Sanitise plugin names
+* Node.pm: Fix the fieldname sanitiser a bit
+* Node.pm: Better error message for empty plugin list (links to wiki)
+* If ntp_offset can read no values from ntpq, replace values with 'U'
+ to avoid master confusion.
+* New plugin for Squeezebox Duo: squeezebox_
+* Add plugin for connected PostgreSQL users.
+* Cosmetic changes in munin-cron script to make it more failure obvious
+ and and clearify the ordering
+* Minimal modularization of munin-html, munin-graph and munin-limits - now
+ half suited to include in munin-fastcgi-graph if we want to
+* And a rather new Getopt::Long is needed for GetOptionsFromArray
+* Turns out that the // (and //=) operator is new to perl so remove all use
+* Add plugin for PostgreSQL tuple access count
+* Add plugin for Slony (PostgreSQL replication) node lag time
+* Add plugins for PostgreSQL scans (squential vs index)
+* Support connecting to non-default database in pg plugins
+* Support multiple parameters to pg plugins, using colon to separate
+ them.
+* Document max_graph_jobs and max_cgi_graph_jobs (see also the wiki).
+* Made munin-graph paralell (defaulting to 6 forked processes).
+ Adapted from 1.2 patch by Kjetil Homme. Many many thanks!
+* check whether javac works before using it, skip java plugins if not
+* pgsql: Properly apply filters to config query as well for wildcard plugins,
+ so we don't generate lots of nan fields in the graphs.
+* munin-html: Do not try to calculate png size, use geometry of the file
+ in the filesystem instead. This will cause a propagation delay -
+ image sizes _may_ be wrong, until munin-html runs again.
+* munin-graph: set m/a time of png to last modification time of the
+ corresponding rrd file
+* Adapt patch in #3 to current munin-cgi-graph for non-fastcgi. Closes #3.
+ Thanks to blueyed
+* Adapt patch in #3 to current munin-cgi-graph to obtain munin-fastcgi-graph
+* Install munin-fastcgi-graph
+* munin-update and family: Do not accpet hostnames outside [^-A-Za-z0-9].
+ Issue helpful error message if someone bumps into this.
+* Munin-node-configure: always do "exit 0" even when saying "no" because
+ it _is_ a normal exit and we do read the stdout.
+ Mass fix of plugins in trunk.
+* linux/cpuspeed: Documentation fixes and slight error-message enhancements
+* Changed the Max memory for the jmx_ plugins to default to a light color
+ (just like apache_processes free slots graph) as currently Max got a dark
+ blue color, making it hard to read graphs
+* Compile the java files with -target 1.5 and -source 1.5 so they will work
+ correctly on sun-java-1.5 and on (without this, when compiled using
+ openjdk/sun-1.6-jdk, they refuse to run on 1.5 jre
+* New vserver plugins adapted from Debian
+* New asterisk plugins adapted from Debian
+* ipmi_sensor_: Applied patch from http://bugs.debian.org/490093 so that
+ the graph scale always starts from zero
+* Add ipmi_sensor_ wildcard plugin from Debian branch, and POD it
+* Massive PODing of plugins for use with munindoc by Stig Sandbeck Mathisen
+ Many thanks!
+* New plugin: openvpn.in from debian, and POD it gently
+* Added the ability to customize the install location for the jmx java
+ library. As most distributions wont want it in the default munin libdir
+* munin-node-configure needs pass the list of plugin names through to
+ apply_wildcards() too. part of #718. thanks to knan for the report.
+* Munin-node: Clean up man-pages, and try and standardise common information
+ across all three applications.
+* Report errors against plugins with inconsistent/unexpected magic markers.
+* Java plugins written by FIX. Adapted for inclusion in munin by Erik
+ Bolsø, Tom Feiner nad Ilya Kikoin. THANKS!
+* Applied patch by Katriel Traum for snmp__memory that converts the plugin
+ to use Munin::Plugin::SNMP, and does some clean-ups
+* New plugin: nomadix_users_. Monitors a kind of enterprise wifi
+ infrastructure.
+* snmp__if_multi: Updated with some known bugs/enhancement needs as well as better author/copyright info
+* linux/ip_: Better support for IPv6. Patch by Rune Skillingstad, thanks!
+ Closes #563.
+* linux/if_* plugins: Even more virtual lan support. Patch by Rune
+ Skillingstad. Thanks. Closes #562.
+* amavis: Fix use of $MUNIN_MKTEMP as pr. #502. Should probably provide
+ a working function in plugin.sh or a better MUNIN_MKTEMP
+* apache_* plugins: Better error messages for diffetent kinds of LWP
+ errors (for example missing Crypt::SSLeay). Patch by Tom Feiner,
+ thanks! Closes Debian #542477 and Munin #710
+* ntp_ plugin: Provide error-message in english if plugin invoked
+ without recognized hostname in symlink
+* hddtemp_smartctl: Use --nocheck=standby if supported by smartctl.
+ Thanks for patch from marxarelli. Closes #715
+* note bug in amavis plugin in doc
+* linux/port_: Fix to allow more than 9999 connections. Patch from
+ Olav Kolbu, thanks! Closes #583
+* sendmail_mqilqueue: Correct queue count on sendmail with
+ HOST_STATUS/hoststat enabled. Thanks to andy for this. Closes #630
+* exim_mailqueue plugin now supports showing frozen messages and uses
+ prettier colours. Thanks to micha for the patch that was adapted!
+ Closes #107.
+* munin-node-configure: Some re-wording of the manual page, and remove
+ some obsolete dependencies on the --shell option.
+* Port munin_stats plugin to use the logtail functionality from
+ Munin::Plugin. Fixes #527. Thanks to janl for indirectly reminding me
+ that I'd never got round to committing this :-)
+* postfix_mailqueue: use postconf to find default spool path. Update
+ documentation and correct author (to "unknown").
+* Munin-node-configure: document M::N::SNMPConfig properly.
+* zimbra_: fix lucene_cachehit race condition with zmstat writer
+* Add new fail2ban plugin
+* munin-check: Updated copyright to Matthias Schmitz
+* Linux: ip_conntrack_max at new location in newer kernels.
+* Add zimbra_ (groupware) plugin
+* Added linux/diskstat_ plugin, from Michael Renner
+ http://blogs.amd.co.at/robe/2008/12/graphing-linux-disk-io-statistics-with-munin.html
+* Added logging for denied connection in munin-node. Closes #714
+* linux/sensros_: Fix error when no sensors execuatble is installed.
+ Merge from http://bugs.debian.org/491473
+* Merge fix for apc_nis.in from http://bugs.debian.org/511781 - The
+ config output by the apc_nis plugin includes: line_volt.max 200 Where
+ the normal mains voltage is higher (most of the world), this has the
+ effect of excluding the quantity from the generated graphs. The value
+ should be increased to at least 300.
+* tomcat_: all new plugin from laxis@magex.hu, deprecate tomcat_*
+* linux/iostat: Added stdout/stderr redirection, merge from debian bug
+ http://bugs.debian.org/512407
+* allow for : in plugin names to support IPv6, Merge from debian bug
+ http://bugs.debian.org/499391
+* Fixed typo in Munin::Plugin documentation, merged from debian bug:
+ http://bugs.debian.org/495003
+* linux/if_*: Added support for msh interfaces
+* linux: Changed df.in and df_inode.in to have nagios compatible graph
+ title, nagios doesnt like special chars in graph titles. (The same
+ patch from debian bug http://bugs.debian.org/472239)
+* add minimal ruby infrastructure
+* Added NetApp plugins from Guillaume Blairon
+* Add mysql_innodb plugin
+* Fix (now old) tomcat plugins
+* freebsd/df*, include nullfs in filesystem list. Patch from Cezary Morga.
+* linux/if_*: Fix vlan support
+* Make boolean parsing a bit more robust (case insensitive)
+* Fix cap protocol on server and node
+* - is also allowed in host names
+* Remove datafield length limit of 19 characters (the understanding of
+ this limit was based on obsolete documentation)
+* Document Munin::Master::Logger better
+* Make Munin::Master::Utils capable of logging
+* Make the pg plugins work properly when DBD::Pg is not present
+ (by saying they can't work).
+* Add slapd_* (OpenLDAP) plugins by Bjørn Ruberg
+* Add PGSQL plugin framework by Magnus Hagander, and some plugins
+* linux/iostat_ios: check if $ARGV[0] is defined to avoid "use of
+ uninitialized value" warnings. Thanks for the report to nicklock!
+ (Ticket #640)
+* postfix_mailstats: Don't fall back to a logfile we have already
+ determined not to exist. Thanks to Ulrik Haugen (Deb:#532876)!
+* freebsd/netstat: Match reset$ instead of reset. Closes #708 with
+ regards to trunk.
+* Add "make tags" target to make navigation easier.
+* linux/port_: Fix #500 better as suggested by Kolbu. Thanks!
+* linux/if_*: Recognize venet|veth interfaces in suggest code. Thanks to
+ "blueyed" for patch! Closes #591
+* Patch to allow master side overrides to work much better. Thanks for
+ patch from "mg"! Closes #588
+* plugins/hddtemp_smartctl: Apply autoconf patch from "qha" that only
+ autoconfigures the plugin if the first drive is autodetectable - or
+ configured. Thanks!
+* linux/cpuspeed: reversed Hz and % in one case, exclude "cpuidle",
+ only graph cpu[0-9]*
+* Documentation: mod_expiry => mod_expires
+* linux/cpu: As per a mailing list thread, change Linux cpu plugin to
+ not set max for any fields because recent kernels are inaccurate to
+ the point where a single field can edge just slightly over the
+ calculated max if it is using all of the processor time (for example,
+ the idle state can trigger this). Without removing the max, the
+ affected fields have gaps, creating confusing graphs.
+* Fix some brainos in apc_envunit_ plugin, make it more like autoconf'igurable
+* Fix sunos/df* plugins quite a bit
+* plugin.sh: Document print_warning better
+* Add a generic crontab for the munin user
+* Fixed longstanding bug in munin-node-configure which reversed list of
+ installed and new wildcard names for wildcard plugins - this has made
+ auto-reconfiguration of whildcard plugins impossible, and downright
+ dangerous if you used the --remove-also option
+* Fix sunos if_ and if_err_ to suggest correct interface names
+* Rename sunos if_errcoll_ to if_err_ to get in line with the other
+ architectures
+* The "setseid" keyword in munin-node.conf should be spelled "setsid" in
+ order to be understood by Net::Server. Since log_file is also set,
+ setsid is redundant, but it is now correctly redundant instead of
+ just ignored as garbage :)
+* Update allow/deny examples in munin-node.conf.in. Net::Server can use
+ CIDR if Net::CIDR is installed. Keep "allow" as default, so as not to
+ need additional dependencies on the default install.
+* linux/df: make tmpfs'es indexed by mountpoint rather than device.
+* Do "list $node" rather than "list $fetchdomain" when collecting node data.
+ (closes #699).
+* Make ./getversion work on Solaris 10 and other systems with old-style
+ /bin/sh (closes #700)
+* Remove special_(sum|stack) from allowed keywords list
+* Make graph_args --title "Foo bar" work as expected (closes #683)
+* Remove depreciated options special_stack and special_sum (replaced by
+ stack and sum ages ago)
+* Make "make install" behave slightly better and document problem with NFS
+* Add varnish_ plugin. Canonical version is to be found in varnish_ repo
+ at all times.
+* Detect rejects from postfix/cleanup, and not just rejects from postfix/smtpd
+ Thanks to Cedric Knight for patch.
+* sendmail_*: Suppress error output from which(1) when the mailstats binary
+ is missing.
+* Add missing documentation and config file option (see #567).
+* munindoc has been left out after r2126, which is wrong.
+* Fix bashisms in several plugins thanks to Raphael Geissert for the bug
+ and the patch. (Closes Debian bug #530147)
+* Various if_ plugins: fix typo found by Peter Schwindt, Debian #523765
+* synced redhat specfile to upstream so make rpm works again
+* Updated redhat's Makefile.config to be in sync with dist
+* ISO8859-1 specific (C) symbol removed
+* Corrected typo that left out man page for munin-update.
+* Fixed regression where MUNIN_* variables would not be exported
+* smart_: Fix brainfart wrt PLUGSTATE vs. STATEDIR and nico's email address
+* New version of smart_ plugin
+* Moved perl build functionality to Module::Build.
+* Sanitise fieldnames
+* Added the no-fixes test. Fixed failing test
+* Fixed Perl::Critic issues
+* More robust and consistent use of boolean configuration options
+* Removed deprecated configuration option: use_default_name
+* Removed unused cli option from docs
+* Unshift DEFs instead of pushing to fix a CDEF argument-ordering issue
+* Fix scope-issue+typo with $STATS
+* Use /opt as default target and move Makefile.config-dist to Makefile.config
+* Make [plugin] user-name evaluation lazy so that configuration for
+ unused plugins will not cause error messages.
+* Added capability negotiation to munin-update
+* Added tls README
+* Add a general man page hub for munin as requested in bugs.debian.org/517952
+* Add -w to munin-limits and fix warnings
+* Moved plugins to a separate folder
+* Moved docs into doc/
+* Add env.upsname and env.upsc settings to the nut_* node plugins
+* Added python oo plugin class by Morten Siebuhr as a contribution
+* nvidia_ plugin: Adapt some more to mainline plugin niceties
+* Applied patch from #669. Make munin-run use Munin::Node::Defaults.
+ Thanks to Matthew Boyle <mlb@decisionsoft.com> for the patch
+* Fixed getversion to handle git-svn usage
+* linux/quota_usage: Use clean_fieldname as needed. Bug discovered by ert256
+ Closes #645.
+* linux/sensors: Recognize negative temperatures. Fix by cnu. Thanks!
+ Closes #647
+* http_loadtime uses pipes and mktemp. Patch by ekohl. Thanks!
+* hddtemp_smartctl: Only check if device is standby for sd? and hd?
+ devices (it fails on raid devices). Patch by anonymous trac user. Thanks!
+* munin-graph: warn -> warning in two places - that will make graphs more
+ usefull - we hope - as noted by stevew@purdue.edu
+* Fix warn lines where warn is given as range (foo:bar). Patch by
+ stevew@purdue.edu. Thanks!
+* Fix get_[gu]id to correctly recognize numbers and strings. Patch by
+ ligne. Thanks!
+* Ignore Emacs and Joe temporary files
+* Protect graph rendering by semaphore too - as suggested by Snide in a
+ patch. Closes #657.
+* More typo fixes from linge. Closes #659, #658. Thanks!
+* Apply patch from #660, fix typos in error messages in munin-node. Many
+ thanks to ligne
+* postfix_mailstats: More explicit error messages. Patch by kuriyama. Thanks!
+* munin-cgi-graph: Check returnvalue of sem* functions in the correct manner
+* apache_processes: Graph free process slots, and provide explicit colours
+ to make it prettier. Patch by TTimo - thanks a lot!
+* linux/df_abs: need bash to compute correctly
+* Fix #619 - error in comment
+* Move munin-node-configure-snmp to @@LIBDIR@@ - it should not be called
+ directly
+* Align snmp__if_ and snmp__if_err_ and remove filter on what kinds of
+ interfaces they catch.
+* snmp__if_multi: Structure the multigraph namespace somewhat and add
+ some helpfull comments for the future programmer.
+* snmp__if_multi: A first multigraph plugin - now we just have to make
+ munin understand it...
+* Port snmp__if_err_ to Munin::Plugin::SNMP - it still needs aligning with
+ snmp__if_ so that interface names will match and so on.
+* Port snmp__swap to Munin::Plugin::SNMP - also change base to 1024
+ as this is memory which is accounted for in powers of 2
+* Port snmp__winload to Munin::Plugin::SNMP
+* Transplant get_by_regex to Munin::Plugin::SNMP and change
+ snmp__netstat to match
+* Port snmp__netstat to Munin::Plugin::SNMP
+* node.d/smart_ documentation contributed by Gabriele Pohl. Thanks!
+* Extend SNMP plugin documentation with a "MIB INFORMATION" header.
+* Start a separate program to test Munin::Plugin functions
+* snmp__if_ plugin can now use 64 bit byte counters if they are available.
+ Added extensive texts in documentation and graph_info about the problems
+ with 32 bit counters and made it explicit if 64 bit counters are
+ available.
+* Add option --pidebug for plugin debugging to munin-run and munin-node.
+ Exports setting through the environment variable MUNIN_DEBUG. Also
+ introduce these in the usage texts. Far from all plugins support this
+ setting.
+* Make Munin::Plugin::scaleNumber and use it in snmp__if_ plugin
+* Port snmp__if_ to Munin::Plugin::SNMP, document, and refine
+* Fix a typo in Munin::Plugin::SNMP - now verified with authenticated SNMPv3
+* Extend Munin::Plugin::SNMP to support SNMP v3
+* Install Munin::Plugin::SNMP, a general generic interface for taking away
+ the boring bits in SNMP plugins. Many thanks for Ilmari for his work
+ on this module.
+* Port snmp__uptime to use Munin::Plugin::SNMP and document it nicely.
+* Do not kluge lines with rrd 1.3 - the lines in 1.3 are nice and precise
+* Apply RRD 1.3 patch from 1.2 series - Many thanks to matthias!
+* Start using Log::Log4perl
+* Add test-case plugins in conjunction with munin-gather work
+ (note: munin-gather is not completed and is semi abandoned at the time
+ of 1.4.0 release)
+* dhcp3 plugin: Document and credit to Rune N. Skillingstad
+* Remove --force-root. It's silly and causes naught but problems.
+ Added text in the root error message about how to su to munin.
+* Add a script to compute n'th percentile. Needs some munin-update
+ extentions to work.
+* munin_get_loc: Fix premature exit - patch by Joe Damato
+* This may fix the double legend headers bug
+* Clearify the autoconf "no" from linux/swap
+* Remove max field from samba config - patch by Kozik
+* linux/iostat: Introduce environment variable SHOW_NUMBERED to show
+ sda<n> in environments where this is wanted
+* Update postfix_mailqueue plugin to pull warning/critical values from
+ the environment.
+* linux/iostat_ios reformed to use seconds (avoiding milli-milli-seconds),
+ added graph_info and munin-doc documentation
+* Introduce SSPOOLDIR for munin-gather's use
+* Slightly update docs of apache plugins
+* Add haproxy_ plugin contributed by Jimmy Olsen
+* Add found nginx plugins - after some cosmetic work
+* Fixup debug output in munin-limits (Brian De Wolf)
+* Add pipe and pipe_command in keyword list in Munin.pm (Brian De Wolf)
+* Fill message structure in munin-limits correctly (Brian De Wolf)
+* Enhanced DEBUG consistency in munin-graph (Patch by Brian De Wolf, thanks)
+* freebsd/netstat: Correct absolute path to netstat program
+* freebsd/memory and vmstat: hardcode absolute paths for awk, bc,
+ netstat, ps and vmstat
+* Lets munin-run print out its usage if its called without a plugin
+ parameter. This avoids a lot of "Use of uninitialized value $ARGV[0]
+ in regexp compilation at /usr/sbin/munin-run line .." messages and
+ closes Debian #416478
+* linux/df: let make insert the right configuration directory in the
+ documentation
+* Make fix for OS X 10.5 by George Barnett - thanks
+* Received hpux df plugins with munindoc - thanks again
+* hp-ux: Added df plugins based on the bdf command - contributed by
+ Chris Gardner
+* linux/iostat_ios: Bugfix by Philipp Niemann to get it working. Thanks!
+* Node/plugin.sh: Patch by Philipp Niemann to limit field names to 19
+ characters (removed as of release of 1.4 as munin actually handles this)
+* Munin-html: Patch to relative path calculation for graph borrowing by
+ Phillip Niemann.
+* Makefile: Correctly locate magic markers - patch by Philipp Niemann
+* Munin-html: Added borrowing of whole groups, through group_order.
+* Plugin.pm/Plugin.sh: Fix up the thresholds functions
+* munin-check: ignore lost+found directories
+* Added new option "group_order" to order groups/graphs at any level.
+* sh-mode, not shell-mode for plugin.sh.in
+* Update FSF address in copyright notices
+* Added plugin to graph haproxy backend usage.
+* Munin::Plugin support for max value settings, patch by Brian De Wolf.
+ Thanks a lot!
+* munin-check: Replace "munin" by "@@USER@@", patch from Pedro Melo, thanks
+* freebsd/systat, new plugin showing interrupts and context switches
+* freebsd/iostat: New plugin
+* node.d/dhcpd3: Parse "include" statements, patch by Walter Huf
+* smart_: Update Nico Stranskys email address
+* SuSE cron.d/munin mentioned munin-nagios, a obsoleted part of munin.
+* Clearify the purpose of DESTDIR
+* plugin qmail-qstat now uses a single pipe to generate all output
+* new plugin: qmailqstat contributed by Nils Breunese
+Add an eval to $DF to expand the string to arguments.
+* And a changelog for 1.3.4 too
+* Update RELEASE and plugins.history for 1.3.4
+
munin (1.3.4, r1277:1560, 8/3/2008)
* New acpi thermal_zone plugin
@@ -156,7 +695,7 @@
* Rename munin_set_var -> munin_set for consistency purposes.
* Fetch services directly after config, to make use of OS caches.
* Bugfix: .graph was ignored in some cases in munin-html, ending in
- trying to show nonexistant graphs.
+ trying to show nonexistent graphs.
* postfix_mailvolume: multiple fixes for problems found in sibling
exim_mailstats plugin:
- Use english to communicate errors (not exit statuses)
@@ -474,7 +1013,7 @@
* Docs: Added man page for munin-node-configure-snmp.
* Docs: Brushed up the comments in the default munin.conf a bit (Deb#294060).
* Docs: Fixed erronous cgiurl docs (SF#1159722).
- * Installation: Create CIGdir if nonexistant.
+ * Installation: Create CIGdir if nonexistent.
munin (1.3.1)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/Checklist
^
|
@@ -7,17 +7,24 @@
* Update node/plugins.history.in:
- 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 -c 25- | cut -d. -f1 | sort -u
+ 1. cd plugins
- * Check if the listed plugins are still present (or moved):
+ 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.//'
- svn --verbose log -r910:1234 | fgrep node.d | grep -w A |
- cut -c 18- | cut -d' ' -f1 | xargs ls -ld
+ 3. Check if the listed plugins are still present (or moved):
+
+ svn --verbose log -r910:1234 | fgrep node.d | grep -w A |
+ cut -d/ -f 4- | sed s'/(.*//' | xargs ls -ld >/dev/null
* Update ChangeLog
* cd ..; svn cp svn://janl@munin.projects.linpro.no/munin/trunk \
svn://janl@munin.projects.linpro.no/munin/tags/1.3.4
+
+ * Update RELEASE in the tag
+
+ * make tar
+
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/HACKING.pod
^
|
@@ -35,11 +35,7 @@
=item B<install>
-Before trying to use the install script from a source tree you need to
-
- make build
-
-To make a clean (re)build of the sandbox
+To make a clean rebuild of the sandbox
./dev_scripts/install 1
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/INSTALL
^
|
@@ -3,9 +3,12 @@
On all hosts:
-- A reasonable Perl5
+- A reasonable Perl 5
-- GNU Make - do not attempt to use any other make.
+- GNU Make - do not attempt to use any other make (build time only)
+
+- Module::Build - this is part of perl 5.10, for earlier Perls it must
+ be installed (build time only)
- The perl module Time::HiRes
@@ -28,8 +31,8 @@
- Text::Balanced
- Params::Validate
- TimeDate
- - Net::SNMP for SNMP autoconfiguration and plugins
- Net::SSLeay if you want to use SSL/TLS
+ - Getopt::Long 2.37 or later
- Log::Log4perl (which depends on
- IPC::Shareable
- Log::Dispatch
@@ -37,7 +40,7 @@
- MIME::Lite
- Mail::Sender
- Mail::Sendmail
- - MailTools
+ - MailTools)
- Developers/packagers: For testing
- Test::MockModule
@@ -52,9 +55,11 @@
Node:
-- Perl modules: Net::Server, Time::HiRes
+- Perl modules: Net::Server, Net::Server::Fork, Time::HiRes
+
+- Perl module Net::SNMP for SNMP autoconfiguration and plugins
-- All SNMP plugins use Net::SNMP
+- For SNMPv3: Perl modules Crypt::DES, Digest::SHA1, Digest::HMAC
- Net::SSLeay if you want to use SSL/TLS
@@ -66,11 +71,15 @@
package system).
-If you're missing some perl modules and they are not in your package
+If you're missing some Perl modules and they are not in your package
system it's recommended to use the cpan shell (as root) to install the
-needed ones:
+needed ones. There is a short cpan shell section at the bottom of
+this file if you do not know how to use it.
- perl -MCPAN -e shell
+Please note that BSD and Linux OSes such as Red Hat Enterprise Linux
+(and Cent OS), Fedora, Debian, Ubuntu, SuSE and others will have quite
+a few of these packages available to install with their standard
+install tools.
Installing
@@ -94,10 +103,13 @@
- Create the user "munin" and the group "munin" if these are
not made automatically. The user needs no shell and no
privileges. On most Linux systems the munin user's shell
- is /etc/nologin - but the user still needs to be able to
+ is the nologin shell (it has different paths on different
+ systems - but the user still needs to be able to
run cron jobs.
- - make
+ - make (do _NOT_ do "make install" directly, there is a bug
+ somewhere that will result in a very defective
+ Munin::Common::Defaults to be installed).
- make install
@@ -125,8 +137,8 @@
generation.
- Create a cron-entry to run "munin-cron" as the user "munin"
- every 5 minutes. See build/dists or build/resources for
- distribution-specific scripts.
+ every 5 minutes. See build/resources for generic or
+ build/dists for distribution-specific scripts.
- If you want to use the dynamic graphs: Configure the CGI
directory, you will find a Apache config example in
@@ -135,6 +147,7 @@
NOTE: Dynamic graphs are not exactly perfect. Se also
http://munin.projects.linpro.no/wiki/CgiHowto
+
To install a node:
- Edit Makefile.config to suite your needs.
@@ -158,10 +171,9 @@
- Start the node agent (as root) SBINDIR/munin-node.
You probably want to use an init-script instead and you
- might find a good one under dists/ or in the resources/
- directory (maybe you need to edit the init script, check the
- given paths in the script you might use).
-
+ might find a good one under build/dists or in the
+ build/resources/ directory (maybe you need to edit the init
+ script, check the given paths in the script you might use).
For further build alternatives, see Makefile.
@@ -194,3 +206,54 @@
which is not already in the package, please send us a copy of them, so
we can add them for others to use. We'd also be happy if you sent us
any new plugins on systems already in the package.
+
+
+Using CPAN shell
+================
+
+If your OS does not provide all the needed perl packages they can be
+intalled by a perl installation tool called CPAN-Shell. There is
+ample documentation about it on the web, but here is a brief tour.
+
+As root execute:
+
+ # perl -MCPAN -e shell
+
+The first time you run this you are interviewed about various things.
+Answer the questions, you can probably answer blank on any you do not
+understand.
+
+You will then be presented with a CPAN prompt (cpan>) . From this
+prompt you type:
+
+ cpan> install Time::HiRes
+
+You could also do it one at a time like this:
+
+ # perl -MCPAN -e 'install Time::HiRes'
+
+Do the same for all modules needed. E.g.,
+
+ install Time:HiRes
+ install Storable
+ install Digest::MD5
+ install Text::Balanced
+
+and so on.
+
+If you need to install Munin on a host with no Internet access you can
+use CPAN shell on a host _with_ Internet access and use the "get"
+command to retrive the needed modules. One problem: The dependencies
+of modules will change over time so the list above may not be correct
+6 months after it was last updated. SO: If you want to make sure you
+get all the needed modules you can do a full install of munin on a
+Internet connected system and then transfer all the modules to the
+non-connected system after. All the modules that the CPAN shell
+retrived can be found like this:
+
+ # cd ~/.cpan/sources
+ # find . -name '*.tar.gz
+ ./authors/id/G/GA/GAAS/Digest-MD5-2.39.tar.gz
+ ...
+
+Now just make sure the sources directory is empty before you begin.
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/Makefile
^
|
@@ -2,7 +2,7 @@
#
# Gnu make only. Seriously.
#
-# $Id: Makefile 2763 2009-10-29 14:45:27Z knan $
+# $Id: Makefile 2951 2009-11-10 20:13:54Z knuthaug $
# Defaults/paths. Allows $(CONFIG) to be overrided by
# make command line
@@ -22,12 +22,11 @@
PLUGINS := $(wildcard plugins/node.d.$(OSTYPE)/* plugins/node.d/*)
MANCENTER := "Munin Documentation"
MAN8 := master/_bin/munin-graph master/_bin/munin-update \
- master/_bin/munin-limits master/_bin/munin-html \
- master/_bin/munin-gather
+ master/_bin/munin-limits master/_bin/munin-html
PODMAN8 := master/doc/munin-cron master/doc/munin master/doc/munin-check
PODMAN5 := master/doc/munin.conf node/doc/munin-node.conf
-.PHONY: install install-pre install-master-prime install-node-prime install-node-pre install-common-prime install-munindoc install-doc install-man \
+.PHONY: install install-pre install-master-prime install-node-prime install-node-pre install-common-prime install-doc install-man \
build build-common-prime build-common-pre build-doc \
source_dist \
test clean \
@@ -47,7 +46,7 @@
echo "Uninstall is not implemented yet"
# This removes the installed config so that the next install-pass installs
-# a new config. Target suitable for maintainers
+# a new config. Target _only_ suitable for maintainers.
unconfig:
rm -f $(HTMLDIR)/.htaccess
rm -f $(CONFDIR)/munin.conf
@@ -59,9 +58,9 @@
######################################################################
ifeq ($(JCVALID),yes)
-install: install-master-prime install-common-prime install-node-prime install-plugins-prime install-plugins-java install-man install-munindoc
+install: install-master-prime install-common-prime install-node-prime install-plugins-prime install-plugins-java install-man
else
-install: install-master-prime install-common-prime install-node-prime install-plugins-prime install-man install-munindoc
+install: install-master-prime install-common-prime install-node-prime install-plugins-prime install-man
endif
install-pre: Makefile Makefile.config
@@ -73,6 +72,7 @@
install-master-prime: $(INFILES_MASTER) install-pre install-master
mkdir -p $(CONFDIR)/templates
+ mkdir -p $(CONFDIR)/templates/partial
mkdir -p $(LIBDIR)
mkdir -p $(BINDIR)
mkdir -p $(PERLLIB)
@@ -83,14 +83,16 @@
$(CHOWN) $(USER) $(HTMLDIR) $(DBDIR)
- for p in build/master/www/*.tmpl; do \
+ for p in master/www/*.tmpl master/www/*.png master/www/*.css resources/favicon.ico; do \
$(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/ ; \
done
- $(INSTALL) -m 0644 master/www/logo.png $(CONFDIR)/templates/
- $(INSTALL) -m 0644 master/www/style.css $(CONFDIR)/templates/
+
+ for p in master/www/partial/*.tmpl; do \
+ $(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/partial/ ; \
+ done
+
$(INSTALL) -m 0644 master/www/definitions.html $(CONFDIR)/templates/
$(INSTALL) -m 0755 master/VeraMono.ttf $(LIBDIR)/
- $(INSTALL) -m 0644 resources/favicon.ico $(HTMLDIR)/
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)/
@@ -101,10 +103,11 @@
$(INSTALL) -m 0755 build/master/_bin/munin-graph $(LIBDIR)/
$(INSTALL) -m 0755 build/master/_bin/munin-html $(LIBDIR)/
$(INSTALL) -m 0755 build/master/_bin/munin-limits $(LIBDIR)/
- $(INSTALL) -m 0755 build/master/_bin/munin-gather $(LIBDIR)/
$(INSTALL) -m 0755 build/master/_bin/munin-cgi-graph $(CGIDIR)/
$(INSTALL) -m 0755 build/master/_bin/munin-fastcgi-graph $(CGIDIR)/
+# Not ready to be installed yet
+# $(INSTALL) -m 0755 build/master/_bin/munin-gather $(LIBDIR)/
# ALWAYS DO THE OS SPECIFIC PLUGINS LAST! THAT WAY THEY OVERWRITE THE
# GENERIC ONES
@@ -125,15 +128,10 @@
$(CHMOD) 0755 $(CONFDIR)/plugin-conf.d
for p in build/plugins/node.d/* build/plugins/node.d.$(OSTYPE)/* ; do \
- if test -f "$$p" ; then \
- family=`sed -n 's/^[[:space:]]*#%# family=\(.*\)$$/\1/p' $$p`;\
- test "$$family" || family=contrib; \
- if echo $(INSTALL_PLUGINS) | \
- grep $$family >/dev/null; then \
- echo Installing $$p; \
- $(INSTALL) -m 0755 $$p $(LIBDIR)/plugins/; \
- fi; \
- fi \
+ if test -f "$$p" ; then \
+ echo Installing $$p; \
+ $(INSTALL) -m 0755 $$p $(LIBDIR)/plugins/; \
+ fi \
done
-mv $(LIBDIR)/plugins/*.adv $(LIBDIR)
$(INSTALL) -m 0644 build/plugins/plugins.history $(LIBDIR)/plugins/
@@ -175,17 +173,12 @@
$(INSTALL) -m 0644 COPYING $(DOCDIR)/
$(INSTALL) -m 0644 build/resources/* $(DOCDIR)/resources
-install-munindoc: build
- mkdir -p $(BINDIR)
- $(INSTALL) -m 0755 build/node/bin/munindoc $(BINDIR)/
-
-
######################################################################
ifeq ($(JCVALID),yes)
-build: $(INFILES) build-master build-common-prime build-node build-plugins-java build-man
+build: $(INFILES) build-master build-common-prime build-node build-plugins build-plugins-java build-man
else
-build: $(INFILES) build-master build-common-prime build-node build-man
+build: $(INFILES) build-master build-common-prime build-node build-plugins build-man
endif
build/%: %.in
@@ -404,6 +397,10 @@
build-%: %/Build
cd $* && $(PERL) Build
+build-common: common/Build
+ cd common && $(PERL) Build && rm -f common/blib/lib/Munin/Common/Defaults.pm && true
+
+
# BUG: the Build script writes files under PWD when it does "install"
# can't seem to find a way to persuade it to write otherwhere.
install-%: %/Build
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/Makefile.config
^
|
@@ -10,6 +10,10 @@
# DESTDIR is empty during building, and optionally set to point to
# a shadow tree during make install.
+# Note: There is a need for a VARDIR, with DBDIR, PLUGSTATE, HTMLDIR
+# and LOGDIR as subdirectories. Today, DBDIR contains configured
+# domains, as well as PLUGSTATE, and we risk collisions.
+
#
# the base of the Munin installation.
#
@@ -34,8 +38,8 @@
LIBDIR = $(PREFIX)/lib
# Server only - Output directory
-HTMLDIR = $(PREFIX)/var/www/munin
-CGIDIR = $(HTMLDIR)/cgi
+HTMLDIR = $(PREFIX)/www/docs
+CGIDIR = $(PREFIX)/www/cgi
# Server only - spool directory for data gathered from nodes by
# munin-gather - experimental. Place on ramdisk to make munin
@@ -55,7 +59,7 @@
PLUGSTATE = $(DBDIR)/plugin-state
# Where Munin should place its logs.
-LOGDIR = $(DESTDIR)/var/log/munin
+LOGDIR = $(PREFIX)/log/munin
# Location of PID files and other statefiles. On the server, must be
# writable by the user "munin".
@@ -123,24 +127,24 @@
# These will work on most modern OSes:
#
GETENT := $(shell which getent || which true 2>/dev/null)
-CHECKUSER := $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
-CHECKGROUP := $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+CHECKUSER := $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
+CHECKGROUP := $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
# For OSX, comment out the previous two lines and comment in these
#
-#CHECKUSER := $(shell nicl . -read /users/$(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
-#CHECKGROUP := $(shell nicl . -read /groups/$(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+#CHECKUSER := $(shell nicl . -read /users/$(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
+#CHECKGROUP := $(shell nicl . -read /groups/$(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
# For OSX 10.5 (Leopard), use the following two lines instead of what's above
#
-#CHECKUSER := $(shell dscl . -read /Users/$(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
-#CHECKGROUP := $(shell dscl . -read /Groups/$(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+#CHECKUSER := $(shell dscl . -read /Users/$(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
+#CHECKGROUP := $(shell dscl . -read /Groups/$(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
# For HP-UX, use these instead:
#
-#CHECKUSER := $(shell pwget -n $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
-#CHECKGROUP := $(shell grget -n $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+#CHECKUSER := $(shell pwget -n $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
+#CHECKGROUP := $(shell grget -n $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
CHOWN := chown
CHMOD := chmod
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/Makefile.config-maint
^
|
@@ -100,8 +100,8 @@
# Which command to use to check if the USER and GROUP to run Munin as, exists.
GETENT := $(shell which getent || which true 2>/dev/null)
-CHECKUSER := $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
-CHECKGROUP := $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+CHECKUSER := $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
+CHECKGROUP := $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
CHOWN := chown
CHMOD := chmod
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/common/lib/Munin/Common/Config.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Common::Config;
-# $Id: Config.pm 2744 2009-10-28 11:41:39Z janl $
+# $Id: Config.pm 2903 2009-11-07 12:27:28Z knuthaug $
use warnings;
use strict;
@@ -8,8 +8,11 @@
use Carp;
use English qw(-no_match_vars);
+# Functions here are unable to log as they don't know if they're used
+# by the node or the master which use divergent logging facilities.
+
my @legal = ("tmpldir", "ncsa", "ncsa_server", "ncsa_config", "rundir",
- "dbdir", "logdir", "htmldir", "include", "domain_order", "node_order",
+ "dbdir", "logdir", "htmldir", "includedir", "domain_order", "node_order",
"graph_order", "graph_sources", "fork", "graph_title", "create_args",
"graph_args", "graph_vlabel", "graph_vtitle", "graph_total",
"graph_scale", "graph", "update", "host_name", "label", "cdef", "draw",
@@ -28,7 +31,7 @@
"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",
+ "unknown_limit", "notify_countdown", "dropdownlimit",
);
my %legal_expanded = map { $_ => 1 } @legal;
@@ -56,19 +59,18 @@
$config_file ||= $self->{config_file};
open my $file, '<', $config_file
- or croak "Cannot open '$config_file': $OS_ERROR";
+ or croak "ERROR: Cannot open '$config_file': $OS_ERROR";
# Note, parse_config is provided by node or master specific config class
eval {
$self->parse_config($file);
};
if ($EVAL_ERROR) {
- die "Failed to parse config file '$config_file': $EVAL_ERROR";
+ croak "ERROR: Failed to parse config file '$config_file': $EVAL_ERROR";
}
close $file
- or die "Cannot close '$config_file': $OS_ERROR";;
-
+ or croak "Cannot close '$config_file': $OS_ERROR";
}
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/common/lib/Munin/Common/Defaults.pm
^
|
@@ -4,7 +4,7 @@
# If you change the class path take a look in get_defaults too, please!
package Munin::Common::Defaults;
-# $Id: Defaults.pm 2466 2009-09-23 11:28:19Z knan $
+# $Id: Defaults.pm 2951 2009-11-10 20:13:54Z knuthaug $
use English qw(-no_match_vars);
use File::Basename qw(dirname);
@@ -15,6 +15,8 @@
my $COMPONENT_ROOT = dirname(__FILE__) . '/../../..';
+our $DROPDOWNLIMIT = 1;
+
our $MUNIN_PREFIX = '';
our $MUNIN_CONFDIR = "$COMPONENT_ROOT/t/config/";
our $MUNIN_BINDIR = '';
|
[-]
[+]
|
Deleted |
munin-1.4.tar.bz2/contrib/python-munin
^
|
-(directory)
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/contrib/python-plugin
^
|
+(directory)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/contrib/python-plugin/README
^
|
(renamed from contrib/python-munin/README)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/contrib/python-plugin/README
^
|
(renamed from contrib/python-munin/README)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/contrib/python-plugin/arp
^
|
(renamed from contrib/python-munin/arp)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/contrib/python-plugin/arp
^
|
(renamed from contrib/python-munin/arp)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/contrib/python-plugin/munin.py
^
|
(renamed from contrib/python-munin/munin.py)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/contrib/python-plugin/munin.py
^
|
(renamed from contrib/python-munin/munin.py)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/contrib/python-plugin/setup.py
^
|
(renamed from contrib/python-munin/setup.py)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/contrib/python-plugin/setup.py
^
|
(renamed from contrib/python-munin/setup.py)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/contrib/python-plugin/test.py
^
|
(renamed from contrib/python-munin/test.py)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/contrib/python-plugin/test.py
^
|
(renamed from contrib/python-munin/test.py)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/dev_scripts/start_munin-node
^
|
@@ -12,4 +12,4 @@
else
env PERL5LIB=$DESTDIR/$PERLSITELIB $DESTDIR/opt/munin/sbin/munin-node "$@"
fi
-tail -f $DESTDIR/var/log/munin/munin-node.log
+tail -f $DESTDIR/opt/munin/log/munin/munin-node.log
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/dists/freebsd/munin-main/files/patch-Makefile.config
^
|
@@ -77,10 +77,10 @@
# Which command to use to check if the USER and GROUP to run Munin as, exists.
-GETENT = $(shell which getent || which true 2>/dev/null)
--CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
--CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
-+CHECKUSER:= $(shell grep $(USER) /etc/passwd >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
-+CHECKGROUP:= $(shell grep $(GROUP) /etc/group >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+-CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
+-CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
++CHECKUSER:= $(shell grep $(USER) /etc/passwd >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
++CHECKGROUP:= $(shell grep $(GROUP) /etc/group >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
CHOWN = chown
CHMOD = chmod
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/dists/freebsd/munin-node/files/patch-Makefile.config
^
|
@@ -77,10 +77,10 @@
# Which command to use to check if the USER and GROUP to run Munin as, exists.
-GETENT = $(shell which getent || which true 2>/dev/null)
--CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
--CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
-+CHECKUSER:= $(shell grep $(USER) /etc/passwd >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
-+CHECKGROUP:= $(shell grep $(GROUP) /etc/group >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+-CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
+-CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
++CHECKUSER:= $(shell grep $(USER) /etc/passwd >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
++CHECKGROUP:= $(shell grep $(GROUP) /etc/group >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
CHOWN = chown
CHMOD = chmod
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/dists/redhat/Makefile.config
^
|
@@ -25,8 +25,8 @@
GROUP = munin
PLUGINUSER = nobody
GETENT = $(shell which getent || which true 2>/dev/null)
-CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
-CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
+CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
DOCDIR = $(PREFIX)/share/doc/munin-$(VERSION)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/dists/redhat/munin.cron.d
^
|
@@ -5,4 +5,3 @@
MAILTO=root
*/5 * * * * munin test -x /usr/bin/munin-cron && /usr/bin/munin-cron
-14 10 * * * munin test -x /usr/share/munin/munin-limits && /usr/share/munin/munin-limits --force --contact nagios --contact old-nagios
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/Build.PL
^
|
@@ -17,6 +17,7 @@
'Storable' => 0,
'Text::Balanced' => 0,
'Time::HiRes' => 0,
+ 'Getopt::Long' => '2.37',
#'Munin::Common' => 0,
},
build_requires => {},
|
[-]
[+]
|
Changed |
munin-1.4.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 2734 2009-10-28 00:48:10Z janl $
+# $Id: munin-cgi-graph.in 2975 2009-11-13 07:47:30Z 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.
@@ -177,7 +177,7 @@
my $service = shift;
my $scale = shift;
- return "$config->{'htmldir'}/$domain/$name-$service-$scale.png";
+ return "$config->{'htmldir'}/$domain/$name/$service-$scale.png";
}
@@ -293,7 +293,7 @@
my @params = ($GRAPHER);
push @params, @$scale;
- push @params, "--skip-locking", "--skip-stats", "--nolazy";
+ push @params, "--skip-locking", "--skip-stats", "--nolazy", "--list-images";
push @params, "--host", $host, "--service", $serv;
push @params, "STDERR>&STDOUT";
@@ -306,6 +306,7 @@
exec @params;
}
$file = join (' ', <$IN>);
+ chomp($file);
close ($IN);
sem_release();
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/_bin/munin-cron.in
^
|
@@ -14,4 +14,6 @@
nice @@LIBDIR@@/munin-graph --cron $@ 2>&1 |
fgrep -v "*** attempt to put segment in horiz list twice"
+wait
+
nice @@LIBDIR@@/munin-html $@ || exit 1
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/_bin/munin-graph.in
^
|
@@ -1,7 +1,7 @@
#!@@PERL@@
# -*- cperl -*-
-=comment
+=begin comment
Copyright (C) 2002-2009 Jimmy Olsen, Audun Ytterdal, Kjell Magne Øierud,
Nicolai Langfeldt, Linpro AS, Redpill Linpro AS and others.
@@ -20,7 +20,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-$Id: munin-graph.in 2746 2009-10-28 14:22:41Z janl $
+$Id: munin-graph.in 2906 2009-11-07 20:38:22Z knuthaug $
+
+=end comment
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/_bin/munin-html.in
^
|
@@ -1,7 +1,7 @@
#!@@PERL@@
# -*- cperl -*-
-=comment
+=begin comment
Copyright (C) 2002-2009 Jimmy Olsen, Audun Ytterdal, Kjell Magne
Øierud, Nicolai Langfeldt, Linpro AS, Redpill Linpro AS and others.
@@ -20,7 +20,9 @@
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-html.in 2759 2009-10-29 14:12:58Z janl $
+$Id: munin-html.in 2802 2009-11-02 11:45:04Z janl $
+
+=end comment
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/_bin/munin-limits.in
^
|
@@ -1,524 +1,42 @@
-#!@@PERL@@ -w
-# -*- perl -*-
-# Copyright (C) 2004-2008 Jimmy Olsen
-#
-# 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: munin-limits.in 2143 2009-04-30 10:00:43Z kjellm $
+#!@@PERL@@
+# -*- cperl -*-
-use strict;
+=begin comment
-use Munin::Master::Logger;
-use Munin::Master::Utils;
-use POSIX qw(strftime);
-use Getopt::Long;
-use Time::HiRes;
-use Text::Balanced qw (extract_multiple extract_delimited
- extract_quotelike extract_bracketed);
-use Log::Log4perl qw (:easy);
-
-my $MDEBUG=0;
-my $conffile = "@@CONFDIR@@/munin.conf";
-my $do_usage = 0;
-my @limit_hosts = ();
-my @limit_services = ();
-my @limit_contacts = ();
-my $stdout = 0;
-my %notes = ();
-my $force = 0;
-my %default_text = ( "default" => '${var:group} :: ${var:host} :: ${var:graph_title}${if:cfields \n\tCRITICALs:${loop<,>:cfields ${var:label} is ${var:value} (outside range [${var:crange}])${if:extinfo : ${var:extinfo}}}.}${if:wfields \n\tWARNINGs:${loop<,>:wfields ${var:label} is ${var:value} (outside range [${var:wrange}])${if:extinfo : ${var:extinfo}}}.}${if:ufields \n\tUNKNOWNs:${loop<,>:ufields ${var:label} is ${var:value}${if:extinfo : ${var:extinfo}}}.}${if:fofields \n\tOKs:${loop<,>:fofields ${var:label} is ${var:value}${if:extinfo : ${var:extinfo}}}.}\n',
- "nagios" => '${var:host}\t${var:graph_title}\t${var:worstid}\t${strtrunc:350 ${if:cfields CRITICALs:${loop<,>:cfields ${var:label} is ${var:value} (outside range [${var:crange}])${if:extinfo : ${var:extinfo}}}.}${if:wfields WARNINGs:${loop<,>:wfields ${var:label} is ${var:value} (outside range [${var:wrange}])${if:extinfo : ${var:extinfo}}}.}${if:ufields UNKNOWNs:${loop<,>:ufields ${var:label} is ${var:value}${if:extinfo : ${var:extinfo}}}.}${if:fofields OKs:${loop<,>:fofields ${var:label} is ${var:value}${if:extinfo : ${var:extinfo}}}.}}',
- "old-nagios" => '${var:host}\t${var:plugin}\t${var:worstid}\t${strtrunc:350 ${var:graph_title}:${if:cfields CRITICALs:${loop<,>:cfields ${var:label} is ${var:value} (outside range [${var:crange}])${if:extinfo : ${var:extinfo}}}.}${if:wfields WARNINGs:${loop<,>:wfields ${var:label} is ${var:value} (outside range [${var:wrange}])${if:extinfo : ${var:extinfo}}}.}${if:ufields UNKNOWNs:${loop<,>:ufields ${var:label} is ${var:value}${if:extinfo : ${var:extinfo}}}.}${if:fofields OKs:${loop<,>:fofields ${var:label} is ${var:value}${if:extinfo : ${var:extinfo}}}.}}'
- );
-
-my $log = new IO::Handle;
-
-# Get options
-$do_usage=1 unless
- GetOptions ( "host=s" => \@limit_hosts,
- "service=s" => \@limit_services,
- "contact=s" => \@limit_contacts,
- "config=s" => \$conffile,
- "debug!" => \$MDEBUG,
- "stdout!" => \$stdout,
- "force!" => \$force,
- "help" => \$do_usage );
-
-if ($do_usage) {
- print "Usage: $0 [options]
-
-Options:
- --help View this message.
- --debug View debug messages.
- --stdout Log to stdout as well as the log file.
- --force Send messages even if they shouldn't normally be sent.
- --service <service> Limit notified services to <service>. Multiple
- --service options may be supplied.
- --host <host> Limit notified hosts to <host>. Multiple --host
- options may be supplied.
- --contact <contact> Limit notified contacts to <contact>. Multiple
- --contact options may be supplied.
- --config <file> Use <file> as configuration file.
- [/etc/munin/munin.conf]
-
-";
- exit 0;
-}
-
-if ($> == 0) {
- print "This program will easily break if you run it as root as you are
-trying now. Please run it as user '@@USER@@'. The correct 'su' command
-on many systems is 'su - munin --shell=/bin/bash'
-Aborting.\n\n";
- exit (1);
-}
-
-my $config = &munin_config ($conffile);
-
-logger_open($config->{'logdir'});
-logger_debug() if $MDEBUG;
-
-my $oldnotes = &munin_readconfig ($config->{'dbdir'}."/limits", 1, 1);
-my $modified=0;
-
-logger("Starting munin-limits, checking lock");
-munin_runlock("$config->{rundir}/munin-limits.lock");
-logger("Created lock: $config->{rundir}/munin-limits.lock");
-
-my $update_time = Time::HiRes::time;
-
-if (!defined $config->{'contact'}->{'nagios'}->{'command'} and
- defined $config->{'nsca'}) {
- $config->{'contact'}->{'old-nagios'}->{'command'} = "$config->{nsca} $config->{nsca_server} -c $config->{nsca_config} -to 60";
- $config->{'contact'}->{'old-nagios'}->{'always_send'} = "critical warning";
-}
-if (!defined $config->{'contact'}->{'nagios'}->{'always_send'}) {
- $config->{'contact'}->{'nagios'}->{'always_send'} = "critical warning";
-}
-
-my $defaultcontacts = munin_get ($config, "contacts", "");
-if (!length $defaultcontacts) {
- my @tmpcontacts = ();
- foreach my $cont (@{munin_get_children ($config->{"contact"})}) {
- if (munin_get ($cont, "command")) {
- push @tmpcontacts, munin_get_node_name ($cont);
- }
- }
- $defaultcontacts = join (' ', @tmpcontacts);
-}
-munin_set_var_loc ($config, ["contacts"], $defaultcontacts);
-
-DEBUG ("Debug: Set default \"contacts\" to \"$defaultcontacts\"");
-
-# Make array of what needs to be checked
-my %work_hash_tmp;
-my $work_array = [];
-foreach my $workfield (@{munin_find_field ($config, qr/^(critical|warning|crit|warn)/)}) {
- my $parent = munin_get_parent ($workfield);
- if (!defined $work_hash_tmp{$parent}) {
- $work_hash_tmp{$parent} = 1;
- push @$work_array, $parent;
- }
-}
-
-# Process array containing services we need to check
-foreach my $workservice (@$work_array) {
- process_service ($workservice);
-}
+Copyright (C) 2004-2008 Jimmy Olsen
-&munin_writeconfig ("$config->{dbdir}/limits", \%notes);
+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.
-$update_time = sprintf ("%.2f",(Time::HiRes::time - $update_time));
+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.
-munin_removelock("$config->{rundir}/munin-limits.lock");
+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.
-logger("munin-limits finished ($update_time sec)");
+$Id: munin-limits.in 2820 2009-11-03 12:03:34Z janl $
-exit 0;
+=end comment
+
+=cut
+
+use warnings;
+use strict;
+
+use Munin::Master::LimitsOld;
-sub process_service {
- my $hash = shift || return;
- my $parentobj = munin_get_parent ($hash);
- my $gparentobj = munin_get_parent (munin_get_parent ($hash));
- my $service = munin_get_node_name ($hash);
- my $parent = munin_get_node_name ($parentobj);
- my $gparent = munin_get_node_name ($gparentobj);
- my $children = munin_get_children ($hash);
-
- return if (@limit_services and !grep (/^$service$/, @limit_services));
-
- DEBUG ("Debug: processing service: $service");
-
- # Some fields that are nice to have in the plugin output
- $hash->{'fields'} = join (' ', map { munin_get_node_name ($_) } @$children);
- $hash->{'plugin'} = $service;
- $hash->{'graph_title'} = $hash->{'notify_alias'} if defined $hash->{'notify_alias'};
- $hash->{'host'} = munin_get ($parentobj, "notify_alias", $parent);
- $hash->{'group'} = munin_get ($gparentobj, "notify_alias", $gparent);
- $hash->{'worst'} = "ok";
- $hash->{'worstid'} = 0 unless defined $hash->{'worstid'};
-
- foreach my $field (@$children) {
- next if (!defined $field or ref ($field) ne "HASH");
- my $fname = munin_get_node_name ($field);
- my $fpath = munin_get_node_loc ($field);
- my $onfield = munin_get_node ($oldnotes, $fpath);
-
- my ($warn, $crit, $unknown_limit) = get_limits ($field);
-
- # Skip fields without warning/critical definitions
- next if (!defined $warn and !defined $crit);
-
- DEBUG ("Debug: processing field: ".join ('::', @$fpath));
-
- my $filename = munin_get_rrd_filename ($field);
- my $value = munin_fetch("$filename");
- # De-taint.
- if (!defined $value) {
- $value = "unknown";
- } else {
- $value = sprintf "%.2f",$value;
- }
-
- # Some fields that are nice to have in the plugin output
- $field->{'value'} = $value;
- $field->{'crange'} = (defined $crit->[0]?$crit->[0]:"").":".(defined $crit->[1]?$crit->[1]:"");
- $field->{'wrange'} = (defined $warn->[0]?$warn->[0]:"").":".(defined $warn->[1]?$warn->[1]:"");
- DEBUG ("Debug: value: ". join ('::', @{munin_get_node_loc ($hash)}) .
- ": $value (crit: ".$field->{'crange'}.") (warn: ".$field->{'wrange'}.")");
-
- 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"} ? "unknown: " . $field->{"extinfo"} : "Value is unknown."));
-
- if (!defined $onfield or !defined $onfield->{"state"} or $onfield->{"state"} ne "unknown") {
- $hash->{'state_changed'} = 1;
- }
- } elsif ((defined ($crit->[0]) and $value < $crit->[0]) or
- (defined ($crit->[1]) and $value > $crit->[1])) {
- $crit->[0] ||= "";
- $crit->[1] ||= "";
- $hash->{'worst'} = "CRITICAL";
- $hash->{'worstid'} = 2;
- munin_set_var_loc (\%notes, [@$fpath, "state"], "critical");
- munin_set_var_loc (\%notes, [@$fpath, "critical"],
- (defined $field->{"extinfo"}?
- "$value (not in ". $field->{'crange'} ."): ". $field->{"extinfo"}:
- "Value is $value. Critical range (". $field->{'crange'} .") exceeded"));
-
- if (!defined $onfield or
- !defined $onfield->{"state"} or
- $onfield->{"state"} ne "critical") {
-
- $hash->{'state_changed'} = 1;
-
- }
- } elsif ((defined ($warn->[0]) and $value < $warn->[0]) or
- (defined ($warn->[1]) and $value > $warn->[1])) {
- $warn->[0] ||= "";
- $warn->[1] ||= "";
- $hash->{'worst'} = "WARNING" if $hash->{"worst"} ne "CRITICAL";
- $hash->{'worstid'} = 1 if $hash->{"worstid"} != 2;
- munin_set_var_loc (\%notes, [@$fpath, "state"], "warning");
- munin_set_var_loc (\%notes, [@$fpath, "warning"],
- (defined $field->{"extinfo"}?
- "$value (not in ". $field->{'wrange'}."): ".$field->{"extinfo"}:
- "Value is $value. Warning range (". $field->{'wrange'} .") exceeded"));
-
- if (!defined $onfield or
- !defined $onfield->{"state"} or
- $onfield->{"state"} ne "warning") {
-
- $hash->{'state_changed'} = 1;
-
- }
- } 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;
- }
- }
- generate_service_message ($hash);
-}
-
-
-sub get_limits {
- my $hash = shift || return;
- # This hash will have values that we can look up such as these:
- my @critical = (undef, undef);
- 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 $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]");
- } elsif (defined $crit) {
- @critical = (0, 0);
- DEBUG ("Debug: processing critical: $name -> $critical[0] : $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]");
- } elsif (defined $warn) {
- @warning = (0, 0);
- DEBUG ("Debug: processing warning: $name -> $warning[0] : $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");
- }
-
- return (\@warning, \@critical, $unknown_limit);
-}
-
-sub generate_service_message {
- my $hash = shift || return;
- my $critical = undef;
- my $worst = $hash->{"worst"};
- my %stats = ('critical' => [], 'warning' => [], 'unknown' => [], 'foks' => [], 'ok' => []);
- my $contacts = munin_get_children (munin_get_node ($config, ["contact"]));
-
- DEBUG ("Debug: generating service message: ". join ('::', @{munin_get_node_loc ($hash)}));
- foreach my $field (@{munin_get_children ( munin_get_node(\%notes, munin_get_node_loc($hash)))}) {
- if (defined $field->{"state"}) {
- push @{$stats{$field->{"state"}}}, munin_get_node_name ($field);
- if ($field->{"state"} eq "ok") {
- push @{$stats{"foks"}}, munin_get_node_name ($field);
- }
- }
- }
- $hash->{'cfields'} = join " ", @{$stats{'critical'}};
- $hash->{'wfields'} = join " ", @{$stats{'warning'}};
- $hash->{'ufields'} = join " ", @{$stats{'unknown'}};
- $hash->{'fofields'} = join " ", @{$stats{'foks'}};
- $hash->{'ofields'} = join " ", @{$stats{'ok'}};
- $hash->{'numcfields'} = scalar @{$stats{'critical'}};
- $hash->{'numwfields'} = scalar @{$stats{'warning'}};
- $hash->{'numufields'} = scalar @{$stats{'unknown'}};
- $hash->{'numfofields'} = scalar @{$stats{'foks'}};
- $hash->{'numofields'} = scalar @{$stats{'ok'}};
-
- my $contactlist = munin_get ($hash, "contacts", "");
- DEBUG ("Debug: Contact list for ". join ('::', @{munin_get_node_loc ($hash)}) . ": $contactlist");
- foreach my $c (split (/\s+/, $contactlist)) {
- next if $c eq "none";
- my $contactobj = munin_get_node ($config, ["contact", $c]);
- next unless defined $contactobj;
- next unless defined munin_get ($contactobj, "command", undef);
- if (@limit_contacts and !grep (/^$c$/, @limit_contacts)) {
- next;
- }
- my $obsess = 0;
- my $cas = munin_get ($contactobj, "always_send");
- if (defined $cas) {
- $obsess = grep {scalar(@{$stats{$_}})} (split (/\s+/, lc $cas));
- }
- if (!$hash->{'state_changed'} and !$obsess) {
- next; # No need to send notification
- }
- logger ("state has changed, notifying $c");
- my $precmd = munin_get ($contactobj, "command");
- my $pretxt = munin_get ($contactobj, "text", munin_get (munin_get_node ($config, ["contact", "default"]), "text", $default_text{$c} || $default_text{"default"}));
- my $txt = message_expand ($hash, $pretxt, "");
- my $cmd = message_expand ($hash, $precmd, "");
- $txt =~ s/\\n/\n/g;
- $txt =~ s/\\t/\t/g;
-
- # In some cases we want to reopen the command
- my $maxmess = munin_get ($contactobj, "max_messages", 0);
- my $curmess = munin_get ($contactobj, "num_messages", 0);
- my $curcmd = munin_get ($contactobj, "pipe_command", undef);
- my $pipe = munin_get ($contactobj, "pipe", undef);
- if ($maxmess and $curmess >= $maxmess ) {
- close ($pipe);
- $pipe = undef;
- munin_set_var_loc ($contactobj, ["pipe"], undef);
- DEBUG ("Debug: Closing \"$c\" -> command (max number of messages reached).");
- } elsif ($curcmd and $curcmd ne $cmd) {
- close ($pipe);
- $pipe = undef;
- munin_set_var_loc ($contactobj, ["pipe"], undef);
- DEBUG ("Debug: Closing \"$c\" -> command (command has changed).");
- }
-
- if (!defined $pipe) {
- my @cmd = extract_multiple (
- message_expand ($hash, $cmd),
- [ sub { extract_delimited ($_[0], q{"'})},
- qr/\S+/
- ],
- undef, 1);
- @cmd = map {
- my $c = $_;
- $c =~ s/['"]$//;
- $c =~ s/^['"]//;
- $c;
- } @cmd;
- $contactobj->{"num_messages"} = 0;
- if ($cmd[0] eq "|") {
- $cmd[0] = "|-";
- } elsif ($cmd[0] !~ /^[|>]/) {
- unshift (@cmd, "|-");
- }
- DEBUG ("Debug: opening \"$c\" for writing: \"" . join('" "',@cmd) . "\".");
- if ($cmd[0] eq ">") {
- ## no critic
- if (! open ($pipe, join (' ', @cmd))) {
- logger ("Fatal: Could not open " . join (' ', @cmd[1 .. $#cmd]) . " for writing: $!");
- exit 3;
- }
- ## critic
- } else {
- my $pid = open ($pipe, "|-");
- if (!defined $pid) {
- logger ("Fatal: Unable to fork: $!");
- exit 3;
- } if (!$pid) { # Child
- # Fork of stdout-to-log filter
- my $logstdout;
- my $logstderr;
- my $logpid = open ($logstdout, "|-");
- if (!defined $logpid) {
- logger ("Fatal: Unable to fork: $!");
- exit 3;
- }
- if (!$logpid) { # Child
- while (<STDIN>) {
- chomp;
- logger ("Command \"$c\" stdout: $_");
- }
- exit 0;
- }
- close (STDOUT);
- *STDOUT = \$logstdout;
- $logpid = open ($logstderr, "|-");
- if (!defined $logpid) {
- logger ("Fatal: Unable to fork: $!");
- exit 3;
- }
- if (!$logpid) { # Child
- while (<STDIN>) {
- chomp;
- logger ("Command \"$c\" stderr: $_");
- }
- exit 0;
- }
- open (STDOUT, ">&", $logstdout);
- open (STDERR, ">&", $logstderr);
-
- exec (@cmd[1 .. $#cmd]) or logger ("Warning: Could not run command \"" . join(' ',@cmd[1 .. $#cmd]) . "\": $!");
- exit 5;
- # NOTREACHED
- }
- }
- logger ("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);
- $contactobj->{"num_messages"} = 1 + munin_get ($contactobj, "num_messages", 0); # $num_messages++
- }
-}
-
-
-sub message_expand {
- my $hash = shift;
- my $text = shift;
- my @res = ();
-
-
- while (length ($text)) {
- if ($text =~ /^([^\$]+|)(?:\$(\{.*)|)$/) {
- push @res, $1;
- $text = $2;
- }
- my @a = extract_bracketed ($text, '{}');
- if ($a[0] =~ /^\{var:(\S+)\}$/) {
- $a[0] = munin_get ($hash, $1, "");
- } elsif ($a[0] =~ /^\{loop<([^>]+)>:\s*(\S+)\s(.+)\}$/) {
- my $d = $1;
- my $f = $2;
- my $t = $3;
- my $fields = munin_get ($hash, $f, "");
- my @res = ();
- if ($fields) {
- foreach my $sub (split /\s+/, $fields) {
- if (defined $hash->{$sub}) {
- push @res, message_expand ($hash->{$sub}, $t);
- }
- }
- }
- $a[0] = join ($d, @res);
- } elsif ($a[0] =~ /^\{loop:\s*(\S+)\s(.+)\}$/) {
- my $f = $1;
- my $t = $2;
- my $fields = munin_get ($hash, $f, "");
- my $res = "";
- if ($fields) {
- foreach my $sub (split /\s+/, $fields) {
- if (defined $hash->{$sub}) {
- push @res, message_expand ($hash->{$sub}, $t);
- }
- }
- }
- $a[0] = $res;
- } elsif ($a[0] =~ /^\{strtrunc:\s*(\S+)\s(.+)\}$/) {
- my $f = "%.".$1."s";
- my $t = $2;
- $a[0] = sprintf ($f, message_expand ($hash, $t));
- } elsif ($a[0] =~ /^\{if:\s*(\!)?(\S+)\s(.+)\}$/) {
- my $n = $1;
- my $f = $2;
- 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;
-
- if ($check) {
- $res .= message_expand ($hash, $t);
- }
- $a[0] = $res;
- }
- push @res, $a[0];
- $text = $a[1];
- }
+limits_startup(\@ARGV);
- return join ('', @res);
-}
+limits_main();
+# ### The End
+
+exit 0;
=head1 NAME
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/_bin/munin-update.in
^
|
@@ -3,15 +3,18 @@
use warnings;
use strict;
-# $Id: munin-update.in 2730 2009-10-27 15:07:38Z janl $
+# $Id: munin-update.in 2872 2009-11-06 09:20:30Z janl $
use English qw(-no_match_vars);
+use Getopt::Long;
+use Pod::Usage;
+use Log::Log4perl qw(:easy);
+
use Munin::Master::Update;
use Munin::Master::Logger;
use Munin::Master::Config;
use Munin::Master::Utils;
-use Getopt::Long;
-use Pod::Usage;
+
# TODO
#
@@ -29,7 +32,6 @@
configure();
logger_open($config->{'logdir'});
-
logger_debug() if $config->{debug};
my $update = Munin::Master::Update->new();
@@ -45,6 +47,23 @@
# Uses default file if config_file is not defined by arguments.
$config->parse_config_from_file($args{config_file});
+ if (defined $config->{'includedir'}) {
+ my $dirname = $config->{'includedir'};
+
+ my $DIR;
+ opendir($DIR, $dirname) or
+ LOGCROAK "Could not open includedir directory $dirname: $!\n";
+ my @files = grep { ! /^\.|~$/ } readdir($DIR) or
+ LOGCROAK "Error reading includedir directory $dirname: $!\n";
+ closedir($DIR);
+
+ @files = map { $_ = $dirname.'/'.$_; } (sort @files);
+
+ foreach my $f (@files) {
+ $config->parse_config_from_file($f);
+ }
+ }
+
# Arguments overrides settings from config file. Note that
# this only handles settings that are on the base level, not
# anything within groups or hosts.
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/lib/Munin/Master/Config.pm
^
|
@@ -2,7 +2,7 @@
use base qw(Munin::Common::Config);
-# $Id: Config.pm 2764 2009-10-29 15:51:37Z bjorn $
+# $Id: Config.pm 2926 2009-11-09 13:16:34Z janl $
# Notes about config data structure:
#
@@ -470,14 +470,26 @@
my $section = undef;
+ my $continuation = '';
+
my $prefix = '';
while (my $line = <$io>) {
$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;
+ $continuation = '';
+ }
# Group/host/service configuration is saved for later persual.
# Everything else is saved at once. Note that _trim removes
@@ -501,6 +513,20 @@
}
+sub get_all_hosts {
+ # Note! This method is implemented in multiple classes to make the
+ # recursion complete.
+ my ($self) = @_;
+
+ my @hosts = ();
+ for my $group (values %{$self->{groups}}) {
+ push @hosts, $group->get_all_hosts;
+ }
+ return @hosts;
+}
+
+
+
sub set {
my ($self, $config) = @_;
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/lib/Munin/Master/GraphOld.pm
^
|
@@ -1,7 +1,8 @@
package Munin::Master::GraphOld;
+
# -*- cperl -*-
-=comment
+=begin comment
This is Munin::Master::GraphOld, a package shell to make munin-graph
modular (so it can loaded persistently in munin-fastcgi-graph for
@@ -27,7 +28,9 @@
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 2758 2009-10-29 13:51:26Z janl $
+$Id: GraphOld.pm 2944 2009-11-10 15:12:46Z jo $
+
+=end comment
=cut
@@ -37,7 +40,7 @@
use Exporter;
our (@ISA, @EXPORT);
-@ISA = qw(Exporter);
+@ISA = qw(Exporter);
@EXPORT = qw(graph_startup graph_check_cron graph_main);
use IO::Socket;
@@ -49,6 +52,7 @@
use Time::HiRes;
use Text::ParseWords;
+# For UTF-8 handling (plugins are assumed to use Latin 1)
if ($RRDs::VERSION >= 1.3) { use Encode; }
use Munin::Master::Logger;
@@ -62,82 +66,91 @@
# And RRDtool 1.2.* draws lines with crayons so we hack
# the LINE* options a bit.
-my $LINEkluge=0;
+my $LINEkluge = 0;
if ($RRDs::VERSION >= 1.2 and $RRDs::VERSION < 1.3) {
+
# Only kluge the line widths in RRD 1.2*
- $LINEkluge=1;
+ $LINEkluge = 1;
}
# RRD 1.3 has a "ADDNAN" operator which evaluates n + NaN = n instead of = NaN.
my $AddNAN = '+';
if ($RRDs::VERSION >= 1.3) {
- $AddNAN = 'ADDNAN';
+ $AddNAN = 'ADDNAN';
}
# Force drawing of "graph no".
my $force_graphing = 0;
-my $force_lazy = 1;
-my $do_usage = 0;
-my $do_version = 0;
-my $cron = 0;
-my $list_images = 0;
-my $skip_locking = 0;
-my $skip_stats = 0;
-my $stdout = 0;
-my $conffile = $Munin::Common::Defaults::MUNIN_CONFDIR."/munin.conf";
-my $libdir = $Munin::Common::Defaults::MUNIN_LIBDIR;
-my %draw = ("day" => 1, "week" => 1, "month" => 1, "year" => 1, "sumyear" => 1, "sumweek" => 1);
+my $force_lazy = 1;
+my $do_usage = 0;
+my $do_version = 0;
+my $cron = 0;
+my $list_images = 0;
+my $skip_locking = 0;
+my $skip_stats = 0;
+my $stdout = 0;
+my $conffile = $Munin::Common::Defaults::MUNIN_CONFDIR . "/munin.conf";
+my $libdir = $Munin::Common::Defaults::MUNIN_LIBDIR;
+my %draw = (
+ "day" => 1,
+ "week" => 1,
+ "month" => 1,
+ "year" => 1,
+ "sumyear" => 1,
+ "sumweek" => 1
+);
-my %PALETTE; # Hash of available palettes
-my @COLOUR; # Array of actuall colours to use
+my %PALETTE; # Hash of available palettes
+my @COLOUR; # Array of actuall colours to use
{
no warnings;
- $PALETTE{'old'} = [ # This is the old munin palette. It lacks contrast.
- qw(#22ff22 #0022ff #ff0000 #00aaaa #ff00ff
- #ffa500 #cc0000 #0000cc #0080C0 #8080C0 #FF0080
- #800080 #688e23 #408080 #808000 #000000 #00FF00
- #0080FF #FF8000 #800000 #FB31FB
- )];
-
- $PALETTE{'default'} = [ # New default palette.Better contrast,more colours
- #Greens Blues Oranges Dk yel Dk blu Purple lime Reds Gray
- qw(#00CC00 #0066B3 #FF8000 #FFCC00 #330099 #990099 #CCFF00 #FF0000 #808080
- #008F00 #00487D #B35A00 #B38F00 #6B006B #8FB300 #B30000 #BEBEBE
- #80FF80 #80C9FF #FFC080 #FFE680 #AA80FF #EE00CC #FF8080
- #666600 #FFBFFF #00FFCC #CC6699 #999900
- )]; # Line variations: Pure, earthy, dark pastel, misc colours
+ $PALETTE{'old'} = [ # This is the old munin palette. It lacks contrast.
+ qw(#22ff22 #0022ff #ff0000 #00aaaa #ff00ff
+ #ffa500 #cc0000 #0000cc #0080C0 #8080C0 #FF0080
+ #800080 #688e23 #408080 #808000 #000000 #00FF00
+ #0080FF #FF8000 #800000 #FB31FB
+ )];
+
+ $PALETTE{'default'} = [ # New default palette.Better contrast,more colours
+ #Greens Blues Oranges Dk yel Dk blu Purple lime Reds Gray
+ qw(#00CC00 #0066B3 #FF8000 #FFCC00 #330099 #990099 #CCFF00 #FF0000 #808080
+ #008F00 #00487D #B35A00 #B38F00 #6B006B #8FB300 #B30000 #BEBEBE
+ #80FF80 #80C9FF #FFC080 #FFE680 #AA80FF #EE00CC #FF8080
+ #666600 #FFBFFF #00FFCC #CC6699 #999900
+ )]; # Line variations: Pure, earthy, dark pastel, misc colours
}
-my $range_colour = "#22ff22";
+my $range_colour = "#22ff22";
my $single_colour = "#00aa00";
my %times = (
- "day" => "-30h",
- "week" => "-8d",
- "month" => "-33d",
- "year" => "-400d");
+ "day" => "-30h",
+ "week" => "-8d",
+ "month" => "-33d",
+ "year" => "-400d"
+);
my %resolutions = (
- "day" => "300",
- "week" => "1500",
- "month" => "7200",
- "year" => "86400");
-
-my %sumtimes = ( # time => [ label, seconds-in-period ]
- "week" => ["hour", 12],
- "year" => ["day", 288]
- );
+ "day" => "300",
+ "week" => "1500",
+ "month" => "7200",
+ "year" => "86400"
+);
+
+my %sumtimes = ( # time => [ label, seconds-in-period ]
+ "week" => ["hour", 12],
+ "year" => ["day", 288]);
# Limit graphing to certain hosts and/or services
-my @limit_hosts = ();
+my @limit_hosts = ();
my @limit_services = ();
-my $watermark = "Munin ".$Munin::Common::Defaults::MUNIN_VERSION;
+my $watermark = "Munin " . $Munin::Common::Defaults::MUNIN_VERSION;
-my $running = 0;
+my $running = 0;
my $max_running = 6;
-my $do_fork = 1;
+my $do_fork = 1;
# "global" Configuration hash
my $config;
@@ -147,96 +160,114 @@
my $DEBUG;
sub graph_startup {
+
# Parse options and set up. Stuff that is usually only needed once.
#
# Do once pr. run, pr possebly once pr. graph in the case of
# munin-cgi-graph
-
+
my ($ARGV) = @_;
# Get options
- &print_usage_and_exit unless
- GetOptionsFromArray (
- $ARGV,
- "force!" => \$force_graphing,
- "lazy!" => \$force_lazy,
- "host=s" => \@limit_hosts,
- "service=s" => \@limit_services,
- "config=s" => \$conffile,
- "stdout!" => \$stdout,
- "day!" => \$draw{'day'},
- "week!" => \$draw{'week'},
- "month!" => \$draw{'month'},
- "year!" => \$draw{'year'},
- "sumweek!" => \$draw{'sumweek'},
- "sumyear!" => \$draw{'sumyear'},
- "list-images!" => \$list_images,
- "skip-locking!"=> \$skip_locking,
- "skip-stats!" => \$skip_stats,
- "debug!" => \$DEBUG,
- "version!" => \$do_version,
- "cron!" => \$cron,
- "fork!" => \$do_fork,
- "n=n" => \$max_running,
- "help" => \$do_usage );
+ &print_usage_and_exit
+ unless GetOptionsFromArray(
+ $ARGV,
+ "force!" => \$force_graphing,
+ "lazy!" => \$force_lazy,
+ "host=s" => \@limit_hosts,
+ "service=s" => \@limit_services,
+ "config=s" => \$conffile,
+ "stdout!" => \$stdout,
+ "day!" => \$draw{'day'},
+ "week!" => \$draw{'week'},
+ "month!" => \$draw{'month'},
+ "year!" => \$draw{'year'},
+ "sumweek!" => \$draw{'sumweek'},
+ "sumyear!" => \$draw{'sumyear'},
+ "list-images!" => \$list_images,
+ "skip-locking!" => \$skip_locking,
+ "skip-stats!" => \$skip_stats,
+ "debug!" => \$DEBUG,
+ "version!" => \$do_version,
+ "cron!" => \$cron,
+ "fork!" => \$do_fork,
+ "n=n" => \$max_running,
+ "help" => \$do_usage
+ );
if ($do_version) {
- print_version_and_exit();
+ print_version_and_exit();
+ }
+
+ if ($do_usage) {
+ print_usage_and_exit();
}
exit_if_run_by_super_user();
- $config = &munin_config ($conffile);
+ $config = &munin_config($conffile);
+
logger_open($config->{'logdir'});
+ logger_debug() if $DEBUG;
- my $palette = &munin_get ($config, "palette", "default");
+ my $palette = &munin_get($config, "palette", "default");
$max_running = &munin_get($config, "max_graph_jobs", $max_running);
if ($max_running == 0) {
- $do_fork=0;
+ $do_fork = 0;
}
if (defined($PALETTE{$palette})) {
- @COLOUR=@{$PALETTE{$palette}};
- } else {
- die "Unknown palette named by 'palette' keyword: $palette\n";
+ @COLOUR = @{$PALETTE{$palette}};
+ }
+ else {
+ die "Unknown palette named by 'palette' keyword: $palette\n";
}
}
sub graph_check_cron {
+
# Are we running from cron and do we have matching graph_strategy
- if (&munin_get ($config, "graph_strategy", "cron") ne "cron" and $cron) {
- # Strategy mismatch: We're run from cron, but munin.conf says
+ if (&munin_get($config, "graph_strategy", "cron") ne "cron" and $cron) {
+
+ # Strategy mismatch: We're run from cron, but munin.conf says
# we use dynamic graph generation
- return 0;
+ return 0;
}
+
# Strategy match:
return 1;
}
sub graph_main {
- my $graph_time= Time::HiRes::time;
+ my $graph_time = Time::HiRes::time;
munin_runlock("$config->{rundir}/munin-graph.lock") unless $skip_locking;
unless ($skip_stats) {
- open ($STATS, '>', "$config->{dbdir}/munin-graph.stats.tmp") or
- logger("Unable to open $config->{dbdir}/munin-graph.stats.tmp");
- autoflush $STATS 1;
+ open($STATS, '>', "$config->{dbdir}/munin-graph.stats.tmp")
+ or WARN "[WARNING] Unable to open $config->{dbdir}/munin-graph.stats.tmp";
+ autoflush $STATS 1;
}
- logger("Starting munin-graph");
+ INFO "Starting munin-graph";
process_work(@limit_hosts);
- $graph_time = sprintf ("%.2f",(Time::HiRes::time - $graph_time));
- logger("Munin-graph finished ($graph_time sec)");
+ $graph_time = sprintf("%.2f", (Time::HiRes::time - $graph_time));
+
+ INFO "Munin-graph finished ($graph_time sec)";
+
print $STATS "GT|total|$graph_time\n" unless $skip_stats;
- rename ("$config->{dbdir}/munin-graph.stats.tmp", "$config->{dbdir}/munin-graph.stats");
+
+ rename(
+ "$config->{dbdir}/munin-graph.stats.tmp",
+ "$config->{dbdir}/munin-graph.stats"
+ );
close $STATS unless $skip_stats;
munin_removelock("$config->{rundir}/munin-graph.lock") unless $skip_locking;
@@ -251,42 +282,41 @@
my $service = shift;
my $scale = shift;
- return (munin_get ($service, "graph_title", $service) . " - by $scale");
+ return (munin_get($service, "graph_title", $service) . " - by $scale");
}
-sub get_custom_graph_args
-{
+sub get_custom_graph_args {
my $service = shift;
my $result = [];
- my $args = munin_get ($service, "graph_args");
+ my $args = munin_get($service, "graph_args");
if (defined $args) {
- my $result = [ "ewords('\s+', 0, $args) ] ;
- return $result;
- } else {
- return;
+ my $result = ["ewords('\s+', 0, $args)];
+ return $result;
+ }
+ else {
+ return;
}
}
-sub get_vlabel
-{
+sub get_vlabel {
my $service = shift;
- my $scale = munin_get ($service, "graph_period", "second");
- my $res = munin_get ($service, "graph_vlabel", munin_get ($service, "graph_vtitle"));
+ my $scale = munin_get($service, "graph_period", "second");
+ my $res = munin_get($service, "graph_vlabel",
+ munin_get($service, "graph_vtitle"));
if (defined $res) {
- $res =~ s/\$\{graph_period\}/$scale/g;
+ $res =~ s/\$\{graph_period\}/$scale/g;
}
return $res;
}
-sub should_scale
-{
+sub should_scale {
my $service = shift;
my $ret;
- if (!defined ($ret = munin_get_bool ($service, "graph_scale"))) {
- $ret = !munin_get_bool ($service, "graph_noscale", 0);
+ if (!defined($ret = munin_get_bool($service, "graph_scale"))) {
+ $ret = !munin_get_bool($service, "graph_noscale", 0);
}
return $ret;
@@ -300,194 +330,229 @@
my $tmp_field;
# Picture filename
- push @$result, munin_get_picture_filename ($service, $scale, $sum||undef);
+ push @$result, munin_get_picture_filename($service, $scale, $sum || undef);
# Title
- push @$result, ("--title", get_title ($service, $scale));
+ push @$result, ("--title", get_title($service, $scale));
# When to start the graph
- push @$result, "--start",$times{$scale};
+ push @$result, "--start", $times{$scale};
# Custom graph args, vlabel and graph title
- if (defined ($tmp_field = get_custom_graph_args ($service))) {
- push (@$result, @{$tmp_field});
+ if (defined($tmp_field = get_custom_graph_args($service))) {
+ push(@$result, @{$tmp_field});
}
- if (defined ($tmp_field = get_vlabel ($service))) {
- push @$result, ("--vertical-label", $tmp_field);
+ if (defined($tmp_field = get_vlabel($service))) {
+ push @$result, ("--vertical-label", $tmp_field);
}
- push @$result,"--height", munin_get ($service, "graph_height", "175");
- push @$result,"--width", munin_get ($service, "graph_width", "400");
- push @$result,"--imgformat", "PNG";
- push @$result,"--lazy" if ($force_lazy);
+ push @$result, "--height", munin_get($service, "graph_height", "175");
+ push @$result, "--width", munin_get($service, "graph_width", "400");
+ push @$result, "--imgformat", "PNG";
+ push @$result, "--lazy" if ($force_lazy);
- push (@$result, "--units-exponent", "0") if (! should_scale ($service));
+ push(@$result, "--units-exponent", "0") if (!should_scale($service));
return $result;
}
sub get_sum_command {
- my $field = shift;
- return munin_get ($field, "sum");
+ my $field = shift;
+ return munin_get($field, "sum");
}
sub get_stack_command {
- my $field = shift;
- return munin_get ($field, "stack");
+ my $field = shift;
+ return munin_get($field, "stack");
}
-sub expand_specials
-{
+sub expand_specials {
my $service = shift;
my $preproc = shift;
my $order = shift;
my $single = shift;
+
my $result = [];
my $fieldnum = 0;
- for my $field (@$order) { # Search for 'specials'...
- my $tmp_field;
-
- if ($field =~ /^-(.+)$/) { # Invisible field
- $field = $1;
- munin_set_var_loc ($service, [$field, "graph"], "no");
- }
-
- $fieldnum++;
- if ($field =~ /^([^=]+)=(.+)$/) { # Aliased in graph_order
- my $fname = $1;
- my $spath = $2;
- my $src = munin_get_node_partialpath ($service, $spath);
- my $sname = munin_get_node_name ($src);
-
- next unless defined $src;
- logger ("DEBUG: Copying settings from $sname to $fname.") if $DEBUG;
-
- foreach my $foption ("draw", "type", "rrdfile", "fieldname", "info") {
- if (!defined $service->{$fname}->{$foption}) {
- if (defined $src->{$foption}) {
- munin_set_var_loc ($service, [$fname, $foption], $src->{$foption});
- }
- }
- }
-
- # cdef is special...
- if (!defined $service->{$fname}->{"cdef"}) {
- if (defined $src->{"cdef"}) {
- (my $tmpcdef = $src->{"cdef"}) =~ s/([,=])$sname([,=]|$)/$1$fname$2/g;
- munin_set_var_loc ($service, [$fname, "cdef"], $tmpcdef);
- }
- }
-
- if (!defined $service->{$fname}->{"label"}) {
- munin_set_var_loc ($service, [$fname, "label"], $fname);
- }
- munin_set_var_loc ($service, [$fname, "filename"], munin_get_rrd_filename ($src));
-
- } elsif (defined ($tmp_field = get_stack_command ($service->{$field}))) {
- logger ("DEBUG: expand_specials ($tmp_field): Doing stack...") if $DEBUG;
- my @spc_stack = ();
- foreach my $pre (split (/\s+/, $tmp_field)) {
- (my $name = $pre) =~ s/=.+//;
- if (!@spc_stack) {
- munin_set_var_loc ($service, [$name, "draw"], munin_get ($service->{$field}, "draw", "LINE2"));
- munin_set_var_loc ($service, [$field, "process"], "no");
- } else {
- munin_set_var_loc ($service, [$name, "draw"], "STACK");
- }
- push (@spc_stack, $name);
- push (@$preproc, $pre);
- push @$result, "$name.label";
- push @$result, "$name.draw";
- push @$result, "$name.cdef";
-
- munin_set_var_loc ($service, [$name, "label"], $name);
- munin_set_var_loc ($service, [$name, "cdef"], "$name,UN,0,$name,IF");
- if (munin_get ($service->{$field}, "cdef") and !munin_get_bool ($service->{$name}, "onlynullcdef", 0)) {
- logger ("DEBUG: NotOnlynullcdef ($field)...") if $DEBUG;
- $service->{$name}->{"cdef"} .= "," . $service->{$field}->{"cdef"};
- $service->{$name}->{"cdef"} =~ s/\b$field\b/$name/g;
- } else {
- logger ("DEBUG: Onlynullcdef ($field)...") if $DEBUG;
- munin_set_var_loc ($service, [$name, "onlynullcdef"], 1);
- push @$result, "$name.onlynullcdef";
- }
- }
- } elsif (defined ($tmp_field = get_sum_command ($service->{$field}))) {
- my @spc_stack = ();
- my $last_name = "";
- logger ("DEBUG: expand_specials ($tmp_field): Doing sum...") if $DEBUG;
-
- if (@$order == 1 or (@$order == 2 and munin_get {$field, "negative", 0})) {
- $single = 1;
- }
-
- foreach my $pre (split (/\s+/, $tmp_field)) {
- (my $path = $pre) =~ s/.+=//;
- my $name = "z".$fieldnum."_".scalar (@spc_stack);
- $last_name = $name;
-
- munin_set_var_loc ($service, [$name, "cdef"], "$name,UN,0,$name,IF");
- munin_set_var_loc ($service, [$name, "graph"], "no");
- munin_set_var_loc ($service, [$name, "label"], $name);
- push @$result, "$name.cdef";
- push @$result, "$name.graph";
- push @$result, "$name.label";
-
- push (@spc_stack, $name);
- push (@$preproc, "$name=$pre");
- }
- $service->{$last_name}->{"cdef"} .= "," . join (',+,', @spc_stack[0 .. @spc_stack-2]) . ',+';
-
- if (my $tc = munin_get ($service->{$field}, "cdef", 0)) { # Oh bugger...
- logger ("DEBUG: Oh bugger...($field)...\n") if $DEBUG;
- $tc =~ s/\b$field\b/$service->{$last_name}->{"cdef"}/;
- $service->{$last_name}->{"cdef"} = $tc;
- }
- munin_set_var_loc ($service, [$field, "process"], "no");
- munin_set_var_loc ($service, [$last_name, "draw"], munin_get ($service->{$field}, "draw"));
- munin_set_var_loc ($service, [$last_name, "label"], munin_get ($service->{$field}, "label"));
- munin_set_var_loc ($service, [$last_name, "graph"], munin_get ($service->{$field}, "graph", "yes"));
- if (my $tmp = munin_get($service->{$field}, "negative")) {
- munin_set_var_loc ($service, [$last_name, "negative"], $tmp);
- }
-
- munin_set_var_loc ($service, [$field, "realname"], $last_name);
+ for my $field (@$order) { # Search for 'specials'...
+ my $tmp_field;
- } elsif (my $nf = munin_get ($service->{$field}, "negative", 0)) {
- if (!munin_get_bool ($service->{$nf}, "graph", 1) or munin_get_bool ($service->{$nf}, "skipdraw", 0)) {
- munin_set_var_loc ($service, [$nf, "graph"], "no");
- }
- }
- }
+ if ($field =~ /^-(.+)$/) { # Invisible field
+ $field = $1;
+ munin_set_var_loc($service, [$field, "graph"], "no");
+ }
+
+ $fieldnum++;
+ if ($field =~ /^([^=]+)=(.+)$/) { # Aliased in graph_order
+ my $fname = $1;
+ my $spath = $2;
+ my $src = munin_get_node_partialpath($service, $spath);
+ my $sname = munin_get_node_name($src);
+
+ next unless defined $src;
+ DEBUG "[DEBUG] Copying settings from $sname to $fname.";
+
+ foreach my $foption ("draw", "type", "rrdfile", "fieldname", "info")
+ {
+ if (!defined $service->{$fname}->{$foption}) {
+ if (defined $src->{$foption}) {
+ munin_set_var_loc($service, [$fname, $foption],
+ $src->{$foption});
+ }
+ }
+ }
+
+ # cdef is special...
+ if (!defined $service->{$fname}->{"cdef"}) {
+ if (defined $src->{"cdef"}) {
+ (my $tmpcdef = $src->{"cdef"})
+ =~ s/([,=])$sname([,=]|$)/$1$fname$2/g;
+ munin_set_var_loc($service, [$fname, "cdef"], $tmpcdef);
+ }
+ }
+
+ if (!defined $service->{$fname}->{"label"}) {
+ munin_set_var_loc($service, [$fname, "label"], $fname);
+ }
+ munin_set_var_loc(
+ $service,
+ [$fname, "filename"],
+ munin_get_rrd_filename($src));
+
+ }
+ elsif (defined($tmp_field = get_stack_command($service->{$field}))) {
+ # Aliased with .stack
+ DEBUG "DEBUG: expand_specials ($tmp_field): Doing stack...";
+
+ my @spc_stack = ();
+ foreach my $pre (split(/\s+/, $tmp_field)) {
+ (my $name = $pre) =~ s/=.+//;
+ if (!@spc_stack) {
+ munin_set_var_loc(
+ $service,
+ [$name, "draw"],
+ munin_get($service->{$field}, "draw", "LINE2"));
+ munin_set_var_loc($service, [$field, "process"], "no");
+ }
+ else {
+ munin_set_var_loc($service, [$name, "draw"], "STACK");
+ }
+ push(@spc_stack, $name);
+ push(@$preproc, $pre);
+ push @$result, "$name.label";
+ push @$result, "$name.draw";
+ push @$result, "$name.cdef";
+
+ munin_set_var_loc($service, [$name, "label"], $name);
+ munin_set_var_loc($service, [$name, "cdef"],
+ "$name,UN,0,$name,IF");
+ if (munin_get($service->{$field}, "cdef")
+ and !munin_get_bool($service->{$name}, "onlynullcdef", 0)) {
+ DEBUG "DEBUG: NotOnlynullcdef ($field)...";
+ $service->{$name}->{"cdef"}
+ .= "," . $service->{$field}->{"cdef"};
+ $service->{$name}->{"cdef"} =~ s/\b$field\b/$name/g;
+ }
+ else {
+ DEBUG "DEBUG: Onlynullcdef ($field)...";
+ munin_set_var_loc($service, [$name, "onlynullcdef"], 1);
+ push @$result, "$name.onlynullcdef";
+ }
+ }
+ } # if get_stack_command
+ elsif (defined($tmp_field = get_sum_command($service->{$field}))) {
+ my @spc_stack = ();
+ my $last_name = "";
+ DEBUG "DEBUG: expand_specials ($tmp_field): Doing sum...";
+
+ if (@$order == 1
+ or (@$order == 2 and munin_get {$field, "negative", 0})) {
+ $single = 1;
+ }
+
+ foreach my $pre (split(/\s+/, $tmp_field)) {
+ (my $path = $pre) =~ s/.+=//;
+ my $name = "z" . $fieldnum . "_" . scalar(@spc_stack);
+ $last_name = $name;
+
+ munin_set_var_loc($service, [$name, "cdef"],
+ "$name,UN,0,$name,IF");
+ munin_set_var_loc($service, [$name, "graph"], "no");
+ munin_set_var_loc($service, [$name, "label"], $name);
+ push @$result, "$name.cdef";
+ push @$result, "$name.graph";
+ push @$result, "$name.label";
+
+ push(@spc_stack, $name);
+ push(@$preproc, "$name=$pre");
+ }
+ $service->{$last_name}->{"cdef"} .=
+ "," . join(",$AddNAN,", @spc_stack[0 .. @spc_stack - 2]) .
+ ",$AddNAN";
+
+ if (my $tc = munin_get($service->{$field}, "cdef", 0))
+ { # Oh bugger...
+ DEBUG "DEBUG: Oh bugger...($field)...\n";
+ $tc =~ s/\b$field\b/$service->{$last_name}->{"cdef"}/;
+ $service->{$last_name}->{"cdef"} = $tc;
+ }
+ munin_set_var_loc($service, [$field, "process"], "no");
+ munin_set_var_loc(
+ $service,
+ [$last_name, "draw"],
+ munin_get($service->{$field}, "draw"));
+ munin_set_var_loc(
+ $service,
+ [$last_name, "label"],
+ munin_get($service->{$field}, "label"));
+ munin_set_var_loc(
+ $service,
+ [$last_name, "graph"],
+ munin_get($service->{$field}, "graph", "yes"));
+
+ if (my $tmp = munin_get($service->{$field}, "negative")) {
+ munin_set_var_loc($service, [$last_name, "negative"], $tmp);
+ }
+
+ munin_set_var_loc($service, [$field, "realname"], $last_name);
+
+ }
+ elsif (my $nf = munin_get($service->{$field}, "negative", 0)) {
+ if ( !munin_get_bool($service->{$nf}, "graph", 1)
+ or munin_get_bool($service->{$nf}, "skipdraw", 0)) {
+ munin_set_var_loc($service, [$nf, "graph"], "no");
+ }
+ }
+ } # for (@$order)
return $result;
}
-sub single_value
-{
+sub single_value {
my $service = shift;
- my $graphable = munin_get ($service, "graphable", 0);;
+ my $graphable = munin_get($service, "graphable", 0);
if (!$graphable) {
- foreach my $field (@{munin_get_field_order ($service)}) {
- logger ("DEBUG: single_value: Checking field \"$field\".") if $DEBUG;
- $graphable++ if munin_draw_field ($service->{$field});
- }
- munin_set_var_loc ($service, ["graphable"], $graphable);
- }
- logger ("DEBUG: service ". join (' :: ', @{munin_get_node_loc ($service)}) ." has $graphable elements.") if $DEBUG;
+ foreach my $field (@{munin_get_field_order($service)}) {
+ DEBUG "DEBUG: single_value: Checking field \"$field\".";
+ $graphable++ if munin_draw_field($service->{$field});
+ }
+ munin_set_var_loc($service, ["graphable"], $graphable);
+ }
+ DEBUG ("[DEBUG] service "
+ . join(' :: ', @{munin_get_node_loc($service)})
+ . " has $graphable elements.");
return ($graphable == 1);
}
-sub get_field_name
-{
+sub get_field_name {
my $name = shift;
- $name = substr (Digest::MD5::md5_hex ($name), -15)
- if (length $name > 15);
+ $name = substr(Digest::MD5::md5_hex($name), -15)
+ if (length $name > 15);
return $name;
}
@@ -495,74 +560,82 @@
sub process_work {
my (@limit_hosts) = @_;
+
# Make array of what is probably needed to graph
my $work_array = [];
- if (@limit_hosts) { # Limit what to update if needed
- foreach my $nodename (@limit_hosts) {
- push @$work_array, map { @{munin_find_field ($_->{$nodename}, "graph_title")} } @{munin_find_field($config, $nodename)};
- }
- } else { # ...else just search for all adresses to update
- push @$work_array, @{munin_find_field($config, "graph_title")};
+ if (@limit_hosts) { # Limit what to update if needed
+ foreach my $nodename (@limit_hosts) {
+ push @$work_array,
+ map {@{munin_find_field($_->{$nodename}, "graph_title")}}
+ @{munin_find_field($config, $nodename)};
+ }
+ }
+ else { # ...else just search for all adresses to update
+ push @$work_array, @{munin_find_field($config, "graph_title")};
}
# @$work_array contains copy of (or pointer to) each service to be graphed.
for my $service (@$work_array) {
- # Want to avoid forking for that
- next if (skip_service ($service));
+ # Want to avoid forking for that
+ next if (skip_service($service));
- # Fork (or not) and run the anonymous sub afterwards.
- fork_and_work(sub { process_service ($service); } );
+ # Fork (or not) and run the anonymous sub afterwards.
+ fork_and_work(sub {process_service($service);});
}
}
sub process_field {
- my $field = shift;
- return munin_get_bool ($field, "process", 1);
+ my $field = shift;
+ return munin_get_bool($field, "process", 1);
}
sub fork_and_work {
my ($work) = @_;
- if (! $do_fork) {
- # We're not forking. Do work and return.
- DEBUG "[DEBUG] Doing work synchrnonously";
- &$work;
- return;
+ 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;
+ 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: $!";
+ ERROR "[ERROR] fork failed: $!";
+ die "fork failed: $!";
}
if ($pid == 0) {
- # This block does the real work. Since we're forking exit
- # afterwards.
- &$work;
+ # This block does the real work. Since we're forking exit
+ # afterwards.
+
+ &$work;
- # See?!
+ # See?!
- exit 0;
+ exit 0;
- } else {
- ++$running;
- DEBUG "[DEBUG] Forked: $pid. Now running $running/$max_running";
- while ($running and look_for_child()) {
- --$running;
- }
+ }
+ else {
+ ++$running;
+ DEBUG "[DEBUG] Forked: $pid. Now running $running/$max_running";
+ while ($running and look_for_child()) {
+ --$running;
+ }
}
}
@@ -571,22 +644,22 @@
my ($service) = @_;
# See if we should skip the service
- return if (skip_service ($service));
+ return if (skip_service($service));
# Make my graphs
- my $sname = munin_get_node_name ($service);
- my $service_time= Time::HiRes::time;
- my $lastupdate = 0;
- my $now = time;
- my $fnum = 0;
+ my $sname = munin_get_node_name($service);
+ my $service_time = Time::HiRes::time;
+ my $lastupdate = 0;
+ my $now = time;
+ my $fnum = 0;
my @rrd;
my @added = ();
DEBUG "[DEBUG] Node name: $sname\n";
- my $field_count = 0;
+ my $field_count = 0;
my $max_field_len = 0;
- my @field_order = ();
+ my @field_order = ();
my $rrdname;
my $force_single_value;
@@ -594,19 +667,19 @@
# Array to keep 'preprocess'ed fields.
my @rrd_preprocess = ();
- DEBUG "[DEBUG] Expanding specials for $sname: \"".join("\",\"", @field_order)."\".";
+ DEBUG "[DEBUG] Expanding specials for $sname: \""
+ . join("\",\"", @field_order) . "\".";
- @added = @{&expand_specials ($service,
- \@rrd_preprocess,
- \@field_order,
- \$force_single_value)};
+ @added = @{
+ &expand_specials($service, \@rrd_preprocess, \@field_order,
+ \$force_single_value)};
@field_order = (@rrd_preprocess, @field_order);
- DEBUG "[DEBUG] Checking field lengths for $sname: \"" .
- join("\",\"", @rrd_preprocess) . "\".";
+ DEBUG "[DEBUG] Checking field lengths for $sname: \""
+ . join("\",\"", @rrd_preprocess) . "\".";
# Get max label length
- $max_field_len = munin_get_max_label_length ($service, \@field_order);
+ $max_field_len = munin_get_max_label_length($service, \@field_order);
# Global headers makes the value tables easier to read no matter how
# wide the labels are.
@@ -614,20 +687,21 @@
# Default format for printing under graph.
my $avgformat;
- my $rrdformat=$avgformat="%6.2lf";
+ my $rrdformat = $avgformat = "%6.2lf";
+
+ if (munin_get($service, "graph_args", "") =~ /--base\s+1024/) {
- if (munin_get ($service, "graph_args", "") =~ /--base\s+1024/) {
- # If the base unit is 1024 then 1012.56 is a valid
- # number to show. That's 7 positions, not 6.
- $rrdformat=$avgformat="%7.2lf";
+ # If the base unit is 1024 then 1012.56 is a valid
+ # number to show. That's 7 positions, not 6.
+ $rrdformat = $avgformat = "%7.2lf";
}
# Plugin specified complete printf format
- $rrdformat = munin_get ($service, "graph_printf", $rrdformat);
+ $rrdformat = munin_get($service, "graph_printf", $rrdformat);
my $rrdscale = '';
- if (munin_get_bool ($service, "graph_scale", 1)) {
- $rrdscale = '%s';
+ if (munin_get_bool($service, "graph_scale", 1)) {
+ $rrdscale = '%s';
}
# Array to keep negative data until we're finished with positive.
@@ -636,479 +710,607 @@
my $filename = "unknown";
my %total_pos;
my %total_neg;
- my $autostacking=0;
+ my $autostacking = 0;
- DEBUG "[DEBUG] Treating fields \"" . join ("\",\"", @field_order) . "\".";
+ DEBUG "[DEBUG] Treating fields \"" . join("\",\"", @field_order) . "\".";
for my $fname (@field_order) {
- my $path = undef;
- my $field = undef;
-
- if ($fname =~ s/=(.+)//) {
- $path = $1;
- }
- $field = munin_get_node ($service, [$fname]);
-
- next if (!defined $field or !$field or !process_field ($field));
- DEBUG "[DEBUG] Processing field \"$fname\" [".munin_get_node_name($field)."].";
-
- my $fielddraw = munin_get ($field, "draw", "LINE2");
-
- if ($field_count == 0 and $fielddraw eq 'STACK') {
- # Illegal -- first field is a STACK
- DEBUG "ERROR: First field (\"$fname\") of graph " .
- join (' :: ', munin_get_node_loc ($service)) .
- " is STACK. STACK can only be drawn after a LINEx or AREA.";
- $fielddraw = "LINE2";
- }
-
- if ($fielddraw eq 'AREASTACK') {
- if ($autostacking==0) {
- $fielddraw='AREA';
- $autostacking=1;
- } else {
- $fielddraw='STACK';
- }
- }
-
- if ($fielddraw =~ /LINESTACK(\d+(?:.\d+)?)/ ) {
- if ($autostacking==0) {
- $fielddraw="LINE$1";
- $autostacking=1;
- } else {
- $fielddraw='STACK';
- }
- }
-
- # Getting name of rrd file
- $filename = munin_get_rrd_filename ($field, $path);
-
- my $update = RRDs::last ($filename);
- $update = 0 if ! defined $update;
- if ($update > $lastupdate) {
- $lastupdate = $update;
- }
-
- # It does not look like $fieldname.rrdfield is possible to set
- my $rrdfield = munin_get ($field, "rrdfield", "42");
-
- my $single_value = $force_single_value || single_value ($service);
-
- my $has_negative = munin_get ($field, "negative");
-
- # Trim the fieldname to make room for other field names.
- $rrdname = &get_field_name ($fname);
-
- DEBUG "[DEBUG] RRD name / filename: $rrdname / $filename\n";
-
- if ($rrdname ne $fname) {
- # A change was made
- munin_set ($field, "cdef_name", $rrdname);
- }
-
- # Push will place the DEF too far down for some CDEFs to work
- unshift (@rrd, "DEF:g$rrdname=" .
- $filename . ":" . $rrdfield . ":AVERAGE");
- unshift (@rrd, "DEF:i$rrdname=" .
- $filename . ":" . $rrdfield . ":MIN");
- unshift (@rrd, "DEF:a$rrdname=" .
- $filename . ":" . $rrdfield . ":MAX");
-
- if (munin_get_bool ($field, "onlynullcdef", 0)) {
- push (@rrd, "CDEF:c$rrdname=g$rrdname" .
- (($now-$update)>900 ? ",POP,UNKN" : ""));
- }
-
- if (munin_get ($field, "type", "GAUGE") ne "GAUGE" and
- graph_by_minute ($service)) {
- push (@rrd, expand_cdef($service, \$rrdname, "$fname,60,*"));
- }
-
- if (my $tmpcdef = munin_get ($field, "cdef")) {
- push (@rrd,expand_cdef($service, \$rrdname, $tmpcdef));
- push (@rrd, "CDEF:c$rrdname=g$rrdname");
- DEBUG "[DEBUG] Field name after cdef set to $rrdname";
- } elsif (!munin_get_bool ($field, "onlynullcdef", 0)) {
- push (@rrd, "CDEF:c$rrdname=g$rrdname" . (($now-$update)>900 ? ",POP,UNKN" : ""));
- }
-
- next if !munin_draw_field ($field);
- DEBUG "[DEBUG] Drawing field \"$fname\".";
-
- if ($single_value) {
- # Only one field. Do min/max range.
- push (@rrd, "CDEF:min_max_diff=a$rrdname,i$rrdname,-");
- push (@rrd, "CDEF:re_zero=min_max_diff,min_max_diff,-")
- if !munin_get ($field, "negative");
-
- push (@rrd, "AREA:i$rrdname#ffffff");
- push (@rrd, "STACK:min_max_diff$range_colour");
- push (@rrd, "LINE2:re_zero#000000") if
- !munin_get ($field, "negative");
- }
-
- # Push "global" headers or not
- if ($has_negative and !@rrd_negatives and $global_headers < 2) {
- # Always for -/+ graphs
- push (@rrd, "COMMENT:" . (" " x $max_field_len));
- push (@rrd, "COMMENT:Cur (-/+)");
- push (@rrd, "COMMENT:Min (-/+)");
- push (@rrd, "COMMENT:Avg (-/+)");
- push (@rrd, "COMMENT:Max (-/+) \\j");
- $global_headers=2; # Avoid further headers/labels
- } elsif ($global_headers == 1) {
- # Or when we want to.
- push (@rrd, "COMMENT:" . (" " x $max_field_len));
- push (@rrd, "COMMENT: Cur$RRDkludge:");
- push (@rrd, "COMMENT:Min$RRDkludge:");
- push (@rrd, "COMMENT:Avg$RRDkludge:");
- push (@rrd, "COMMENT:Max$RRDkludge: \\j");
- $global_headers=2; # Avoid further headers/labels
- }
-
- my $colour;
-
- if (my $tmpcol = munin_get ($field, "colour")) {
- $colour = "#" . $tmpcol;
- } elsif ($single_value) {
- $colour = $single_colour;
- } else {
- $colour = $COLOUR[$field_count%@COLOUR];
- }
-
- $field_count++;
-
- my $tmplabel = munin_get ($field, "label", $fname);
-
- push (@rrd, $fielddraw . ":g$rrdname" . $colour . ":" .
- escape ($tmplabel) . (" " x ($max_field_len + 1 - length $tmplabel)));
-
- # Check for negative fields (typically network (or disk) traffic)
- if ($has_negative) {
- my $negfieldname = orig_to_cdef ($service, munin_get ($field, "negative"));
- my $negfield = $service->{$negfieldname};
- if (my $tmpneg = munin_get ($negfield, "realname")) {
- $negfieldname = $tmpneg;
- $negfield = $service->{$negfieldname};
- }
-
- if (!@rrd_negatives) {
- # zero-line, to redraw zero afterwards.
- push (@rrd_negatives, "CDEF:re_zero=g$negfieldname,UN,0,0,IF");
- }
-
- push (@rrd_negatives, "CDEF:ng$negfieldname=g$negfieldname,-1,*");
-
- if ($single_value) {
- # Only one field. Do min/max range.
- push (@rrd, "CDEF:neg_min_max_diff=i$negfieldname,a$negfieldname,-");
- push (@rrd, "CDEF:ni$negfieldname=i$negfieldname,-1,*");
- push (@rrd, "AREA:ni$negfieldname#ffffff");
- push (@rrd, "STACK:neg_min_max_diff$range_colour");
- }
-
- push (@rrd_negatives, $fielddraw . ":ng$negfieldname" . $colour );
+ my $path = undef;
+ my $field = undef;
- # Draw HRULEs
- my $linedef = munin_get ($negfield, "line");
- if ($linedef) {
- my ($number, $ldcolour, $label) = split (/:/, $linedef, 3);
- push (@rrd_negatives, "HRULE:".$number.
- ($ldcolour ? "#$ldcolour" : $colour));
- } elsif (my $tmpwarn = munin_get ($negfield, "warning")) {
-
- my ($warn_min,$warn_max) = split(':', $tmpwarn);
-
- if ( defined($warn_min) ) {
- push (@rrd, "HRULE:".$warn_min.($single_value ? "#ff0000" : $COLOUR[($field_count-1)%@COLOUR]));
- }
- if ( defined($warn_max) ) {
- push (@rrd, "HRULE:".$warn_max.($single_value ? "#ff0000" : $COLOUR[($field_count-1)%@COLOUR]));
- }
- }
-
- push (@rrd, "GPRINT:c$negfieldname:LAST:$rrdformat" . $rrdscale . "/\\g");
- push (@rrd, "GPRINT:c$rrdname:LAST:$rrdformat" . $rrdscale . "");
- push (@rrd, "GPRINT:i$negfieldname:MIN:$rrdformat" . $rrdscale . "/\\g");
- push (@rrd, "GPRINT:i$rrdname:MIN:$rrdformat" . $rrdscale . "");
- push (@rrd, "GPRINT:g$negfieldname:AVERAGE:$avgformat" . $rrdscale . "/\\g");
- push (@rrd, "GPRINT:g$rrdname:AVERAGE:$avgformat" . $rrdscale . "");
- push (@rrd, "GPRINT:a$negfieldname:MAX:$rrdformat" . $rrdscale . "/\\g");
- push (@rrd, "GPRINT:a$rrdname:MAX:$rrdformat" . $rrdscale . "\\j");
- push (@{$total_pos{'min'}}, "i$rrdname");
- push (@{$total_pos{'avg'}}, "g$rrdname");
- push (@{$total_pos{'max'}}, "a$rrdname");
- push (@{$total_neg{'min'}}, "i$negfieldname");
- push (@{$total_neg{'avg'}}, "g$negfieldname");
- push (@{$total_neg{'max'}}, "a$negfieldname");
- } else {
- push (@rrd, "COMMENT: Cur$RRDkludge:") unless $global_headers;
- push (@rrd, "GPRINT:c$rrdname:LAST:$rrdformat" . $rrdscale . "");
- push (@rrd, "COMMENT: Min$RRDkludge:") unless $global_headers;
- push (@rrd, "GPRINT:i$rrdname:MIN:$rrdformat" . $rrdscale . "");
- push (@rrd, "COMMENT: Avg$RRDkludge:") unless $global_headers;
- push (@rrd, "GPRINT:g$rrdname:AVERAGE:$avgformat" . $rrdscale . "");
- push (@rrd, "COMMENT: Max$RRDkludge:") unless $global_headers;
- push (@rrd, "GPRINT:a$rrdname:MAX:$rrdformat" . $rrdscale . "\\j");
- push (@{$total_pos{'min'}}, "i$rrdname");
- push (@{$total_pos{'avg'}}, "g$rrdname");
- push (@{$total_pos{'max'}}, "a$rrdname");
- }
-
- # Draw HRULEs
- my $linedef = munin_get ($field, "line");
- if ($linedef) {
- my ($number, $ldcolour, $label) = split (/:/, $linedef, 3);
- $label =~ s/:/\\:/g if defined $label;
- push (@rrd, "HRULE:".$number.
- ($ldcolour ? "#$ldcolour" :
- ((defined $single_value and $single_value) ?
- "#ff0000" : $colour)).
- ((defined $label and length ($label)) ? ":$label" : ""),
- "COMMENT: \\j"
- );
- } elsif (my $tmpwarn = munin_get ($field, "warning")) {
-
- my ($warn_min,$warn_max) = split(':', $tmpwarn);
-
- if ( defined( $warn_min ) ) {
- push (@rrd, "HRULE:".$warn_min.($single_value ? "#ff0000" : $COLOUR[($field_count-1)%@COLOUR]));
- }
- if ( defined( $warn_max ) ) {
- push (@rrd, "HRULE:".$warn_max.($single_value ? "#ff0000" : $COLOUR[($field_count-1)%@COLOUR]));
- }
- }
+ if ($fname =~ s/=(.+)//) {
+ $path = $1;
+ }
+ $field = munin_get_node($service, [$fname]);
+
+ next if (!defined $field or !$field or !process_field($field));
+ DEBUG "[DEBUG] Processing field \"$fname\" ["
+ . munin_get_node_name($field) . "].";
+
+ my $fielddraw = munin_get($field, "draw", "LINE2");
+
+ if ($field_count == 0 and $fielddraw eq 'STACK') {
+
+ # Illegal -- first field is a STACK
+ DEBUG "ERROR: First field (\"$fname\") of graph "
+ . join(' :: ', munin_get_node_loc($service))
+ . " is STACK. STACK can only be drawn after a LINEx or AREA.";
+ $fielddraw = "LINE2";
+ }
+
+ if ($fielddraw eq 'AREASTACK') {
+ if ($autostacking == 0) {
+ $fielddraw = 'AREA';
+ $autostacking = 1;
+ }
+ else {
+ $fielddraw = 'STACK';
+ }
+ }
+
+ if ($fielddraw =~ /LINESTACK(\d+(?:.\d+)?)/) {
+ if ($autostacking == 0) {
+ $fielddraw = "LINE$1";
+ $autostacking = 1;
+ }
+ else {
+ $fielddraw = 'STACK';
+ }
+ }
+
+ # Getting name of rrd file
+ $filename = munin_get_rrd_filename($field, $path);
+
+ my $update = RRDs::last($filename);
+ $update = 0 if !defined $update;
+ if ($update > $lastupdate) {
+ $lastupdate = $update;
+ }
+
+ # It does not look like $fieldname.rrdfield is possible to set
+ my $rrdfield = munin_get($field, "rrdfield", "42");
+
+ my $single_value = $force_single_value || single_value($service);
+
+ my $has_negative = munin_get($field, "negative");
+
+ # Trim the fieldname to make room for other field names.
+
+ $rrdname = &get_field_name($fname);
+
+ DEBUG "[DEBUG] RRD name / filename: $rrdname / $filename\n";
+
+ if ($rrdname ne $fname) {
+
+ # A change was made
+ munin_set($field, "cdef_name", $rrdname);
+ }
+
+ # Push will place the DEF too far down for some CDEFs to work
+ unshift(@rrd,
+ "DEF:g$rrdname=" . $filename . ":" . $rrdfield . ":AVERAGE");
+ unshift(@rrd, "DEF:i$rrdname=" . $filename . ":" . $rrdfield . ":MIN");
+ unshift(@rrd, "DEF:a$rrdname=" . $filename . ":" . $rrdfield . ":MAX");
+
+ if (munin_get_bool($field, "onlynullcdef", 0)) {
+ push(@rrd,
+ "CDEF:c$rrdname=g$rrdname"
+ . (($now - $update) > 900 ? ",POP,UNKN" : ""));
+ }
+
+ if ( munin_get($field, "type", "GAUGE") ne "GAUGE"
+ and graph_by_minute($service)) {
+ push(@rrd, expand_cdef($service, \$rrdname, "$fname,60,*"));
+ }
+
+ if (my $tmpcdef = munin_get($field, "cdef")) {
+ push(@rrd, expand_cdef($service, \$rrdname, $tmpcdef));
+ push(@rrd, "CDEF:c$rrdname=g$rrdname");
+ DEBUG "[DEBUG] Field name after cdef set to $rrdname";
+ }
+ elsif (!munin_get_bool($field, "onlynullcdef", 0)) {
+ push(@rrd,
+ "CDEF:c$rrdname=g$rrdname"
+ . (($now - $update) > 900 ? ",POP,UNKN" : ""));
+ }
+
+ next if !munin_draw_field($field);
+ DEBUG "[DEBUG] Drawing field \"$fname\".";
+
+ if ($single_value) {
+
+ # Only one field. Do min/max range.
+ push(@rrd, "CDEF:min_max_diff=a$rrdname,i$rrdname,-");
+ push(@rrd, "CDEF:re_zero=min_max_diff,min_max_diff,-")
+ if !munin_get($field, "negative");
+
+ push(@rrd, "AREA:i$rrdname#ffffff");
+ push(@rrd, "STACK:min_max_diff$range_colour");
+ push(@rrd, "LINE2:re_zero#000000")
+ if !munin_get($field, "negative");
+ }
+
+ # Push "global" headers or not
+ if ($has_negative and !@rrd_negatives and $global_headers < 2) {
+
+ # Always for -/+ graphs
+ push(@rrd, "COMMENT:" . (" " x $max_field_len));
+ push(@rrd, "COMMENT:Cur (-/+)");
+ push(@rrd, "COMMENT:Min (-/+)");
+ push(@rrd, "COMMENT:Avg (-/+)");
+ push(@rrd, "COMMENT:Max (-/+) \\j");
+ $global_headers = 2; # Avoid further headers/labels
+ }
+ elsif ($global_headers == 1) {
+
+ # Or when we want to.
+ push(@rrd, "COMMENT:" . (" " x $max_field_len));
+ push(@rrd, "COMMENT: Cur$RRDkludge:");
+ push(@rrd, "COMMENT:Min$RRDkludge:");
+ push(@rrd, "COMMENT:Avg$RRDkludge:");
+ push(@rrd, "COMMENT:Max$RRDkludge: \\j");
+ $global_headers = 2; # Avoid further headers/labels
+ }
+
+ my $colour;
+
+ if (my $tmpcol = munin_get($field, "colour")) {
+ $colour = "#" . $tmpcol;
+ }
+ elsif ($single_value) {
+ $colour = $single_colour;
+ }
+ else {
+ $colour = $COLOUR[$field_count % @COLOUR];
+ }
+
+ $field_count++;
+
+ my $tmplabel = munin_get($field, "label", $fname);
+
+ push(@rrd,
+ $fielddraw
+ . ":g$rrdname"
+ . $colour . ":"
+ . escape($tmplabel)
+ . (" " x ($max_field_len + 1 - length $tmplabel)));
+
+ # Check for negative fields (typically network (or disk) traffic)
+ if ($has_negative) {
+ my $negfieldname
+ = orig_to_cdef($service, munin_get($field, "negative"));
+ my $negfield = $service->{$negfieldname};
+ if (my $tmpneg = munin_get($negfield, "realname")) {
+ $negfieldname = $tmpneg;
+ $negfield = $service->{$negfieldname};
+ }
+
+ if (!@rrd_negatives) {
+
+ # zero-line, to redraw zero afterwards.
+ push(@rrd_negatives, "CDEF:re_zero=g$negfieldname,UN,0,0,IF");
+ }
+
+ push(@rrd_negatives, "CDEF:ng$negfieldname=g$negfieldname,-1,*");
+
+ if ($single_value) {
+
+ # Only one field. Do min/max range.
+ push(@rrd,
+ "CDEF:neg_min_max_diff=i$negfieldname,a$negfieldname,-");
+ push(@rrd, "CDEF:ni$negfieldname=i$negfieldname,-1,*");
+ push(@rrd, "AREA:ni$negfieldname#ffffff");
+ push(@rrd, "STACK:neg_min_max_diff$range_colour");
+ }
+
+ push(@rrd_negatives, $fielddraw . ":ng$negfieldname" . $colour);
+
+ # Draw HRULEs
+ my $linedef = munin_get($negfield, "line");
+ if ($linedef) {
+ my ($number, $ldcolour, $label) = split(/:/, $linedef, 3);
+ push(@rrd_negatives,
+ "HRULE:" . $number . ($ldcolour ? "#$ldcolour" : $colour));
+ }
+ elsif (my $tmpwarn = munin_get($negfield, "warning")) {
+
+ my ($warn_min, $warn_max) = split(':', $tmpwarn);
+
+ if (defined($warn_min)) {
+ push(
+ @rrd,
+ "HRULE:"
+ . $warn_min
+ . (
+ $single_value
+ ? "#ff0000"
+ : $COLOUR[($field_count - 1) % @COLOUR]));
+ }
+ if (defined($warn_max)) {
+ push(
+ @rrd,
+ "HRULE:"
+ . $warn_max
+ . (
+ $single_value
+ ? "#ff0000"
+ : $COLOUR[($field_count - 1) % @COLOUR]));
+ }
+ }
+
+ push(@rrd,
+ "GPRINT:c$negfieldname:LAST:$rrdformat" . $rrdscale . "/\\g");
+ push(@rrd, "GPRINT:c$rrdname:LAST:$rrdformat" . $rrdscale . "");
+ push(@rrd,
+ "GPRINT:i$negfieldname:MIN:$rrdformat" . $rrdscale . "/\\g");
+ push(@rrd, "GPRINT:i$rrdname:MIN:$rrdformat" . $rrdscale . "");
+ push(@rrd,
+ "GPRINT:g$negfieldname:AVERAGE:$avgformat"
+ . $rrdscale
+ . "/\\g");
+ push(@rrd, "GPRINT:g$rrdname:AVERAGE:$avgformat" . $rrdscale . "");
+ push(@rrd,
+ "GPRINT:a$negfieldname:MAX:$rrdformat" . $rrdscale . "/\\g");
+ push(@rrd, "GPRINT:a$rrdname:MAX:$rrdformat" . $rrdscale . "\\j");
+ push(@{$total_pos{'min'}}, "i$rrdname");
+ push(@{$total_pos{'avg'}}, "g$rrdname");
+ push(@{$total_pos{'max'}}, "a$rrdname");
+ push(@{$total_neg{'min'}}, "i$negfieldname");
+ push(@{$total_neg{'avg'}}, "g$negfieldname");
+ push(@{$total_neg{'max'}}, "a$negfieldname");
+ }
+ else {
+ push(@rrd, "COMMENT: Cur$RRDkludge:") unless $global_headers;
+ push(@rrd, "GPRINT:c$rrdname:LAST:$rrdformat" . $rrdscale . "");
+ push(@rrd, "COMMENT: Min$RRDkludge:") unless $global_headers;
+ push(@rrd, "GPRINT:i$rrdname:MIN:$rrdformat" . $rrdscale . "");
+ push(@rrd, "COMMENT: Avg$RRDkludge:") unless $global_headers;
+ push(@rrd, "GPRINT:g$rrdname:AVERAGE:$avgformat" . $rrdscale . "");
+ push(@rrd, "COMMENT: Max$RRDkludge:") unless $global_headers;
+ push(@rrd, "GPRINT:a$rrdname:MAX:$rrdformat" . $rrdscale . "\\j");
+ push(@{$total_pos{'min'}}, "i$rrdname");
+ push(@{$total_pos{'avg'}}, "g$rrdname");
+ push(@{$total_pos{'max'}}, "a$rrdname");
+ }
+
+ # Draw HRULEs
+ my $linedef = munin_get($field, "line");
+ if ($linedef) {
+ my ($number, $ldcolour, $label) = split(/:/, $linedef, 3);
+ $label =~ s/:/\\:/g if defined $label;
+ push(
+ @rrd,
+ "HRULE:"
+ . $number
+ . (
+ $ldcolour ? "#$ldcolour"
+ : ((defined $single_value and $single_value) ? "#ff0000"
+ : $colour))
+ . ((defined $label and length($label)) ? ":$label" : ""),
+ "COMMENT: \\j"
+ );
+ }
+ elsif (my $tmpwarn = munin_get($field, "warning")) {
+
+ my ($warn_min, $warn_max) = split(':', $tmpwarn);
+
+ if (defined($warn_min)) {
+ push(
+ @rrd,
+ "HRULE:"
+ . $warn_min
+ . (
+ $single_value
+ ? "#ff0000"
+ : $COLOUR[($field_count - 1) % @COLOUR]));
+ }
+ if (defined($warn_max)) {
+ push(
+ @rrd,
+ "HRULE:"
+ . $warn_max
+ . (
+ $single_value
+ ? "#ff0000"
+ : $COLOUR[($field_count - 1) % @COLOUR]));
+ }
+ }
}
- my $graphtotal = munin_get ($service, "graph_total");
+ my $graphtotal = munin_get($service, "graph_total");
if (@rrd_negatives) {
- push (@rrd, @rrd_negatives);
- push (@rrd, "LINE2:re_zero#000000"); # Redraw zero.
- if (defined $graphtotal and exists $total_pos{'min'} and
- exists $total_neg{'min'} and
- @{$total_pos{'min'}} and @{$total_neg{'min'}}) {
-
- push (@rrd, "CDEF:ipostotal=".
- join (",", @{$total_pos{'min'}}).
- (",$AddNAN" x (@{$total_pos{'min'}}-1)));
- push (@rrd, "CDEF:gpostotal=".
- join (",", @{$total_pos{'avg'}}).
- (",$AddNAN" x (@{$total_pos{'avg'}}-1)));
- push (@rrd, "CDEF:apostotal=".
- join (",", @{$total_pos{'max'}}).
- (",$AddNAN" x (@{$total_pos{'max'}}-1)));
- push (@rrd, "CDEF:inegtotal=".
- join (",", @{$total_neg{'min'}}).
- (",$AddNAN" x (@{$total_neg{'min'}}-1)));
- push (@rrd, "CDEF:gnegtotal=".
- join (",", @{$total_neg{'avg'}}).
- (",$AddNAN" x (@{$total_neg{'avg'}}-1)));
- push (@rrd, "CDEF:anegtotal=".
- join (",", @{$total_neg{'max'}}).
- (",$AddNAN" x (@{$total_neg{'max'}}-1)));
- push (@rrd, "LINE1:gpostotal#000000:$graphtotal" . (" " x ($max_field_len - length ($graphtotal) + 1)));
- push (@rrd, "GPRINT:gnegtotal:LAST:$rrdformat" . $rrdscale . "/\\g");
- push (@rrd, "GPRINT:gpostotal:LAST:$rrdformat" . $rrdscale . "");
- push (@rrd, "GPRINT:inegtotal:MIN:$rrdformat" . $rrdscale . "/\\g");
- push (@rrd, "GPRINT:ipostotal:MIN:$rrdformat" . $rrdscale . "");
- push (@rrd, "GPRINT:gnegtotal:AVERAGE:$avgformat" . $rrdscale . "/\\g");
- push (@rrd, "GPRINT:gpostotal:AVERAGE:$avgformat" . $rrdscale . "");
- push (@rrd, "GPRINT:anegtotal:MAX:$rrdformat" . $rrdscale . "/\\g");
- push (@rrd, "GPRINT:apostotal:MAX:$rrdformat" . $rrdscale . "\\j");
- }
- } elsif (defined $graphtotal and exists $total_pos{'min'} and @{$total_pos{'min'}}) {
- push (@rrd, "CDEF:ipostotal=".
- join (",", @{$total_pos{'min'}}).
- (",$AddNAN" x (@{$total_pos{'min'}}-1)));
- push (@rrd, "CDEF:gpostotal=".
- join (",", @{$total_pos{'avg'}}).
- (",$AddNAN" x (@{$total_pos{'avg'}}-1)));
- push (@rrd, "CDEF:apostotal=".
- join (",", @{$total_pos{'max'}}).
- (",$AddNAN" x (@{$total_pos{'max'}}-1)));
-
- push (@rrd, "LINE1:gpostotal#000000:$graphtotal" . (" " x ($max_field_len - length ($graphtotal) + 1)));
- push (@rrd, "COMMENT: Cur$RRDkludge:") unless $global_headers;
- push (@rrd, "GPRINT:gpostotal:LAST:$rrdformat" . $rrdscale . "");
- push (@rrd, "COMMENT: Min$RRDkludge:") unless $global_headers;
- push (@rrd, "GPRINT:ipostotal:MIN:$rrdformat" . $rrdscale . "");
- push (@rrd, "COMMENT: Avg$RRDkludge:") unless $global_headers;
- push (@rrd, "GPRINT:gpostotal:AVERAGE:$avgformat" . $rrdscale ."");
- push (@rrd, "COMMENT: Max$RRDkludge:") unless $global_headers;
- push (@rrd, "GPRINT:apostotal:MAX:$rrdformat" . $rrdscale . "\\j");
+ push(@rrd, @rrd_negatives);
+ push(@rrd, "LINE2:re_zero#000000"); # Redraw zero.
+ if ( defined $graphtotal
+ and exists $total_pos{'min'}
+ and exists $total_neg{'min'}
+ and @{$total_pos{'min'}}
+ and @{$total_neg{'min'}}) {
+
+ push(@rrd,
+ "CDEF:ipostotal="
+ . join(",", @{$total_pos{'min'}})
+ . (",$AddNAN" x (@{$total_pos{'min'}} - 1)));
+ push(@rrd,
+ "CDEF:gpostotal="
+ . join(",", @{$total_pos{'avg'}})
+ . (",$AddNAN" x (@{$total_pos{'avg'}} - 1)));
+ push(@rrd,
+ "CDEF:apostotal="
+ . join(",", @{$total_pos{'max'}})
+ . (",$AddNAN" x (@{$total_pos{'max'}} - 1)));
+ push(@rrd,
+ "CDEF:inegtotal="
+ . join(",", @{$total_neg{'min'}})
+ . (",$AddNAN" x (@{$total_neg{'min'}} - 1)));
+ push(@rrd,
+ "CDEF:gnegtotal="
+ . join(",", @{$total_neg{'avg'}})
+ . (",$AddNAN" x (@{$total_neg{'avg'}} - 1)));
+ push(@rrd,
+ "CDEF:anegtotal="
+ . join(",", @{$total_neg{'max'}})
+ . (",$AddNAN" x (@{$total_neg{'max'}} - 1)));
+ push(@rrd,
+ "LINE1:gpostotal#000000:$graphtotal"
+ . (" " x ($max_field_len - length($graphtotal) + 1)));
+ push(@rrd, "GPRINT:gnegtotal:LAST:$rrdformat" . $rrdscale . "/\\g");
+ push(@rrd, "GPRINT:gpostotal:LAST:$rrdformat" . $rrdscale . "");
+ push(@rrd, "GPRINT:inegtotal:MIN:$rrdformat" . $rrdscale . "/\\g");
+ push(@rrd, "GPRINT:ipostotal:MIN:$rrdformat" . $rrdscale . "");
+ push(@rrd,
+ "GPRINT:gnegtotal:AVERAGE:$avgformat" . $rrdscale . "/\\g");
+ push(@rrd, "GPRINT:gpostotal:AVERAGE:$avgformat" . $rrdscale . "");
+ push(@rrd, "GPRINT:anegtotal:MAX:$rrdformat" . $rrdscale . "/\\g");
+ push(@rrd, "GPRINT:apostotal:MAX:$rrdformat" . $rrdscale . "\\j");
+ }
+ }
+ elsif ( defined $graphtotal
+ and exists $total_pos{'min'}
+ and @{$total_pos{'min'}}) {
+ push(@rrd,
+ "CDEF:ipostotal="
+ . join(",", @{$total_pos{'min'}})
+ . (",$AddNAN" x (@{$total_pos{'min'}} - 1)));
+ push(@rrd,
+ "CDEF:gpostotal="
+ . join(",", @{$total_pos{'avg'}})
+ . (",$AddNAN" x (@{$total_pos{'avg'}} - 1)));
+ push(@rrd,
+ "CDEF:apostotal="
+ . join(",", @{$total_pos{'max'}})
+ . (",$AddNAN" x (@{$total_pos{'max'}} - 1)));
+
+ push(@rrd,
+ "LINE1:gpostotal#000000:$graphtotal"
+ . (" " x ($max_field_len - length($graphtotal) + 1)));
+ push(@rrd, "COMMENT: Cur$RRDkludge:") unless $global_headers;
+ push(@rrd, "GPRINT:gpostotal:LAST:$rrdformat" . $rrdscale . "");
+ push(@rrd, "COMMENT: Min$RRDkludge:") unless $global_headers;
+ push(@rrd, "GPRINT:ipostotal:MIN:$rrdformat" . $rrdscale . "");
+ push(@rrd, "COMMENT: Avg$RRDkludge:") unless $global_headers;
+ push(@rrd, "GPRINT:gpostotal:AVERAGE:$avgformat" . $rrdscale . "");
+ push(@rrd, "COMMENT: Max$RRDkludge:") unless $global_headers;
+ push(@rrd, "GPRINT:apostotal:MAX:$rrdformat" . $rrdscale . "\\j");
}
for my $time (keys %times) {
- next unless ($draw{$time});
- my $picfilename = munin_get_picture_filename ($service, $time);
- (my $picdirname = $picfilename) =~ s/\/[^\/]+$//;
-
- DEBUG "[DEBUG] Picture filename: $picfilename";
-
- my @complete = ();
- if ($RRDkludge) {
- # 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;
-
- # Do the header (title, vtitle, size, etc...)
- push @complete, @{get_header ($service, $time)};
- if ($LINEkluge) {
- @rrd = map {
+ next unless ($draw{$time});
+ my $picfilename = munin_get_picture_filename($service, $time);
+ (my $picdirname = $picfilename) =~ s/\/[^\/]+$//;
+
+ # DEBUG "[DEBUG] Picture filename: $picfilename";
+
+ my @complete = ();
+ if ($RRDkludge) {
+
+ # 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;
+
+ # Do the header (title, vtitle, size, etc...)
+ push @complete, @{get_header($service, $time)};
+ if ($LINEkluge) {
+ @rrd = map {
my $line = $_;
$line =~ s/LINE3:/LINE2.2:/;
$line =~ s/LINE2:/LINE1.6:/;
+
# LINE1 is thin enough.
$line;
} @rrd;
- }
- push @complete, @rrd;
+ }
+ push @complete, @rrd;
- push (@complete, "COMMENT:Last update$RRDkludge: " .
- RRDescape(scalar localtime($lastupdate)) . "\\r");
-
- if (time - 300 < $lastupdate) {
- push @complete, "--end",
- (int($lastupdate/$resolutions{$time}))*$resolutions{$time};
- }
- DEBUG "\n\nrrdtool \"graph\" \"".
- join ("\"\n\t\"",@complete). "\"\n";
-
- # Make sure directory exists
- munin_mkdir_p ($picdirname, oct(777));
-
- # Since version 1.3 rrdtool uses libpango which needs its input
- # as utf8 string. So we assume that every input is in latin1
- # and decode it to perl's internal representation and then to utf8.
-
- if ( $RRDs::VERSION >= 1.3 ) {
- @complete = map {
- my $str = $_;
- $str = encode("utf8", (decode("latin1", $_)));
- $str;
- } @complete;
- }
-
- RRDs::graph (@complete);
- if (my $ERROR = RRDs::error) {
- ERROR "[ERROR] Unable to graph $picfilename : $ERROR";
- } else {
- # Set time of png file to the time of the last update of
- # the rrd file. This makes http's If-Modified-Since more
- # reliable, esp. in combination with munin-*cgi-graph.
-
- utime $lastupdate, $lastupdate, munin_get_picture_filename($service, $time);
- if ($list_images) {
- # Command-line option to list images created
- print munin_get_picture_filename ($service, $time),"\n";
- }
- }
- }
-
- if (munin_get_bool ($service, "graph_sums", 0)) {
- foreach my $time (keys %sumtimes) {
- my $picfilename = munin_get_picture_filename ($service, $time, 1);
- (my $picdirname = $picfilename) =~ s/\/[^\/]+$//;
- next unless ($draw{"sum".$time});
- my @rrd_sum;
- push @rrd_sum, @{get_header ($service, $time, 1)};
-
- if (time - 300 < $lastupdate) {
- push @rrd_sum, "--end",(int($lastupdate/$resolutions{$time}))*$resolutions{$time};
+ push(@complete,
+ "COMMENT:Last update$RRDkludge: "
+ . RRDescape(scalar localtime($lastupdate))
+ . "\\r");
+
+ if (time - 300 < $lastupdate) {
+ if (@added) { # stop one period earlier if it's a .sum or .stack
+ push @complete, "--end",
+ (int(($lastupdate-$resolutions{$time}) / $resolutions{$time})) * $resolutions{$time};
+ } else {
+ push @complete, "--end",
+ (int($lastupdate / $resolutions{$time})) * $resolutions{$time};
}
- push @rrd_sum, @rrd;
- push (@rrd_sum, "COMMENT:Last update$RRDkludge: " . RRDescape(scalar localtime($lastupdate)) . "\\r");
+ }
- my $labelled = 0;
- my @defined = ();
- for (my $index = 0; $index <= $#rrd_sum; $index++) {
- if ($rrd_sum[$index] =~ /^(--vertical-label|-v)$/) {
- (my $label = munin_get ($service, "graph_vlabel")) =~ s/\$\{graph_period\}/$sumtimes{$time}[0]/g;
- splice (@rrd_sum, $index, 2, ("--vertical-label", $label));
- $index++;
- $labelled++;
- } elsif ($rrd_sum[$index] =~ /^(LINE[123]|STACK|AREA|GPRINT):([^#:]+)([#:].+)$/) {
- my ($pre, $fname, $post) = ($1, $2, $3);
- next if $fname eq "re_zero";
- if ($post =~ /^:AVERAGE/) {
- splice (@rrd_sum, $index, 1, $pre . ":x$fname" . $post);
- $index++;
- next;
- }
- next if grep /^x$fname$/, @defined;
- push @defined, "x$fname";
- my @replace;
-
- if (munin_get ($service->{$fname}, "type", "GAUGE") ne "GAUGE") {
- if ($time eq "week") {
- # Every plot is half an hour. Add two plots and multiply, to get per hour
- if (graph_by_minute ($service)) {
- # Already multiplied by 60
- push @replace, "CDEF:x$fname=PREV($fname),UN,0,PREV($fname),IF,$fname,+,5,*,6,*";
- } else {
- push @replace, "CDEF:x$fname=PREV($fname),UN,0,PREV($fname),IF,$fname,+,300,*,6,*";
- }
- } else {
- # Every plot is one day exactly. Just multiply.
- if (graph_by_minute ($service)) {
- # Already multiplied by 60
- push @replace, "CDEF:x$fname=$fname,5,*,288,*";
- } else {
- push @replace, "CDEF:x$fname=$fname,300,*,288,*";
- }
- }
- }
- push @replace, $pre . ":x$fname" . $post;
- splice (@rrd_sum, $index, 1, @replace);
- $index++;
- } elsif ($rrd_sum[$index] =~ /^(--lower-limit|--upper-limit|-l|-u)$/) {
- $index++;
- $rrd_sum[$index] = $rrd_sum[$index] * 300 * $sumtimes{$time}->[1];
- }
- }
-
-
- unless ($labelled) {
- my $label = munin_get ($service, "graph_vlabel_sum_$time", $sumtimes{$time}->[0]);
- unshift @rrd_sum, "--vertical-label", $label;
- }
+ DEBUG "\n\nrrdtool 'graph' '" . join("'\n\t'", @complete) . "'\n";
- DEBUG "\n\nrrdtool \"graph\" \"".join ("\"\n\t\"",@rrd_sum)."\"\n";
+ # Make sure directory exists
+ munin_mkdir_p($picdirname, oct(777));
- # Make sure directory exists
- munin_mkdir_p ($picdirname, oct(777));
+ # Since version 1.3 rrdtool uses libpango which needs its input
+ # as utf8 string. So we assume that every input is in latin1
+ # and decode it to perl's internal representation and then to utf8.
- RRDs::graph (@rrd_sum);
+ if ($RRDs::VERSION >= 1.3) {
+ @complete = map {
+ my $str = $_;
+ $str = encode("utf8", (decode("latin1", $_)));
+ $str;
+ } @complete;
+ }
- if (my $ERROR = RRDs::error) {
- ERROR "Unable to graph ".
- munin_get_picture_filename ($service, $time) .
- ": $ERROR";
- } elsif ($list_images) {
- # Command-line option to list images created
- print munin_get_picture_filename ($service, $time, 1),"\n";
- }
- }
- }
+ RRDs::graph(@complete);
+ if (my $ERROR = RRDs::error) {
+ ERROR "[ERROR] Unable to graph $picfilename : $ERROR";
+ }
+ else {
+
+ # Set time of png file to the time of the last update of
+ # the rrd file. This makes http's If-Modified-Since more
+ # reliable, esp. in combination with munin-*cgi-graph.
+
+ # Since this disrupts rrd's --lazy option we're disableing
+ # it until we can do it in a less distructive way, we need
+ # to do it only on files that were updated _just_ now.
+ # Should probably also only be done in cgi mode.
+
+ # utime $lastupdate, $lastupdate,
+ # munin_get_picture_filename($service, $time);
+
+ if ($list_images) {
+ # Command-line option to list images created
+ print munin_get_picture_filename ($service, $time), "\n";
+ }
+ }
+ }
+
+ if (munin_get_bool($service, "graph_sums", 0)) {
+ foreach my $time (keys %sumtimes) {
+ my $picfilename = munin_get_picture_filename($service, $time, 1);
+ (my $picdirname = $picfilename) =~ s/\/[^\/]+$//;
+ next unless ($draw{"sum" . $time});
+ my @rrd_sum;
+ push @rrd_sum, @{get_header($service, $time, 1)};
+
+ if (time - 300 < $lastupdate) {
+ if (@added) { # stop 5 minutes earlier if it's a .sum or .stack
+ push @rrd_sum, "--end",
+ (int(($lastupdate-$resolutions{$time}) / $resolutions{$time})) * $resolutions{$time};
+ } else {
+ push @rrd_sum, "--end",
+ (int($lastupdate / $resolutions{$time})) * $resolutions{$time};
+ }
+ }
+ push @rrd_sum, @rrd;
+ push(@rrd_sum,
+ "COMMENT:Last update$RRDkludge: "
+ . RRDescape(scalar localtime($lastupdate))
+ . "\\r");
+
+ my $labelled = 0;
+ my @defined = ();
+ for (my $index = 0; $index <= $#rrd_sum; $index++) {
+ if ($rrd_sum[$index] =~ /^(--vertical-label|-v)$/) {
+ (my $label = munin_get($service, "graph_vlabel"))
+ =~ s/\$\{graph_period\}/$sumtimes{$time}[0]/g;
+ splice(@rrd_sum, $index, 2, ("--vertical-label", $label));
+ $index++;
+ $labelled++;
+ }
+ elsif ($rrd_sum[$index]
+ =~ /^(LINE[123]|STACK|AREA|GPRINT):([^#:]+)([#:].+)$/) {
+ my ($pre, $fname, $post) = ($1, $2, $3);
+ next if $fname eq "re_zero";
+ if ($post =~ /^:AVERAGE/) {
+ splice(@rrd_sum, $index, 1, $pre . ":x$fname" . $post);
+ $index++;
+ next;
+ }
+ next if grep /^x$fname$/, @defined;
+ push @defined, "x$fname";
+ my @replace;
+
+ if (munin_get($service->{$fname}, "type", "GAUGE") ne
+ "GAUGE") {
+ if ($time eq "week") {
+
+ # Every plot is half an hour. Add two plots and multiply, to get per hour
+ if (graph_by_minute($service)) {
+
+ # Already multiplied by 60
+ push @replace,
+ "CDEF:x$fname=PREV($fname),UN,0,PREV($fname),IF,$fname,+,5,*,6,*";
+ }
+ else {
+ push @replace,
+ "CDEF:x$fname=PREV($fname),UN,0,PREV($fname),IF,$fname,+,300,*,6,*";
+ }
+ }
+ else {
+
+ # Every plot is one day exactly. Just multiply.
+ if (graph_by_minute($service)) {
+
+ # Already multiplied by 60
+ push @replace, "CDEF:x$fname=$fname,5,*,288,*";
+ }
+ else {
+ push @replace,
+ "CDEF:x$fname=$fname,300,*,288,*";
+ }
+ }
+ }
+ push @replace, $pre . ":x$fname" . $post;
+ splice(@rrd_sum, $index, 1, @replace);
+ $index++;
+ }
+ elsif (
+ $rrd_sum[$index] =~ /^(--lower-limit|--upper-limit|-l|-u)$/)
+ {
+ $index++;
+ $rrd_sum[$index]
+ = $rrd_sum[$index] * 300 * $sumtimes{$time}->[1];
+ }
+ }
+
+
+ unless ($labelled) {
+ my $label = munin_get($service, "graph_vlabel_sum_$time",
+ $sumtimes{$time}->[0]);
+ unshift @rrd_sum, "--vertical-label", $label;
+ }
+
+ DEBUG "\n\nrrdtool 'graph' '" . join("'\n\t'", @rrd_sum) . "'\n";
+
+ # Make sure directory exists
+ munin_mkdir_p($picdirname, oct(777));
+
+ RRDs::graph(@rrd_sum);
+
+ if (my $ERROR = RRDs::error) {
+ ERROR "Unable to graph "
+ . munin_get_picture_filename($service, $time)
+ . ": $ERROR";
+ }
+ elsif ($list_images) {
+ # Command-line option to list images created
+ print munin_get_picture_filename ($service, $time, 1), "\n";
+ }
+ } # foreach (keys %sumtimes)
+ } # if graph_sums
- $service_time = sprintf ("%.2f",(Time::HiRes::time - $service_time));
+ $service_time = sprintf("%.2f", (Time::HiRes::time - $service_time));
INFO "Graphed service : $sname ($service_time sec * 4)";
print $STATS "GS|$service_time\n" unless $skip_stats;
foreach (@added) {
- delete $service->{$_} if exists $service->{$_};
+ delete $service->{$_} if exists $service->{$_};
}
@added = ();
}
@@ -1117,17 +1319,17 @@
sub graph_by_minute {
my $service = shift;
- return (munin_get ($service, "graph_period", "second") eq "minute");
+ return (munin_get($service, "graph_period", "second") eq "minute");
}
sub orig_to_cdef {
my $service = shift;
my $fieldname = shift;
- return unless ref ($service) eq "HASH";
+ return unless ref($service) eq "HASH";
if (defined $service->{$fieldname}->{"cdef_name"}) {
- return orig_to_cdef ($service, $service->{$fieldname}->{"cdef_name"});
+ return orig_to_cdef($service, $service->{$fieldname}->{"cdef_name"});
}
return $fieldname;
}
@@ -1135,7 +1337,7 @@
sub skip_service {
my $service = shift;
- my $sname = munin_get_node_name ($service);
+ my $sname = munin_get_node_name($service);
# Skip if we've limited services with cli options
return 1 if (@limit_services and !grep /^$sname$/, @limit_services);
@@ -1144,64 +1346,62 @@
return 0 if $force_graphing;
# See if we should skip it because of conf-options
- return 1 if (munin_get ($service, "graph", "yes") eq "on-demand" or
- !munin_get_bool ($service, "graph", 1));
+ return 1
+ if (munin_get($service, "graph", "yes") eq "on-demand"
+ or !munin_get_bool($service, "graph", 1));
# Don't skip
return 0;
}
sub expand_cdef {
- my $service = shift;
- my $cfield_ref = shift;
- my $cdef = shift;
-
- my $new_field = &get_field_name ("cdef$$cfield_ref");
-
- my ($max, $min, $avg) = ("CDEF:a$new_field=$cdef", "CDEF:i$new_field=$cdef", "CDEF:g$new_field=$cdef");
-
- foreach my $field (@{munin_find_field ($service, "label")}) {
- my $fieldname = munin_get_node_name ($field);
- my $rrdname = &orig_to_cdef ($service, $fieldname);
- if ($cdef =~ /\b$fieldname\b/) {
- $max =~ s/([,=])$fieldname([,=]|$)/$1a$rrdname$2/g;
- $min =~ s/([,=])$fieldname([,=]|$)/$1i$rrdname$2/g;
- $avg =~ s/([,=])$fieldname([,=]|$)/$1g$rrdname$2/g;
- }
+ my $service = shift;
+ my $cfield_ref = shift;
+ my $cdef = shift;
+
+ my $new_field = &get_field_name("cdef$$cfield_ref");
+
+ my ($max, $min, $avg) = (
+ "CDEF:a$new_field=$cdef", "CDEF:i$new_field=$cdef",
+ "CDEF:g$new_field=$cdef"
+ );
+
+ foreach my $field (@{munin_find_field($service, "label")}) {
+ my $fieldname = munin_get_node_name($field);
+ my $rrdname = &orig_to_cdef($service, $fieldname);
+ if ($cdef =~ /\b$fieldname\b/) {
+ $max =~ s/([,=])$fieldname([,=]|$)/$1a$rrdname$2/g;
+ $min =~ s/([,=])$fieldname([,=]|$)/$1i$rrdname$2/g;
+ $avg =~ s/([,=])$fieldname([,=]|$)/$1g$rrdname$2/g;
+ }
}
- munin_set_var_loc ($service, [$$cfield_ref, "cdef_name"], $new_field);
+ munin_set_var_loc($service, [$$cfield_ref, "cdef_name"], $new_field);
$$cfield_ref = $new_field;
return ($max, $min, $avg);
}
-sub parse_path
-{
+sub parse_path {
my ($path, $domain, $node, $service, $field) = @_;
my $filename = "unknown";
- if ($path =~ /^\s*([^:]*):([^:]*):([^:]*):([^:]*)\s*$/)
- {
- $filename = munin_get_filename ($config, $1, $2, $3, $4);
- }
- elsif ($path =~ /^\s*([^:]*):([^:]*):([^:]*)\s*$/)
- {
- $filename = munin_get_filename ($config, $domain, $1, $2, $3);
- }
- elsif ($path =~ /^\s*([^:]*):([^:]*)\s*$/)
- {
- $filename = munin_get_filename ($config, $domain, $node, $1, $2);
- }
- elsif ($path =~ /^\s*([^:]*)\s*$/)
- {
- $filename = munin_get_filename ($config, $domain, $node, $service, $1);
+ if ($path =~ /^\s*([^:]*):([^:]*):([^:]*):([^:]*)\s*$/) {
+ $filename = munin_get_filename($config, $1, $2, $3, $4);
+ }
+ elsif ($path =~ /^\s*([^:]*):([^:]*):([^:]*)\s*$/) {
+ $filename = munin_get_filename($config, $domain, $1, $2, $3);
+ }
+ elsif ($path =~ /^\s*([^:]*):([^:]*)\s*$/) {
+ $filename = munin_get_filename($config, $domain, $node, $1, $2);
+ }
+ elsif ($path =~ /^\s*([^:]*)\s*$/) {
+ $filename = munin_get_filename($config, $domain, $node, $service, $1);
}
return $filename;
}
-sub escape
-{
+sub escape {
my $text = shift;
return if not defined $text;
$text =~ s/\\/\\\\/g;
@@ -1209,8 +1409,7 @@
return $text;
}
-sub RRDescape
-{
+sub RRDescape {
my $text = shift;
return $RRDs::VERSION < 1.2 ? $text : escape($text);
}
@@ -1247,7 +1446,7 @@
--[no]sumyear Create summarised year-graphs. [--sumyear]
";
- exit 0;
+ exit 0;
}
1;
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/lib/Munin/Master/Group.pm
^
|
@@ -2,7 +2,7 @@
use base qw(Munin::Master::GroupRepository);
-# $Id: Group.pm 2592 2009-10-14 12:53:18Z janl $
+# $Id: Group.pm 2831 2009-11-03 23:32:48Z janl $
use warnings;
use strict;
@@ -55,8 +55,16 @@
sub get_all_hosts {
my ($self) = @_;
+
+ my @hosts = ();
+
+ for my $group (values %{$self->{groups}}) {
+ push @hosts, $group->get_all_hosts;
+ }
+
+ push @hosts, values %{$self->{hosts}};
- return values %{$self->{hosts}};
+ return @hosts;
}
1;
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/lib/Munin/Master/GroupRepository.pm
^
|
@@ -2,7 +2,7 @@
use base qw(Munin::Master::Config);
-# $Id: GroupRepository.pm 2613 2009-10-19 15:01:19Z janl $
+# $Id: GroupRepository.pm 2831 2009-11-03 23:32:48Z janl $
use warnings;
use strict;
@@ -28,95 +28,8 @@
return $self;
}
-
-=comment
-
-I do not think this is needed here anymore - all parsing happens in
-Munin::Master::Config (or it's super classes) - janl 16.10.2009
-
-sub _initialize {
- my ($self, $groups_and_hosts) = @_;
-
- #use Data::Dumper; warn Dumper($groups_and_hosts);
-
- for my $gah (keys %$groups_and_hosts) {
- DEBUG "Initialization loop: section label [$gah]\n";
-
- croak "Invalid section name [" . $gah .
- "], check munin configuration file, failed"
- unless $gah =~ /^[-\w;:.]+$/;
-
- $self->_process_section($gah, $groups_and_hosts->{$gah});
- }
- for my $group (values %{$self->{groups}}) {
- $group->give_attributes_to_hosts();
- }
-}
-
-sub _process_group {
- # Process group part of section
- my ($self, $group_name, $attributes) = @_;
-
- DEBUG "Processing section in group $group_name\n";
-
- croak "Invalid group section definition" unless length $group_name;
-
- $self->{groups}{$group_name} ||= Munin::Master::Group->new($group_name);
- $self->{groups}{$group_name}->add_attributes($attributes);
-
- return $self->{groups}{$group_name};
-}
-
-
-sub _process_section {
- my ($self, $definition, $attributes) = @_;
-
- DEBUG "Processing section labeled [$definition]\n";
-
- my $group_name =
- $self->_extract_group_name_from_definition($definition);
-
- my $group = $self->_process_group($group_name, {});
-
- my $host_name = substr($definition, rindex($definition, ';')+1 );
-
- if (length($host_name) > 0) {
- my $host = Munin::Master::Host->new($host_name, $group, $attributes);
- $group->add_host($host);
- }
-
- return $group;
-}
-
-
-sub _extract_host_name_from_definition {
- my ($self, $definition) = @_;
-
- my $dot_loc = index($definition, '.');
- my $sc_loc = index($definition, ';');
-
- # Return bare hostname
- return $definition if $sc_loc == -1 and $dot_loc == -1;
-}
-
-
-=cut
-
-
-sub get_all_hosts {
- my ($self) = @_;
-
- my @hosts = ();
- for my $group (values %{$self->{groups}}) {
- push @hosts, $group->get_all_hosts();
- }
-
- return @hosts;
-}
-
1;
-
__END__
=head1 NAME
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/lib/Munin/Master/HTMLOld.pm
^
|
@@ -1,14 +1,15 @@
package Munin::Master::HTMLOld;
-# -*- perl -*-
-=comment
+=begin comment
+-*- perl -*-
This is Munin::Master::HTMLOld, a minimal package shell to make
munin-html modular (so it can loaded persistently in
munin-fastcgi-graph for example) without making it object oriented
-yet. The non "old" module will feature propper object orientation
+yet. The non-"old" module will feature propper object orientation
like munin-update and will have to wait until later.
+
Copyright (C) 2002-2009 Jimmy Olsen, Audun Ytterdal, Kjell Magne
Øierud, Nicolai Langfeldt, Linpro AS, Redpill Linpro AS and others.
@@ -24,10 +25,32 @@
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.
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+$Id: HTMLOld.pm 2975 2009-11-13 07:47:30Z feiner.tom $
+
+
+This is the hierarchy of templates
+
+ * munin-overview.tmpl - Overview with all groups and hosts shown (2 levels down)
+
+ * munin-domianview.tmpl - all members of one domain, showing links down to each single service
+ and/or sub-group
+ * munin-nodeview.tmpl - two (=day, week) graphs from all plugins on the node
-$Id: HTMLOld.pm 2759 2009-10-29 14:12:58Z janl $
+ * munin-serviceview.tmpl - deepest level of view, shows all 4 graphs from one timeseries
+
+ OR
+
+ * munin-nodeview.tmpl - multigraph sub-level. When multigraph sublevels end ends
+ the next is a munin-serviceview.
+
+ * Comparison pages (x4) are at the service level. Not sure how to work multigraph into them so
+ avoid it all-together.
+
+=end comment
=cut
@@ -37,7 +60,7 @@
use Exporter;
our (@ISA, @EXPORT);
-@ISA = qw(Exporter);
+@ISA = qw(Exporter);
@EXPORT = qw(html_startup html_main);
use HTML::Template;
@@ -51,163 +74,398 @@
use Log::Log4perl qw( :easy );
-my @times = ( "day", "week", "month", "year" );
-
-my @limit_hosts = ();
-my @limit_services = ();
+my @times = ("day", "week", "month", "year");
-my $DEBUG=0;
-my $conffile = "$Munin::Common::Defaults::MUNIN_CONFDIR/munin.conf";
-my $do_usage = 0;
+my $DEBUG = 0;
+my $conffile = "$Munin::Common::Defaults::MUNIN_CONFDIR/munin.conf";
+my $do_usage = 0;
my $do_version = 0;
-my $stdout = 0;
+my $stdout = 0;
my $config;
my $limits;
-my $timestamp;
+my $htmltagline;
my %comparisontemplates;
+my $tmpldir;
+my $htmldir;
+
+my $do_dump = 0;
+my $do_fork = 0; # No effect in this program.
sub html_startup {
my ($ARGV) = @_;
- &print_usage_and_exit unless
- GetOptionsFromArray (
+ $do_usage = 1
+ unless GetOptionsFromArray(
$ARGV,
- "host=s" => \@limit_hosts,
- "service=s" => \@limit_services,
- "config=s" => \$conffile,
- "debug!" => \$DEBUG,
- "stdout!" => \$stdout,
- "help" => \$do_usage,
- "version!" => \$do_version );
+ "host=s" => [],
+ "service=s" => [],
+ "config=s" => \$conffile,
+ "debug!" => \$DEBUG,
+ "stdout!" => \$stdout,
+ "help" => \$do_usage,
+ "version!" => \$do_version,
+ "dump!" => \$do_dump,
+ "fork!" => \$do_fork,
+ );
- if ($do_version) {
- print_version_and_exit();
- }
+ print_usage_and_exit() if $do_usage;
+ print_version_and_exit() if $do_version;
exit_if_run_by_super_user();
- $config = &munin_config ($conffile, $config);
+ $config = munin_config($conffile, $config);
+ $limits = munin_readconfig($config->{dbdir} . "/limits", 1, 1);
- %comparisontemplates = (
- day => HTML::Template->new(
- filename => "$config->{tmpldir}/munin-comparison-day.tmpl",
- die_on_bad_params => 0,
- loop_context_vars => 1),
- week => HTML::Template->new(
- filename => "$config->{tmpldir}/munin-comparison-week.tmpl",
- die_on_bad_params => 0,
- loop_context_vars => 1),
- month => HTML::Template->new(
- filename => "$config->{tmpldir}/munin-comparison-month.tmpl",
- die_on_bad_params => 0, loop_context_vars => 1),
- year => HTML::Template->new(
- filename => "$config->{tmpldir}/munin-comparison-year.tmpl",
- die_on_bad_params => 0,
- loop_context_vars => 1)
- );
+ logger_open($config->{'logdir'});
+ logger_debug() if $DEBUG;
- #Make sure the logo and the stylesheet file is in the html dir
- my @files = ("style.css", "logo.png", "definitions.html");
- foreach my $file( (@files) ) {
- if ((! -e "$config->{htmldir}/$file") or
- (-e "$config->{tmpldir}/$file") and
- ((stat ("$config->{tmpldir}/$file"))[9] > (stat("$config->{htmldir}/$file"))[9])) {
- unless (system("cp", "$config->{tmpldir}/$file", "$config->{htmldir}/")){
- logger("copied $file into htmldir");
- } else {
- logger("could not copy $file into htmldir");
- }
- }
- }
+ $tmpldir = $config->{tmpldir};
+ $htmldir = $config->{htmldir};
+
+ %comparisontemplates = instanciate_comparison_templates($tmpldir);
-}
+ copy_web_resources($tmpldir, $htmldir);
+
+ if (!defined $config->{'cgiurl_graph'}) {
+ if (defined $config->{'cgiurl'}) {
+ $config->{'cgiurl_graph'}
+ = $config->{'cgiurl'} . "/munin-cgi-graph";
+ }
+ else {
+ $config->{'cgiurl_graph'} = "/cgi-bin/munin-cgi-graph";
+ }
+ INFO "[INFO] Determined that cgiurl_graph is ".$config->{'cgiurl_graph'} if
+ munin_get($config,"graph_strategy","cron") eq 'cgi';
+ }
+}
sub html_main {
my $update_time = Time::HiRes::time;
- logger_open($config->{'logdir'});
- logger_debug() if $DEBUG;
-
- INFO "Starting munin-html, checking lock";
+ my $lockfile = "$config->{rundir}/munin-html.lock";
- $limits = &munin_readconfig ($config->{dbdir}."/limits", 1, 1);
- if (!defined $config->{'cgiurl_graph'})
- {
- if (defined $config->{'cgiurl'})
- {
- $config->{'cgiurl_graph'} = $config->{'cgiurl'} . "/munin-cgi-graph";
- }
- else
- {
- $config->{'cgiurl_graph'} = "/cgi-bin/munin-cgi-graph";
- }
- }
+ INFO "[INFO] Starting munin-html, getting lock $lockfile";
- munin_runlock("$config->{rundir}/munin-html.lock");
+ munin_runlock($lockfile);
# For timestamping graphs
- my $timestamp = strftime("%Y-%m-%d T %T", localtime);
-
+ my $timestamp = strftime("%Y-%m-%d %T%z (%Z)", localtime);
+ if ($timestamp =~ /%z/) {
+ # %z (numeric timezone offset) may not be available, but %Z
+ # (timeszone name) seems to be universaly supported though the
+ # timezone names are not really standardized.
+ $timestamp = strftime("%Y-%m-%d %T%Z", localtime);
+ }
+ $htmltagline = "This page was generated by <a href='http://munin-monitoring.org/'>Munin</a> version ".$Munin::Common::Defaults::MUNIN_VERSION." at $timestamp";
# Preparing the group tree...
- my $groups = get_group_tree ($config);
+ my $groups = get_group_tree($config);
if (defined $groups->{"name"} and $groups->{"name"} eq "root") {
- $groups = $groups->{"groups"}; # root->groups
+ $groups = $groups->{"groups"}; # root->groups
+ }
+
+ if ($do_dump) {
+ use Data::Dumper;
+
+ $Data::Dumper::Sortkeys = sub { my $a=shift; my @b = grep (!/#%#parent/, keys %$a); \@b; };
+ print Dumper $groups;
+ exit 0;
+ }
+
+ generate_group_templates($groups);
+
+ emit_main_index($groups,$timestamp);
+
+ INFO "[INFO] Releasing lock file $lockfile";
+
+ munin_removelock("$lockfile");
+
+ $update_time = sprintf("%.2f", (Time::HiRes::time - $update_time));
+
+ INFO "[INFO] munin-html finished ($update_time sec)";
+}
+
+sub find_complinks{
+ my($type) = @_;
+
+ my @links = ();
+
+ foreach my $current (qw(day week month year)) {
+ my $data = {};
+
+ if ($type eq $current) {
+ $data->{'LINK'} = undef;
+ }
+ else {
+ $data->{'LINK'} = "comparison-$current.html";
+ }
+
+ $data->{'NAME'} = $current;
+ push(@links, $data);
+ }
+
+ return \@links;
+
+}
+
+
+sub emit_comparison_template {
+ my ($key, $t) = @_;
+
+ ( my $file = $key->{'filename'}) =~ s/index.html$//;
+
+ $file .= "comparison-$t.html";
+
+ DEBUG "[DEBUG] Creating comparison page $file";
+
+ $comparisontemplates{$t}->param(
+ INFO_OPTION => 'Groups on this level',
+ NAME => $key->{'name'},
+ GROUPS => $key->{'comparegroups'},
+ PATH => $key->{'path'},
+ CSSPATH => $key->{'csspath'},
+ COMPLINKS => find_complinks($t),
+ LARGESET => decide_largeset($key->{'peers'}),
+ PEERS => $key->{'peers'},
+ PARENT => $key->{'path'}->[-2]->{'name'},
+ CATEGORIES => $key->{'comparecategories'},
+ NCATEGORIES => $key->{'ncomparecategories'},
+ TAGLINE => $htmltagline,
+ );
+
+ open(my $FILE, '>', $file)
+ or die "Cannot open $file for writing: $!";
+ print $FILE $comparisontemplates{$t}->output;
+ close $FILE;
+}
+
+
+sub emit_graph_template {
+ my ($key) = @_;
+
+ my $graphtemplate = HTML::Template->new(
+ filename => "$tmpldir/munin-nodeview.tmpl",
+ die_on_bad_params => 0,
+ loop_context_vars => 1,
+ filter => sub {
+ my $ref = shift;
+ $$ref =~ s/URLX/URL$key->{'depth'}/g;
+ });
+
+ DEBUG "[DEBUG] Creating graph(nodeview) page ".$key->{filename};
+
+ $graphtemplate->param(
+ INFO_OPTION => 'Nodes on this level',
+ GROUPS => $key->{'groups'},
+ PATH => $key->{'path'},
+ CSSPATH => $key->{'csspath'},
+ PEERS => $key->{'peers'},
+ LARGESET => decide_largeset($key->{'peers'}),
+ PARENT => $key->{'path'}->[-2]->{'name'},
+ NAME => $key->{'name'},
+ CATEGORIES => $key->{'categories'},
+ NCATEGORIES => $key->{'ncategories'},
+ TAGLINE => $htmltagline,
+ );
+
+ my $filename = $key->{'filename'};
+ open(my $FILE, '>', $filename)
+ or die "Cannot open $filename for writing: $!";
+ print $FILE $graphtemplate->output;
+ close $FILE;
+}
+
+
+sub emit_group_template {
+ my ($key) = @_;
+
+ my $grouptemplate = HTML::Template->new(
+ filename => "$tmpldir/munin-domainview.tmpl",
+ die_on_bad_params => 0,
+ loop_context_vars => 1,
+ filter => sub {
+ my $ref = shift;
+ $$ref =~ s/URLX/URL$key->{'depth'}/g;
+ });
+
+ DEBUG "[DEBUG] Creating group page ".$key->{filename};
+
+ $grouptemplate->param(
+ INFO_OPTION => 'Groups on this level',
+ GROUPS => $key->{'groups'},
+ PATH => $key->{'path'},
+ CSSPATH => $key->{'csspath'},
+ PEERS => $key->{'peers'},
+ LARGESET => decide_largeset($key->{'peers'}),
+ PARENT => $key->{'path'}->[-2]->{'name'} || "Overview",
+ COMPARE => $key->{'compare'},
+ TAGLINE => $htmltagline,
+ );
+
+ my $filename = $key->{'filename'};
+ open(my $FILE, '>', $filename)
+ or die "Cannot open $filename for writing: $!";
+ print $FILE $grouptemplate->output;
+ close $FILE or die "Cannot close $filename after writing: $!";
+}
+
+
+sub emit_service_template {
+ my ($srv, $pathnodes, $peers, $csspath, $service) = @_;
+
+ my $servicetemplate = HTML::Template->new(
+ filename => "$tmpldir/munin-serviceview.tmpl",
+ die_on_bad_params => 0,
+ loop_context_vars => 1
+ );
+
+ #remove underscores from peers and title (last path element)
+ if ($peers){
+ $peers = [ map { $_->{'name'} =~ s/_/ /g; $_;} @$peers ];
}
+
+ $pathnodes->[scalar(@$pathnodes) - 1]->{'name'} =~ s/_/ /g;
+
+ $servicetemplate->param(
+ INFO_OPTION => 'Graphs in same category',
+ SERVICES => [$srv],
+ PATH => $pathnodes,
+ PEERS => $peers,
+ LARGESET => decide_largeset($peers),
+ CSSPATH => $csspath,
+ CATEGORY => ucfirst $srv->{'category'},
+ TAGLINE => $htmltagline,
+ );
+
+ # No stored filename for this kind of html node.
+ my $filename = munin_get_html_filename($service);
+
+ my $dirname = $filename;
+ $dirname =~ s/\/[^\/]*$//;
+
+ DEBUG "[DEBUG] Creating service page $filename";
+ munin_mkdir_p($dirname, oct(755));
+
+ open(my $FILE, '>', $filename)
+ or die "Cannot open '$filename' for writing: $!";
+ print $FILE $servicetemplate->output;
+ close $FILE or die "Cannot close '$filename' after writing: $!";
+}
+
+sub decide_largeset {
+
+ my ($peers) = @_;
+ return scalar(@$peers) > $config->{'dropdownlimit'} ? 1 : 0;
+
+}
+sub emit_main_index {
# Draw main index
- my $template = HTML::Template->new(filename => "$config->{tmpldir}/munin-overview.tmpl",
- die_on_bad_params => 0,
- loop_context_vars => 1);
-
- generate_group_templates ($groups);
-
- $template->param(GROUPS => $groups,
- TIMESTAMP => $timestamp);
- my $filename = munin_get_html_filename ($config);
- open (my $FILE, '>', $filename) or
- die "Cannot open $filename for writing: $!";
+
+ my ($groups, $timestamp) = @_;
+
+ my $template = HTML::Template->new(
+ filename => "$tmpldir/munin-overview.tmpl",
+ die_on_bad_params => 0,
+ loop_context_vars => 1
+ );
+
+ # FIX: this sometimes bugs:
+
+ # HTML::Template::param() : attempt to set parameter 'groups' with
+ # a scalar - parameter is not a TMPL_VAR! at
+ # /usr/local/share/perl/5.10.0/Munin/Master/HTMLOld.pm line 140
+
+ $template->param(
+ TAGLINE => $htmltagline,
+ GROUPS => $groups,
+ );
+
+ my $filename = munin_get_html_filename($config);
+
+ DEBUG "[DEBUG] Creating main index $filename";
+
+ open(my $FILE, '>', $filename)
+ or die "Cannot open $filename for writing: $!";
print $FILE $template->output;
close $FILE;
+}
+
- munin_removelock("$config->{rundir}/munin-html.lock");
+sub copy_web_resources {
+ my ($tmpldir, $htmldir) = @_;
- $update_time = sprintf("%.2f",(Time::HiRes::time - $update_time));
+ # Make sure the logo and the stylesheet file is in the html dir
+ # NOTE: The templates have hardcoded path to definitions.html, and it is not right, esp. when
+ # we have nested groups and nested services.
+ my @files = ("style.css", "logo.png", "logo-h.png", "definitions.html", "favicon.ico");
+
+ foreach my $file ((@files)) {
+ if ( (!-e "$htmldir/$file")
+ or (-e "$tmpldir/$file")
+ and ((stat("$tmpldir/$file"))[9] > (stat("$htmldir/$file"))[9])) {
+ unless (system("cp", "$tmpldir/$file", "$htmldir/")) {
+ INFO "[INFO] copied $file into " . $htmldir;
+ }
+ else {
+ ERROR "[ERROR] Could not copy $file from $tmpldir to $htmldir";
+ die "[ERROR] Could not copy $file from $tmpldir to $htmldir\n";
+ }
+ }
+ }
+}
+
+sub instanciate_comparison_templates {
+ my ($tmpldir) = @_;
- logger("munin-html finished ($update_time sec)");
+ return (
+ day => HTML::Template->new(
+ filename => "$tmpldir/munin-comparison-day.tmpl",
+ die_on_bad_params => 0,
+ loop_context_vars => 1
+ ),
+ week => HTML::Template->new(
+ filename => "$tmpldir/munin-comparison-week.tmpl",
+ die_on_bad_params => 0,
+ loop_context_vars => 1
+ ),
+ month => HTML::Template->new(
+ filename => "$tmpldir/munin-comparison-month.tmpl",
+ die_on_bad_params => 0,
+ loop_context_vars => 1
+ ),
+ year => HTML::Template->new(
+ filename => "$tmpldir/munin-comparison-year.tmpl",
+ die_on_bad_params => 0,
+ loop_context_vars => 1
+ ));
}
-sub get_png_size
-{
- my $filename = shift;
- my $width = undef;
- my $height = undef;
-
- if (open (my $PNG, '<', $filename))
- {
- my $incoming;
- binmode ($PNG);
- if (read ($PNG, $incoming, 4))
- {
- if ($incoming =~ /PNG$/)
- {
- if (read ($PNG, $incoming, 12))
- {
- if (read ($PNG, $incoming, 4))
- {
- $width = unpack ("N", $incoming);
- read ($PNG, $incoming, 4);
- $height = unpack ("N", $incoming);
- }
- }
- }
- }
- close ($PNG);
- }
+sub get_png_size {
+ my $filename = shift;
+ my $width = undef;
+ my $height = undef;
+
+ if (open(my $PNG, '<', $filename)) {
+ my $incoming;
+ binmode($PNG);
+ if (read($PNG, $incoming, 4)) {
+ if ($incoming =~ /PNG$/) {
+ if (read($PNG, $incoming, 12)) {
+ if (read($PNG, $incoming, 4)) {
+ $width = unpack("N", $incoming);
+ read($PNG, $incoming, 4);
+ $height = unpack("N", $incoming);
+ }
+ }
+ }
+ }
+ close($PNG);
+ }
- return ($width, $height);
+ return ($width, $height);
}
@@ -216,26 +474,59 @@
my $category = shift;
my $ret = [];
my $link = "index.html";
- my $parent = munin_get_parent ($hash) || return;
- my $me = munin_get_node_name ($hash);
- my $pchildren = munin_get_children ($parent);
-
- foreach my $peer (sort {munin_get_node_name($a) cmp munin_get_node_name($b)} @$pchildren) {
- next unless defined $peer and ref ($peer) eq "HASH";
- next if defined $category and lc (munin_get ($peer, "graph_category", "other")) ne $category;
- next if (!defined $peer->{'graph_title'} and (!defined $peer->{'#%#visible'} or !$peer->{'#%#visible'}));
- next if (defined $peer->{'graph_title'} and !munin_get_bool ($peer, "graph", 1));
- my $peername = munin_get_node_name ($peer);
- next if $peername eq "contact" and munin_get_node_name ($parent) eq "root";
- if ($peername eq $me) {
- unshift @$ret, { "name" => $peername, "link" => undef };
- } else {
- if (defined $peer->{'graph_title'}) {
- unshift @$ret, { "name" => $peername, "link" => "$peername.html" };
+ my $parent = munin_get_parent($hash) || return;
+ my $me = munin_get_node_name($hash);
+ my $pchildren = munin_get_children($parent);
+
+ foreach my $peer (sort {munin_get_node_name($b) cmp munin_get_node_name($a)}
+ @$pchildren) {
+ next unless defined $peer and ref($peer) eq "HASH";
+ next
+ if defined $category
+ and lc(munin_get($peer, "graph_category", "other")) ne
+ $category;
+ next
+ if (!defined $peer->{'graph_title'}
+ and (!defined $peer->{'#%#visible'} or !$peer->{'#%#visible'}));
+ next
+ if (defined $peer->{'graph_title'}
+ and !munin_get_bool($peer, "graph", 1));
+ my $peername = munin_get_node_name($peer);
+ next
+ if $peername eq "contact"
+ and munin_get_node_name($parent) eq "root";
+ if ($peername eq $me) {
+ unshift @$ret, {"name" => $peername, "link" => undef};
+ }
+ else {
+ # Handle different directory levels between subgraphs and regular graphs
+ if (munin_has_subservices ($hash)) {
+ if (munin_has_subservices ($peer)) {
+ # I've got subgraphs, peer's got subgraphs
+ unshift @$ret,
+ {"name" => $peername, "link" => "../$peername/index.html"};
+ } else {
+ # I've got subgraphs, peer's a regular graph
+ unshift @$ret,
+ {"name" => $peername, "link" => "../$peername.html"};
+ }
+ } elsif (munin_has_subservices ($peer)) {
+ # I'm a regular graph, peer's got subgraphs
+ unshift @$ret,
+ {"name" => $peername, "link" => "$peername/index.html"};
} else {
- unshift @$ret, { "name" => $peername, "link" => "../$peername/index.html" };
+ if (defined $peer->{'graph_title'}) {
+ # Both me and peer are regular graphs
+ unshift @$ret,
+ {"name" => $peername, "link" => "$peername.html"};
+ }
+ else {
+ # We're not on the graph level -- handle group peering
+ unshift @$ret,
+ {"name" => $peername, "link" => "../$peername/index.html"};
+ }
}
- }
+ }
}
return $ret;
}
@@ -244,33 +535,66 @@
sub get_group_tree {
my $hash = shift;
my $base = shift || "";
- my $graphs = [];
- my $groups = [];
- my $cattrav = {};
- my $cats = [];
- my $path = [];
+
+ my $graphs = []; # Pushy array of graphs, [ { name => 'cpu'}, ...]
+ my $groups = []; # Slices of the $config hash
+ my $cattrav = {}; # Categories, array of strings
+ my $cats = []; # Array of graph information ('categories')
+ my $path = []; # (temporary) array of paths relevant to . (here)
my $rpath = undef;
- my $ret = {};
my $visible = 0;
my $csspath;
- my $children = munin_get_sorted_children ($hash);
+ my $children = munin_get_sorted_children($hash);
foreach my $child (@$children) {
- next unless defined $child and ref ($child) eq "HASH" and keys %$child;
- if (defined $child->{"graph_title"} and munin_get_bool ($child, "graph", 1)) {
- my $childname = munin_get_node_name ($child);
- my $childnode = generate_service_templates ($child);
- $visible = 1;
- push @$graphs, { "name" => $childname };
- $childnode->{'name'} = $child->{"graph_title"};
- $childnode->{'url'} = $base . $childname.".html";
- for (my $shrinkpath = $childnode->{'url'}, my $counter = 0; $shrinkpath; $shrinkpath =~ s/^[^\/]+\/?//, $counter++) {
- $childnode->{'url'.$counter} = $shrinkpath;
+ next unless defined $child and ref($child) eq "HASH" and keys %$child;
+
+ $child->{"#%#ParentsNameAsString"} = munin_get_node_name($hash);
+
+ if (defined $child->{"graph_title"}
+ and munin_get_bool($child, "graph", 1)) {
+
+ $child->{'#%#is_service'} = 1;
+
+ my $childname = munin_get_node_name($child);
+ my $childnode = generate_service_templates($child);
+
+ push @$graphs, {"name" => $childname};
+ $childnode->{'name'} = $child->{"graph_title"};
+
+ # Make sure the link gets right even if the service has subservices
+ if (munin_has_subservices ($child)) {
+ $childnode->{'url'} = $base . $childname . "/index.html";
+ } else {
+ $childnode->{'url'} = $base . $childname . ".html";
}
- push @{$cattrav->{ lc munin_get ($child, "graph_category", "other") }}, $childnode;
- } elsif (ref ($child) eq "HASH" and !defined $child->{"graph_title"}) {
- push @$groups, grep { defined $_ } get_group_tree ($child, $base . munin_get_node_name ($child) . "/");
+
+ for (my $shrinkpath = $childnode->{'url'}, my $counter = 0;
+ $shrinkpath;
+ $shrinkpath =~ s/^[^\/]+\/?//, $counter++)
+ {
+ $childnode->{'url' . $counter} = $shrinkpath;
+ }
+
+ push @{$cattrav->{lc munin_get($child, "graph_category", "other")}},
+ $childnode;
+
+ # IFF this is a multigraph plugin there may be sub-graphs.
+ push( @$groups,
+ grep {defined $_}
+ get_group_tree($child,
+ $base.munin_get_node_name($child)."/"));
+
+ $visible = 1;
+ }
+ elsif (ref($child) eq "HASH" and !defined $child->{"graph_title"}) {
+
+ push( @$groups,
+ grep {defined $_}
+ get_group_tree($child,
+ $base.munin_get_node_name($child) . "/"));
+
if (scalar @$groups) {
$visible = 1;
}
@@ -278,122 +602,178 @@
}
return unless $visible;
+
$hash->{'#%#visible'} = 1;
# We need the categories in another format.
foreach my $cat (sort keys %$cattrav) {
- my $obj = {};
- $obj->{'name'} = $cat;
- $obj->{'url'} = $base."index.html#".$cat;
- $obj->{'services'} = [ sort { lc ($a->{'name'}) cmp lc ($b->{'name'}) } @{$cattrav->{$cat}} ];
- $obj->{'state_'.lc munin_category_status ($hash, $limits, $cat, 1)} = 1;
- for (my $shrinkpath = $obj->{'url'}, my $counter = 0; $shrinkpath =~ /\//; $shrinkpath =~ s/^[^\/]+\/*//, $counter++) {
- $obj->{'url'.$counter} = $shrinkpath;
- }
- push @$cats, $obj;
+ my $obj = {};
+ $obj->{'name'} = $cat;
+ $obj->{'url'} = $base . "index.html#" . $cat;
+ $obj->{'services'} = [sort {lc($a->{'name'}) cmp lc($b->{'name'})}
+ @{$cattrav->{$cat}}];
+ $obj->{'state_' . lc munin_category_status($hash, $limits, $cat, 1)}
+ = 1;
+ for (
+ my $shrinkpath = $obj->{'url'}, my $counter = 0;
+ $shrinkpath =~ /\//;
+ $shrinkpath =~ s/^[^\/]+\/*//, $counter++
+ ) {
+ $obj->{'url' . $counter} = $shrinkpath;
+ }
+ push @$cats, $obj;
}
# ...and we need a couple of paths available.
- @$path = reverse map { { "name" => $_, "path" => (defined $rpath?($rpath.="../")."index.html":($rpath="")) } } reverse ( undef , split ('\/', $base) );
+ @$path = reverse map {
+ {
+ "name" => $_,
+ "path" => (
+ defined $rpath
+ ? ($rpath .= "../") . "index.html"
+ : ($rpath = ""))}
+ } reverse(undef, split('\/', $base));
+
($csspath = $path->[0]->{'path'}) =~ s/index.html$/style.css/;
# We need a bit more info for the comparison templates
- my $compare = munin_get_bool ($hash, "compare", 1);
- my $comparecats = [];
+ my $compare = munin_get_bool($hash, "compare", 1);
+ my $comparecats = [];
my $comparecatshash = {};
- my $comparegroups = [];
+ my $comparegroups = [];
+
if ($compare) {
- foreach my $tmpgroup (@$groups) {
- # First we gather a bit of data into comparecatshash...
- if ($tmpgroup->{'ngraphs'} > 0) {
- push @$comparegroups, $tmpgroup;
- foreach my $tmpcat (@{$tmpgroup->{'categories'}}) {
- $comparecatshash->{$tmpcat->{'name'}}->{'groupname'} = $tmpcat->{'name'};
- foreach my $tmpserv (@{$tmpcat->{'services'}}) {
- $comparecatshash->{$tmpcat->{'name'}}->{'services'}->{$tmpserv->{'name'}}->{'nodes'}->{$tmpgroup->{'name'}} = $tmpserv;
- $comparecatshash->{$tmpcat->{'name'}}->{'services'}->{$tmpserv->{'name'}}->{'nodes'}->{$tmpgroup->{'name'}}->{'nodename'} = $tmpgroup->{'name'};
- }
- }
- }
- }
- if (scalar @$comparegroups > 1) {
+ foreach my $tmpgroup (@$groups) {
+
+ # First we gather a bit of data into comparecatshash...
+ if ($tmpgroup->{'ngraphs'} > 0) {
+ push @$comparegroups, $tmpgroup;
+ foreach my $tmpcat (@{$tmpgroup->{'categories'}}) {
+ $comparecatshash->{$tmpcat->{'name'}}->{'groupname'}
+ = $tmpcat->{'name'};
+ foreach my $tmpserv (@{$tmpcat->{'services'}}) {
+ $comparecatshash->{$tmpcat->{'name'}}->{'services'}
+ ->{$tmpserv->{'name'}}->{'nodes'}
+ ->{$tmpgroup->{'name'}} = $tmpserv;
+ $comparecatshash->{$tmpcat->{'name'}}->{'services'}
+ ->{$tmpserv->{'name'}}->{'nodes'}
+ ->{$tmpgroup->{'name'}}->{'nodename'}
+ = $tmpgroup->{'name'};
+ }
+ }
+ }
+ }
+ if (scalar @$comparegroups > 1) {
+
# ...then we restructure it, comparecats need to end up looking like: ->[i]->{'service'}->[i]->{'nodes'}->[i]->{*}
- $compare = 1;
- foreach my $tmpcat (sort keys %$comparecatshash) {
- foreach my $tmpserv (sort keys %{$comparecatshash->{$tmpcat}->{'services'}}) {
- my @nodelist = map { $comparecatshash->{$tmpcat}->{'services'}->{$tmpserv}->{'nodes'}->{$_} }
- sort keys %{$comparecatshash->{$tmpcat}->{'services'}->{$tmpserv}->{'nodes'}};
- delete $comparecatshash->{$tmpcat}->{'services'}->{$tmpserv}->{'nodes'};
- $comparecatshash->{$tmpcat}->{'services'}->{$tmpserv}->{'nodes'} = \@nodelist;
- }
- my @servlist = map { $comparecatshash->{$tmpcat}->{'services'}->{$_} }
- sort keys %{$comparecatshash->{$tmpcat}->{'services'}};
- delete $comparecatshash->{$tmpcat}->{'services'};
- $comparecatshash->{$tmpcat}->{'services'} = \@servlist;
- }
- @$comparecats = map { $comparecatshash->{$_} } sort keys %$comparecatshash;
- } else {
- $compare = 0;
- }
+ $compare = 1;
+ foreach my $tmpcat (sort keys %$comparecatshash) {
+ foreach my $tmpserv (
+ sort keys %{$comparecatshash->{$tmpcat}->{'services'}}) {
+ my @nodelist = map {
+ $comparecatshash->{$tmpcat}->{'services'}->{$tmpserv}
+ ->{'nodes'}->{$_}
+ }
+ sort keys
+ %{$comparecatshash->{$tmpcat}->{'services'}->{$tmpserv}
+ ->{'nodes'}};
+ delete $comparecatshash->{$tmpcat}->{'services'}->{$tmpserv}
+ ->{'nodes'};
+ $comparecatshash->{$tmpcat}->{'services'}->{$tmpserv}
+ ->{'nodes'} = \@nodelist;
+ }
+ my @servlist
+ = map {$comparecatshash->{$tmpcat}->{'services'}->{$_}}
+ sort keys %{$comparecatshash->{$tmpcat}->{'services'}};
+ delete $comparecatshash->{$tmpcat}->{'services'};
+ $comparecatshash->{$tmpcat}->{'services'} = \@servlist;
+ }
+ @$comparecats
+ = map {$comparecatshash->{$_}} sort keys %$comparecatshash;
+ }
+ else {
+ $compare = 0;
+ }
}
- $ret = {
- "name" => munin_get_node_name ($hash),
- "hashnode" => $hash,
- "url" => $base . "index.html",
- "path" => $path,
- "depth" => scalar(my @splitted_base = split("/",$base."index.html"))-1,
- "filename" => munin_get_html_filename ($hash),
- "csspath" => $csspath,
- "groups" => $groups,
- "graphs" => $graphs,
- "categories" => $cats,
- "ngroups" => scalar (@$groups),
- "ngraphs" => scalar (@$graphs),
- "ncategories" => scalar (@$cats),
- "compare" => $compare,
- "comparegroups" => $comparegroups,
- "ncomparegroups" => scalar (@$comparegroups),
- "comparecategories" => $comparecats,
- "ncomparecategories" => scalar (@$comparecats),
+ my $ret = {
+ "name" => munin_get_node_name($hash),
+ "hashnode" => $hash,
+ "url" => $base . "index.html",
+ "path" => $path,
+ "depth" => scalar(my @splitted_base = split("/", $base . "index.html"))
+ - 1,
+ "filename" => munin_get_html_filename($hash),
+ "csspath" => $csspath,
+ "groups" => $groups,
+ "graphs" => $graphs,
+ "multigraph" => munin_has_subservices ($hash),
+ "categories" => $cats,
+ "ngroups" => scalar(@$groups),
+ "ngraphs" => scalar(@$graphs),
+ "ncategories" => scalar(@$cats),
+ "compare" => $compare,
+ "comparegroups" => $comparegroups,
+ "ncomparegroups" => scalar(@$comparegroups),
+ "comparecategories" => $comparecats,
+ "ncomparecategories" => scalar(@$comparecats),
};
+
if ($ret->{'url'} ne "/index.html") {
- for (my $shrinkpath = $ret->{'url'}, my $counter = 0; $shrinkpath =~ /\//; $shrinkpath =~ s/^[^\/]+\/*//, $counter++) {
- $ret->{'url'.$counter} = $shrinkpath;
- }
+ for (
+ my $shrinkpath = $ret->{'url'}, my $counter = 0;
+ $shrinkpath =~ /\//;
+ $shrinkpath =~ s/^[^\/]+\/*//, $counter++
+ ) {
+ $ret->{'url' . $counter} = $shrinkpath;
+ }
}
return $ret;
}
+# This is called both at group level, service level, and subservice level
sub munin_get_sorted_children {
- my $hash = shift || return;
- my $children = munin_get_children ($hash);
- my $group_order = $hash->{'group_order'} || "";
- my $ret = [];
+ my $hash = shift || return;
+
+ my $children = munin_get_children($hash);
+ my $group_order;
+ my $ret = [];
+
+ if (defined $hash->{'group_order'}) {
+ $group_order = $hash->{'group_order'};
+ } elsif (defined $hash->{'domain_order'}) {
+ $group_order = $hash->{'domain_order'};
+ } elsif (defined $hash->{'node_order'}) {
+ $group_order = $hash->{'node_order'};
+ } else {
+ $group_order = "";
+ }
- my %children = map { munin_get_node_name ($_) => $_ } @$children;
+ my %children = map {munin_get_node_name($_) => $_} @$children;
foreach my $group (split /\s+/, $group_order) {
if (defined $children{$group}) {
- push @$ret, $children{$group};
- delete $children{$group};
- } elsif ($group =~ /^(.+)=([^=]+)$/) {
- # "Borrow" the graph from another group
- my $groupname = $1;
- my $path = $2;
- my $borrowed = munin_get_node_partialpath ($hash, $path);
- if (defined $borrowed) {
- munin_copy_node_toloc ($borrowed, $hash, [$groupname]);
- $hash->{$groupname}->{'#%#origin'} = $borrowed;
- }
- push @$ret, $hash->{$groupname};
- }
+ push @$ret, $children{$group};
+ delete $children{$group};
+ }
+ elsif ($group =~ /^(.+)=([^=]+)$/) {
+
+ # "Borrow" the graph from another group
+ my $groupname = $1;
+ my $path = $2;
+ my $borrowed = munin_get_node_partialpath($hash, $path);
+ if (defined $borrowed) {
+ munin_copy_node_toloc($borrowed, $hash, [$groupname]);
+ $hash->{$groupname}->{'#%#origin'} = $borrowed;
+ }
+ push @$ret, $hash->{$groupname};
+ }
}
- foreach my $group (sort { $a cmp $b } keys %children) {
+ foreach my $group (sort {$a cmp $b} keys %children) {
push @$ret, $children{$group};
}
@@ -403,109 +783,70 @@
sub generate_group_templates {
my $arr = shift || return;
- return unless ref ($arr) eq "ARRAY";
+ return unless ref($arr) eq "ARRAY";
foreach my $key (@$arr) {
- if (defined $key and ref ($key) eq "HASH") {
- $key->{'peers'} = get_peer_nodes ($key->{'hashnode'});
- delete $key->{'hashnode'}; # This was only kept there for getting the peers
- if (defined $key->{'ngroups'} and $key->{'ngroups'}) {
- $key->{'groups'} = $key->{'groups'};
- generate_group_templates ($key->{'groups'});
-
- my $grouptemplate = HTML::Template->new(
- filename => munin_get ($config, "tmpldir", "")."/munin-domainview.tmpl",
- die_on_bad_params => 0,
- loop_context_vars => 1,
- filter => sub { my $ref=shift; $$ref =~ s/URLX/URL$key->{'depth'}/g; }
- );
-
- $grouptemplate->param (
- GROUPS => $key->{'groups'},
- PATH => $key->{'path'},
- CSSPATH => $key->{'csspath'},
- PEERS => $key->{'peers'},
- PARENT => $key->{'path'}->[-2]->{'name'} || "Overview",
- COMPARE => $key->{'compare'},
- TIMESTAMP => $timestamp,
- );
- my $filename = $key->{'filename'};
- open (my $FILE, '>', $filename) or
- die "Cannot open $filename for writing: $!";
- print $FILE $grouptemplate->output;
- close $FILE;
-
- if ($key->{'compare'}) { # Create comparison templates as well
- foreach my $t (@times) {
- (my $file = $key->{'filename'}) =~ s/index.html$//;
- $file .= "comparison-$t.html";
- $comparisontemplates{$t}->param (
- NAME => $key->{'name'},
- GROUPS => $key->{'comparegroups'},
- PATH => $key->{'path'},
- CSSPATH => $key->{'csspath'},
- PEERS => $key->{'peers'},
- PARENT => $key->{'path'}->[-2]->{'name'},
- CATEGORIES => $key->{'comparecategories'},
- NCATEGORIES => $key->{'ncomparecategories'},
- TIMESTAMP => $timestamp,
- );
- open (my $FILE, '>', $file) or die "Cannot open $file for writing: $!";
- print $FILE $comparisontemplates{$t}->output;
- close $FILE;
- }
- }
- }
+ if (defined $key and ref($key) eq "HASH") {
+ $key->{'peers'} = get_peer_nodes($key->{'hashnode'}, lc munin_get($key->{'hashnode'}, "graph_category", "other"));
- if (defined $key->{'ngraphs'} and $key->{'ngraphs'}) {
- my $graphtemplate = HTML::Template->new(
- filename => munin_get ($config, "tmpldir", "")."/munin-nodeview.tmpl",
- die_on_bad_params => 0,
- loop_context_vars => 1,
- filter => sub { my $ref=shift; $$ref =~ s/URLX/URL$key->{'depth'}/g; }
- );
-
- $graphtemplate->param (
- GROUPS => $key->{'groups'},
- PATH => $key->{'path'},
- CSSPATH => $key->{'csspath'},
- PEERS => $key->{'peers'},
- PARENT => $key->{'path'}->[-2]->{'name'},
- NAME => $key->{'name'},
- CATEGORIES => $key->{'categories'},
- NCATEGORIES => $key->{'ncategories'},
- TIMESTAMP => $timestamp,
- );
- my $filename = $key->{'filename'};
- open (my $FILE, '>', $filename) or
- die "Cannot open $filename for writing: $!";
- print $FILE $graphtemplate->output;
- close $FILE;
- }
- }
+ # This was only kept there for getting the peers
+ delete $key->{'hashnode'};
+
+ if (defined $key->{'ngroups'} and $key->{'ngroups'}) {
+ # WTF: $key->{'groups'} = $key->{'groups'};
+ generate_group_templates($key->{'groups'});
+
+ emit_group_template($key);
+
+ if ($key->{'compare'}) { # Create comparison templates as well
+ foreach my $t (@times) {
+ emit_comparison_template($key,$t);
+ }
+ }
+ }
+
+ if (defined $key->{'ngraphs'} and $key->{'ngraphs'}) {
+ emit_graph_template($key);
+ }
+ }
}
}
sub borrowed_path {
+ # I wish I knew what this function does. It appears to make
+ # .. path elements to climb up the directory hierarchy. To
+ # "borrow" something from a different directory level.
+
my $hash = shift;
my $prepath = shift || "";
my $postpath = shift || "";
- return unless defined $hash and ref ($hash) eq "HASH";
+ return unless defined $hash and ref($hash) eq "HASH";
if (defined $hash->{'#%#origin'}) {
- return $prepath . "../" . munin_get_node_name ($hash->{'#%#origin'}) . "/" . $postpath;
- } else {
+ return
+ $prepath . "../"
+ . munin_get_node_name($hash->{'#%#origin'}) . "/"
+ . $postpath;
+ }
+ else {
if (defined $hash->{'#%#parent'}) {
- if (defined $hash->{'graph_title'}) {
- return borrowed_path ($hash->{'#%#parent'}, $prepath . "../", $postpath);
- } else {
- return borrowed_path ($hash->{'#%#parent'}, $prepath . "../", munin_get_node_name ($hash) . "/" . $postpath);
- }
- } else {
- return;
- }
+ if (defined $hash->{'graph_title'}) {
+ return borrowed_path($hash->{'#%#parent'}, $prepath . "../",
+ $postpath);
+ }
+ else {
+ return borrowed_path(
+ $hash->{'#%#parent'},
+ $prepath . "../",
+ munin_get_node_name($hash) . "/" . $postpath
+ );
+ }
+ }
+ else {
+ return;
+ }
}
}
@@ -513,145 +854,142 @@
sub generate_service_templates {
my $service = shift || return;
- return unless munin_get_bool ($service, "graph", 1);
+
+ return unless munin_get_bool($service, "graph", 1);
my %srv;
my $fieldnum = 0;
my @graph_info;
my @field_info;
- my @loc = munin_get_node_loc ($service);
- my $pathnodes = get_path_nodes ($service);
- my $peers = get_peer_nodes ($service, lc munin_get ($service, "graph_category", "other"));
- my $parent = munin_get_parent_name ($service);
- (my $csspath = $pathnodes->[0]->{'link'}) =~ s/index.html$/style.css/;
- my $bp = borrowed_path ($service) || ".";
+ my @loc = @{munin_get_node_loc($service)};
+ my $pathnodes = get_path_nodes($service);
+ my $peers = get_peer_nodes($service,
+ lc munin_get($service, "graph_category", "other"));
+ my $parent = munin_get_parent_name($service);
+ (my $csspath = $pathnodes->[0]->{'path'}) =~ s/index.html$/style.css/;
+ my $bp = borrowed_path($service) || ".";
- $srv{'node'} = munin_get_node_name ($service);
- logger("processing service: $srv{node}");
+ $srv{'node'} = munin_get_node_name($service);
+ DEBUG "[DEBUG] processing service: $srv{node}";
$srv{'service'} = $service;
- $srv{'label'} = munin_get ($service, "graph_title");
- $srv{'category'} = lc( munin_get ($service, "graph_category", "other") );
+ $srv{'label'} = munin_get($service, "graph_title");
+ $srv{'category'} = lc(munin_get($service, "graph_category", "other"));
- my $method = munin_get ($service, "graph_strategy", "cron");
+ my $method = munin_get($service, "graph_strategy", "cron");
- $srv{'url'} = "$srv{node}.html";
+ $srv{'url'} = "$srv{node}.html";
- my $path = join ('/', @loc);
+ my $path = join('/', @loc);
if ($method eq "cgi") {
- $srv{'imgday'} =$config->{'cgiurl_graph'}."/$path-day.png";
- $srv{'imgweek'} =$config->{'cgiurl_graph'}."/$path-week.png";
- $srv{'imgmonth'}=$config->{'cgiurl_graph'}."/$path-month.png";
- $srv{'imgyear'} =$config->{'cgiurl_graph'}."/$path-year.png";
-
- if (munin_get_bool ($service, "graph_sums", 0)) {
- $srv{'imgweeksum'} = $config->{'cgiurl_graph'}."/$path-week-sum.png";
- $srv{'imgyearsum'} = $config->{'cgiurl_graph'}."/$path-year-sum.png";
- }
- } else {
- # graph strategy cron
-
- # Image locations for regular pages
- $srv{'imgday'} ="$bp/$srv{node}-day.png";
- $srv{'imgweek'} ="$bp/$srv{node}-week.png";
- $srv{'imgmonth'}="$bp/$srv{node}-month.png";
- $srv{'imgyear'} ="$bp/$srv{node}-year.png";
-
- # Image locations for comparison pages
- $srv{'cimgday'} ="$bp/$parent/$srv{node}-day.png";
- $srv{'cimgweek'} ="$bp/$parent/$srv{node}-week.png";
- $srv{'cimgmonth'}="$bp/$parent/$srv{node}-month.png";
- $srv{'cimgyear'} ="$bp/$parent/$srv{node}-year.png";
+ $srv{'imgday'} = $config->{'cgiurl_graph'} . "/$path-day.png";
+ $srv{'imgweek'} = $config->{'cgiurl_graph'} . "/$path-week.png";
+ $srv{'imgmonth'} = $config->{'cgiurl_graph'} . "/$path-month.png";
+ $srv{'imgyear'} = $config->{'cgiurl_graph'} . "/$path-year.png";
+
+ if (munin_get_bool($service, "graph_sums", 0)) {
+ $srv{'imgweeksum'}
+ = $config->{'cgiurl_graph'} . "/$path-week-sum.png";
+ $srv{'imgyearsum'}
+ = $config->{'cgiurl_graph'} . "/$path-year-sum.png";
+ }
+ }
+ else {
+
+ # graph strategy cron
+
+ # Image locations for regular pages
+ $srv{'imgday'} = "$bp/$srv{node}-day.png";
+ $srv{'imgweek'} = "$bp/$srv{node}-week.png";
+ $srv{'imgmonth'} = "$bp/$srv{node}-month.png";
+ $srv{'imgyear'} = "$bp/$srv{node}-year.png";
+
+ # Image locations for comparison pages
+ $srv{'cimgday'} = "$bp/$parent/$srv{node}-day.png";
+ $srv{'cimgweek'} = "$bp/$parent/$srv{node}-week.png";
+ $srv{'cimgmonth'} = "$bp/$parent/$srv{node}-month.png";
+ $srv{'cimgyear'} = "$bp/$parent/$srv{node}-year.png";
}
for my $scale (@times) {
- if (my ($w, $h) = get_png_size(munin_get_picture_filename($service, $scale))) {
- $srv{"img".$scale."width"} = $w;
- $srv{"img".$scale."height"} = $h;
- }
+ if (my ($w, $h)
+ = get_png_size(munin_get_picture_filename($service, $scale))) {
+ $srv{"img" . $scale . "width"} = $w;
+ $srv{"img" . $scale . "height"} = $h;
+ }
}
- if (munin_get_bool ($service, "graph_sums", 0)) {
- $srv{imgweeksum} = "$srv{node}-week-sum.png";
- $srv{imgyearsum} = "$srv{node}-year-sum.png";
- for my $scale (["week", "year"]) {
- if (my ($w, $h) = get_png_size (munin_get_picture_filename($service, $scale, 1))) {
- $srv{"img".$scale."sumwidth"} = $w;
- $srv{"img".$scale."sumheight"} = $h;
- }
- }
+ if (munin_get_bool($service, "graph_sums", 0)) {
+ $srv{imgweeksum} = "$srv{node}-week-sum.png";
+ $srv{imgyearsum} = "$srv{node}-year-sum.png";
+ for my $scale (["week", "year"]) {
+ if (my ($w, $h)
+ = get_png_size(munin_get_picture_filename($service, $scale, 1)))
+ {
+ $srv{"img" . $scale . "sumwidth"} = $w;
+ $srv{"img" . $scale . "sumheight"} = $h;
+ }
+ }
}
# Do "help" section
- if (my $info = munin_get ($service, "graph_info")) {
- my %graph_info;
- $graph_info{info} = $info;
- push @{$srv{graphinfo}}, \%graph_info;
- }
-
- $srv{fieldlist} .= "<tr><th align='left' valign='top'>Field</th><th align='left' valign='top'>Type</th><th align='left' valign='top'>Warn</th><th align='left' valign='top'>Crit</th><th></tr>";
- foreach my $f (@{munin_get_field_order ($service)}) {
- $f =~ s/=(.*)$//;
- my $path = $1;
- next if (!defined $service->{$f});
- my $fieldobj = $service->{$f};
- next if (ref ($fieldobj) ne "HASH" or !defined $fieldobj->{'label'});
- next if (!munin_draw_field ($fieldobj));
+ if (my $info = munin_get($service, "graph_info")) {
+ my %graph_info;
+ $graph_info{info} = $info;
+ push @{$srv{graphinfo}}, \%graph_info;
+ }
+
+ $srv{fieldlist}
+ .= "<tr><th align='left' valign='top'>Field</th><th align='left' valign='top'>Type</th><th align='left' valign='top'>Warn</th><th align='left' valign='top'>Crit</th><th></tr>";
+ foreach my $f (@{munin_get_field_order($service)}) {
+ $f =~ s/=(.*)$//;
+ my $path = $1;
+ next if (!defined $service->{$f});
+ my $fieldobj = $service->{$f};
+ next if (ref($fieldobj) ne "HASH" or !defined $fieldobj->{'label'});
+ next if (!munin_draw_field($fieldobj));
+
+ #DEBUG "DEBUG: single_value: Checking field \"$f\" ($path).";
- #DEBUG "DEBUG: single_value: Checking field \"$f\" ($path).";
+ if (defined $path) {
- if (defined $path) {
- # This call is to make sure field settings are copied
+ # This call is to make sure field settings are copied
# for aliases, .stack, et al. Todo: put that part of
# munin_get_rrd_filename into its own functino.
- munin_get_rrd_filename ($f, $path);
- }
+ munin_get_rrd_filename($f, $path);
+ }
- my %field_info;
- $fieldnum++;
+ my %field_info;
+ $fieldnum++;
- $field_info{'hr'} = 1 unless ($fieldnum % 3);
- $field_info{'field'} = $f;
- $field_info{'label'} = munin_get ($fieldobj, "label", $f);
- $field_info{'type'} = lc( munin_get ($fieldobj, "type", "GAUGE") );
- $field_info{'warn'} = munin_get ($fieldobj, "warning");
- $field_info{'crit'} = munin_get ($fieldobj, "critical");
- $field_info{'info'} = munin_get ($fieldobj, "info");
-
- my $state = munin_field_status ($fieldobj, $limits, 1);
-
- if (defined $state) {
- $field_info{'state_warning'} = 1 if $state eq "warning";
- $field_info{'state_critical'} = 1 if $state eq "critical";
- $field_info{'state_unknown'} = 1 if $state eq "unknown";
- }
- push @{$srv{'fieldinfo'}}, \%field_info;
+ $field_info{'hr'} = 1 unless ($fieldnum % 3);
+ $field_info{'field'} = $f;
+ $field_info{'label'} = munin_get($fieldobj, "label", $f);
+ $field_info{'type'} = lc(munin_get($fieldobj, "type", "GAUGE"));
+ $field_info{'warn'} = munin_get($fieldobj, "warning");
+ $field_info{'crit'} = munin_get($fieldobj, "critical");
+ $field_info{'info'} = munin_get($fieldobj, "info");
+ $field_info{'extinfo'} = munin_get($fieldobj, "extinfo");
+
+ my $state = munin_field_status($fieldobj, $limits, 1);
+
+ if (defined $state) {
+ $field_info{'state_warning'} = 1 if $state eq "warning";
+ $field_info{'state_critical'} = 1 if $state eq "critical";
+ $field_info{'state_unknown'} = 1 if $state eq "unknown";
+ }
+ push @{$srv{'fieldinfo'}}, \%field_info;
}
- my $state = munin_service_status ($service, $limits, 1);
+ my $state = munin_service_status($service, $limits, 1);
+
if (defined $state) {
- $srv{'state_warning'} = 1 if $state eq "warning";
- $srv{'state_critical'} = 1 if $state eq "critical";
- $srv{'state_unknown'} = 1 if $state eq "unknown";
- }
-
- my $servicetemplate = HTML::Template->new(filename => "$config->{tmpldir}/munin-serviceview.tmpl",
- die_on_bad_params => 0,
- loop_context_vars => 1);
- $servicetemplate->param(SERVICES => [\%srv],
- PATH => $pathnodes,
- PEERS => $peers,
- CSS => $csspath,
- CSSPATH => $csspath,
- CATEGORY => ucfirst $srv{'category'},
- TIMESTAMP => $timestamp);
- my $filename = munin_get_html_filename ($service);
- my $dirname = $filename; $dirname =~ s/\/[^\/]*$//;
- munin_mkdir_p ($dirname, oct(755));
- open (my $FILE, '>', $filename) or
- die "Cannot open '$filename' for writing: $!";
- print $FILE $servicetemplate->output;
- close $FILE;
+ $srv{'state_warning'} = 1 if $state eq "warning";
+ $srv{'state_critical'} = 1 if $state eq "critical";
+ $srv{'state_unknown'} = 1 if $state eq "unknown";
+ }
+
+ emit_service_template(\%srv, $pathnodes, $peers, $csspath, $service);
return \%srv;
}
@@ -662,11 +1000,12 @@
my $ret = [];
my $link = "index.html";
- unshift @$ret, { "name" => munin_get_node_name ($hash), "link" => undef };
- while ($hash = munin_get_parent ($hash)) {
- unshift @$ret, { "name" => munin_get_node_name ($hash), "link" => $link };
- $link = "../" . $link;
+ unshift @$ret, {"name" => munin_get_node_name($hash), "path" => undef};
+ while ($hash = munin_get_parent($hash)) {
+ unshift @$ret, {"name" => munin_get_node_name($hash), "path" => $link};
+ $link = "../" . $link;
}
+
$ret->[0]->{'name'} = undef;
return $ret;
}
@@ -680,6 +1019,7 @@
--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.
--config <file> Use <file> as configuration file.
@@ -706,11 +1046,15 @@
=item B<< --service <service> >>
-Limit services to those of E<lt>serviceE<gt>. Multiple --service options may be supplied. [unset]
+Compatability. No effect.
=item B<< --host <host> >>
-Limit hosts to those of E<lt>host<gt>. Multiple --host options may be supplied. [unset]
+Compatability. No effect.
+
+=item B<< --nofork >>
+
+Compatability. No effect.
=item B<< --config <file> >>
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/lib/Munin/Master/Host.pm
^
|
@@ -2,7 +2,7 @@
use base qw(Munin::Master::Group);
-# $Id: Host.pm 2704 2009-10-25 22:05:01Z qha $
+# $Id: Host.pm 2831 2009-11-03 23:32:48Z janl $
use warnings;
use strict;
@@ -32,6 +32,26 @@
}
+sub get_full_path {
+ # Find the full nested named path of the current host object
+ # might one for M::M::Group too and make it recursive instead of
+ # "just" itterative but not now.
+
+ my ($self) = @_;
+
+ my $group;
+ my @groups = ( $self->{host_name} );
+
+ $group=$self->{group};
+ while (defined($group)) {
+ unshift(@groups,$group->{group_name});
+ $group=$group->{group};
+ }
+
+ return join(";",@groups);
+}
+
+
sub add_attributes_if_not_exists {
my ($self, $attributes) = @_;
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/lib/Munin/Master/LimitsOld.pm
^
|
@@ -0,0 +1,716 @@
+package Munin::Master::LimitsOld;
+# -*- perl -*-
+
+=begin comment
+
+This is Munin::Master::LimitsOld, a minimal package shell to make
+munin-limits modular (so it can be loaded persistently in a daemon for
+example) without making it object oriented yet. The non-'old' module
+will feature propper object orientation like munin-update and will
+have to wait until later.
+
+
+Copyright (C) 2004-2009 Jimmy Olsen
+
+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: LimitsOld.pm 2916 2009-11-09 09:56:57Z janl $
+
+=end comment
+
+=cut
+
+use warnings;
+use strict;
+
+use Exporter;
+
+our (@ISA, @EXPORT);
+@ISA = qw ( Exporter );
+@EXPORT = qw ( limits_startup limits_main );
+
+use POSIX qw ( strftime );
+use Getopt::Long 2.37 qw ( GetOptionsFromArray );
+use Time::HiRes;
+use Text::Balanced qw ( extract_multiple extract_delimited
+ extract_quotelike extract_bracketed );
+use Log::Log4perl qw ( :easy );
+
+use Munin::Master::Logger;
+use Munin::Master::Utils;
+use Munin::Common::Defaults;
+
+my $DEBUG = 0;
+my $conffile = "$Munin::Common::Defaults::MUNIN_CONFDIR/munin.conf";
+my $do_usage = 0;
+my $do_version = 0;
+my @limit_hosts = ();
+my @limit_services = ();
+my @limit_contacts = ();
+my $stdout = 0;
+my %notes = ();
+my $force = 0;
+my $config;
+my $oldnotes;
+my $modified = 0;
+my %default_text = (
+ "default" =>
+ '${var:group} :: ${var:host} :: ${var:graph_title}${if:cfields \n\tCRITICALs:${loop<,>:cfields ${var:label} is ${var:value} (outside range [${var:crange}])${if:extinfo : ${var:extinfo}}}.}${if:wfields \n\tWARNINGs:${loop<,>:wfields ${var:label} is ${var:value} (outside range [${var:wrange}])${if:extinfo : ${var:extinfo}}}.}${if:ufields \n\tUNKNOWNs:${loop<,>:ufields ${var:label} is ${var:value}${if:extinfo : ${var:extinfo}}}.}${if:fofields \n\tOKs:${loop<,>:fofields ${var:label} is ${var:value}${if:extinfo : ${var:extinfo}}}.}\n',
+ "nagios" =>
+ '${var:host}\t${var:graph_title}\t${var:worstid}\t${strtrunc:350 ${if:cfields CRITICALs:${loop<,>:cfields ${var:label} is ${var:value} (outside range [${var:crange}])${if:extinfo : ${var:extinfo}}}.}${if:wfields WARNINGs:${loop<,>:wfields ${var:label} is ${var:value} (outside range [${var:wrange}])${if:extinfo : ${var:extinfo}}}.}${if:ufields UNKNOWNs:${loop<,>:ufields ${var:label} is ${var:value}${if:extinfo : ${var:extinfo}}}.}${if:fofields OKs:${loop<,>:fofields ${var:label} is ${var:value}${if:extinfo : ${var:extinfo}}}.}}',
+ "old-nagios" =>
+ '${var:host}\t${var:plugin}\t${var:worstid}\t${strtrunc:350 ${var:graph_title}:${if:cfields CRITICALs:${loop<,>:cfields ${var:label} is ${var:value} (outside range [${var:crange}])${if:extinfo : ${var:extinfo}}}.}${if:wfields WARNINGs:${loop<,>:wfields ${var:label} is ${var:value} (outside range [${var:wrange}])${if:extinfo : ${var:extinfo}}}.}${if:ufields UNKNOWNs:${loop<,>:ufields ${var:label} is ${var:value}${if:extinfo : ${var:extinfo}}}.}${if:fofields OKs:${loop<,>:fofields ${var:label} is ${var:value}${if:extinfo : ${var:extinfo}}}.}}'
+);
+
+sub limits_startup {
+ my ($ARGV) = @_;
+
+ # Get options
+ $do_usage = 1
+ unless GetOptionsFromArray(
+ $ARGV,
+ "host=s" => \@limit_hosts,
+ "service=s" => \@limit_services,
+ "contact=s" => \@limit_contacts,
+ "config=s" => \$conffile,
+ "debug!" => \$DEBUG,
+ "stdout!" => \$stdout,
+ "force!" => \$force,
+ "version!" => \$do_version,
+ "help" => \$do_usage
+ );
+
+ print_usage_and_exit() if $do_usage;
+ print_version_and_exit() if $do_version;
+
+ exit_if_run_by_super_user();
+
+ $config = &munin_config($conffile);
+
+ logger_open($config->{'logdir'});
+ logger_debug() if $DEBUG;
+}
+
+
+sub limits_main {
+ my $update_time = Time::HiRes::time;
+
+ my $lockfile = "$config->{rundir}/munin-limits.lock";
+
+ INFO "[INFO] Starting munin-limits, getting lock $lockfile";
+
+ munin_runlock("$config->{rundir}/munin-limits.lock");
+
+ $oldnotes = &munin_readconfig($config->{'dbdir'} . "/limits", 1, 1);
+
+ initialize_for_nagios();
+
+ initialize_contacts();
+
+ process_limits();
+
+ &munin_writeconfig("$config->{dbdir}/limits", \%notes);
+
+ $update_time = sprintf("%.2f", (Time::HiRes::time - $update_time));
+
+ munin_removelock("$config->{rundir}/munin-limits.lock");
+
+ INFO "[INFO] munin-limits finished ($update_time sec)";
+}
+
+
+sub process_limits {
+
+ # Make array of what needs to be checked
+ my %work_hash_tmp;
+ my $work_array = [];
+ foreach my $workfield (
+ @{munin_find_field_for_limits($config, qr/^(critical|warning)/)}) {
+ my $parent = munin_get_parent($workfield);
+ if (!defined $work_hash_tmp{$parent}) {
+ $work_hash_tmp{$parent} = 1;
+ push @$work_array, $parent;
+ }
+ }
+
+ # Process array containing services we need to check
+ foreach my $workservice (@$work_array) {
+ process_service($workservice);
+ }
+
+}
+
+
+sub initialize_contacts {
+ my $defaultcontacts = munin_get($config, "contacts", "");
+ if (!length $defaultcontacts) {
+ my @tmpcontacts = ();
+ foreach my $cont (@{munin_get_children($config->{"contact"})}) {
+ if (munin_get($cont, "command")) {
+ push @tmpcontacts, munin_get_node_name($cont);
+ }
+ }
+ $defaultcontacts = join(' ', @tmpcontacts);
+ }
+ munin_set_var_loc($config, ["contacts"], $defaultcontacts);
+
+ DEBUG "[DEBUG] Set default \"contacts\" to \"$defaultcontacts\"";
+}
+
+
+sub initialize_for_nagios {
+ if ( !defined $config->{'contact'}->{'nagios'}->{'command'}
+ and defined $config->{'nsca'}) {
+ $config->{'contact'}->{'old-nagios'}->{'command'}
+ = "$config->{nsca} $config->{nsca_server} -c $config->{nsca_config} -to 60";
+ $config->{'contact'}->{'old-nagios'}->{'always_send'}
+ = "critical warning";
+ }
+ if (!defined $config->{'contact'}->{'nagios'}->{'always_send'}) {
+ $config->{'contact'}->{'nagios'}->{'always_send'} = "critical warning";
+ }
+}
+
+
+sub print_usage_and_exit {
+ print "Usage: $0 [options]
+
+Options:
+ --help View this message.
+ --debug View debug messages.
+ --stdout Log to stdout as well as the log file.
+ --force Send messages even if they shouldn't normally be sent.
+ --service <service> Limit notified services to <service>. Multiple
+ --service options may be supplied.
+ --host <host> Limit notified hosts to <host>. Multiple --host
+ options may be supplied.
+ --contact <contact> Limit notified contacts to <contact>. Multiple
+ --contact options may be supplied.
+ --config <file> Use <file> as configuration file.
+ [/etc/munin/munin.conf]
+
+";
+ exit 0;
+}
+
+
+# Get the host of the service in question
+sub get_host_node {
+ my $service = shift || return undef;
+ my $parent = munin_get_parent($service) || return undef;
+
+ if (munin_has_subservices($parent)) {
+ return get_host_node($parent);
+ } else {
+ return $parent;
+ }
+}
+
+sub get_notify_name {
+ my $hash = shift || return;
+
+ if (defined $hash->{'notify_alias'}) {
+ return $hash->{'notify_alias'};
+ } elsif (defined $hash->{'graph_title'}) {
+ return $hash->{'graph_title'};
+ } else {
+ return munin_get_node_name($hash);
+ }
+}
+
+# Joined "sub-path" under host level
+sub get_full_service_name {
+ my $service = shift || return undef;
+ my $parent = munin_get_parent($service);
+ my $name = get_notify_name($service);
+
+ if (defined $parent and munin_has_subservices($parent)) {
+ return (get_full_service_name($parent) . " :: " . $name);
+ } else {
+ return $name;
+ }
+
+}
+
+# Joined group path above host level
+sub get_full_group_path {
+ my $group = shift || return undef;
+ my $parent = munin_get_parent($group);
+ my $name = get_notify_name($group);
+
+ if (defined $parent and munin_get_node_name($parent) ne "root") {
+ return (get_full_group_path($parent) . " :: " . $name);
+ } else {
+ return $name;
+ }
+}
+
+sub process_service {
+ my $hash = shift || return;
+ my $hobj = get_host_node($hash);
+ my $service = munin_get_node_name($hash);
+ my $hparentobj = munin_get_parent($hobj);
+ my $parent = munin_get_node_name($hobj);
+ my $gparent = munin_get_node_name($hparentobj);
+ my $children = munin_get_children($hash);
+
+ if (!ref $hash) {
+ LOGCROAK("I was passed a non-hash!");
+ }
+
+ return if (@limit_services and !grep (/^$service$/, @limit_services));
+
+ DEBUG "[DEBUG] processing service: $service";
+
+ # Some fields that are nice to have in the plugin output
+ $hash->{'fields'} = join(' ', map {munin_get_node_name($_)} @$children);
+ $hash->{'plugin'} = $service;
+ $hash->{'graph_title'} = get_full_service_name($hash);
+ $hash->{'host'} = get_notify_name($hobj);
+ $hash->{'group'} = get_full_group_path($hparentobj);
+ $hash->{'worst'} = "ok";
+ $hash->{'worstid'} = 0 unless defined $hash->{'worstid'};
+
+ foreach my $field (@$children) {
+ next if (!defined $field or ref($field) ne "HASH");
+ my $fname = munin_get_node_name($field);
+ my $fpath = munin_get_node_loc($field);
+ my $onfield = munin_get_node($oldnotes, $fpath);
+
+ # Test directly here as get_limits is in truth recursive and
+ # that fools us when processing multigraphs.
+ next if (!defined($field->{warning}) and !defined($field->{critical}));
+
+ my ($warn, $crit, $unknown_limit) = get_limits($field);
+
+ # Skip fields without warning/critical definitions
+ next if (!defined $warn and !defined $crit);
+
+ DEBUG "[DEBUG] processing field: " . join('::', @$fpath);
+
+ my $filename = munin_get_rrd_filename($field);
+ my $value = munin_fetch("$filename");
+
+ DEBUG "[DEBUG] rrd filename is: $filename";
+
+ # De-taint.
+ if (!defined $value) {
+ $value = "unknown";
+ }
+ else {
+ $value = sprintf "%.2f", $value;
+ }
+
+ # Some fields that are nice to have in the plugin output
+ $field->{'value'} = $value;
+ $field->{'crange'} = (defined $crit->[0] ? $crit->[0] : "") . ":"
+ . (defined $crit->[1] ? $crit->[1] : "");
+ $field->{'wrange'} = (defined $warn->[0] ? $warn->[0] : "") . ":"
+ . (defined $warn->[1] ? $warn->[1] : "");
+ DEBUG("[DEBUG] value: "
+ . join('::', @$fpath)
+ . ": $value (crit: "
+ . $field->{'crange'}
+ . ") (warn: "
+ . $field->{'wrange'}
+ . ")");
+
+ 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"}
+ ? "unknown: " . $field->{"extinfo"}
+ : "Value is unknown."
+ ));
+
+ if ( !defined $onfield
+ or !defined $onfield->{"state"}
+ or $onfield->{"state"} ne "unknown") {
+ $hash->{'state_changed'} = 1;
+ }
+ }
+ elsif ((defined($crit->[0]) and $value < $crit->[0])
+ or (defined($crit->[1]) and $value > $crit->[1])) {
+ $crit->[0] ||= "";
+ $crit->[1] ||= "";
+ $hash->{'worst'} = "CRITICAL";
+ $hash->{'worstid'} = 2;
+ munin_set_var_loc(\%notes, [@$fpath, "state"], "critical");
+ munin_set_var_loc(
+ \%notes,
+ [@$fpath, "critical"], (
+ defined $field->{"extinfo"}
+ ? "$value (not in "
+ . $field->{'crange'} . "): "
+ . $field->{"extinfo"}
+ : "Value is $value. Critical range ("
+ . $field->{'crange'}
+ . ") exceeded"
+ ));
+
+ if ( !defined $onfield
+ or !defined $onfield->{"state"}
+ or $onfield->{"state"} ne "critical") {
+
+ $hash->{'state_changed'} = 1;
+
+ }
+ }
+ elsif ((defined($warn->[0]) and $value < $warn->[0])
+ or (defined($warn->[1]) and $value > $warn->[1])) {
+ $warn->[0] ||= "";
+ $warn->[1] ||= "";
+ $hash->{'worst'} = "WARNING" if $hash->{"worst"} ne "CRITICAL";
+ $hash->{'worstid'} = 1 if $hash->{"worstid"} != 2;
+ munin_set_var_loc(\%notes, [@$fpath, "state"], "warning");
+ munin_set_var_loc(
+ \%notes,
+ [@$fpath, "warning"], (
+ defined $field->{"extinfo"}
+ ? "$value (not in "
+ . $field->{'wrange'} . "): "
+ . $field->{"extinfo"}
+ : "Value is $value. Warning range ("
+ . $field->{'wrange'}
+ . ") exceeded"
+ ));
+
+ if ( !defined $onfield
+ or !defined $onfield->{"state"}
+ or $onfield->{"state"} ne "warning") {
+
+ $hash->{'state_changed'} = 1;
+
+ }
+ }
+ 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;
+ }
+ }
+ generate_service_message($hash);
+}
+
+
+sub get_limits {
+ my $hash = shift || return;
+
+ # This hash will have values that we can look up such as these:
+ my @critical = (undef, undef);
+ 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 $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]";
+ }
+ elsif (defined $crit) {
+ @critical = (0, 0);
+ DEBUG "[DEBUG] processing critical: $name -> $critical[0] : $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]";
+ }
+ elsif (defined $warn) {
+ @warning = (0, 0);
+ DEBUG "[DEBUG] processing warning: $name -> $warning[0] : $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";
+ }
+
+ return (\@warning, \@critical, $unknown_limit);
+}
+
+sub generate_service_message {
+ my $hash = shift || return;
+ my $critical = undef;
+ my $worst = $hash->{"worst"};
+ my %stats = (
+ 'critical' => [],
+ 'warning' => [],
+ 'unknown' => [],
+ 'foks' => [],
+ 'ok' => []);
+
+ my $contacts = munin_get_children(munin_get_node($config, ["contact"]));
+
+ DEBUG "[DEBUG] generating service message: "
+ . join('::', @{munin_get_node_loc($hash)});
+
+ foreach my $field (
+ @{munin_get_children(
+ munin_get_node(\%notes, munin_get_node_loc($hash)))}
+ ) {
+ if (defined $field->{"state"}) {
+ push @{$stats{$field->{"state"}}}, munin_get_node_name($field);
+ if ($field->{"state"} eq "ok") {
+ push @{$stats{"foks"}}, munin_get_node_name($field);
+ }
+ }
+ }
+ $hash->{'cfields'} = join " ", @{$stats{'critical'}};
+ $hash->{'wfields'} = join " ", @{$stats{'warning'}};
+ $hash->{'ufields'} = join " ", @{$stats{'unknown'}};
+ $hash->{'fofields'} = join " ", @{$stats{'foks'}};
+ $hash->{'ofields'} = join " ", @{$stats{'ok'}};
+ $hash->{'numcfields'} = scalar @{$stats{'critical'}};
+ $hash->{'numwfields'} = scalar @{$stats{'warning'}};
+ $hash->{'numufields'} = scalar @{$stats{'unknown'}};
+ $hash->{'numfofields'} = scalar @{$stats{'foks'}};
+ $hash->{'numofields'} = scalar @{$stats{'ok'}};
+
+ my $contactlist = munin_get($hash, "contacts", "");
+ DEBUG("[DEBUG] Contact list for "
+ . join('::', @{munin_get_node_loc($hash)})
+ . ": $contactlist");
+
+ foreach my $c (split(/\s+/, $contactlist)) {
+ next if $c eq "none";
+ my $contactobj = munin_get_node($config, ["contact", $c]);
+ next unless defined $contactobj;
+ next unless defined munin_get($contactobj, "command", undef);
+ if (@limit_contacts and !grep (/^$c$/, @limit_contacts)) {
+ next;
+ }
+ my $obsess = 0;
+ my $cas = munin_get($contactobj, "always_send");
+ if (defined $cas) {
+ $obsess = grep {scalar(@{$stats{$_}})} (split(/\s+/, lc $cas));
+ }
+ if (!$hash->{'state_changed'} and !$obsess) {
+ next; # No need to send notification
+ }
+ DEBUG "state has changed, notifying $c";
+ my $precmd = munin_get($contactobj, "command");
+ my $pretxt = munin_get(
+ $contactobj,
+ "text",
+ munin_get(
+ munin_get_node($config, ["contact", "default"]),
+ "text",
+ $default_text{$c} || $default_text{"default"}));
+ my $txt = message_expand($hash, $pretxt, "");
+ my $cmd = message_expand($hash, $precmd, "");
+ $txt =~ s/\\n/\n/g;
+ $txt =~ s/\\t/\t/g;
+
+ # In some cases we want to reopen the command
+ my $maxmess = munin_get($contactobj, "max_messages", 0);
+ my $curmess = munin_get($contactobj, "num_messages", 0);
+ my $curcmd = munin_get($contactobj, "pipe_command", undef);
+ my $pipe = munin_get($contactobj, "pipe", undef);
+ if ($maxmess and $curmess >= $maxmess) {
+ close($pipe);
+ $pipe = undef;
+ munin_set_var_loc($contactobj, ["pipe"], undef);
+ DEBUG "[DEBUG] Closing \"$c\" -> command (max number of messages reached).";
+ }
+ elsif ($curcmd and $curcmd ne $cmd) {
+ close($pipe);
+ $pipe = undef;
+ munin_set_var_loc($contactobj, ["pipe"], undef);
+ DEBUG "[DEBUG] Closing \"$c\" -> command (command has changed).";
+ }
+
+ if (!defined $pipe) {
+ my @cmd = extract_multiple(
+ message_expand($hash, $cmd),
+ [sub {extract_delimited($_[0], q{"'})}, qr/\S+/],
+ undef, 1
+ );
+ @cmd = map {
+ my $c = $_;
+ $c =~ s/['"]$//;
+ $c =~ s/^['"]//;
+ $c;
+ } @cmd;
+ $contactobj->{"num_messages"} = 0;
+ if ($cmd[0] eq "|") {
+ $cmd[0] = "|-";
+ }
+ elsif ($cmd[0] !~ /^[|>]/) {
+ unshift(@cmd, "|-");
+ }
+ DEBUG("[DEBUG] opening \"$c\" for writing: \""
+ . join('" "', @cmd)
+ . "\".");
+ if ($cmd[0] eq ">") {
+ ## no critic
+ if (!open($pipe, join(' ', @cmd))) {
+ FATAL("[FATAL] Could not open "
+ . join(' ', @cmd[1 .. $#cmd])
+ . " for writing: $!");
+ exit 3;
+ }
+ ## critic
+ }
+ else {
+ my $pid = open($pipe, "|-");
+ if (!defined $pid) {
+ FATAL "Fatal: Unable to fork: $!";
+ exit 3;
+ }
+ if (!$pid) { # Child
+ # Fork of stdout-to-log filter
+ my $logstdout;
+ my $logstderr;
+ my $logpid = open($logstdout, "|-");
+ if (!defined $logpid) {
+ FATAL "Fatal: Unable to fork: $!";
+ exit 3;
+ }
+ if (!$logpid) { # Child
+ while (<STDIN>) {
+ chomp;
+ INFO "Command \"$c\" stdout: $_";
+ }
+ exit 0;
+ }
+ close(STDOUT);
+ *STDOUT = \$logstdout;
+ $logpid = open($logstderr, "|-");
+ if (!defined $logpid) {
+ FATAL "Fatal: Unable to fork: $!";
+ exit 3;
+ }
+ if (!$logpid) { # Child
+ while (<STDIN>) {
+ chomp;
+ FATAL "Command \"$c\" stderr: $_";
+ }
+ exit 0;
+ }
+ open(STDOUT, ">&", $logstdout);
+ open(STDERR, ">&", $logstderr);
+
+ exec(@cmd[1 .. $#cmd])
+ or WARN("[WARNING] Could not run command \""
+ . join(' ', @cmd[1 .. $#cmd])
+ . "\": $!");
+ exit 5;
+
+ # NOTREACHED
+ }
+ }
+ 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);
+ $contactobj->{"num_messages"}
+ = 1 + munin_get($contactobj, "num_messages", 0); # $num_messages++
+ }
+}
+
+
+sub message_expand {
+ my $hash = shift;
+ my $text = shift;
+ my @res = ();
+
+
+ while (length($text)) {
+ if ($text =~ /^([^\$]+|)(?:\$(\{.*)|)$/) {
+ push @res, $1;
+ $text = $2;
+ }
+ my @a = extract_bracketed($text, '{}');
+ if ($a[0] =~ /^\{var:(\S+)\}$/) {
+ $a[0] = munin_get($hash, $1, "");
+ }
+ elsif ($a[0] =~ /^\{loop<([^>]+)>:\s*(\S+)\s(.+)\}$/) {
+ my $d = $1;
+ my $f = $2;
+ my $t = $3;
+ my $fields = munin_get($hash, $f, "");
+ my @res = ();
+ if ($fields) {
+ foreach my $sub (split /\s+/, $fields) {
+ if (defined $hash->{$sub}) {
+ push @res, message_expand($hash->{$sub}, $t);
+ }
+ }
+ }
+ $a[0] = join($d, @res);
+ }
+ elsif ($a[0] =~ /^\{loop:\s*(\S+)\s(.+)\}$/) {
+ my $f = $1;
+ my $t = $2;
+ my $fields = munin_get($hash, $f, "");
+ my $res = "";
+ if ($fields) {
+ foreach my $sub (split /\s+/, $fields) {
+ if (defined $hash->{$sub}) {
+ push @res, message_expand($hash->{$sub}, $t);
+ }
+ }
+ }
+ $a[0] = $res;
+ }
+ elsif ($a[0] =~ /^\{strtrunc:\s*(\S+)\s(.+)\}$/) {
+ my $f = "%." . $1 . "s";
+ my $t = $2;
+ $a[0] = sprintf($f, message_expand($hash, $t));
+ }
+ elsif ($a[0] =~ /^\{if:\s*(\!)?(\S+)\s(.+)\}$/) {
+ my $n = $1;
+ my $f = $2;
+ 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;
+
+ if ($check) {
+ $res .= message_expand($hash, $t);
+ }
+ $a[0] = $res;
+ }
+ push @res, $a[0];
+ $text = $a[1];
+ }
+
+ return join('', @res);
+}
+
+1;
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/lib/Munin/Master/Logger.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Master::Logger;
-# $Id: Logger.pm 2474 2009-09-24 17:52:17Z feiner.tom $
+# $Id: Logger.pm 2860 2009-11-05 14:42:20Z janl $
=head1 NAME
@@ -46,7 +46,7 @@
=head1 AUTHOR
Munin master logging ported to Log4perl by Nicolai Langfeldt. Split
-out into this module by Kjell Magne Øyerud.
+out into this module by Kjell Magne Øierud.
=head1 LICENSE
@@ -74,6 +74,14 @@
my $logopened = 0;
my $me = basename($PROGRAM_NAME);
+sub _warn_catcher {
+ if ($logopened) {
+ WARN "[PERL WARNING] ".join(" ",@_);
+ } else {
+ print STDERR join(" ",@_);
+ }
+}
+
sub logger_open {
# This is called when we have a directory and file name to log in.
@@ -92,7 +100,10 @@
$logopened = 1;
}
- get_logger('')->info("Opened log file!");
+ get_logger('')->info("Opened log file");
+
+ # Get perl warnings into the log files
+ $SIG{__WARN__} = \&_warn_catcher;
}
sub logger_debug {
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/lib/Munin/Master/Node.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Master::Node;
-# $Id: Node.pm 2726 2009-10-27 12:17:17Z janl $
+# $Id: Node.pm 2924 2009-11-09 12:33:50Z janl $
# This module is used by UpdateWorker to keep in touch with a node and
# parse some of the output.
@@ -18,7 +18,7 @@
my $config = Munin::Master::Config->instance()->{config};
sub new {
- my ($class, $address, $port, $host) = @_;
+ my ($class, $address, $port, $host, $configref) = @_;
my $self = {
address => $address,
@@ -28,6 +28,7 @@
socket => undef,
master_capabilities => qw(multigraph),
io_timeout => 5,
+ configref => $configref,
};
return bless $self, $class;
@@ -70,7 +71,7 @@
if (!$greeting) {
die "[ERROR] Got no reply from node ".$self->{host}."\n";
}
- if (! $greeting =~ /\#.*(?:lrrd|munin) (?:client|node) at (\S+)/) {
+ if ($greeting !~ /\#.*(?:lrrd|munin) (?:client|node) at (\S+)/) {
die "[ERROR] Got unknown reply from node ".$self->{host}."\n";
}
return $1;
@@ -124,7 +125,7 @@
# other takes advantage of the capabilities it understands (or
# dumbs itself down to the counterparts level of sophistication).
- DEBUG "[DEBUG] Negociating capabilities\n";
+ DEBUG "[DEBUG] Negotiating capabilities\n";
$self->_node_write_single("cap $self->{master_capabilities}\n");
my $cap = $self->_node_read_single();
@@ -145,7 +146,7 @@
sub list_plugins {
my ($self) = @_;
- my $host = $config->{groups_and_hosts}{$self->{host}}{use_node_name}
+ my $host = $self->{configref}{use_node_name}
? $self->{node_name}
: $self->{host};
@@ -157,7 +158,7 @@
my $list = $self->_node_read_single();
if (not $list) {
- WARN "[WARNING] Config node $self->{host} listed no services for $host";
+ WARN "[WARNING] Config node $self->{host} listed no services for $host. Please see http://munin-monitoring.org/wiki/FAQ_no_graphs for further information.";
}
return split / /, $list;
@@ -167,6 +168,9 @@
sub parse_service_config {
my ($self, $service, @lines) = @_;
+ my $errors;
+ my $correct;
+
my $plugin = $service;
my $nodedesignation = $self->{host}."/".$self->{address}."/".$self->{port};
@@ -184,6 +188,7 @@
$data_source_config->{$service} = {};
};
+
local *push_graphorder = sub {
my ($oldservice) = @_;
@@ -194,7 +199,9 @@
@graph_order = ( );
};
- DEBUG "[DEBUG] Now parsing config output from plugin $plugin on ".$self->{host};
+
+ DEBUG "[DEBUG] Now parsing config output from plugin $plugin on "
+ .$self->{host};
new_service($service);
@@ -203,25 +210,28 @@
DEBUG "[CONFIG from $plugin] $line";
if ($line =~ /\# timeout/) {
- die "[ERROR] Timeout error ($nodedesignation). Please consult the log.\n";
+ die "[ERROR] Timeout error on $nodedesignation during fetch of $plugin. \n";
}
next unless $line;
next if $line =~ /^\#/;
if ($line =~ m{\A multigraph \s+ (.+) }xms) {
+ $correct++;
+
push_graphorder($service);
$service = $1;
if ($service eq 'multigraph') {
- ERROR "[ERROR] SERVICE can't be named \"$service\" in plugin $plugin on ".$self->{host}."/".$self->{address}."/".$self->{port};
- croak("Illegal service name. Please consult the log");
+ die "[ERROR] SERVICE can't be named \"$service\" in plugin $plugin on ".$self->{host}."/".$self->{address}."/".$self->{port};
}
new_service($service);
DEBUG "[CONFIG multigraph $plugin] Service is now $service";
}
elsif ($line =~ m{\A (\w+)\.(\w+) \s+ (.+) }xms) {
+ $correct++;
+
my ($ds_name, $ds_var, $ds_val) = ($1, $2, $3);
$ds_name = $self->_sanitise_fieldname($ds_name);
$data_source_config->{$service}{$ds_name} ||= {};
@@ -230,14 +240,21 @@
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 {
- die "[ERROR] Protocol exception: unrecognized line '$line' from $plugin on $nodedesignation.\n";
+ $errors++;
+ DEBUG "[DEBUG] Protocol exception: unrecognized line '$line' from $plugin on $nodedesignation.\n";
}
}
+ if ($errors) {
+ WARN "[WARNING] There were errors in $errors lines and $correct correct lines in data from 'config $plugin' on $nodedesignation";
+ }
+
$self->_validate_data_sources($data_source_config);
push_graphorder($service);
@@ -255,6 +272,8 @@
# The whole config in one fell swoop.
my @lines = $self->_node_read();
+ $service = $self->_sanitise_plugin_name($service);
+
return $self->parse_service_config($service,@lines);
}
@@ -262,12 +281,17 @@
sub _validate_data_sources {
my ($self, $all_data_source_config) = @_;
+ my $nodedesignation = $self->{host}."/".$self->{address}.":".$self->{port};
+
for my $service (keys %$all_data_source_config) {
my $data_source_config = $all_data_source_config->{$service};
for my $ds (keys %$data_source_config) {
- croak "Missing required attribute 'label' for data source '$ds'"
- unless defined $data_source_config->{$ds}{label};
+ if (!defined $data_source_config->{$ds}{label}) {
+ ERROR "Missing required attribute 'label' for data source '$ds' in service $service on $nodedesignation";
+ $data_source_config->{$ds}{label} = 'No .label provided';
+ $data_source_config->{$ds}{extinfo} = "NOTE: The plugin did not provide any label for the data source $ds. It is in need of fixing.";
+ }
}
}
}
@@ -277,6 +301,8 @@
my ($self, $service, @lines) = @_;
my $plugin = $service;
+ my $errors = 0;
+ my $correct = 0;
my $nodedesignation = $self->{host}."/".$self->{address}.":".$self->{port};
@@ -292,15 +318,16 @@
DEBUG "[FETCH from $plugin] $line";
if ($line =~ /\# timeout/) {
- WARN "[WARNING] Timeout in fetch from '$plugin' on ".
+ die "[WARNING] Timeout in fetch from '$plugin' on ".
$nodedesignation;
- croak("Timeout error. Please consult the log.");
}
next unless $line;
next if $line =~ /^\#/;
if ($line =~ m{\A multigraph \s+ (.+) }xms) {
+ $correct++;
+
$service = $1;
$values{$service} = {};
@@ -310,23 +337,47 @@
croak("Plugin error. Please consult the log.");
}
}
- elsif ($line =~ m{ (\w+)\.value \s+ ([\S:]+) }xms) {
+ elsif ($line =~ m{\A ([^\.]+)\.value \s+ ([\S:]+) }xms) {
my ($data_source, $value, $when) = ($1, $2, 'N');
+ $correct++;
+
$data_source = $self->_sanitise_fieldname($data_source);
+ DEBUG "[FETCH from $plugin] Storing $value in $data_source";
+
if ($value =~ /^(\d+):(.+)$/) {
$when = $1;
$value = $2;
}
- $values{$service}{$data_source} =
- { value => $value, when => $when };
+ $values{$service}{$data_source} ||= {};
+
+ $values{$service}{$data_source}{value} = $value;
+ $values{$service}{$data_source}{when} = $when;
}
+ elsif ($line =~ m{\A ([^\.]+)\.extinfo \s+ (.+) }xms) {
+ # Extinfo is used in munin-limits
+ my ($data_source, $value) = ($1, $2);
+
+ $correct++;
+
+ $data_source = $self->_sanitise_fieldname($data_source);
+
+ $values{$service}{$data_source} ||= {};
+
+ $values{$service}{$data_source}{extinfo} = $value;
+
+ }
else {
- die "[ERROR] Protocol exception while fetching '$service' from $nodedesignation: unrecogniced line '$line'"
+ $errors++;
+ DEBUG "[DEBUG] Protocol exception while fetching '$service' from $plugin on $nodedesignation: unrecognized line '$line'";
+ next;
}
}
+ if ($errors) {
+ WARN "[WARNING] There were errors in $errors lines and $correct correct lines in data from 'fetch $plugin' on $nodedesignation";
+ }
return %values;
}
@@ -336,21 +387,30 @@
my ($self, $plugin) = @_;
$self->_node_write_single("fetch $plugin\n");
+
my @lines = $self->_node_read();
+ $plugin = $self->_sanitise_plugin_name($plugin);
+
return $self->parse_service_data($plugin,@lines);
}
-sub _sanitise_fieldname {
+sub _sanitise_plugin_name {
my ($self, $name) = @_;
- $name =~ s/[\W-]/_/g;
+ $name =~ s/[^_A-Za-z0-9]/_/g;
+
+ return $name;
+}
- # This trunkation is based on a misunderstanding about fieldname
- # lengths - most likely - janl 2009-10-21
- # return substr($name, -18);
+sub _sanitise_fieldname {
+ # http://munin.projects.linpro.no/wiki/notes_on_datasource_names
+ my ($self, $name) = @_;
+
+ $name =~ s/^[^A-Za-z_]/_/;
+ $name =~ s/[^A-Za-z0-9_]/_/g;
return $name;
}
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/lib/Munin/Master/ProcessManager.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Master::ProcessManager;
-# $Id: ProcessManager.pm 2616 2009-10-20 13:38:38Z janl $
+# $Id: ProcessManager.pm 2960 2009-11-11 19:56:38Z feiner.tom $
use warnings;
use strict;
@@ -15,6 +15,7 @@
use Munin::Master::Config;
use Munin::Master::Logger;
+use Log::Log4perl qw( :easy );
my $E_DIED = 18;
my $E_TIMED_OUT = 19;
@@ -63,7 +64,7 @@
sub start_work {
my ($self) = @_;
- logger("Starting work") if $config->{debug};
+ DEBUG "[DEBUG] Starting work";
my $sock = $self->_prepare_unix_socket();
@@ -74,7 +75,7 @@
}) or croak "Work timed out before all workers finished";
$self->{workers} = [];
- logger("Work done") if $config->{debug};
+ DEBUG "[DEBUG] Work done";
$self->_free_socket($sock);
}
@@ -102,7 +103,7 @@
my ($self) = @_;
while (@{$self->{workers}}) {
- logger(sprintf "Active: " . scalar %{$self->{active_workers}});
+ DEBUG sprintf "[DEBUG] Active workers: " . scalar %{$self->{active_workers}};
last if scalar keys %{$self->{active_workers}} == $self->{max_concurrent};
$self->_start_next_worker();
}
@@ -138,7 +139,7 @@
accept $worker_sock, $sock;
});
if ($timed_out) {
- logger("[WARNING] Call to accept timed out: " . join keys %{$self->{result_queue}});
+ WARN "[WARNING] Call to accept timed out (this could be due to a firewalled munin-node): " . join keys %{$self->{result_queue}};
next;
}
next unless fileno $worker_sock;
@@ -183,7 +184,7 @@
my $child_exit = $CHILD_ERROR >> 8;
my $child_signal = $CHILD_ERROR & 127;
- logger("Reaping $self->{active_workers}{$worker_pid} $child_exit/$child_signal");
+ INFO "[INFO]: Reaping $self->{active_workers}{$worker_pid}. Exited $child_exit/$child_signal";
delete $self->{active_workers}{$worker_pid};
}
}
@@ -207,7 +208,7 @@
sub _do_work {
my ($self, $worker) = @_;
- logger("Starting $worker") if $config->{debug};
+ DEBUG "[DEBUG] Starting $worker";
my $retval = 0;
@@ -217,13 +218,13 @@
$res = $worker->do_work();
});
if ($timed_out) {
- logger("[ERROR] $worker timed out");
+ ERROR "[ERROR] $worker timed out";
$res = undef;
$retval = $E_TIMED_OUT;
}
};
if ($EVAL_ERROR) {
- logger("[ERROR] $worker died with '$EVAL_ERROR'");
+ ERROR "[ERROR] $worker died with '$EVAL_ERROR'";
$res = undef;
$retval = $E_DIED;
}
@@ -231,11 +232,11 @@
my $sock;
unless (socket $sock, PF_UNIX, SOCK_STREAM, 0) {
- logger("[ERROR] Unable to create socket: $!");
+ ERROR "[ERROR] Unable to create socket: $!";
return $E_DIED;
}
unless (connect $sock, sockaddr_un($self->{socket_file})) {
- logger("[ERROR] Unable to connect to socket: $!");
+ ERROR "[ERROR] Unable to connect to socket: $!";
return $E_DIED;
}
@@ -253,7 +254,7 @@
=head1 NAME
-Munin::Master::ProcessManager - Manager for parallell exeution of Workers.
+Munin::Master::ProcessManager - Manager for parallell execution of Workers.
=head1 SYNOPSIS
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/lib/Munin/Master/Update.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Master::Update;
-# $Id: Update.pm 2726 2009-10-27 12:17:17Z janl $
+# $Id: Update.pm 2945 2009-11-10 16:34:17Z bjorn $
use warnings;
use strict;
@@ -45,7 +45,7 @@
$self->_create_rundir_if_missing();
$self->_do_with_lock_and_timing(sub {
- logger("Starting munin-update");
+ INFO "[INFO]: Starting munin-update";
$self->{old_service_configs} = $self->_read_old_service_configs();
@@ -70,7 +70,9 @@
# Get old service configuration from the config instance since the
# syntaxes are identical.
my $oldconfig = Munin::Master::Config->instance()->{oldconfig};
- my $datafile = $oldconfig->{config_file};
+
+ my $datafile = $oldconfig->{config_file} = $config->{dbdir}.'/datafile';
+
my $file;
if (-e $datafile ) {
@@ -107,7 +109,6 @@
# logger("Skipping '$name' (update disabled by config)");
# logger("Queuing '$name' for update.");
-
my @hosts = $self->{group_repository}->get_all_hosts();
if (%{$config->{limit_hosts}}) {
@@ -128,9 +129,10 @@
my $update_time = Time::HiRes::time;
if (!open ($self->{STATS}, '>', "$config->{dbdir}/munin-update.stats.tmp")) {
- logger("[WARNING] Unable to open $config->{dbdir}/munin-update.stats");
+ WARN "[WARNING] Could not open STATS to $config->{dbdir}/munin-update.stats.tmp: $!";
# Use /dev/null instead - if the admin won't fix he won't care
- open($self->{STATS}, '>', "/dev/null") or die "Could not open STATS to /dev/null: $?";
+ open($self->{STATS}, '>', "/dev/null") or
+ LOGCROAK "[FATAL] Could not open STATS to /dev/null (fallback for not being able to open $config->{dbdir}/munin-update.stats.tmp): $!";
}
my $retval = $block->();
@@ -140,7 +142,7 @@
close ($self->{STATS});
$self->{STATS} = undef;
rename ("$config->{dbdir}/munin-update.stats.tmp", "$config->{dbdir}/munin-update.stats");
- logger("Munin-update finished ($update_time sec)");
+ INFO "[INFO]: Munin-update finished ($update_time sec)";
munin_removelock($lock);
@@ -196,19 +198,20 @@
return sub {
my ($worker_id, $reason) = @_;
- # FIXME: $worker_id is not defined!
- logger("Failed worker $worker_id");
+ WARN "[WARNING] Failed worker $worker_id";
push @{$self->{failed_workers}}, $worker_id;
};
}
-# FIX merge with Update::Worker::_get_rrd_file_name
+# FIX merge with UpdateWorker::_get_rrd_file_name
+# FIX seems like dead code? Or only used in ensure_?
sub _get_rrd_file_name {
my ($self, $host, $service, $ds_name, $ds_type) = @_;
my $type_id = lc(substr(($ds_type), 0, 1));
my ($g, $h) = split /;/, $host;
+ # // ... perl mode
my $file = sprintf("%s-%s-%s-%s.rrd",
$h,
$service,
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/lib/Munin/Master/UpdateWorker.pm
^
|
@@ -1,29 +1,7 @@
package Munin::Master::UpdateWorker;
use base qw(Munin::Master::Worker);
-=comment
-
-This file is part of Munin.
-
- Copyright (C) 2002-2009 Jimmy Olsen, et al.
-
- 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
-
-
-$Id: UpdateWorker.pm 2757 2009-10-29 13:45:42Z janl $
-
-=cut
+# $Id: UpdateWorker.pm 2950 2009-11-10 17:53:43Z ligne $
use warnings;
use strict;
@@ -40,18 +18,19 @@
use Munin::Master::Utils;
use RRDs;
use Time::HiRes;
-
+use Data::Dumper;
my $config = Munin::Master::Config->instance()->{config};
sub new {
my ($class, $host) = @_;
- my $self = $class->SUPER::new("$host->{group}{group_name};$host->{host_name}");
+ my $self = $class->SUPER::new($host->get_full_path);
$self->{host} = $host;
$self->{node} = Munin::Master::Node->new($host->{address},
$host->{port},
- $host->{host_name});
+ $host->{host_name},
+ $host);
return $self;
}
@@ -63,14 +42,15 @@
my $update_time = Time::HiRes::time;
my $host = $self->{host}{host_name};
+ my $path = $self->{host}->get_full_path;
+ $path =~ s{[:;]}{-}g;
my $nodedesignation = $host."/".
$self->{host}{address}.":".$self->{host}{port};
- my $lock_file = sprintf ('%s/munin-%s-%s.lock',
+ my $lock_file = sprintf ('%s/munin-%s.lock',
$config->{rundir},
- $self->{host}{group}{group_name},
- $host);
+ $path);
if (!munin_getlock($lock_file)) {
WARN "Could not get lock $lock_file for $nodedesignation. Skipping node.";
@@ -103,22 +83,33 @@
};
if ($EVAL_ERROR) {
ERROR $EVAL_ERROR;
- warn "$EVAL_ERROR\n";
+ print STDERR "$EVAL_ERROR\n";
next;
}
# 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 colision: plugin $plugin on $nodedesignation reports $service which already exists on that host. Deleting new data.";
+ 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";
+ }
+ }
+ }
+
$self->_compare_and_act_on_config_changes(\%service_config);
%{$all_service_configs{data_source}} = (
@@ -133,7 +124,8 @@
}
#use Data::Dumper; warn Dumper(\@services);
- });
+
+ }); # do_in_session
munin_removelock($lock_file);
@@ -156,7 +148,7 @@
# FIX Report failed service so that we can use the old service
# config.
ERROR $EVAL_ERROR;
- warn "$EVAL_ERROR\n";
+ print STDERR "$EVAL_ERROR\n";
return;
}
@@ -279,7 +271,7 @@
my $old_rrd_file = $self->_get_rrd_file_name($service, $old_data_source,
$old_ds_config);
- my $hostspec = $self->{node}{hostname}.'/'.$self->{node}{address}.':'.
+ my $hostspec = $self->{node}{host}.'/'.$self->{node}{address}.':'.
$self->{node}{port};
if ($rrd_file ne $old_rrd_file) {
@@ -360,7 +352,7 @@
$self->_update_rrd_file($rrd_file, $ds_name, $service_data->{$ds_name});
}
else {
- WARN "[WARNING] Service $service on $nodedesignation returned no data";
+ WARN "[WARNING] Service $service on $nodedesignation returned no data for label $ds_name";
}
}
}
@@ -394,37 +386,28 @@
my ($self, $service, $ds_name, $ds_config) = @_;
my $type_id = lc(substr(($ds_config->{type}), 0, 1));
- my $group = $self->{host}{group}{group_name};
+
+ my $path = $self->{host}->get_full_path;
+ $path =~ s{[;:]}{/}g;
+
+ # Multigraph/nested services will have . in the service name in this function.
+ $service =~ s{\.}{-}g;
# The following is rigged to match the corresponding function in
# munin-graph/munin-html where it's less clear what are groups and
# what are hosts and what are services, and they simply pop
# elements off the end and so on.
- my @lastpart = ($self->{host}{host_name}, split (/\./, "$service.$ds_name"));
- my $last = pop(@lastpart);
- my $nexttolast = pop(@lastpart);
-
my $file = sprintf("%s-%s-%s-%s.rrd",
- join("/",@lastpart),
- $nexttolast,
- $last,
+ $path,
+ $service,
+ $ds_name,
$type_id);
- # Not really a danger (we're not doing this stuff via the shell),
- # so more to avoid confusion with silly filenames.
- ($group) = map {
- my $p = $_;
- $p =~ tr/\//_/;
- $p =~ s/^\./_/g;
- $p;
- } ($group);
-
$file = File::Spec->catfile($config->{dbdir},
- $group,
$file);
- DEBUG "[DEBUG] Made rrd filename: $file\n";
+ TRACE "[TRACE] Made rrd filename: $file\n";
return $file;
}
@@ -494,6 +477,7 @@
DEBUG "[DEBUG] Updating $rrd_file with ".$ds_values->{when}.":$value";
RRDs::update($rrd_file, "$ds_values->{when}:$value");
if (my $ERROR = RRDs::error) {
+ #confess Dumper @_;
ERROR "[ERROR] In RRD: Error updating $rrd_file: $ERROR";
}
}
@@ -525,3 +509,21 @@
=back
+=head1 COPYING
+
+Copyright (C) 2002-2009 Jimmy Olsen, et al.
+
+ 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
+
+
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/lib/Munin/Master/Utils.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Master::Utils;
-# $Id: Utils.pm 2755 2009-10-29 12:40:52Z janl $
+# $Id: Utils.pm 2961 2009-11-11 19:59:26Z feiner.tom $
use strict;
use warnings;
@@ -61,9 +61,11 @@
'munin_get_separated_node',
'munin_mkdir_p',
'munin_find_field',
+ 'munin_find_field_for_limits',
'munin_get_parent',
'munin_get_children',
'munin_get_node_partialpath',
+ 'munin_has_subservices',
'print_version_and_exit',
'exit_if_run_by_super_user',
'look_for_child',
@@ -75,7 +77,6 @@
my $nsca = new IO::Handle;
my $config = undef;
-my $DEBUG=0;
my $configfile="$Munin::Common::Defaults::MUNIN_CONFDIR/munin.conf";
# Fields to copy when "aliasing" a field
@@ -96,7 +97,7 @@
my ($start,$step,$names,$data) = RRDs::fetch $file,$type || "AVERAGE";
unless (defined $data)
{
- logger ("Could not fetch data from $file(".($type||"AVERAGE")."): ". RRDs::error);
+ WARN ("[WARNING] Could not fetch data from $file(".($type||"AVERAGE")."): ". RRDs::error);
return;
}
my @array = map { @$_[0] } splice(@$data, $#$data - ($last || 1));
@@ -129,7 +130,7 @@
else
{
print $nsca "$name\t$service\t$level\t$comment\n";
- DEBUG "To $nsca: $name;$service;$level;$comment\n";
+ DEBUG "[DEBUG] To $nsca: $name;$service;$level;$comment\n";
}
}
@@ -138,7 +139,7 @@
# Create lock file, fail and die if not possible.
my ($lockname) = @_;
if (sysopen (LOCK,$lockname,O_WRONLY | O_CREAT | O_EXCL)) {
- DEBUG "Creating lock : $lockname succeded\n";
+ DEBUG "[DEBUG] Creating lock : $lockname succeeded\n";
print LOCK $$; # we want the pid inside for later use
close LOCK;
return 1;
@@ -153,14 +154,14 @@
my ($lockname) = @_;
unlink $lockname or
- LOGCROAK("Error deleting lock $lockname: $!\n");
+ LOGCROAK("[FATAL ERROR] Error deleting lock $lockname: $!\n");
}
sub munin_runlock {
my ($lockname) = @_;
- unless (&munin_getlock($lockname)) {
- LOGCROAK("Lock already exists: $lockname. Dying.\n");
+ unless (munin_getlock($lockname)) {
+ LOGCROAK("[FATAL ERROR] Lock already exists: $lockname. Dying.\n");
}
return 1;
}
@@ -169,6 +170,7 @@
sub munin_getlock {
my ($lockname) = @_;
if (-f $lockname) {
+ DEBUG "[DEBUG] Lock $lockname already exists, checking process";
# Is the lockpid alive?
# To check this is inteligent and so on. It also makes for a
@@ -179,17 +181,26 @@
open my $LOCK, '<', $lockname or
LOGCROAK("Could not open $lockname for reading: $!\n");
my $pid = <$LOCK>;
+ $pid = '' if !defined($pid);
close($LOCK) or LOGCROAK("Could not close $lockname: $!\n");
+
+ DEBUG "[DEBUG] Lock contained pid '$pid'";
+
# Make sure it's a proper pid
if (defined($pid) and $pid =~ /^(\d+)$/ and $1 != 1) {
$pid = $1;
if (kill(0, $pid)) {
+ DEBUG "[DEBUG] kill -0 $pid worked - it is still alive. Locking failed.";
return 0;
}
+ INFO "[INFO] Process $pid is dead, stealing lock, removing file";
+ } else {
+ INFO "[INFO] PID in lock file is bogus. Removing lock file";
}
- &munin_removelock($lockname);
+ munin_removelock($lockname);
}
- &munin_createlock($lockname);
+ DEBUG "[DEBUG] Creating new lock file $lockname";
+ munin_createlock($lockname);
return 1;
}
@@ -198,13 +209,13 @@
my ($config,$data) = @_;
for my $domain (keys %{$data->{domain}}) {
unless ($config->{domain}->{$domain}) {
- logger("Removing domain: $domain");
+ DEBUG "[DEBUG] Removing domain: $domain";
delete ($data->{domain}->{$domain});
next;
}
for my $node (keys %{$data->{domain}->{$domain}->{node}}) {
unless ($config->{domain}->{$domain}->{node}->{$node}) {
- logger("Removing node from $domain: $node");
+ DEBUG "[DEBUG] Removing node from $domain: $node";
delete ($data->{domain}->{$domain}->{node}->{$node});
}
}
@@ -214,11 +225,23 @@
sub munin_overwrite {
+ # copy from $overwrite OVER $config.
+
my ($configfile,$overwrite) = @_;
for my $key (keys %$overwrite) {
next if $key =~ /^#%#/;
if (ref $overwrite->{$key}) {
- &munin_overwrite($configfile->{$key},$overwrite->{$key});
+ if (!defined $configfile->{$key}) {
+ if (ref $overwrite->{$key} eq "HASH") {
+ $configfile->{$key}->{'#%#parent'} = $configfile;
+ $configfile->{$key}->{'#%#name'} = $key;
+ munin_overwrite($configfile->{$key},$overwrite->{$key});
+ } else {
+ $configfile->{$key} = $overwrite->{$key};
+ }
+ } else {
+ munin_overwrite($configfile->{$key},$overwrite->{$key});
+ }
} else {
$configfile->{$key} = $overwrite->{$key};
}
@@ -229,7 +252,8 @@
sub munin_readconfig {
my ($conf, $missingok, $corruptok) = @_;
- my $config = undef;
+
+ my $config = undef;
my @contents = undef;
$conf ||= $configfile;
@@ -240,18 +264,19 @@
if (open (my $CFG, '<', $conf)) {
@contents = <$CFG>;
close ($CFG);
- $config = &munin_parse_config (\@contents);
+ $config = munin_parse_config (\@contents);
}
# Some important defaults before we return...
- $config->{'rundir'} ||= "/var/lock";
- $config->{'dbdir'} ||= $Munin::Common::Defaults::MUNIN_DBDIR;
- $config->{'logdir'} ||= $Munin::Common::Defaults::MUNIN_LOGDIR;
- $config->{'tmpldir'} ||= "$Munin::Common::Defaults::MUNIN_CONFDIR/templates/";
- $config->{'htmldir'} ||= $Munin::Common::Defaults::MUNIN_HTMLDIR;
- $config->{'spooldir'} ||= $Munin::Common::Defaults::MUNIN_SSPOOLDIR;
- $config->{'#%#parent'} = undef;
- $config->{'#%#name'} = "root";
+ $config->{'dropdownlimit'} ||= $Munin::Common::Defaults::DROPDOWNLIMIT;
+ $config->{'rundir'} ||= $Munin::Common::Defaults::MUNIN_STATEDIR;
+ $config->{'dbdir'} ||= $Munin::Common::Defaults::MUNIN_DBDIR;
+ $config->{'logdir'} ||= $Munin::Common::Defaults::MUNIN_LOGDIR;
+ $config->{'tmpldir'} ||= "$Munin::Common::Defaults::MUNIN_CONFDIR/templates/";
+ $config->{'htmldir'} ||= $Munin::Common::Defaults::MUNIN_HTMLDIR;
+ $config->{'spooldir'} ||= $Munin::Common::Defaults::MUNIN_SSPOOLDIR;
+ $config->{'#%#parent'} = undef;
+ $config->{'#%#name'} = "root";
return ($config);
}
@@ -288,7 +313,7 @@
if ($line =~ /^\.(\S+)\s+(.+)\s*$/) {
my ($var, $val) = ($1, $2);
- $hash = &munin_set_var_path ($hash, $var, $val);
+ $hash = munin_set_var_path ($hash, $var, $val);
} elsif ($line =~ /^\s*\[([^\]]*)]\s*$/) {
$prefix = $1;
if ($prefix =~ /^([^:]+);([^:;]+)$/) {
@@ -306,7 +331,7 @@
}
} elsif ($line =~ /^\s*(\S+)\s+(.+)\s*$/) {
my ($var, $val) = ($1, $2);
- $hash = &munin_set_var_path ($hash, "$prefix$var", $val);
+ $hash = munin_set_var_path ($hash, "$prefix$var", $val);
} else {
warn "Malformed configuration line \"$line\".";
}
@@ -372,6 +397,12 @@
sub munin_find_field {
+ # Starting at the (presumably the root) $hash make recursive calls
+ # until for example graph_title or value is found, and then
+ # continue recursing and itterating to all are found.
+ #
+ # Then we return a array of pointers into the $hash
+
my $hash = shift;
my $field = shift;
my $avoid = shift;
@@ -397,6 +428,32 @@
}
+sub munin_find_field_for_limits {
+ my $hash = shift;
+ my $field = shift;
+ my $avoid = shift;
+ my $res = [];
+
+ if (ref ($field) ne "Regexp") {
+ $field = qr/^$field$/;
+ }
+
+ if (ref ($hash) eq "HASH") {
+ foreach my $key (keys %{$hash}) {
+ next if $key =~ /^#%#/;
+ last if defined $avoid and $key eq $avoid;
+ if (ref ($hash->{$key}) eq "HASH") {
+ push @$res, @{munin_find_field_for_limits ($hash->{$key}, $field, $avoid)};
+ } elsif ($key =~ $field) {
+ push @$res, $hash;
+ }
+ }
+ }
+
+ return $res;
+}
+
+
sub munin_get_children {
my $hash = shift;
my $res = [];
@@ -506,19 +563,20 @@
}
-sub munin_get_node
-{
+sub munin_get_node {
+ # From the given point in the hash itterate deeper into the
+ # has along the path given by the array in $loc.
+ #
+ # If any part of the path in $loc is undefined we bail.
my $hash = shift;
my $loc = shift;
foreach my $tmpvar (@$loc) {
if ($tmpvar !~ /\S/) {
- logger ("Error: munin_get_node: Cannot work on hash node \"$tmpvar\"");
- return;
+ ERROR "[ERROR] munin_get_node: Cannot work on hash node \"$tmpvar\"";
+ return undef;
}
- # This used to be "return undef" which seems a bit hash and also has
- # been reported to be harmful. - janl
- next if !exists $hash->{$tmpvar};
+ return undef if !exists $hash->{$tmpvar};
$hash = $hash->{$tmpvar};
}
return $hash;
@@ -543,7 +601,7 @@
my $tmpvar = shift @aloc;
$tmpvar = shift @aloc while (defined $tmpvar and $tmpvar =~ /^#%#/);
if ($tmpvar !~ /\S/) {
- logger ("Error: munin_set_var_loc: Cannot work on hash node \"$tmpvar\"");
+ ERROR "[ERROR] munin_set_var_loc: Cannot work on hash node \"$tmpvar\"";
return;
}
if (@aloc > 0) {
@@ -553,8 +611,8 @@
}
return munin_set_var_loc ($hash->{$tmpvar}, \@aloc, $val);
} else {
- logger ("Warning: munin_set_var_loc: Setting unknown option \"$tmpvar\".")
- unless Munin::Common::Config::cl_is_keyword($tmpvar);
+ WARN "[WARNING] munin_set_var_loc: Setting unknown option \"$tmpvar\"."
+ unless Munin::Common::Config::cl_is_keyword($tmpvar);
# FIX
@@ -594,7 +652,7 @@
my @leftarr = split (/;/, $1);
push @$varloc, @leftarr;
} else {
- logger ("Error: munin_get_node_partialpath: Malformatted variable path \"$var\".");
+ ERROR "[ERROR] munin_get_node_partialpath: Malformed variable path \"$var\".";
}
# We've got both parts of the loc (varloc and hashloc) -- let's figure out
@@ -615,8 +673,8 @@
my $result = undef;
- logger ("Debug: munin_set_var_path: Setting var \"$var\" = \"$val\"")
- if $DEBUG;
+ DEBUG "[DEBUG] munin_set_var_path: Setting var \"$var\" = \"$val\"";
+
if ($var =~ /^\s*([^:]+):(\S+)\s*$/) {
my ($leftstring, $rightstring) = ($1, $2);
@@ -638,11 +696,11 @@
my @leftarr = split (/;/, $1);
$result = munin_set_var_loc ($hash, [@leftarr], $val);
} else {
- logger ("Error: munin_set_var_path: Malformatted variable path \"$var\".");
+ ERROR "Error: munin_set_var_path: Malformatted variable path \"$var\".";
}
if (!defined $result) {
- logger ("Error: munin_set_var_path: Failed setting \"$var\" = \"$val\".");
+ ERROR "Error: munin_set_var_path: Failed setting \"$var\" = \"$val\".";
}
return $hash;
@@ -663,8 +721,7 @@
}
-sub munin_writeconfig_loop
-{
+sub munin_writeconfig_loop {
my ($hash,$fh,$pre) = @_;
foreach my $key (keys %$hash) {
@@ -676,7 +733,8 @@
next if !defined $pre and $key eq "version"; # Handled separately
next if !defined $hash->{$key} or !length $hash->{$key};
(my $outstring = $hash->{$key}) =~ s/([^\\])#/$1\\#/g;
- DEBUG "Writing: $path $outstring\n";
+ # Too much. Can be seen in the file itself.
+ # DEBUG "[DEBUG] Writing: $path $outstring\n";
if ($outstring =~ /\\$/)
{ # Backslash as last char has special meaning. Avoid it.
print $fh "$path $outstring\\\n";
@@ -691,6 +749,8 @@
sub munin_writeconfig {
my ($datafilename,$data,$fh) = @_;
+ DEBUG "[DEBUG] Writing state to $datafilename";
+
if (!defined $fh) {
$fh = gensym();
unless (open ($fh, ">", $datafilename)) {
@@ -701,30 +761,53 @@
# Write version
print $fh "version $VERSION\n";
# Write datafile
- &munin_writeconfig_loop ($data, $fh);
+ munin_writeconfig_loop ($data, $fh);
- if (defined $fh)
- {
- DEBUG "Closing filehandle \"$datafilename\"...\n";
- close ($fh);
- }
+ DEBUG "[DEBUG] Closing filehandle \"$datafilename\"...\n";
+ close ($fh);
}
sub munin_config {
my $conffile = shift;
- $config = shift;
+ my $config = shift;
+
$conffile ||= $configfile;
- $config = &munin_readconfig ($conffile);
- my $data = &munin_readconfig("$config->{dbdir}/datafile", 1, 1);
+ $config = munin_readconfig ($conffile);
+
+ if (defined $config->{'includedir'}) {
+ my $dirname = $config->{'includedir'};
+ DEBUG "Includedir statement to include files in $dirname";
+
+ my $DIR;
+ opendir($DIR, $dirname) or
+ LOGCROAK "Could not open includedir directory $dirname: $!\n";
+ my @files = grep { ! /^\.|~$/ } readdir($DIR) or
+ LOGCROAK "Error reading includedir directory $dirname: $!\n";
+ closedir($DIR);
+
+ @files = map { $_ = $dirname.'/'.$_; } (sort @files);
+
+ foreach my $f (@files) {
+ INFO "Reading additional config from $f";
- $data = &munin_overwrite($data,$config);
+ my $extra = munin_readconfig ($f);
+ $config = munin_overwrite($extra,$config);
+ }
+ }
+
+ my $data = munin_readconfig("$config->{dbdir}/datafile", 1, 1);
+
+ $data = munin_overwrite($data,$config);
return ($data);
}
sub munin_get_html_filename {
+ # Actually only used in M::M::HTMLOld
+
my $hash = shift;
+
my $loc = munin_get_node_loc ($hash);
my $ret = munin_get ($hash, 'htmldir');
my $plugin = "index";
@@ -739,7 +822,7 @@
$l;
} @$loc;
- if (defined $hash->{'graph_title'}) {
+ if (defined $hash->{'graph_title'} and !munin_has_subservices ($hash)) {
$plugin = pop @$loc or return;
}
@@ -755,6 +838,7 @@
my $hash = shift;
my $scale = shift;
my $sum = shift;
+
my $loc = munin_get_picture_loc ($hash);
my $ret = munin_get ($hash, 'htmldir');
@@ -810,48 +894,65 @@
my @leftarr = split (/;/, $1);
$result = [@leftarr];
} else {
- logger ("Error: munin_path_to_loc: Malformatted variable path \"$path\".");
+ ERROR "[ERROR] munin_path_to_loc: Malformatted variable path \"$path\".";
}
if (!defined $result) {
- logger ("Error: munin_path_to_loc: Failed converting \"$path\".");
+ ERROR "[ERROR] munin_path_to_loc: Failed converting \"$path\".";
}
return $result;
}
+sub munin_get_keypath {
+ my $hash = shift;
+ my $asfile = shift || '';
+
+ my @group = ();
+ my $host = 0;
+ my @service = ();
+
+ my $i = $hash;
+
+ while (ref ($i) eq "HASH") {
+ my $name = $i->{'#%#name'};
+ last if $name eq 'root';
+ if ($host) {
+ # Into group land now
+ unshift(@group,$name);
+ } else {
+ # 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}) {
+ unshift(@service,$name);
+ } else {
+ $host = 1;
+ unshift(@group,$name);
+ }
+ }
+ $i=$i->{'#%#parent'};
+ }
+
+ if ($asfile) {
+ return join('/',@group).'-'.join('-',@service);
+ } else {
+ return join(';',@group).':'.join('.',@service);
+ }
+}
+
+
sub munin_get_filename {
my $hash = shift;
- my $loc = munin_get_node_loc ($hash);
+
+ my $loc = munin_get_keypath ($hash,1);
my $ret = munin_get ($hash, "dbdir");
if (!defined $loc or !defined $ret) {
return;
}
- # Not really a danger (we're not doing this stuff via the
- # shell), so more to avoid confusion with silly filenames
- @$loc = map {
- my $l = $_;
- $l =~ s/\//_/g;
- $l =~ s/^\./_/g;
- $l;
- } @$loc;
-
- # In the case of multigraphs with nested services the names of
- # these variables are wrong. The $node becomes the plugin name
- # for example.
- my $field = pop @$loc or return;
- my $plugin = pop @$loc or return;
- my $node = pop @$loc or return;
-
- if (@$loc) { # The rest is used as directory names...
- $ret .= "/" . join ('/', @$loc);
- }
-
- return ($ret . "/$node-$plugin-$field-" . lc substr (munin_get($hash, "type", "GAUGE"), 0,1). ".rrd");
-
+ return ($ret . "/$loc-" . lc substr (munin_get($hash, "type", "GAUGE"), 0,1). ".rrd");
}
@@ -861,7 +962,7 @@
my $field = shift;
my $default = shift;
- my $ans = &munin_get ($hash, $field, $default);
+ my $ans = munin_get ($hash, $field, $default);
return if not defined $ans;
if ($ans =~ /^yes$/i or
@@ -999,7 +1100,7 @@
foreach my $service (keys %{$snode})
{
- my $fres = &munin_service_status ($config, $limits, $domain, $node, $service, $check_draw);
+ my $fres = munin_service_status ($config, $limits, $domain, $node, $service, $check_draw);
if (defined $fres)
{
if ($fres eq "critical")
@@ -1161,6 +1262,11 @@
my $fieldname = munin_get_node_name ($fieldnode);
push @$result,$fieldname if !grep /^\Q$fieldname\E(?:=|$)/, @$result;;
}
+
+ for my $fieldnode (@{munin_find_field ($hash, "stack")}) {
+ my $fieldname = munin_get_node_name ($fieldnode);
+ push @$result,$fieldname if !grep /^\Q$fieldname\E(?:=|$)/, @$result;;
+ }
return $result;
}
@@ -1169,6 +1275,7 @@
sub munin_get_rrd_filename {
my $field = shift;
my $path = shift;
+
my $result = undef;
my $name = munin_get_node_name ($field);
@@ -1176,7 +1283,9 @@
return if !defined $field or ref ($field) ne "HASH";
# If the field has a .filename setting, use it
- return $result if $result = munin_get ($field, "filename");
+ if ($result = munin_get ($field, "filename")) {
+ return $result;
+ }
# Handle custom paths (used in .sum, .stack, graph_order, et al)
if (defined $path and length $path) {
@@ -1270,6 +1379,18 @@
return $running;
}
+sub munin_has_subservices {
+ my ($hash) = @_;
+ return 0 unless defined $hash;
+
+ # Only services (which again require graph_title) can have subservices
+ return 0 unless defined $hash->{'graph_title'};
+
+ if (!defined $hash->{'#%#has_subservices'}) {
+ $hash->{'#%#has_subservices'} = scalar (grep $_, map { ref($hash->{$_}) eq "HASH" and $_ ne '#%#parent' and defined $hash->{$_}->{'graph_title'} ? 1 : undef } keys %$hash);
+ }
+ return $hash->{'#%#has_subservices'};
+}
1;
@@ -1372,7 +1493,7 @@
=item B<munin_find_field>
-Search a hash to find nodes with $field defined.
+Search a hash to find hash nodes with $field defined.
Parameters:
- $hash: A hash ref to search
@@ -1628,6 +1749,20 @@
=item B<munin_graph_column_headers>
+=item B<munin_has_subservices>
+
+ munin_has_subservices($hash);
+
+Checks whether the service represented by $hash has subservices (multigraph),
+and returns the result.
+
+Parameters:
+ - $hash: Hash reference pointing to a service
+
+Returns:
+ - true: if the hash is indeed a service, and said service has got subservices
+ - false: otherwise
+
=item B<munin_mkdir_p>
@@ -1766,5 +1901,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+=cut
# vim: syntax=perl ts=8
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/munin.conf.in
^
|
@@ -1,15 +1,22 @@
# Example configuration file for Munin, generated by 'make build'
# The next three variables specifies where the location of the RRD
-# databases, the HTML output, and the logs, severally. They all
-# must be writable by the user running munin-cron.
-dbdir @@DBDIR@@
-htmldir @@HTMLDIR@@
-logdir @@LOGDIR@@
-rundir @@STATEDIR@@
-
+# databases, the HTML output, logs and the lock/pid files. They all
+# must be writable by the user running munin-cron. They are all
+# defaulted to the values you see here.
+#
+# dbdir @@DBDIR@@
+# htmldir @@HTMLDIR@@
+# logdir @@LOGDIR@@
+# rundir @@STATEDIR@@
+#
# Where to look for the HTML templates
-tmpldir @@CONFDIR@@/templates
+# tmpldir @@CONFDIR@@/templates
+
+# (Exactly one) directory to include all files from. There is no
+# default.
+#
+# includedir @@CONFDIR@@/munin-conf.d
# Make graphs show values per minute instead of per second
#graph_period minute
@@ -21,21 +28,25 @@
#
#graph_strategy cgi
-# munin-graph runs in parallel, the number of concurrent processes is
-# 6. If you want munin-graph to not be parallel set to 0. If set too high
-# it will slow down munin-graph. Some experiments are needed to determine
-# how many are optimal on your system.
-#
-#max_graph_jobs 6
-
# munin-cgi-graph is invoked by the web server up to very many times at the
# same time. This is not optimal since it results in high CPU and memory
# consumption to the degree that the system can thrash. Again the default is
# 6. Most likely the optimal number for max_cgi_graph_jobs is the same as
# max_graph_jobs.
-
+#
#munin_cgi_graph_jobs 6
+# If the automatic CGI url is wrong for your system override it here:
+#
+#cgiurl_graph /cgi-bin/munin-cgi-graph
+
+# munin-graph runs in parallel, the number of concurrent processes is
+# 6. If you want munin-graph to not be parallel set to 0. If set too
+# high it will slow down munin-graph. Some experiments are needed to
+# determine how many are optimal on your system. On a multi-core
+# system with good SCSI disks the number can probably be quite high.
+#
+#max_graph_jobs 6
# Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime
# something changes (OK -> WARNING, CRITICAL -> OK, etc)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/t/munin_master_config.t
^
|
@@ -35,7 +35,7 @@
{
use_node_name => 1,
address => '127.0.0.1',
- port => '4949',
+ port => '4948',
'load1.graph_title' => 'Loads side by side',
'load1.graph_order' => 'fii=fii.foo.com:load.load fay=fay.foo.com:load.load',
host_name => 'marvin',
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/t/munin_master_node.t
^
|
@@ -1,12 +1,15 @@
+# -*- cperl -*-
use warnings;
use strict;
use Munin::Master::Config;
-use Test::More tests => 16;
+use Test::More tests => 13;
use Test::MockModule;
use Test::MockObject::Extends;
use Test::Exception;
+use Data::Dumper;
+
use_ok('Munin::Master::Node');
my $config = Munin::Master::Config->instance();
@@ -21,16 +24,16 @@
}
-######################################################################
+############################# 2 #########################################
{
my $node = Munin::Master::Node->new();
- isa_ok($node, 'Munin::Master::Node');
+ isa_ok($node, 'Munin::Master::Node','Create a node object');
}
-######################################################################
+############################# 3 #########################################
{
@@ -43,11 +46,11 @@
$node->_do_connect();
- is($node->{node_name}, 'foo.example.com');
+ is($node->{node_name}, 'foo.example.com','Node name is detected');
}
-######################################################################
+############################# 4 #########################################
{
@@ -64,60 +67,31 @@
{
my $node = setup();
- $node->mock('_node_read', sub {
- return (
- '# Node capabilities: (bar baz foo). Session capabilities: (',
- 'foo',
- '# )',
- );
+ $node->mock('_node_read_single', sub {
+ return ('cap multigraph');
});
my @res = $node->negotiate_capabilities();
- is_deeply(\@res, ['foo'], 'Capabilities - single');
+ is_deeply(\@res, ['multigraph'], 'Capabilities - single');
}
-{
- my $node = setup();
- $node->mock('_node_read', sub {
- return (
- '# Node capabilities: (bar baz foo). Session capabilities: (',
- '',
- '# )',
- );
- });
- my @res = $node->negotiate_capabilities();
-
- is_deeply(\@res, [], 'Capabilities - none');
-}
-
+=begin comment
+This fails. Frankly it should result in "multigraph".
{
my $node = setup();
- $node->mock('_node_read', sub {
- return (
- '# Node capabilities: (bar baz foo). Session capabilities: (',
- 'bar baz foo',
- '# )',
- );
+ $node->mock('_node_read_single', sub {
+ return ('cap bar baz foo');
});
my @res = $node->negotiate_capabilities();
- is_deeply(\@res, [qw(bar baz foo)], 'Capabilities - multiple');
+ is_deeply(\@res, ['baz'], 'Capabilities - none');
}
+=end comment
+=cut
-{
- my $node = setup();
- $node->mock('_node_read', sub {
- return (
- '# Unknown command bla bla bla',
- );
- });
- my @res = $node->negotiate_capabilities();
-
- is_deeply(\@res, ['NA'], 'Capabilities - not applicable');
-}
######################################################################
@@ -129,9 +103,9 @@
$node->{node_name} = 'node';
- my @res = $node->list_services();
+ my @res = $node->list_plugins();
- is_deeply(\@res, [qw(foo bar baz)], 'List services');
+ is_deeply(\@res, [qw(foo bar baz)], 'List plugins');
}
@@ -142,7 +116,7 @@
my $node = setup();
$node->mock('_node_read', sub { return ('# timeout: bla bla bla') });
throws_ok { $node->fetch_service_config('foo') }
- qr/Client reported timeout in configuration of 'foo'/,
+ qr/Timeout error on node/,
'Fetch service config - Timeout throws exception';
}
@@ -177,23 +151,32 @@
);
});
my %res = $node->fetch_service_config('foo');
- is_deeply(\%res, {
- global => [
- [qw(foo bar)],
- [qw(zap gabonk)],
- ['graph_order', 'baz zip']
- ],
- data_source => {
- baz => {label => 'foo'},
- zip => {label => 'bar'},
- },
- }, 'Fetch service config - implicit graph order');
+
+ is_deeply(\%res,
+ {
+ global => {
+ multigraph => [ 'foo' ],
+ foo => {
+ [qw(foo bar)],
+ [qw(zap gabonk)],
+ ['graph_order', 'baz zip'],
+ },
+ },
+ data_source => {
+ foo => {
+ baz => {label => 'foo'},
+ zip => {label => 'bar'},
+ },
+ },
+ },
+ 'Fetch service config - implicit graph order'
+ );
}
{
my $node = setup();
- $node->mock('_node_read', sub {
+ $node->mock('_node_read', sub {
return (
'',
'# bla bla bla',
@@ -226,16 +209,15 @@
my $node = setup();
$node->mock('_node_read', sub { return ('# timeout: bla bla bla') });
-
throws_ok { $node->fetch_service_data('foo') }
- qr/Client reported timeout in configuration of 'foo'/,
+ qr/Timeout in fetch from 'foo'/,
'Fetch service data - Timeout throws exception';
}
{
my $node = setup();
- $node->mock('_node_read', sub {
+ $node->mock('_node_read', sub {
return (
'',
'# bla bla bla',
|
|
Added |
munin-1.4.tar.bz2/master/www/logo-h.png
^
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/munin-comparison-day.tmpl
^
|
@@ -0,0 +1,40 @@
+<TMPL_INCLUDE NAME="partial/head.tmpl">
+<body>
+
+<TMPL_INCLUDE NAME="partial/logo_navigation_comparison.tmpl">
+
+<table class="invisiblebox">
+ <TMPL_LOOP NAME="CATEGORIES">
+ <tr><td class="graphbox" id="<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">">
+ <table>
+ <tr><td colspan="<TMPL_VAR NAME="NGROUPS">"><h3 class="nobottom"> <TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></h3></td></tr>
+ <TMPL_LOOP NAME="SERVICES">
+ <tr>
+ <TMPL_LOOP NAME="NODES">
+ <td valign="top">
+ <table class="invisiblebox">
+ <tr><td colspan="2"></td></tr>
+ <tr><td colspan="2"><div class="lighttext"><a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html"><TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a> :: <TMPL_IF NAME="URL1"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL1">"></TMPL_IF><TMPL_VAR ESCAPE="HTML" NAME="LABEL"><TMPL_IF NAME="URL1"></a></TMPL_IF></div></td></tr>
+ <tr><td>
+ <a title="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">"/><TMPL_IF NAME="CIMGDAY"><a href="<TMPL_VAR NAME="URL1">"><img src="<TMPL_VAR NAME="CIMGDAY">" alt="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">" <TMPL_IF NAME="IMGDAYWIDTH">width="<TMPL_VAR NAME="IMGDAYWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGDAYHEIGHT">height="<TMPL_VAR NAME="IMGDAYHEIGHT">"</TMPL_IF>/></a></TMPL_IF>
+ </td></tr>
+ </table>
+ </td>
+ </TMPL_LOOP>
+ </tr>
+ </TMPL_LOOP>
+ </table>
+ </td></tr>
+
+ <tr><td></td></tr>
+
+ </TMPL_LOOP>
+ <tr>
+ <td class="linkbox">
+ <TMPL_INCLUDE NAME="partial/bottom_navigation.tmpl">
+ </td>
+ </tr>
+ </table>
+ <TMPL_INCLUDE NAME="partial/generated_by.tmpl">
+</body>
+</html>
|
[-]
[+]
|
Deleted |
munin-1.4.tar.bz2/master/www/munin-comparison-day.tmpl.in
^
|
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <link rel="stylesheet" href="../style.css" type="text/css" />
- <meta http-equiv="refresh" content="300" />
- <title><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="name"> :: <TMPL_VAR ESCAPE="HTML" NAME="name"><TMPL_ELSE>Munin</TMPL_IF></TMPL_LOOP></title>
- <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
- <meta name="author" content="Auto-generated by Munin" />
-</head>
-<body>
-<table cellpadding="3" border="0">
- <tr>
- <td rowspan="2"><div class="logo"> </div></td>
- <td valign="top">
- <h2><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="NAME"> :: <TMPL_IF NAME="PATH"><A HREF="<TMPL_VAR NAME="PATH">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="PATH"></A></TMPL_IF><TMPL_ELSE><TMPL_IF NAME="PATH"><A HREF="<TMPL_VAR NAME="PATH">"></TMPL_IF>Overview<TMPL_IF NAME="PATH"></A></TMPL_IF></TMPL_IF></TMPL_LOOP>
- :: [ day <a href="comparison-week.html">week</a> <a href="comparison-month.html">month</a> <a href="comparison-year.html">year</a> ]</h2>
- </td>
- </tr>
- <tr>
- <td valign="top">
- <h2><TMPL_VAR ESCAPE="HTML" NAME="NAME"> :: [ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="#<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">"><TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></a> </TMPL_LOOP>]</h2>
- </td>
- </tr>
-</table>
-
-<table class="invisiblebox">
- <tr><td>
- <hr class="ruler" />
- </td></tr>
-
- <TMPL_LOOP NAME="CATEGORIES">
- <tr><td class="graphbox" id="<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">">
- <table>
- <tr><td colspan="<TMPL_VAR NAME="NGROUPS">"><h3 class="nobottom"> <TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></h3></td></tr>
- <tr><td colspan="<TMPL_VAR NAME="NGROUPS">"><hr class="ruler2" /></td></tr>
- <TMPL_LOOP NAME="SERVICES">
- <tr>
- <TMPL_LOOP NAME="NODES">
- <td valign="top">
- <table class="invisiblebox">
- <tr><td colspan="2"></td></tr>
- <tr><td colspan="2"><div class="lighttext"><a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html"><TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a> :: <TMPL_IF NAME="URL1"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL1">"></TMPL_IF><TMPL_VAR ESCAPE="HTML" NAME="LABEL"><TMPL_IF NAME="URL1"></a></TMPL_IF></div></td></tr>
- <tr><td>
- <a title="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">"/><TMPL_IF NAME="CIMGDAY"><a href="<TMPL_VAR NAME="URL1">"><img src="<TMPL_VAR NAME="CIMGDAY">" alt="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">" <TMPL_IF NAME="IMGDAYWIDTH">width="<TMPL_VAR NAME="IMGDAYWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGDAYHEIGHT">height="<TMPL_VAR NAME="IMGDAYHEIGHT">"</TMPL_IF>/></a></TMPL_IF>
- </td></tr>
- </table>
- </td>
- </TMPL_LOOP>
- </tr>
- </TMPL_LOOP>
- </table>
- </td></tr>
-
- <tr><td></td></tr>
-
- </TMPL_LOOP>
- <tr><td class="linkbox">
- <TMPL_VAR NAME="PARENT"> :<TMPL_LOOP NAME="PEERS">: <TMPL_IF NAME="LINK"><a href="<TMPL_VAR NAME="LINK">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="LINK"></a></TMPL_IF></a> </TMPL_LOOP>
- </td></tr>
-</table>
-
- <table cellpadding="2" cellspacing="4" border="0">
- <tr>
- <td><i class="small">This page was generated by <a href="http://munin.sourceforge.net/">Munin</a> version @@VERSION@@ at <TMPL_VAR NAME="TIMESTAMP"></i></td>
- </tr>
- </table>
-</body>
-</html>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/munin-comparison-month.tmpl
^
|
@@ -0,0 +1,40 @@
+<TMPL_INCLUDE NAME="partial/head.tmpl">
+<body>
+
+<TMPL_INCLUDE NAME="partial/logo_navigation_comparison.tmpl">
+
+<table class="invisiblebox">
+ <TMPL_LOOP NAME="CATEGORIES">
+ <tr><td class="graphbox" id="<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">">
+ <table>
+ <tr><td colspan="<TMPL_VAR NAME="NGROUPS">"><h3 class="nobottom"> <TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></h3></td></tr>
+ <TMPL_LOOP NAME="SERVICES">
+ <tr>
+ <TMPL_LOOP NAME="NODES">
+ <td valign="top">
+ <table class="invisiblebox">
+ <tr><td colspan="2"></td></tr>
+ <tr><td colspan="2"><div class="lighttext"><a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html"><TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a> :: <TMPL_IF NAME="URL1"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL1">"></TMPL_IF><TMPL_VAR ESCAPE="HTML" NAME="LABEL"><TMPL_IF NAME="URL1"></a></TMPL_IF></div></td></tr>
+ <tr><td>
+ <a title="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">"/><TMPL_IF NAME="CIMGMONTH"><a href="<TMPL_VAR NAME="URL1">"><img src="<TMPL_VAR NAME="CIMGMONTH">" alt="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">" <TMPL_IF NAME="IMGMONTHWIDTH">width="<TMPL_VAR NAME="IMGMONTHWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGMONTHHEIGHT">height="<TMPL_VAR NAME="IMGMONTHHEIGHT">"</TMPL_IF>/></a></TMPL_IF>
+ </td></tr>
+ </table>
+ </td>
+ </TMPL_LOOP>
+ </tr>
+ </TMPL_LOOP>
+ </table>
+ </td></tr>
+
+ <tr><td></td></tr>
+
+ </TMPL_LOOP>
+ <tr>
+ <td class="linkbox">
+ <TMPL_INCLUDE NAME="partial/bottom_navigation.tmpl">
+ </td>
+</tr>
+</table>
+ <TMPL_INCLUDE NAME="partial/generated_by.tmpl">
+</body>
+</html>
|
[-]
[+]
|
Deleted |
munin-1.4.tar.bz2/master/www/munin-comparison-month.tmpl.in
^
|
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <link rel="stylesheet" href="../style.css" type="text/css" />
- <meta http-equiv="refresh" content="300" />
- <title><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="name"> :: <TMPL_VAR ESCAPE="HTML" NAME="name"><TMPL_ELSE>Munin</TMPL_IF></TMPL_LOOP></title>
- <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
- <meta name="author" content="Auto-generated by Munin" />
-</head>
-<body>
-<table cellpadding="3" border="0">
- <tr>
- <td rowspan="2"><div class="logo"> </div></td>
- <td valign="top">
- <h2><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="NAME"> :: <TMPL_IF NAME="PATH"><A HREF="<TMPL_VAR NAME="PATH">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="PATH"></A></TMPL_IF><TMPL_ELSE><TMPL_IF NAME="PATH"><A HREF="<TMPL_VAR NAME="PATH">"></TMPL_IF>Overview<TMPL_IF NAME="PATH"></A></TMPL_IF></TMPL_IF></TMPL_LOOP>
- :: [ <a href="comparison-day.html">day</a> <a href="comparison-week.html">week</a> month <a href="comparison-year.html">year</a> ]</h2>
- </td>
- </tr>
- <tr>
- <td valign="top">
- <h2><TMPL_VAR ESCAPE="HTML" NAME="NAME"> :: [ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="#<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">"><TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></a> </TMPL_LOOP>]</h2>
- </td>
- </tr>
-</table>
-
-<table class="invisiblebox">
- <tr><td>
- <hr class="ruler" />
- </td></tr>
-
- <TMPL_LOOP NAME="CATEGORIES">
- <tr><td class="graphbox" id="<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">">
- <table>
- <tr><td colspan="<TMPL_VAR NAME="NGROUPS">"><h3 class="nobottom"> <TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></h3></td></tr>
- <tr><td colspan="<TMPL_VAR NAME="NGROUPS">"><hr class="ruler2" /></td></tr>
- <TMPL_LOOP NAME="SERVICES">
- <tr>
- <TMPL_LOOP NAME="NODES">
- <td valign="top">
- <table class="invisiblebox">
- <tr><td colspan="2"></td></tr>
- <tr><td colspan="2"><div class="lighttext"><a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html"><TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a> :: <TMPL_IF NAME="URL1"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL1">"></TMPL_IF><TMPL_VAR ESCAPE="HTML" NAME="LABEL"><TMPL_IF NAME="URL1"></a></TMPL_IF></div></td></tr>
- <tr><td>
- <a title="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">"/><TMPL_IF NAME="CIMGMONTH"><a href="<TMPL_VAR NAME="URL1">"><img src="<TMPL_VAR NAME="CIMGMONTH">" alt="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">" <TMPL_IF NAME="IMGMONTHWIDTH">width="<TMPL_VAR NAME="IMGMONTHWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGMONTHHEIGHT">height="<TMPL_VAR NAME="IMGMONTHHEIGHT">"</TMPL_IF>/></a></TMPL_IF>
- </td></tr>
- </table>
- </td>
- </TMPL_LOOP>
- </tr>
- </TMPL_LOOP>
- </table>
- </td></tr>
-
- <tr><td></td></tr>
-
- </TMPL_LOOP>
- <tr><td class="linkbox">
- <TMPL_VAR NAME="PARENT"> :<TMPL_LOOP NAME="PEERS">: <TMPL_IF NAME="LINK"><a href="<TMPL_VAR NAME="LINK">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="LINK"></a></TMPL_IF></a> </TMPL_LOOP>
- </td></tr>
-</table>
-
- <table cellpadding="2" cellspacing="4" border="0">
- <tr>
- <td><i class="small">This page was generated by <a href="http://munin.sourceforge.net/">Munin</a> version @@VERSION@@ at <TMPL_VAR NAME="TIMESTAMP"></i></td>
- </tr>
- </table>
-</body>
-</html>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/munin-comparison-week.tmpl
^
|
@@ -0,0 +1,41 @@
+<TMPL_INCLUDE NAME="partial/head.tmpl">
+<body>
+
+<TMPL_INCLUDE NAME="partial/logo_navigation_comparison.tmpl">
+
+<table class="invisiblebox">
+ <TMPL_LOOP NAME="CATEGORIES">
+ <tr><td class="graphbox" id="<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">">
+ <table>
+ <tr><td colspan="<TMPL_VAR NAME="NGROUPS">"><h3 class="nobottom"> <TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></h3></td></tr>
+ <TMPL_LOOP NAME="SERVICES">
+ <tr>
+ <TMPL_LOOP NAME="NODES">
+ <td valign="top">
+ <table class="invisiblebox">
+ <tr><td colspan="2"></td></tr>
+ <tr><td colspan="2"><div class="lighttext"><a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html"><TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a> :: <TMPL_IF NAME="URL1"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL1">"></TMPL_IF><TMPL_VAR ESCAPE="HTML" NAME="LABEL"><TMPL_IF NAME="URL1"></a></TMPL_IF></div></td></tr>
+ <tr><td>
+ <a title="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">"/><TMPL_IF NAME="CIMGWEEK"><a href="<TMPL_VAR NAME="URL1">"><img src="<TMPL_VAR NAME="CIMGWEEK">" alt="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">" <TMPL_IF NAME="IMGWEEKWIDTH">width="<TMPL_VAR NAME="IMGWEEKWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGWEEKHEIGHT">height="<TMPL_VAR NAME="IMGWEEKHEIGHT">"</TMPL_IF>/></a></TMPL_IF>
+ </td></tr>
+ </table>
+ </td>
+ </TMPL_LOOP>
+ </tr>
+ </TMPL_LOOP>
+ </table>
+ </td></tr>
+
+ <tr><td></td></tr>
+
+ </TMPL_LOOP>
+ <tr>
+ <td class="linkbox">
+ <TMPL_INCLUDE NAME="partial/bottom_navigation.tmpl">
+ </td>
+ </tr>
+</table>
+
+ <TMPL_INCLUDE NAME="partial/generated_by.tmpl">
+</body>
+</html>
|
[-]
[+]
|
Deleted |
munin-1.4.tar.bz2/master/www/munin-comparison-week.tmpl.in
^
|
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <link rel="stylesheet" href="../style.css" type="text/css" />
- <meta http-equiv="refresh" content="300" />
- <title><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="name"> :: <TMPL_VAR ESCAPE="HTML" NAME="name"><TMPL_ELSE>Munin</TMPL_IF></TMPL_LOOP></title>
- <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
- <meta name="author" content="Auto-generated by Munin" />
-</head>
-<body>
-<table cellpadding="3" border="0">
- <tr>
- <td rowspan="2"><div class="logo"> </div></td>
- <td valign="top">
- <h2><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="NAME"> :: <TMPL_IF NAME="PATH"><A HREF="<TMPL_VAR NAME="PATH">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="PATH"></A></TMPL_IF><TMPL_ELSE><TMPL_IF NAME="PATH"><A HREF="<TMPL_VAR NAME="PATH">"></TMPL_IF>Overview<TMPL_IF NAME="PATH"></A></TMPL_IF></TMPL_IF></TMPL_LOOP>
- :: [ <a href="comparison-day.html">day</a> week <a href="comparison-month.html">month</a> <a href="comparison-year.html">year</a> ]</h2>
- </td>
- </tr>
- <tr>
- <td valign="top">
- <h2><TMPL_VAR ESCAPE="HTML" NAME="NAME"> :: [ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="#<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">"><TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></a> </TMPL_LOOP>]</h2>
- </td>
- </tr>
-</table>
-
-<table class="invisiblebox">
- <tr><td>
- <hr class="ruler" />
- </td></tr>
-
- <TMPL_LOOP NAME="CATEGORIES">
- <tr><td class="graphbox" id="<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">">
- <table>
- <tr><td colspan="<TMPL_VAR NAME="NGROUPS">"><h3 class="nobottom"> <TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></h3></td></tr>
- <tr><td colspan="<TMPL_VAR NAME="NGROUPS">"><hr class="ruler2" /></td></tr>
- <TMPL_LOOP NAME="SERVICES">
- <tr>
- <TMPL_LOOP NAME="NODES">
- <td valign="top">
- <table class="invisiblebox">
- <tr><td colspan="2"></td></tr>
- <tr><td colspan="2"><div class="lighttext"><a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html"><TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a> :: <TMPL_IF NAME="URL1"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL1">"></TMPL_IF><TMPL_VAR ESCAPE="HTML" NAME="LABEL"><TMPL_IF NAME="URL1"></a></TMPL_IF></div></td></tr>
- <tr><td>
- <a title="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">"/><TMPL_IF NAME="CIMGWEEK"><a href="<TMPL_VAR NAME="URL1">"><img src="<TMPL_VAR NAME="CIMGWEEK">" alt="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">" <TMPL_IF NAME="IMGWEEKWIDTH">width="<TMPL_VAR NAME="IMGWEEKWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGWEEKHEIGHT">height="<TMPL_VAR NAME="IMGWEEKHEIGHT">"</TMPL_IF>/></a></TMPL_IF>
- </td></tr>
- </table>
- </td>
- </TMPL_LOOP>
- </tr>
- </TMPL_LOOP>
- </table>
- </td></tr>
-
- <tr><td></td></tr>
-
- </TMPL_LOOP>
- <tr><td class="linkbox">
- <TMPL_VAR NAME="PARENT"> :<TMPL_LOOP NAME="PEERS">: <TMPL_IF NAME="LINK"><a href="<TMPL_VAR NAME="LINK">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="LINK"></a></TMPL_IF></a> </TMPL_LOOP>
- </td></tr>
-</table>
-
- <table cellpadding="2" cellspacing="4" border="0">
- <tr>
- <td><i class="small">This page was generated by <a href="http://munin.sourceforge.net/">Munin</a> version @@VERSION@@ at <TMPL_VAR NAME="TIMESTAMP"></i></td>
- </tr>
- </table>
-</body>
-</html>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/munin-comparison-year.tmpl
^
|
@@ -0,0 +1,40 @@
+<TMPL_INCLUDE NAME="partial/head.tmpl">
+<body>
+
+<TMPL_INCLUDE NAME="partial/logo_navigation_comparison.tmpl">
+
+<table class="invisiblebox">
+ <TMPL_LOOP NAME="CATEGORIES">
+ <tr><td class="graphbox" id="<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">">
+ <table>
+ <tr><td colspan="<TMPL_VAR NAME="NGROUPS">"><h3 class="nobottom"> <TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></h3></td></tr>
+ <TMPL_LOOP NAME="SERVICES">
+ <tr>
+ <TMPL_LOOP NAME="NODES">
+ <td valign="top">
+ <table class="invisiblebox">
+ <tr><td colspan="2"></td></tr>
+ <tr><td colspan="2"><div class="lighttext"><a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html"><TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a> :: <TMPL_IF NAME="URL1"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL1">"></TMPL_IF><TMPL_VAR ESCAPE="HTML" NAME="LABEL"><TMPL_IF NAME="URL1"></a></TMPL_IF></div></td></tr>
+ <tr><td>
+ <a title="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">"/><TMPL_IF NAME="CIMGYEAR"><a href="<TMPL_VAR NAME="URL1">"><img src="<TMPL_VAR NAME="CIMGYEAR">" alt="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">" <TMPL_IF NAME="IMGYEARWIDTH">width="<TMPL_VAR NAME="IMGYEARWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGYEARHEIGHT">height="<TMPL_VAR NAME="IMGYEARHEIGHT">"</TMPL_IF>/></a></TMPL_IF>
+ </td></tr>
+ </table>
+ </td>
+ </TMPL_LOOP>
+ </tr>
+ </TMPL_LOOP>
+ </table>
+ </td></tr>
+
+ <tr><td></td></tr>
+
+ </TMPL_LOOP>
+ <tr>
+ <td class="linkbox">
+ <TMPL_INCLUDE NAME="partial/bottom_navigation.tmpl">
+ </td>
+ </tr>
+ </table>
+ <TMPL_INCLUDE NAME="partial/generated_by.tmpl">
+</body>
+</html>
|
[-]
[+]
|
Deleted |
munin-1.4.tar.bz2/master/www/munin-comparison-year.tmpl.in
^
|
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <link rel="stylesheet" href="../style.css" type="text/css" />
- <meta http-equiv="refresh" content="300" />
- <title><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="name"> :: <TMPL_VAR ESCAPE="HTML" NAME="name"><TMPL_ELSE>Munin</TMPL_IF></TMPL_LOOP></title>
- <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
- <meta name="author" content="Auto-generated by Munin" />
-</head>
-<body>
-<table cellpadding="3" border="0">
- <tr>
- <td rowspan="2"><div class="logo"> </div></td>
- <td valign="top">
- <h2><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="NAME"> :: <TMPL_IF NAME="PATH"><A HREF="<TMPL_VAR NAME="PATH">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="PATH"></A></TMPL_IF><TMPL_ELSE><TMPL_IF NAME="PATH"><A HREF="<TMPL_VAR NAME="PATH">"></TMPL_IF>Overview<TMPL_IF NAME="PATH"></A></TMPL_IF></TMPL_IF></TMPL_LOOP>
- :: [ <a href="comparison-day.html">day</a> <a href="comparison-week.html">week</a> <a href="comparison-month.html">month</a> year ]</h2>
- </td>
- </tr>
- <tr>
- <td valign="top">
- <h2><TMPL_VAR ESCAPE="HTML" NAME="NAME"> :: [ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="#<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">"><TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></a> </TMPL_LOOP>]</h2>
- </td>
- </tr>
-</table>
-
-<table class="invisiblebox">
- <tr><td>
- <hr class="ruler" />
- </td></tr>
-
- <TMPL_LOOP NAME="CATEGORIES">
- <tr><td class="graphbox" id="<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">">
- <table>
- <tr><td colspan="<TMPL_VAR NAME="NGROUPS">"><h3 class="nobottom"> <TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></h3></td></tr>
- <tr><td colspan="<TMPL_VAR NAME="NGROUPS">"><hr class="ruler2" /></td></tr>
- <TMPL_LOOP NAME="SERVICES">
- <tr>
- <TMPL_LOOP NAME="NODES">
- <td valign="top">
- <table class="invisiblebox">
- <tr><td colspan="2"></td></tr>
- <tr><td colspan="2"><div class="lighttext"><a href="<TMPL_VAR ESCAPE="URL" NAME="NODENAME">/index.html"><TMPL_VAR ESCAPE="HTML" NAME="NODENAME"></a> :: <TMPL_IF NAME="URL1"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL1">"></TMPL_IF><TMPL_VAR ESCAPE="HTML" NAME="LABEL"><TMPL_IF NAME="URL1"></a></TMPL_IF></div></td></tr>
- <tr><td>
- <a title="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">"/><TMPL_IF NAME="CIMGYEAR"><a href="<TMPL_VAR NAME="URL1">"><img src="<TMPL_VAR NAME="CIMGYEAR">" alt="<TMPL_VAR ESCAPE="HTML" NAME="LABEL">" <TMPL_IF NAME="IMGYEARWIDTH">width="<TMPL_VAR NAME="IMGYEARWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGYEARHEIGHT">height="<TMPL_VAR NAME="IMGYEARHEIGHT">"</TMPL_IF>/></a></TMPL_IF>
- </td></tr>
- </table>
- </td>
- </TMPL_LOOP>
- </tr>
- </TMPL_LOOP>
- </table>
- </td></tr>
-
- <tr><td></td></tr>
-
- </TMPL_LOOP>
- <tr><td class="linkbox">
- <TMPL_VAR NAME="PARENT"> :<TMPL_LOOP NAME="PEERS">: <TMPL_IF NAME="LINK"><a href="<TMPL_VAR NAME="LINK">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="LINK"></a></TMPL_IF></a> </TMPL_LOOP>
- </td></tr>
-</table>
-
- <table cellpadding="2" cellspacing="4" border="0">
- <tr>
- <td><i class="small">This page was generated by <a href="http://munin.sourceforge.net/">Munin</a> version @@VERSION@@ at <TMPL_VAR NAME="TIMESTAMP"></i></td>
- </tr>
- </table>
-</body>
-</html>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/munin-domainview.tmpl
^
|
@@ -0,0 +1,83 @@
+<TMPL_INCLUDE NAME="partial/head.tmpl">
+<!--
+ BODY matter. Starts off with a table with the logo on the left, and various headlines on the right.
+-->
+<body>
+
+<TMPL_INCLUDE NAME="partial/logo_navigation.tmpl">
+
+ <table class="largeinvisiblebox">
+ <tr>
+ <td class="linkbox">
+ <ul>
+<!--
+ Outer body loop, going down, the groups (at this (current) level. Listing level 1!
+-->
+ <TMPL_LOOP NAME="GROUPS">
+ <li><span class="domain"><a href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
+ <ul>
+ <!-- In each group there are N categories -->
+ <TMPL_IF NAME="NCATEGORIES"><TMPL_LOOP NAME="CATEGORIES">
+ <li><span class="host"><a href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
+ <ul>
+ <!-- And in each categroy there are M services -->
+ <TMPL_LOOP NAME="SERVICES">
+ <li><span class="service"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span></li>
+ </TMPL_LOOP><!-- SERVICES -->
+ </ul>
+ </li>
+ </TMPL_LOOP><!--CATEGORIES --></TMPL_IF><!-- NCATEGORIES -->
+ <TMPL_IF NAME="NGROUPS">
+<!-- GROUPS Listing level 2 -->
+ <TMPL_LOOP NAME="GROUPS">
+ <li><span class="domain"><a href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
+ <ul>
+ <TMPL_IF NAME="NCATEGORIES"><TMPL_LOOP NAME="CATEGORIES">
+ <li><span class="host"><a href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
+ <ul>
+ <TMPL_LOOP NAME="SERVICES">
+ <li><span class="service"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span></li>
+ </TMPL_LOOP>
+ </ul>
+ </li>
+ </TMPL_LOOP></TMPL_IF>
+ <TMPL_IF NAME="NGROUPS"><!-- NGROUPS level 3 -->
+ <TMPL_LOOP NAME="GROUPS"><!-- GROUPS Listing level 3 -->
+ <li><span class="domain"><a href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
+ <ul>
+ <!-- In each group N categories and so on -->
+ <TMPL_IF NAME="NCATEGORIES"><TMPL_LOOP NAME="CATEGORIES">
+ <li><span class="host"><a href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
+ <ul>
+ <!-- And in each catrgory there are services -->
+ <TMPL_LOOP NAME="SERVICES">
+ <li><span class="service"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span></li>
+ </TMPL_LOOP><!-- END SERVICES -->
+ </ul>
+ </li>
+ </TMPL_LOOP><!-- END CATEGORIES --></TMPL_IF>
+ <TMPL_IF NAME="NGROUPS">
+ </TMPL_IF>
+ </ul>
+ </li>
+ </TMPL_LOOP><!-- END GROUPS Listing level 3 -->
+ </TMPL_IF><!-- END NGROUPS level 3 -->
+ </ul>
+ </li>
+ </TMPL_LOOP><!-- END GROUPS Listing level 2 -->
+ </TMPL_IF><!-- END NGROUPS level 2 -->
+ </ul>
+ </li>
+ </TMPL_LOOP><!--END GROUPS Listing level 1 -->
+ </ul>
+ </td></tr>
+ <tr><td></td></tr>
+ <tr>
+ <td class="linkbox">
+ <TMPL_INCLUDE NAME="partial/bottom_navigation.tmpl">
+ </td>
+ </tr>
+ </table>
+ <TMPL_INCLUDE NAME="partial/generated_by.tmpl">
+</body>
+</html>
|
[-]
[+]
|
Deleted |
munin-1.4.tar.bz2/master/www/munin-domainview.tmpl.in
^
|
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <link rel="stylesheet" href="<TMPL_VAR NAME="CSSPATH">" type="text/css" />
- <meta http-equiv="refresh" content="300" />
- <title><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="name"> :: <TMPL_VAR ESCAPE="HTML" NAME="name"><TMPL_ELSE>Munin</TMPL_IF></TMPL_LOOP></title>
- <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
- <meta name="author" content="Auto-generated by Munin" />
-</head>
-<body>
-<table cellpadding="3" border="0">
- <tr>
- <td rowspan="2"><div class="logo"> </div></td>
- <td valign="top">
- <h2><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="NAME"> :: <TMPL_IF NAME="PATH"><A HREF="<TMPL_VAR NAME="PATH">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="PATH"></A></TMPL_IF><TMPL_ELSE><TMPL_IF NAME="PATH"><A HREF="<TMPL_VAR NAME="PATH">"></TMPL_IF>Overview<TMPL_IF NAME="PATH"></A></TMPL_IF></TMPL_IF></TMPL_LOOP></h2>
- </td>
- </tr>
- <TMPL_IF NAME="COMPARE">
- <tr>
- <td valign="top">
- <h2><TMPL_VAR ESCAPE="HTML" NAME="NAME"> :: [ <a href="comparison-day.html">day</a> <a href="comparison-week.html">week</a> <a href="comparison-month.html">month</a> <a href="comparison-year.html">year</a> ]</h2>
- </td>
- </tr></TMPL_IF>
-</table>
-
- <table class="largeinvisiblebox">
- <tr>
- <td class="linkbox">
- <ul>
- <TMPL_LOOP NAME="GROUPS">
- <li><span class="domain"><a href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
- <ul>
- <TMPL_IF NAME="NCATEGORIES"><TMPL_LOOP NAME="CATEGORIES">
- <li><span class="host"><a href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
- <ul>
- <TMPL_LOOP NAME="SERVICES">
- <li><span class="service"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span></li>
- </TMPL_LOOP>
- </ul>
- </li>
- </TMPL_LOOP></TMPL_IF>
- <TMPL_IF NAME="NGROUPS">
- <TMPL_LOOP NAME="GROUPS">
- <li><span class="domain"><a href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
- <ul>
- <TMPL_IF NAME="NCATEGORIES"><TMPL_LOOP NAME="CATEGORIES">
- <li><span class="host"><a href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
- <ul>
- <TMPL_LOOP NAME="SERVICES">
- <li><span class="service"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span></li>
- </TMPL_LOOP>
- </ul>
- </li>
- </TMPL_LOOP></TMPL_IF>
- <TMPL_IF NAME="NGROUPS">
- <TMPL_LOOP NAME="GROUPS">
- <li><span class="domain"><a href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
- <ul>
- <TMPL_IF NAME="NCATEGORIES"><TMPL_LOOP NAME="CATEGORIES">
- <li><span class="host"><a href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span>
- <ul>
- <TMPL_LOOP NAME="SERVICES">
- <li><span class="service"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span></li>
- </TMPL_LOOP>
- </ul>
- </li>
- </TMPL_LOOP></TMPL_IF>
- <TMPL_IF NAME="NGROUPS">
- </TMPL_IF>
- </ul>
- </li>
- </TMPL_LOOP>
- </TMPL_IF>
- </ul>
- </li>
- </TMPL_LOOP>
- </TMPL_IF>
- </ul>
- </li>
- </TMPL_LOOP>
- </ul>
- </td></tr>
- <tr><td></td></tr>
- <tr>
- <td class="linkbox">
- <TMPL_VAR NAME="PARENT"> :<TMPL_LOOP NAME="PEERS">: <TMPL_IF NAME="LINK"><a href="<TMPL_VAR NAME="LINK">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="LINK"></a></TMPL_IF></a> </TMPL_LOOP>
- </td>
- </tr>
- </table>
- <table cellpadding="2" cellspacing="4" border="0">
- <tr>
- <td><i class="small">This page was generated by <a href="http://munin.sourceforge.net/">Munin</a> version @@VERSION@@ at <TMPL_VAR NAME="TIMESTAMP"></i></td>
- </tr>
- </table>
-</body>
-</html>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/munin-nodeview.tmpl
^
|
@@ -0,0 +1,49 @@
+<TMPL_INCLUDE NAME="partial/head.tmpl">
+<!--
+ BODY PART. Start with a horizontal table thing with logo and "headline" material.
+-->
+<body>
+<TMPL_INCLUDE NAME="partial/logo_navigation.tmpl">
+<table class="invisiblebox">
+<!--
+ Outer loop, going down on the page, the categories of plugins
+ (they are grouped by category)
+-->
+ <TMPL_LOOP NAME="CATEGORIES">
+ <tr><td class="graphbox" id="<TMPL_VAR ESCAPE="HTML" NAME="NAME">">
+ <table>
+ <!-- <a id="<TMPL_VAR ESCAPE="HTML" NAME="NAME">"> </a> -->
+ <tr><td colspan="2"><h3 class="nobottom"> <TMPL_VAR ESCAPE="HTML" NAME="NAME"></h3></td></tr>
+<!--
+ Next loop, one service pr "line" going down. Each line has to images: day and week graphs
+ and some header matter
+-->
+ <TMPL_LOOP NAME="SERVICES">
+ <tr><td><div class="lighttext">:: <a <TMPL_IF NAME="STATE_WARNING">class="warn heading"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit heading"</TMPL_IF> href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></div></td></tr>
+ <tr>
+ <td><a href="<TMPL_VAR NAME="URLX">"><img <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF><TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> src="<TMPL_VAR NAME="IMGDAY">" alt="<TMPL_VAR ESCAPE="HTML" NAME="NAME">" <TMPL_IF NAME="IMGDAYWIDTH">width="<TMPL_VAR NAME="IMGDAYWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGDAYHEIGHT">height="<TMPL_VAR NAME="IMGDAYHEIGHT">"</TMPL_IF>/></a></td>
+ <td><a href="<TMPL_VAR NAME="URLX">"><img <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> src="<TMPL_VAR NAME="IMGWEEK">" alt="<TMPL_VAR ESCAPE="HTML" NAME="NAME">" <TMPL_IF NAME="IMGWEEKWIDTH">width="<TMPL_VAR NAME="IMGWEEKWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGWEEKHEIGHT">height="<TMPL_VAR NAME="IMGWEEKHEIGHT">"</TMPL_IF>/></a></td>
+ </tr>
+ </TMPL_LOOP><!-- End of SERVICES loop -->
+ </table>
+ </td></tr>
+
+ <tr><td></td></tr>
+
+ </TMPL_LOOP><!-- End of CATEGORIES loop -->
+<!--
+ Start of end matter: A line of "pages at the same nesting level ("peers")
+-->
+ <tr>
+ <td class="linkbox">
+ <TMPL_INCLUDE NAME="partial/bottom_navigation.tmpl">
+ </td>
+ </tr>
+</table>
+
+<!--
+ End of end: A line containing the munin signature
+-->
+ <TMPL_INCLUDE NAME="partial/generated_by.tmpl">
+</body>
+</html>
|
[-]
[+]
|
Deleted |
munin-1.4.tar.bz2/master/www/munin-nodeview.tmpl.in
^
|
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <link rel="stylesheet" href="<TMPL_VAR NAME="CSSPATH">" type="text/css" />
- <meta http-equiv="refresh" content="300" />
- <title><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="name"> :: <TMPL_VAR ESCAPE="HTML" NAME="name"><TMPL_ELSE>Munin</TMPL_IF></TMPL_LOOP></title>
- <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
- <meta name="author" content="Auto-generated by Munin" />
-</head>
-<body>
-<table cellpadding="3" border="0">
- <tr>
- <td rowspan="2"><div class="logo"> </div></td>
- <td valign="top">
- <h2><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="NAME"> :: <TMPL_IF NAME="PATH"><A HREF="<TMPL_VAR NAME="PATH">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="PATH"></A></TMPL_IF><TMPL_ELSE><TMPL_IF NAME="PATH"><A HREF="<TMPL_VAR NAME="PATH">"></TMPL_IF>Overview<TMPL_IF NAME="PATH"></A></TMPL_IF></TMPL_IF></TMPL_LOOP></h2>
- </td>
- </tr>
- <tr>
- <td valign="top">
- <h2><TMPL_VAR NAME="NAME"><TMPL_IF NAME="NCATEGORIES"> :: [ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="#<TMPL_VAR ESCAPE="HTML" NAME="NAME">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF></h2>
- </td>
- </tr>
-</table>
-
-<table class="invisiblebox">
- <tr><td>
- <hr class="ruler" />
- </td></tr>
-
- <TMPL_LOOP NAME="CATEGORIES">
- <tr><td class="graphbox" id="<TMPL_VAR ESCAPE="HTML" NAME="NAME">">
- <table>
- <!-- <a id="<TMPL_VAR ESCAPE="HTML" NAME="NAME">"> </a> -->
- <tr><td colspan="2"><h3 class="nobottom"> <TMPL_VAR ESCAPE="HTML" NAME="NAME"></h3></td></tr>
- <tr><td colspan="2"><hr class="ruler2" /></td></tr>
- <TMPL_LOOP NAME="SERVICES">
- <tr><td></td></tr>
- <tr><td><div class="lighttext">:: <a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URLX">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></div></td></tr>
- <tr>
- <td><a href="<TMPL_VAR NAME="URLX">"><img src="<TMPL_VAR NAME="IMGDAY">" alt="<TMPL_VAR ESCAPE="HTML" NAME="NAME">" <TMPL_IF NAME="IMGDAYWIDTH">width="<TMPL_VAR NAME="IMGDAYWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGDAYHEIGHT">height="<TMPL_VAR NAME="IMGDAYHEIGHT">"</TMPL_IF>/></a></td>
- <td><a href="<TMPL_VAR NAME="URLX">"><img src="<TMPL_VAR NAME="IMGWEEK">" alt="<TMPL_VAR ESCAPE="HTML" NAME="NAME">" <TMPL_IF NAME="IMGWEEKWIDTH">width="<TMPL_VAR NAME="IMGWEEKWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGWEEKHEIGHT">height="<TMPL_VAR NAME="IMGWEEKHEIGHT">"</TMPL_IF>/></a></td>
- </tr>
- </TMPL_LOOP>
- </table>
- </td></tr>
-
- <tr><td></td></tr>
-
- </TMPL_LOOP>
- <tr><td class="linkbox">
- <TMPL_VAR NAME="PARENT"> :<TMPL_LOOP NAME="PEERS">: <TMPL_IF NAME="LINK"><a href="<TMPL_VAR NAME="LINK">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="LINK"></a></TMPL_IF></a> </TMPL_LOOP>
- </td></tr>
-</table>
-
- <table cellpadding="2" cellspacing="4" border="0">
- <tr>
- <td><i class="small">This page was generated by <a href="http://munin.sourceforge.net/">Munin</a> version @@VERSION@@ at <TMPL_VAR NAME="TIMESTAMP"></i></td>
- </tr>
- </table>
-</body>
-</html>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/munin-overview.tmpl
^
|
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <link rel="stylesheet" href="style.css" type="text/css" />
+ <meta http-equiv="refresh" content="300" />
+ <title>Munin :: overview</title>
+ <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
+ <meta name="author" content="Auto-generated by Munin" />
+</head>
+<body>
+ <table id="header-table">
+ <tr>
+ <td class="logo"><div class="logo"> </div></td>
+ <td class="overview"><h1>Overview</h1></td>
+ </tr>
+ </table>
+ <table class="largeinvisiblebox">
+ <tbody>
+ <tr>
+ <td>
+ <TMPL_LOOP NAME="GROUPS">
+ <ul>
+ <li><TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span><TMPL_IF NAME="COMPARE"> :: [ <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a> <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a> <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a> <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF> <TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
+<TMPL_IF NAME="NGROUPS"><TMPL_LOOP NAME="GROUPS"><TMPL_UNLESS NAME="MULTIGRAPH"><ul>
+ <li><TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span><TMPL_IF NAME="COMPARE"> :: [ <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a> <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a> <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a> <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF> <TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
+<TMPL_IF NAME="NGROUPS"><TMPL_LOOP NAME="GROUPS"><TMPL_UNLESS NAME="MULTIGRAPH"><ul>
+ <li><TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span><TMPL_IF NAME="COMPARE"> :: [ <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a> <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a> <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a> <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF> <TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
+<TMPL_IF NAME="NGROUPS"><TMPL_LOOP NAME="GROUPS"><TMPL_UNLESS NAME="MULTIGRAPH"><ul>
+ <li><TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span><TMPL_IF NAME="COMPARE"> :: [ <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a> <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a> <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a> <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF> <TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
+<TMPL_IF NAME="NGROUPS"><TMPL_LOOP NAME="GROUPS"> <TMPL_UNLESS NAME="MULTIGRAPH"><ul>
+ <li><TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span><TMPL_IF NAME="COMPARE"> :: [ <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a> <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a> <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a> <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF> <TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
+<TMPL_IF NAME="NGROUPS"><TMPL_LOOP NAME="GROUPS"><TMPL_UNLESS NAME="MULTIGRAPH"><ul>
+ <li><TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span><TMPL_IF NAME="COMPARE"> :: [ <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a> <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a> <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a> <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF> <TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
+ </li>
+ </ul>
+ </TMPL_UNLESS>
+ </TMPL_LOOP></TMPL_IF>
+ </li>
+ </ul>
+ </TMPL_UNLESS>
+ </TMPL_LOOP></TMPL_IF>
+ </li>
+ </ul>
+ </TMPL_UNLESS>
+ </TMPL_LOOP></TMPL_IF>
+ </li>
+ </ul>
+ </TMPL_UNLESS>
+ </TMPL_LOOP>
+ </TMPL_IF>
+ </li>
+ </ul>
+ </TMPL_UNLESS>
+ </TMPL_LOOP>
+ </TMPL_IF>
+ </li>
+ </ul>
+ </TMPL_LOOP>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <TMPL_INCLUDE NAME="partial/generated_by.tmpl">
+</body>
+</html>
|
[-]
[+]
|
Deleted |
munin-1.4.tar.bz2/master/www/munin-overview.tmpl.in
^
|
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <link rel="stylesheet" href="style.css" type="text/css" />
- <meta http-equiv="refresh" content="300" />
- <title>Munin :: overview</title>
- <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
- <meta name="author" content="Auto-generated by Munin" />
-</head>
-<body>
- <table cellpadding="3" border="0">
- <tr>
- <td><div class="logo"> </div></td>
- <td valign="top"><h1>Overview</h1></td>
- </tr>
- </table>
- <div class="box">
- <TMPL_LOOP NAME="GROUPS">
- <ul>
- <li><TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span><TMPL_IF NAME="COMPARE"> :: [ <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a> <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a> <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a> <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF> <TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
- <TMLP_IF NAME="NGROUPS">
- <TMPL_LOOP NAME="GROUPS">
- <ul>
- <li><TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span><TMPL_IF NAME="COMPARE"> :: [ <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a> <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a> <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a> <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF> <TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
- <TMLP_IF NAME="NGROUPS">
- <TMPL_LOOP NAME="GROUPS">
- <ul>
- <li><TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span><TMPL_IF NAME="COMPARE"> :: [ <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a> <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a> <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a> <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF> <TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
- <TMLP_IF NAME="NGROUPS">
- <TMPL_LOOP NAME="GROUPS">
- <ul>
- <li><TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span><TMPL_IF NAME="COMPARE"> :: [ <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a> <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a> <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a> <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF> <TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
- <TMLP_IF NAME="NGROUPS">
- <TMPL_LOOP NAME="GROUPS">
- <ul>
- <li><TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span><TMPL_IF NAME="COMPARE"> :: [ <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a> <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a> <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a> <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF> <TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
- <TMLP_IF NAME="NGROUPS">
- <TMPL_LOOP NAME="GROUPS">
- <ul>
- <li><TMPL_IF NAME="NCATEGORIES"><span class="host"><TMPL_ELSE><span class="domain"></TMPL_IF><a href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a></span><TMPL_IF NAME="COMPARE"> :: [ <a href="<TMPL_VAR NAME="NAME">/comparison-day.html">day</a> <a href="<TMPL_VAR NAME="NAME">/comparison-week.html">week</a> <a href="<TMPL_VAR NAME="NAME">/comparison-month.html">month</a> <a href="<TMPL_VAR NAME="NAME">/comparison-year.html">year</a> ]</TMPL_IF> <TMPL_IF NAME="NCATEGORIES">[ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="<TMPL_VAR NAME="URL">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF>
- </li>
- </ul>
- </TMPL_LOOP>
- </TMLP_IF>
- </li>
- </ul>
- </TMPL_LOOP>
- </TMLP_IF>
- </li>
- </ul>
- </TMPL_LOOP>
- </TMLP_IF>
- </li>
- </ul>
- </TMPL_LOOP>
- </TMLP_IF>
- </li>
- </ul>
- </TMPL_LOOP>
- </TMLP_IF>
- </li>
- </ul>
- </TMPL_LOOP>
- </div>
-<table cellpadding="2" cellspacing="4" border="0">
- <tr>
- <td><i class="small">This page was generated by <a href="http://munin.sourceforge.net/">Munin</a> version @@VERSION@@ at <TMPL_VAR NAME="TIMESTAMP"></i></td>
- </tr>
-</table>
-</body>
-</html>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/munin-serviceview.tmpl
^
|
@@ -0,0 +1,91 @@
+<TMPL_INCLUDE NAME="partial/head.tmpl">
+<!--
+ Body material.
+ First comes a heading frame with logo and the breadcrumbs with links to each level above
+-->
+<body>
+<TMPL_INCLUDE NAME="partial/logo_navigation.tmpl">
+ <!-- Loop over the services at this level. Mostly only to access the
+ nested variables describing the _one_ service that should be
+ available here. -->
+ <TMPL_LOOP NAME="SERVICES">
+
+ <table class="invisiblebox">
+ <tr>
+ <!-- Table row: Day image -->
+ <!-- Note, the class of the img does not work to set border width and color. Could be something to do with the table? -->
+ <td><img src="<TMPL_VAR NAME="IMGDAY">" alt="daily graph" <TMPL_IF NAME="IMGDAYWIDTH">width="<TMPL_VAR NAME="IMGDAYWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGDAYHEIGHT">height="<TMPL_VAR NAME="IMGDAYHEIGHT">"</TMPL_IF>/></td>
+ <!-- cont'd: Week image -->
+ <td><img src="<TMPL_VAR NAME="IMGWEEK">" alt="weekly graph" <TMPL_IF NAME="IMGWEEKWIDTH">width="<TMPL_VAR NAME="IMGWEEKWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGWEEKHEIGHT">height="<TMPL_VAR NAME="IMGWEEKHEIGHT">"</TMPL_IF>/></td>
+ </tr>
+ <tr>
+ <!-- New table row: Month image -->
+ <td><img src="<TMPL_VAR NAME="IMGMONTH">" alt="monthly graph" <TMPL_IF NAME="IMGMONTHWIDTH">width="<TMPL_VAR NAME="IMGMONTHWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGMONTHHEIGHT">height="<TMPL_VAR NAME="IMGMONTHHEIGHT">"</TMPL_IF>/></td>
+ <!-- cont'd: Year image -->
+ <td><img src="<TMPL_VAR NAME="IMGYEAR">" alt="yearly graph" <TMPL_IF NAME="IMGYEARWIDTH">width="<TMPL_VAR NAME="IMGYEARWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGYEARHEIGHT">height="<TMPL_VAR NAME="IMGYEARHEIGHT">"</TMPL_IF>/></td>
+ </tr>
+ <!-- .sum graphs. One of the least used features of munin? -->
+<TMPL_IF NAME="IMGWEEKSUM">
+ <tr>
+ <!-- Week sum -->
+ <td><img src="<TMPL_VAR NAME="IMGWEEKSUM">" alt="summed weekly graph" <TMPL_IF NAME="IMGWEEKSUMWIDTH">width="<TMPL_VAR NAME="IMGWEEKSUMWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGWEEKSUMHEIGHT">height="<TMPL_VAR NAME="IMGWEEKSUMHEIGHT">"</TMPL_IF>/></td>
+ <!-- Month sum? BUG?: See mixture of "month" and "year" in the text and tags -->
+ <td><img src="<TMPL_VAR NAME="IMGYEARSUM">" alt="summed monthly graph" <TMPL_IF NAME="IMGYEARSUMWIDTH">width="<TMPL_VAR NAME="IMGYEARSUMWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGYEARSUMHEIGHT">height="<TMPL_VAR NAME="IMGYEARSUMHEIGHT">"</TMPL_IF>/></td>
+ </tr>
+</TMPL_IF><!-- IMGWEEKSUM -->
+
+<!-- Here follows meta information for the graphs -->
+
+ <tr>
+ <td colspan="2" class="legendbox">
+ <table width='100%' id="legend" cellpadding="0" cellspacing="0">
+ <TMPL_LOOP NAME="GRAPHINFO"><!-- Do we actually allow mutiple graph_info, or is this just to access the nested data? -->
+ <tr>
+ <td class='wrap' colspan="6" align='left' valign='top'><TMPL_VAR NAME="INFO"></td>
+ </tr>
+ </TMPL_LOOP><!-- GRAPHINFO -->
+
+ <TMPL_IF NAME="STATE_WARNING"><tr><td class='wrap' colspan="6" align='left' valign='top'><b>NOTE!</b> This service is in WARNING state because one of the values reported is outside the allowed range. Please see further down for information about the ranges and the graph for the values.</td></tr></TMPL_IF>
+ <TMPL_IF NAME="STATE_CRITICAL"><tr><td class='wrap' colspan="6" align='left' valign='top'><b>NOTE!</b> This service is in CRITICAL state because one of the values reported is outside the allowed range. Please see further down for information about the ranges and the graph for the values.</td></tr></TMPL_IF>
+ <TMPL_IF NAME="STATE_UNKNOWN"><tr><td class='wrap' colspan="6" align='left' valign='top'><b>NOTE!</b> This service is in UNKNOWN state, because something bad happened. Please check your network, the munin-node, and the plugin.</td></tr></TMPL_IF>
+
+ <tr>
+ <th align='left' valign='top'>Field</th>
+ <th align='left' valign='top'><span title="For use in munin.conf">Internal name</span></th> <!-- BUG: The definitions.html reference is not correct, it is only available at the root, there are not enough ..s in the URL -->
+ <th align='center' valign='top'><a href="../../definitions.html#data_types">Type</a></th>
+ <th align='center' valign='top'>Warn</th>
+ <th align='center' valign='top'>Crit</th>
+ <th>Info</th>
+ </tr>
+ <TMPL_LOOP NAME="FIELDINFO">
+ <tr class="<TMPL_IF NAME="__odd__">oddrow<TMPL_ELSE>evenrow</TMPL_IF><TMPL_IF NAME="__last__"> lastrow</TMPL_IF>">
+ <td align='left' valign='top'><TMPL_VAR ESCAPE="HTML" NAME="LABEL"></td>
+ <td align='left' valign='top'><span title="For use in munin.conf"><TMPL_VAR ESCAPE="HTML" NAME="FIELD"></span></td>
+ <td align='center' valign='top'><TMPL_VAR NAME="TYPE"></td>
+ <td align='center' valign='top'><TMPL_IF NAME="STATE_WARNING"><div class='warntext'></TMPL_IF><TMPL_VAR NAME="WARN"><TMPL_IF NAME="STATE_WARNING"></div><TMPL_ELSE> </TMPL_IF></td>
+ <td align='center' valign='top'><TMPL_IF NAME="STATE_CRITICAL"><div class='crittext'></TMPL_IF><TMPL_VAR NAME="CRIT"><TMPL_IF NAME="STATE_CRITICAL"></div><TMPL_ELSE> </TMPL_IF></td>
+ <td class='wrap' align='left' valign='top'><TMPL_IF NAME="INFO"><TMPL_VAR ESCAPE="HTML" NAME="INFO"><TMPL_ELSE> </TMPL_IF></td>
+ </tr>
+
+ <TMPL_IF NAME="EXTINFO">
+ <tr class="<TMPL_IF NAME="__odd__">oddrow<TMPL_ELSE>evenrow</TMPL_IF>"><td class='wrap' colspan="6" align='left' valign='top'>This field has the following extra information: <TMPL_VAR ESCAPE="HTML" NAME="EXTINFO"></td></tr>
+ </TMPL_IF>
+ </TMPL_LOOP><!-- FIELDINFO -->
+ </table>
+ </td>
+ </tr>
+ </TMPL_LOOP><!-- What ends here? Probably SERVICES -->
+ <tr>
+ <td>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" class="linkbox">
+ <TMPL_INCLUDE NAME="partial/bottom_navigation.tmpl">
+ </td>
+ </tr>
+</table>
+ <TMPL_INCLUDE NAME="partial/generated_by.tmpl">
+</body>
+</html>
+
|
[-]
[+]
|
Deleted |
munin-1.4.tar.bz2/master/www/munin-serviceview.tmpl.in
^
|
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <link rel="stylesheet" href="<TMPL_VAR NAME="CSSPATH">" type="text/css" />
- <meta http-equiv="refresh" content="300" />
- <title><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="name"> :: <TMPL_VAR ESCAPE="HTML" NAME="name"><TMPL_ELSE>Munin</TMPL_IF></TMPL_LOOP></title>
- <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
- <meta name="author" content="Auto-generated by Munin" />
-</head>
-<body>
- <table cellpadding="3" border="0">
- <tr>
- <td><div class="logo"> </div></td>
- <td valign="top">
- <h2>
- <TMPL_LOOP NAME="PATH">
- <TMPL_IF NAME="name"> ::
- <TMPL_IF NAME="link"><A HREF="<TMPL_VAR NAME="link">"></TMPL_IF>
- <TMPL_VAR NAME="name">
- <TMPL_IF NAME="link"></A></TMPL_IF>
- <TMPL_ELSE>
- <TMPL_IF NAME="link"><A HREF="<TMPL_VAR NAME="link">"></TMPL_IF>
- Overview
- <TMPL_IF NAME="link"></A></TMPL_IF>
- </TMPL_IF>
- </TMPL_LOOP></h2>
- </td>
- </tr>
- </table>
- <TMPL_LOOP NAME="SERVICES">
-
- <table class="invisiblebox">
- <tr>
- <td colspan="2"><hr class="ruler" /></td>
- </tr>
- <tr>
- <td><img src="<TMPL_VAR NAME="IMGDAY">" alt="daily graph" <TMPL_IF NAME="IMGDAYWIDTH">width="<TMPL_VAR NAME="IMGDAYWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGDAYHEIGHT">height="<TMPL_VAR NAME="IMGDAYHEIGHT">"</TMPL_IF>/></td>
- <td><img src="<TMPL_VAR NAME="IMGWEEK">" alt="weekly graph" <TMPL_IF NAME="IMGWEEKWIDTH">width="<TMPL_VAR NAME="IMGWEEKWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGWEEKHEIGHT">height="<TMPL_VAR NAME="IMGWEEKHEIGHT">"</TMPL_IF>/></td>
- </tr>
- <tr>
- <td><img src="<TMPL_VAR NAME="IMGMONTH">" alt="monthly graph" <TMPL_IF NAME="IMGMONTHWIDTH">width="<TMPL_VAR NAME="IMGMONTHWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGMONTHHEIGHT">height="<TMPL_VAR NAME="IMGMONTHHEIGHT">"</TMPL_IF>/></td>
- <td><img src="<TMPL_VAR NAME="IMGYEAR">" alt="yearly graph" <TMPL_IF NAME="IMGYEARWIDTH">width="<TMPL_VAR NAME="IMGYEARWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGYEARHEIGHT">height="<TMPL_VAR NAME="IMGYEARHEIGHT">"</TMPL_IF>/></td>
- </tr>
-<TMPL_IF NAME="IMGWEEKSUM">
- <tr>
- <td><img src="<TMPL_VAR NAME="IMGWEEKSUM">" alt="summed weekly graph" <TMPL_IF NAME="IMGWEEKSUMWIDTH">width="<TMPL_VAR NAME="IMGWEEKSUMWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGWEEKSUMHEIGHT">height="<TMPL_VAR NAME="IMGWEEKSUMHEIGHT">"</TMPL_IF>/></td>
- <td><img src="<TMPL_VAR NAME="IMGYEARSUM">" alt="summed monthly graph" <TMPL_IF NAME="IMGYEARSUMWIDTH">width="<TMPL_VAR NAME="IMGYEARSUMWIDTH">" </TMPL_IF> <TMPL_IF NAME="IMGYEARSUMHEIGHT">height="<TMPL_VAR NAME="IMGYEARSUMHEIGHT">"</TMPL_IF>/></td>
- </tr>
-</TMPL_IF>
- <tr>
- <td colspan="2" class="legendbox">
- <table width='100%'>
- <TMPL_LOOP NAME="GRAPHINFO">
- <tr>
- <td class='wrap' colspan="6" align='left' valign='top'><TMPL_VAR NAME="INFO"></td>
- </tr>
- <tr>
- <td colspan="6"><hr class="ruler2" /></td>
- </tr>
- </TMPL_LOOP>
- <tr>
- <th align='left' valign='top'>Field</th>
- <th align='left' valign='top'><span title="For use in munin.conf">Internal name</span></th>
- <th align='center' valign='top'><a href="../definitions.html#data_types">Type</a></th>
- <th align='center' valign='top'>Warn</th>
- <th align='center' valign='top'>Crit</th>
- <th> </th>
- </tr>
- <TMPL_LOOP NAME="FIELDINFO">
- <TMPL_IF NAME="HR">
- <tr>
- <td colspan="6"><hr class="ruler" /></td>
- </tr>
- </TMPL_IF>
- <tr>
- <td align='left' valign='top'><TMPL_VAR ESCAPE="HTML" NAME="LABEL"></td>
- <td align='left' valign='top'><span title="For use in munin.conf"><TMPL_VAR ESCAPE="HTML" NAME="FIELD"></span></td>
- <td align='center' valign='top'><TMPL_VAR NAME="TYPE"></td>
- <td align='center' valign='top'><TMPL_IF NAME="STATE_WARNING"><div class='warntext'></TMPL_IF><TMPL_VAR NAME="WARN"><TMPL_IF NAME="STATE_WARNING"></div></TMPL_IF></td>
- <td align='center' valign='top'><TMPL_IF NAME="STATE_CRITICAL"><div class='crittext'></TMPL_IF><TMPL_VAR NAME="CRIT"><TMPL_IF NAME="STATE_CRITICAL"></div></TMPL_IF></td>
- <td class='wrap' align='left' valign='top'><TMPL_VAR ESCAPE="HTML" NAME="INFO"></td>
- </tr>
- </TMPL_LOOP>
- </table>
- </td>
- </tr>
- </TMPL_LOOP>
- <tr><td></td></tr>
- <tr>
- <td colspan="2" class="linkbox">
- <TMPL_VAR NAME="CATEGORY"> :<TMPL_LOOP NAME="PEERS">: <TMPL_IF NAME="LINK"><a href="<TMPL_VAR NAME="LINK">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="LINK"></a></TMPL_IF> </TMPL_LOOP>
- </td>
- </tr>
-</table>
-
-<table cellpadding="2" cellspacing="4" border="0">
- <tr>
- <td><i class="small">This page was generated by <a href="http://munin.sourceforge.net/">Munin</a> version @@VERSION@@ at <TMPL_VAR NAME="TIMESTAMP"></i></td>
- </tr>
-</table>
-
-</body>
-</html>
-
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/partial
^
|
+(directory)
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/partial/bottom_navigation.tmpl
^
|
@@ -0,0 +1,33 @@
+<TMPL_LOOP NAME="PATH">
+ <TMPL_UNLESS NAME="__last__">
+ <TMPL_IF NAME="name"> ::
+ <TMPL_IF NAME="path"><a href="<TMPL_VAR NAME="path">"></TMPL_IF>
+ <TMPL_VAR NAME="name">
+ <TMPL_IF NAME="path"></a></TMPL_IF>
+ <TMPL_ELSE>
+ <TMPL_IF NAME="path"><a href="<TMPL_VAR NAME="path">"></TMPL_IF>
+ Overview
+ <TMPL_IF NAME="path"></a></TMPL_IF>
+ </TMPL_IF>
+ </TMPL_UNLESS>
+ </TMPL_LOOP>
+ <TMPL_IF NAME="CATEGORY">
+ :: <TMPL_VAR NAME="CATEGORY">
+ </TMPL_IF>
+ <TMPL_IF NAME="LARGESET">:: <select class="peers" onchange="window.open(this.options[this.selectedIndex].value,'_top')">
+ <option value=""><TMPL_VAR NAME="INFO_OPTION"></option>
+ <TMPL_LOOP NAME="PEERS">
+ <option
+ <TMPL_IF NAME="LINK">
+ value="<TMPL_VAR NAME="LINK">">
+ <TMPL_ELSE>
+ value="">
+ </TMPL_IF>
+ <TMPL_VAR NAME="NAME"></option>
+
+ </TMPL_LOOP>
+ </select>
+ <TMPL_ELSE>
+ :<TMPL_LOOP NAME="PEERS">: <TMPL_IF NAME="LINK"><a href="<TMPL_VAR NAME="LINK">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="LINK"></a></TMPL_IF> </TMPL_LOOP>
+ </TMPL_IF>
+
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/partial/generated_by.tmpl
^
|
@@ -0,0 +1,5 @@
+<table id="generated-table">
+ <tr>
+ <td><i class="small"><TMPL_VAR NAME="TAGLINE"></i></td>
+ </tr>
+</table>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/partial/head.tmpl
^
|
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <link rel="stylesheet" href="<TMPL_VAR NAME="CSSPATH">" type="text/css" />
+ <meta http-equiv="refresh" content="300" />
+ <title><TMPL_LOOP NAME="PATH"><TMPL_IF NAME="name"> :: <TMPL_VAR ESCAPE="HTML" NAME="name"><TMPL_ELSE>Munin</TMPL_IF></TMPL_LOOP></title>
+ <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
+ <meta name="author" content="Auto-generated by Munin" />
+</head>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/partial/logo_navigation.tmpl
^
|
@@ -0,0 +1,18 @@
+<table id="header-table">
+<TMPL_INCLUDE NAME="logo_path.tmpl">
+<!-- Second header line containing host name and a list of categories of the graphs -->
+ <TMPL_IF NAME="NCATEGORIES">
+ <tr>
+ <td valign="top">
+ <h2><TMPL_VAR NAME="NAME"><TMPL_IF NAME="NCATEGORIES"> :: [ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="#<TMPL_VAR ESCAPE="HTML" NAME="NAME">"><TMPL_VAR ESCAPE="HTML" NAME="NAME"></a> </TMPL_LOOP>]</TMPL_IF></h2>
+ </td>
+ </tr>
+ </TMPL_IF>
+ <TMPL_IF NAME="COMPARE">
+ <tr>
+ <td valign="top">
+ <h2><TMPL_VAR ESCAPE="HTML" NAME="NAME"> :: [ <a href="comparison-day.html">day</a> <a href="comparison-week.html">week</a> <a href="comparison-month.html">month</a> <a href="comparison-year.html">year</a> ]</h2>
+ </td>
+ </tr>
+ </TMPL_IF>
+</table>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/partial/logo_navigation_comparison.tmpl
^
|
@@ -0,0 +1,21 @@
+<table id="header-table">
+ <tr>
+ <td rowspan="2"><div class="logo"> </div></td>
+ <td valign="top">
+ <h2><TMPL_INCLUDE NAME="path.tmpl">
+ :: [ <TMPL_LOOP NAME="COMPLINKS">
+ <TMPL_IF NAME="LINK">
+ <a href="<TMPL_VAR NAME="LINK">"><TMPL_VAR NAME="NAME"></a>
+ <TMPL_ELSE>
+ <TMPL_VAR NAME="NAME">
+ </TMPL_IF>
+ </TMPL_LOOP> ]
+ </h2>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <h2><TMPL_VAR ESCAPE="HTML" NAME="NAME"> :: [ <TMPL_LOOP NAME="CATEGORIES"><a <TMPL_IF NAME="STATE_WARNING">class="warn"</TMPL_IF> <TMPL_IF NAME="STATE_CRITICAL">class="crit"</TMPL_IF> href="#<TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME">"><TMPL_VAR ESCAPE="HTML" NAME="GROUPNAME"></a> </TMPL_LOOP>]</h2>
+ </td>
+ </tr>
+</table>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/partial/logo_path.tmpl
^
|
@@ -0,0 +1,6 @@
+ <tr>
+ <td class="logo" rowspan="2"><div class="logo"> </div></td>
+ <td valign="top">
+ <h2><TMPL_INCLUDE NAME="path.tmpl"></h2>
+ </td>
+ </tr>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/partial/path.tmpl
^
|
@@ -0,0 +1 @@
+<TMPL_LOOP NAME="PATH"><TMPL_IF NAME="NAME"> :: <TMPL_IF NAME="PATH"><a href="<TMPL_VAR NAME="PATH">"></TMPL_IF><TMPL_VAR NAME="NAME"><TMPL_IF NAME="PATH"></a></TMPL_IF><TMPL_ELSE><TMPL_IF NAME="PATH"><a href="<TMPL_VAR NAME="PATH">"></TMPL_IF>Overview<TMPL_IF NAME="PATH"></a></TMPL_IF></TMPL_IF></TMPL_LOOP>
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/master/www/style-1.2.css
^
|
@@ -0,0 +1,205 @@
+body, h1, h2, h3, p, span, div {
+ font-family: verdana, helvetica, arial, sans-serif;
+ font-size: small;
+ }
+
+body {
+ background-color: #ffffff;
+ color: #000000;
+
+ }
+
+h3.nobottom {
+ margin-top: 20px;
+ margin-bottom: 0px;
+}
+
+div.logo {
+ background-image: url(logo.png);
+ background-repeat: no-repeat;
+ width: 41px;
+ height: 59px;
+}
+
+div.lighttext {
+ background-color: #ffffff;
+ color: #777777;
+ font-style: italic;
+
+ }
+
+.domain {
+ font-size: medium;
+ font-weight: bold;
+ }
+
+.host {
+ font-weight: bold;
+ }
+
+.service {
+ font-size: x-small;
+ font-weight: bold;
+ }
+
+.center {
+ text-align: center;
+}
+
+.small {
+ font-size: smaller;
+ }
+
+.noborder {
+ border-width: 0px;
+ border-collapse: collapse;
+ }
+
+table.largeinvisiblebox {
+ border-width: thin;
+ border-top: 0px;
+ border-bottom: 0px;
+ border-left: 0px;
+ border-right: 0px;
+ border-color: #999;
+ border-style: solid;
+ padding: 0px 0px 0px 0px;
+ margin: 0px 0px 0px 0px;
+ white-space: nowrap;
+ max-width: 90%;
+ width: 80%;
+}
+
+table.invisiblebox {
+ border-width: thin;
+ border-top: 0px;
+ border-bottom: 0px;
+ border-left: 0px;
+ border-right: 0px;
+ border-color: #999;
+ border-style: solid;
+ padding: 0px 0px 0px 0px;
+ margin: 0px 0px 0px 0px;
+ white-space: nowrap;
+ width: 1%;
+}
+
+td.graphbox {
+ border-width: thin;
+ border-top: 1px;
+ border-bottom: 1px;
+ border-left: 1px;
+ border-right: 1px;
+ border-color: #999;
+ border-style: solid;
+ padding: 4px 4px 4px 4px;
+ margin: 0px 0px 0px 0px;
+ white-space: nowrap;
+ width: 100%;
+}
+
+.box {
+ border-width: thin;
+ border-top: 1px;
+ border-bottom: 1px;
+ border-left: 1px;
+ border-right: 1px;
+ border-color: #999;
+ border-style: solid;
+ padding: 4px 4px 4px 4px;
+ margin: 2px 2px 2px 2px;
+ text-align: left;
+ width: 80%;
+ max-width: 90%
+}
+
+td.legendbox {
+ border-width: thin;
+ border-top: 1px;
+ border-bottom: 1px;
+ border-left: 1px;
+ border-right: 1px;
+ border-color: #999;
+ border-style: solid;
+ padding: 8px 4px 2px 2px;
+ margin: 2px 2px 2px 2px;
+ text-align: left;
+ width: 100%;
+}
+
+td.wrap {
+ white-space: normal;
+ max-width: 1%;
+}
+
+td.linkbox {
+ border-width: thin;
+ border-top: 1px;
+ border-bottom: 1px;
+ border-left: 1px;
+ border-right: 1px;
+ border-color: #999;
+ border-style: solid;
+ padding: 4px 4px 4px 4px;
+ margin: 2px 2px 2px 2px;
+ width: 100%;
+ white-space: normal;
+}
+
+.warntext {
+ font-weight: bold;
+ background-color: #cccc00;
+}
+
+.crittext {
+ font-weight: bold;
+ background-color: #ff6f22;
+}
+
+.ruler {
+ background-color: #999999;
+ border: 0px;
+ height: 1px;
+}
+
+.ruler2 {
+ background-color: #999999;
+ border: 0px;
+ height: 2px;
+}
+
+a.meek:link {
+ color: #486aaf;
+ font-size: small;
+ }
+
+a.meek:visited {
+ color: #af1a00;
+ font-size: small;
+ }
+
+a.meek:active {
+ color: #486aaf;
+ font-size: small;
+ }
+
+a.meek:hover {
+ color: #999999;
+ font-size: small;
+ }
+
+
+a.warn:link { color: #cc9900; }
+a.warn:visited { color: #cc9900; }
+a.warn:active { color: #cc9900; }
+a.warn:hover { color: #cc9900; }
+
+a.crit:link { color: #cc0000; }
+a.crit:visited { color: #cc0000; }
+a.crit:active { color: #cc0000; }
+a.crit:hover { color: #cc0000; }
+
+a:link { color: #486aaf; }
+a:visited { color: #486aaf; }
+a:active { color: #486aaf; }
+a:hover { color: #486aaf; }
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/master/www/style.css
^
|
@@ -1,24 +1,58 @@
+html {
+}
+
body, h1, h2, h3, p, span, div {
- font-family: verdana, helvetica, arial, sans-serif;
- font-size: small;
+ font-family: "vera sans", "dejavu sans", helvetica, verdana, arial, sans-serif;
+ color: #333333;
}
+h1{
+ margin: 0.5em;
+}
+
body {
- background-color: #ffffff;
- color: #000000;
-
+ background-color: #fdfdfd;
+ width: 99%;
+ margin: 0em auto 1em auto;
+ padding: 0.0em 0.1em 1em 0.1em;
+ font-size: 90%;
+
}
+
+select {
+ border: 1px solid #d1d1d1;
+}
+
+h2 {
+ margin: 0em;
+ padding: 0px;
+ font-size: 110%;
+ font-weight: bold;
+ margin-left: auto;
+ margin-right: auto;
+}
+
h3.nobottom {
- margin-top: 20px;
+ margin-top: 0px;
margin-bottom: 0px;
+ font-size: 120%;
+ letter-spacing: 0.05em;
+ margin-left: 0px;
+ padding-left: 10px;
+ padding-bottom: 0px;
+ padding-top: 0px;
}
+
div.logo {
- background-image: url(logo.png);
+ background-image: url(logo-h.png);
background-repeat: no-repeat;
- width: 41px;
- height: 59px;
+ width: 115px;
+ height: 30px;
+ padding-right: 10px;
+ margin-top: 7px;
+ padding-bottom: 6px;
}
div.lighttext {
@@ -38,7 +72,7 @@
}
.service {
- font-size: x-small;
+ font-size: small;
font-weight: bold;
}
@@ -48,7 +82,7 @@
.small {
font-size: smaller;
- }
+}
.noborder {
border-width: 0px;
@@ -56,104 +90,181 @@
}
table.largeinvisiblebox {
- border-width: thin;
- border-top: 0px;
- border-bottom: 0px;
- border-left: 0px;
- border-right: 0px;
- border-color: #999;
- border-style: solid;
- padding: 0px 0px 0px 0px;
- margin: 0px 0px 0px 0px;
- white-space: nowrap;
- max-width: 90%;
- width: 80%;
+ border-width: thin;
+ border-top: 0px;
+ border-bottom: 0px;
+ border-left: 0px;
+ border-right: 0px;
+ border-color: #999;
+ border-style: solid;
+ padding: 0px 0px 0px 0px;
+ margin: 0px auto 0px auto;
+ white-space: nowrap;
+ max-width: 97%;
+ width: 90%;
+ min-width: 50%;
+
+}
+
+#header-table{
+ width: 90%;
+ margin: 0 auto 0em auto;
+ background-color: #fbfbfb;
+ border-bottom: 1px solid #cfd6f8;
+ border-left: 1px solid #cfd6f8;
+ border-right: 1px solid #cfd6f8;
+ overflow: auto;
+}
+
+#header-table td{
+ padding-bottom: 0px;
+ margin: 0em auto 0em auto;
+}
+
+#header-table tr{
+ margin: 0em auto 0em auto;
+ padding: 0px;
+}
+
+#header-table td.overview{
+ margin: 0em auto 0em auto;
+ text-align: left;
+}
+
+#header-table td.overview h1{
+ margin-top: 0em;
+ margin-bottom: 0em;
+ margin-left: 0.1em;
+ padding-top: 1px;
+}
+
+
+#header-table td.logo{
+ width: 115px;
+ height: 48px;
+ margin: 0em auto 0em auto;
}
table.invisiblebox {
- border-width: thin;
- border-top: 0px;
- border-bottom: 0px;
- border-left: 0px;
- border-right: 0px;
- border-color: #999;
- border-style: solid;
- padding: 0px 0px 0px 0px;
- margin: 0px 0px 0px 0px;
- white-space: nowrap;
- width: 1%;
+ border: 0px solid #999999;
+ width: 90%;
+ padding: 0px 0px 0px 0px;
+ margin-top: 10px;
+ margin-left: auto;
+ margin-bottom: 0px;
+ margin-right: auto;
+ white-space: nowrap;
}
+table.invisiblebox tr{
+ padding-bottom: 15px;
+}
+
+
td.graphbox {
- border-width: thin;
- border-top: 1px;
- border-bottom: 1px;
- border-left: 1px;
- border-right: 1px;
- border-color: #999;
- border-style: solid;
- padding: 4px 4px 4px 4px;
- margin: 0px 0px 0px 0px;
- white-space: nowrap;
- width: 100%;
+ padding: 5px;
+ white-space: nowrap;
}
+td.graphbox > table {
+ border-left: 1px dashed #aaaaaa;
+ padding-left: 10px;
+ margin-bottom: 1em;
+ white-space: nowrap;
+}
+
+
.box {
- border-width: thin;
- border-top: 1px;
- border-bottom: 1px;
- border-left: 1px;
- border-right: 1px;
- border-color: #999;
- border-style: solid;
- padding: 4px 4px 4px 4px;
- margin: 2px 2px 2px 2px;
- text-align: left;
- width: 80%;
- max-width: 90%
+ padding: 4px;
+ margin: 10px auto 0px auto;
+ text-align: left;
+}
+
+#legend {
+ margin: 2px;
+}
+
+#legend tr, #legend td{
+ padding: 3px 2px 3px 2px;
+ margin: 1px;
+}
+
+#legend th{
+ border-bottom: 1px solid #999999;
+}
+
+#legend .oddrow{
+ background-color: #f8f8f8;
+}
+
+#legend .oddrow td{
+ border-bottom: 1px solid #d8d8d8;
+}
+
+#legend .evenrow{
+ background-color: #fdfdfd;
+}
+
+#legend .evenrow td{
+ border-bottom: 1px solid #d8d8d8;
+}
+
+#legend .lastrow td{
+ border-bottom: 0px solid transparent !important;
}
+
+
td.legendbox {
- border-width: thin;
- border-top: 1px;
- border-bottom: 1px;
- border-left: 1px;
- border-right: 1px;
- border-color: #999;
- border-style: solid;
- padding: 8px 4px 2px 2px;
- margin: 2px 2px 2px 2px;
- text-align: left;
- width: 100%;
+ border: 1px solid #999999;
+ padding: 8px 4px 2px 2px;
+ margin: 8px 2px 2px 2px;
+ text-align: left;
+ width: 90%;
}
td.wrap {
white-space: normal;
- max-width: 1%;
+ width: 20%;
}
td.linkbox {
- border-width: thin;
- border-top: 1px;
- border-bottom: 1px;
- border-left: 1px;
- border-right: 1px;
- border-color: #999;
- border-style: solid;
- padding: 4px 4px 4px 4px;
- margin: 2px 2px 2px 2px;
- width: 100%;
- white-space: normal;
+ padding: 4px 4px 4px 4px;
+ margin: 10px auto 0px auto;
+ max-width: 97%;
+ width: 90%;
+ min-width: 50%;
+ white-space: normal;
+}
+
+#generated-table {
+ width: 90%;
+ margin: 1em auto -0.5em auto;
+ padding-right: 0.5em;
+ background-color: #fbfbfb;
+ border: 1px solid #bbc3ea;
+}
+
+#generated-table tbody td {
+ text-align: right;
+ margin: 0px;
+ padding: 0px;
}
.warntext {
font-weight: bold;
background-color: #cccc00;
+ padding: 0px;
+ margin: -1px;
+ border: 1px solid #b9b900;
}
.crittext {
font-weight: bold;
background-color: #ff6f22;
+ padding: 0px;
+ margin: -1px;
+ border: 1px solid #f16722;
}
.ruler {
@@ -168,6 +279,14 @@
height: 2px;
}
+a:link,a:visited,a:active {
+ text-decoration: none;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
a.meek:link {
color: #486aaf;
font-size: small;
@@ -188,18 +307,43 @@
font-size: small;
}
+li li {
+ margin-left: -1.2em;
+}
-a.warn:link { color: #cc9900; }
-a.warn:visited { color: #cc9900; }
-a.warn:active { color: #cc9900; }
-a.warn:hover { color: #cc9900; }
-
-a.crit:link { color: #cc0000; }
-a.crit:visited { color: #cc0000; }
-a.crit:active { color: #cc0000; }
-a.crit:hover { color: #cc0000; }
+ul li {
+ margin-left: -1.2em;
+}
+
+a {
+ border-width: 0px;
+}
+
+.heading {
+ font-weight: bold;
+}
+
+a.unkn:link { color: #ffaa00; }
+a.unkn:visited { color: #ffaa00; }
+a.unkn:active { color: #ffaa00; }
+a.unkn:hover { color: #ffaa00; }
+
+a.warn:link { color: #ffd300; }
+a.warn:visited { color: #ffd300; }
+a.warn:active { color: #ffd300; }
+a.warn:hover { color: #ffd300; }
+
+a.crit:link { color: #ff0000; }
+a.crit:visited { color: #ff0000; }
+a.crit:active { color: #ff0000; }
+a.crit:hover { color: #ff0000; }
a:link { color: #486aaf; }
a:visited { color: #486aaf; }
a:active { color: #486aaf; }
a:hover { color: #486aaf; }
+
+img { border-width: 2px; border-color: transparent; }
+img.warn { border-width: 2px; border-color: #ffd300; }
+img.crit { border-width: 2px; border-color: #ff0000; }
+img.unkn { border-width: 2px; border-color: #ffaa00; }
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/node/bin/munindoc
^
|
@@ -0,0 +1,110 @@
+#!/usr/bin/perl -w
+# -*- perl -*-
+#
+# This script provides the basis for a plugin documentation system for
+# munin. Please see "man perlpod" for the reference manual to writing
+# pod files.
+#
+# This is a very thin veneer for re-using perldoc for our own purposes.
+#
+# ---
+# Copyright (C) 2008-2009 Nicolai Langfeldt/Linpro AS
+#
+# 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: munin-update.in 1420 2008-01-30 12:17:43Z janl $
+
+require 5;
+
+use strict;
+use Pod::Perldoc;
+use File::Find;
+use Munin::Common::Defaults;
+
+my @found = (); # Found plugin path names, by priority
+
+my @myargv = @ARGV; # Save the ARGV we want for ourselves.
+
+my ($plugin) = @myargv; # First argument is a plugin name
+
+die "munindoc: Please name a plugin\n" unless $plugin;
+
+my $plugin_re = quotemeta($plugin);
+
+@ARGV=();
+
+# Dirs in which to look for $plugin.pod and $plugin files.
+my @DIRS = ("$Munin::Common::Defaults::MUNIN_LIBDIR/plugins",
+ "$Munin::Common::Defaults::MUNIN_CONFDIR/plugins",
+ "$Munin::Common::Defaults::MUNIN_PERLLIB");
+
+File::Find::find({wanted => \&wanted_pod}, @DIRS);
+File::Find::find({wanted => \&wanted_basename}, @DIRS);
+
+# print "Found: ",join(", ",@found),"\n";
+# exit 0;
+
+# -F Arguments are file names, not modules
+push(@ARGV,'-F',@found);
+
+exit( Pod::Perldoc->run() );
+
+sub wanted_pod {
+# print "Want pod: $File::Find::name\n";
+ /^$plugin_re\.pod$/so && push(@found,$File::Find::name);
+}
+
+sub wanted_basename {
+# print "Want basename: $File::Find::name\n";
+ $_ eq $plugin && push(@found,$File::Find::name);
+}
+
+__END__
+
+=head1 NAME
+
+munindoc - Munin documentation
+
+=head1 DESCRIPTION
+
+This program displays Munin documentation, esp. plugin documentation.
+Note that not all plugins are documented yet.
+
+Most Munin commands (such as munin-run, and munindoc itself) is only
+documented through the usual Unix man command.
+
+=head1 PLUGIN DOCUMENTATION
+
+The plugin documentation should include basic usage information,
+anything you want to know about configuration, and how to interpret
+the output.
+
+Additional information typically found is usually the name of the
+plugin author, licensing and "magic markers" which controls plugin
+auto configuration (done by munin-node-configure).
+
+If you want to document a plugin you can take a look at
+http://munin-monitoring.org/wiki/munindoc for details on how to do it.
+
+=head1 AUTHOR
+
+(C) 2008-2009 Nicolai Langfeldt, Redpill Linpro AS. ...But all the
+work is handed off to the perldoc command once we have located the
+Munin documentation files.
+
+=head1 LICENSE
+
+GPLv2
|
[-]
[+]
|
Deleted |
munin-1.4.tar.bz2/node/bin/munindoc.in
^
|
@@ -1,82 +0,0 @@
-#!/usr/bin/perl -w
-# -*- perl -*-
-#
-# This script provides the basis for a plugin documentation system for
-# munin. Please see "man perlpod" for the reference manual to writing
-# pod files.
-#
-# This is a very thin veneer for re-using perldoc for our own purposes.
-#
-# ---
-# Copyright (C) 2008 Nicolai Langfeldt/Linpro AS
-#
-# 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: munin-update.in 1420 2008-01-30 12:17:43Z janl $
-
-require 5;
-
-use strict;
-use Pod::Perldoc;
-use File::Find;
-
-my @found = (); # Found plugin path names, by priority
-
-my @myargv = @ARGV; # Save the ARGV we want for ourselves.
-
-my ($plugin) = @myargv; # First argument is a plugin name
-
-die "munindoc: Please name a plugin\n" unless $plugin;
-
-my $plugin_re = quotemeta($plugin);
-
-@ARGV=();
-
-# Dirs in which to look for $plugin.pod and $plugin files.
-my @DIRS = ('@@LIBDIR@@/plugins','@@CONFDIR@@/plugins', '@@PERLLIB@@');
-# my @DIRS = ('/usr/share/munin/plugins','/etc/munin/plugins');
-
-File::Find::find({wanted => \&wanted_pod}, @DIRS);
-File::Find::find({wanted => \&wanted_basename}, @DIRS);
-
-# print "Found: ",join(", ",@found),"\n";
-# exit 0;
-
-# -F Arguments are file names, not modules
-push(@ARGV,'-F',@found);
-
-exit( Pod::Perldoc->run() );
-
-sub wanted_pod {
-# print "Want pod: $File::Find::name\n";
- /^$plugin_re\.pod$/so && push(@found,$File::Find::name);
-}
-
-sub wanted_basename {
-# print "Want basename: $File::Find::name\n";
- $_ eq $plugin && push(@found,$File::Find::name);
-}
-
-__END__
-
-=head1 NAME
-
-munindoc - Munin documentation
-
-=head1 DESCRIPTION
-
-This program displays munin documentation found in pod format adjacent
-to plugins (and later other parts of Munin).
|
[-]
[+]
|
Changed |
munin-1.4.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 2672 2009-10-23 13:36:35Z ligne $
+# $Id: Config.pm 2773 2009-10-30 08:35:18Z bjorn $
use strict;
use warnings;
@@ -273,7 +273,7 @@
unless defined $gid || $is_optional;
if (!defined $gid && $is_optional) {
- carp "DEBUG: Skipping optional nonexistant group '$group'"
+ carp "DEBUG: Skipping optional nonexistent group '$group'"
if $self->{DEBUG};
next;
}
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/node/lib/Munin/Node/Configure/Plugin.pm
^
|
@@ -1,10 +1,11 @@
package Munin::Node::Configure::Plugin;
-# $Id: Plugin.pm 2722 2009-10-26 19:54:47Z ligne $
+# $Id: Plugin.pm 2971 2009-11-12 18:15:04Z ligne $
use strict;
use warnings;
+use Munin::Node::Utils qw(set_intersection set_difference);
use Munin::Node::Configure::Debug;
@@ -48,9 +49,9 @@
# (remove) = (installed) \ (suggested)
# (add) = (suggested) \ (installed)
# (same) = (installed) ⋂ (suggested)
-sub _remove { _set_difference(@_); }
-sub _add { _set_difference(reverse @_); }
-sub _same { _set_intersection(@_); }
+sub _remove { set_difference(@_); }
+sub _add { set_difference(reverse @_); }
+sub _same { set_intersection(@_); }
sub suggestion_string
@@ -129,11 +130,15 @@
sub _suggested_links
{
my ($self) = @_;
- if ($self->{default} eq 'yes' and not $self->is_wildcard) {
- return [ $self->{name} ];
+
+ # no suggestions if there isn't any
+ return [] if $self->{default} ne 'yes';
+
+ if ($self->is_wildcard or $self->{name} =~ /^snmp__/) {
+ return [ map { $self->_expand_wildcard($_) } @{$self->{suggestions}} ];
}
else {
- return [ map { $self->_expand_wildcard($_) } @{$self->{suggestions}} ];
+ return [ $self->{name} ];
}
}
@@ -337,31 +342,6 @@
}
-### Set operations #############################################################
-
-# returns the list of elements in arrayref $a that are not in arrayref $b
-# NOTE this is *not* a method.
-sub _set_difference
-{
- my ($A, $B) = @_;
- my %set;
- @set{@$A} = ();
- delete @set{@$B};
- return sort keys %set;
-}
-
-
-# returns the list of elements common to arrayrefs $a and $b
-# NOTE this is *not* a method.
-sub _set_intersection
-{
- my ($A, $B) = @_;
- my %set;
- @set{@$A} = (1) x @$A;
- return sort grep $set{$_}, @$B;
-}
-
-
1;
__END__
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/node/lib/Munin/Node/OS.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Node::OS;
-# $Id: OS.pm 2431 2009-09-16 10:04:17Z janl $
+# $Id: OS.pm 2773 2009-10-30 08:35:18Z bjorn $
use warnings;
use strict;
@@ -64,7 +64,7 @@
return 1 unless $config->{paranoia};
unless (-e "$target") {
- warn "Failed to check permissions on nonexistant target: '$target'";
+ warn "Failed to check permissions on nonexistent target: '$target'";
return;
}
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/node/lib/Munin/Node/Server.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Node::Server;
-# $Id: Server.pm 2672 2009-10-23 13:36:35Z ligne $
+# $Id: Server.pm 2974 2009-11-12 23:43:50Z ligne $
use base qw(Net::Server::Fork);
@@ -17,10 +17,14 @@
use Munin::Node::Logger;
use Munin::Node::Service;
use Munin::Node::Session;
+use Munin::Node::Utils;
# A set of all services that this node can run.
my %services;
+# Services that require the server to support multigraph plugins.
+my @multigraph_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
# other hosts (e.g SNMP services).
@@ -34,33 +38,28 @@
my $self = shift;
print STDERR "In pre_loop_hook.\n" if $config->{DEBUG};
_load_services();
- _load_service_configurations();
- $self->SUPER::pre_loop_hook();
+ Munin::Node::Service->prepare_plugin_environment(keys %services);
+ _add_services_to_nodes(keys %services);
+ return $self->SUPER::pre_loop_hook();
}
-sub request_denied_hook {
+sub request_denied_hook
+{
my $self = shift;
logger("Denying connection from: $self->{server}->{peeraddr}");
return;
}
-sub _load_service_configurations {
- $config->process_plugin_configuration_files();
- $config->apply_wildcards(keys %services);
- return;
-}
-
-
sub _load_services {
- opendir (my $DIR, $config->{servicedir})
+ opendir (my $DIR, $config->{servicedir})
|| die "Cannot open plugindir: $config->{servicedir} $!";
for my $file (readdir($DIR)) {
next unless Munin::Node::Service->is_a_runnable_service($file);
print STDERR "file: '$file'\n" if $config->{DEBUG};
- _add_to_services_and_nodes($file);
+ $services{$file} = 1;
}
closedir $DIR;
@@ -68,7 +67,51 @@
}
-sub process_request {
+# Runs config on each plugin, and add them to the right nodes and plugin groups.
+sub _add_services_to_nodes
+{
+ my (@services) = @_;
+
+ for my $service (keys %services) {
+ print STDERR "Configuring $service\n" if $config->{DEBUG};
+
+ my $res = eval {
+ local $SIG{CHLD}; # stop Net::Server from reaping the dead service too fast
+ Munin::Node::Service->fork_service($config->{servicedir},
+ $service,
+ 'config');
+ };
+
+ # FIXME: report errors properly
+ if ($EVAL_ERROR or $res->{timed_out} or $res->{retval}) {
+ print STDERR "Error running $service. Dropping it.\n"
+ if $config->{DEBUG};
+ delete $services{$service};
+ }
+
+ my ($host_name) = grep /^host_name /, @{$res->{stdout}};
+ my $node = $config->{sconf}{$service}{host_name}
+ || (split /\s+/, ($host_name || ''))[1]
+ || $config->{fqdn};
+
+ print STDERR "\tAdding to node $node\n" if $config->{DEBUG};
+ $nodes{$node}{$service} = 1;
+
+ # Note any plugins that require particular server capabilities.
+ if (grep /^multigraph\s+/, @{$res->{stdout}}) {
+ print STDERR "\tAdding to multigraph plugins\n"
+ if $config->{DEBUG};
+ push @multigraph_services, $service;
+ }
+ }
+ print STDERR "Finished configuring services\n" if $config->{DEBUG};
+
+ return;
+}
+
+
+sub process_request
+{
my $self = shift;
my $session = Munin::Node::Session->new();
@@ -85,7 +128,7 @@
my $timed_out = !do_with_timeout($config->{'timeout'}, sub {
while (defined (my $line = _net_read($session))) {
chomp $line;
- _process_command_line($session, $line)
+ _process_command_line($session, $line)
or last;
}
});
@@ -120,15 +163,15 @@
}
elsif (/^quit/i || /^\./) {
exit 1;
- }
+ }
elsif (/^version/i) {
_show_version($session);
- }
+ }
elsif (/^nodes/i) {
_show_nodes($session);
}
elsif (/^fetch\s?(\S*)/i) {
- _print_service($session, _run_service($session, $1))
+ _print_service($session, _run_service($session, $1))
}
elsif (/^config\s?(\S*)/i) {
_print_service($session, _run_service($session, $1, "config"));
@@ -153,8 +196,8 @@
sub _expect_starttls {
my ($session) = @_;
-
- return !$session->{tls_started}
+
+ return !$session->{tls_started}
&& ($session->{tls_mode} eq 'paranoid' || $session->{tls_mode} eq 'enabled');
}
@@ -162,12 +205,12 @@
sub _negotiate_session_capabilities {
my ($session, $server_capabilities) = @_;
- my %node_cap = map { $_ => 1 } qw(null);
- my %server_cap = map { $_ => 1 } split(/ /, $server_capabilities);
-
- $session->{capabilities} = \%server_cap;
+ my @node_cap = qw( multigraph );
+ $session->{server_capabilities} = {
+ map { $_ => 1 } split(/ /, $server_capabilities)
+ };
- _net_write($session, sprintf("cap %s\n",join(" ",keys %node_cap)) );
+ _net_write($session, sprintf("cap %s\n",join(" ", @node_cap)));
}
@@ -176,30 +219,18 @@
my $mode = $session->{tls_mode};
- my $key;
- my $cert;
- my $depth;
- my $ca_cert;
- my $tls_verify;
-
- $key = $config->{tls_private_key};
- $key = "$Munin::Common::Defaults::MUNIN_CONFDIR/munin-node.pem"
- unless defined $key;
-
- $cert = $config->{tls_certificate};
- $cert = "$Munin::Common::Defaults::MUNIN_CONFDIR/munin-node.pem"
- unless defined $cert;
-
- $ca_cert = $config->{tls_ca_certificate};
- $ca_cert = "$Munin::Common::Defaults::MUNIN_CONFDIR/cacert.pem"
- unless defined $ca_cert;
+ my $key = $config->{tls_private_key}
+ || "$Munin::Common::Defaults::MUNIN_CONFDIR/munin-node.pem";
+ my $cert = $config->{tls_certificate}
+ || "$Munin::Common::Defaults::MUNIN_CONFDIR/munin-node.pem";
+ my $ca_cert = $config->{tls_ca_certificate}
+ || "$Munin::Common::Defaults::MUNIN_CONFDIR/cacert.pem";
+ my $tls_verify = $config->{tls_verify_certificate}
+ || 'no';
- $depth = $config->{tls_verify_depth};
+ my $depth = $config->{tls_verify_depth};
$depth = 5 unless defined $depth;
- $tls_verify = $config->{tls_verify_certificate};
- $tls_verify = "no" unless defined $tls_verify;
-
$session->{tls} = Munin::Common::TLSServer->new({
DEBUG => $config->{DEBUG},
logger => \&logger,
@@ -207,7 +238,7 @@
read_func => sub { die "Shouln't need to read!?" },
tls_ca_cert => $ca_cert,
tls_cert => $cert,
- tls_paranoia => $mode,
+ tls_paranoia => $mode,
tls_priv => $key,
tls_vdepth => $depth,
tls_verify => $tls_verify,
@@ -235,7 +266,7 @@
sub _show_nodes {
my ($session) = @_;
-
+
for my $node (keys %nodes) {
_net_write($session, "$node\n");
}
@@ -243,17 +274,6 @@
}
-sub _add_to_services_and_nodes {
- my ($service) = @_;
-
- $services{$service} = 1;
- # FIXME: may need to query the plugin to get host_name. eg. in the case of
- # SNMP plugins.
- my $node = $config->{sconf}{$service}{host_name} || $config->{fqdn};
- $nodes{$node}{$service} = 1;
-}
-
-
sub _print_service {
my ($session, @lines) = @_;
for my $line (@lines) {
@@ -265,9 +285,17 @@
sub _list_services {
my ($session, $node) = @_;
+
$node ||= $config->{fqdn};
- _net_write($session, join(" ", keys %{$nodes{$node}}))
- if exists $nodes{$node};
+
+ if (exists $nodes{$node}) {
+ # remove any plugins that require capabilities the server doesn't provide
+ my @services = keys %{$nodes{$node}};
+ @services = Munin::Node::Utils::set_difference(\@services, \@multigraph_services)
+ unless $session->{server_capabilities}{multigraph};
+
+ _net_write($session, join(" ", @services));
+ }
_net_write($session, "\n");
}
@@ -352,7 +380,7 @@
use Munin::Node::Server;
Munin::Node::Server->run(...);
-
+
For arguments to run(), see L<Net::Server>.
=head1 METHODS
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/node/lib/Munin/Node/Service.pm
^
|
@@ -1,6 +1,6 @@
package Munin::Node::Service;
-# $Id: Service.pm 2748 2009-10-28 18:45:14Z ligne $
+# $Id: Service.pm 2865 2009-11-05 17:53:32Z ligne $
use warnings;
use strict;
@@ -32,7 +32,7 @@
# service directory? Shouldn't we complain if there is junk in the
# service directory?
return if $file =~ m/^\./; # Hidden files
- return if $file =~ m/\.conf$/; # Config files
+ return if $file =~ m/\.conf$/; # Config files
return if $file !~ m/^([-\w.:]+)$/; # Skip if any weird chars
@@ -46,13 +46,49 @@
}
+sub prepare_plugin_environment
+{
+ my (@plugins) = @_;
+
+ Munin::Common::Defaults->export_to_environment();
+
+ $config->{fqdn} ||= Munin::Node::OS->get_fq_hostname();
+
+ # Export some variables plugins might be interested in
+ $ENV{MUNIN_DEBUG} = $config->{PIDEBUG};
+ $ENV{FQDN} = $config->{fqdn};
+
+ # Tell plugins about supported capabilities
+ $ENV{MUNIN_CAP_MULTIGRAPH} = 1;
+
+ # Some locales use "," as decimal separator. This can mess up a lot
+ # of plugins.
+ $ENV{LC_ALL} = 'C';
+
+ $config->{defuser} = getpwnam($Munin::Common::Defaults::MUNIN_PLUGINUSER)
+ unless defined $config->{defuser};
+ $config->{defgroup} = getgrnam($Munin::Common::Defaults::MUNIN_GROUP)
+ unless defined $config->{defgroup};
+
+ if ($config->{sconffile}) {
+ # only used by munin-run
+ $config->parse_plugin_config_file($config->{sconffile});
+ }
+ else {
+ $config->process_plugin_configuration_files();
+ }
+ $config->apply_wildcards(@plugins);
+
+ return;
+}
+
+
sub export_service_environment {
my ($class, $service) = @_;
print STDERR "# Setting up environment\n" if $config->{DEBUG};
- my $env = $config->{sconf}{$service}{env};
+ my $env = $config->{sconf}{$service}{env} or return;
- return unless defined $env;
while (my ($k, $v) = each %$env) {
print STDERR "# Environment $k = $v\n" if $config->{DEBUG};
$ENV{$k} = $v;
@@ -110,7 +146,7 @@
};
if ($EVAL_ERROR) {
- logger("Plugin \"$service\" Can't drop privileges: $EVAL_ERROR. "
+ logger("Plugin '$service' Can't drop privileges: $EVAL_ERROR. "
. "Bailing out.\n");
exit 1;
}
@@ -175,7 +211,7 @@
my ($class, $dir, $service, $arg) = @_;
my $timeout = $config->{sconf}{$service}{timeout}
- || $config->{timeout};
+ || $config->{timeout};
my $run_service = sub {
$class->exec_service($dir, $service, $arg);
@@ -218,6 +254,11 @@
If not specified, $dir defaults to $config->{servicedir}
+=item B<prepare_plugin_environment(@services)>
+
+Carries out various tasks that plugins require before being run, such as
+loading service configurations and exporting common environment variables.
+
=item B<export_service_environment>
Munin::Node::Service->export_service_enviromnent($service);
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/node/lib/Munin/Node/Utils.pm
^
|
@@ -0,0 +1,62 @@
+package Munin::Node::Utils;
+
+use Exporter ();
+our @ISA = qw/Exporter/;
+our @EXPORT_OK = qw/
+ set_difference
+ set_intersection
+/;
+
+
+### Set operations #############################################################
+
+sub set_difference
+{
+ my ($A, $B) = @_;
+ my %set;
+ @set{@$A} = ();
+ delete @set{@$B};
+ return sort keys %set;
+}
+
+
+sub set_intersection
+{
+ my ($A, $B) = @_;
+ my %set;
+ @set{@$A} = (1) x @$A;
+ return sort grep $set{$_}, @$B;
+}
+
+
+1;
+
+__END__
+
+
+=head1 NAME
+
+Munin::Node::Utils - Various utility functions
+
+
+=head1 SYNOPSIS
+
+ use Munin::Node::Utils qw( ... );
+
+
+=head1 SUBROUTINES
+
+=over
+
+=item B<set_difference(\@a, \@b)>
+
+Returns the list of elements in arrayref \@a that are not in arrayref \@b.
+
+
+=item B<set_intersection(\@a, \@b)>
+
+Returns the list of elements common to arrayrefs \@a and \@b.
+
+
+=cut
+# vim: ts=4 : et
|
[-]
[+]
|
Changed |
munin-1.4.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 2665 2009-10-22 17:27:39Z ligne $
+# $Id: munin-node 2848 2009-11-05 12:58:00Z ligne $
#
use strict;
@@ -60,23 +60,18 @@
$0 =~ /^(.*)$/;
$0 = $1;
- # Make build time configuration settings available at runtime.
- Munin::Common::Defaults->export_to_environment();
-
parse_args();
- # Export debug setting to plugins.
- $ENV{'MUNIN_DEBUG'} = $PIDEBUG ;
-
# Check permissions of configuration
-
unless (Munin::Node::OS->check_perms($servicedir, $paranoia)
- && Munin::Node::OS->check_perms($conffile, $paranoia)) {
+ && Munin::Node::OS->check_perms($conffile, $paranoia))
+ {
die "Fatal error. Bailing out.";
}
my $config = Munin::Node::Config->instance();
$config->parse_config_from_file($conffile);
+
$FQDN = $config->{fqdn} if defined $config->{fqdn};
$defuser = $config->{defuser} if defined $config->{defuser};
$defgroup = $config->{defgroup} if defined $config->{defgroup};
@@ -84,15 +79,6 @@
push @ignores, @{$config->{ignores}} if defined $config->{ignores};
- # A hack to override the hostname if everything else fails
- $FQDN ||= Munin::Node::OS->get_fq_hostname();
-
- $ENV{FQDN}=$FQDN;
-
- # Some locales uses "," as decimal separator. This can mess up a lot
- # of plugins.
- $ENV{'LC_ALL'}='C';
-
$config->reinitialize({
timeout => $timeout,
@@ -265,4 +251,4 @@
=cut
-# vim:syntax=perl ts=4
+# vim:syntax=perl ts=4 : expandtab
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/node/sbin/munin-node-configure
^
|
@@ -282,7 +282,7 @@
my ($plugins) = @_;
# We're going to be running plugins
- prepare_plugin_environment($plugins);
+ Munin::Node::Service->prepare_plugin_environment($plugins->names);
foreach my $plugin ($plugins->list) {
fetch_plugin_autoconf($plugin);
@@ -360,7 +360,8 @@
$@;
}
- prepare_plugin_environment($plugins);
+ Munin::Node::Service->prepare_plugin_environment($plugins->names);
+
fetch_plugin_snmpconf($_) foreach ($plugins->list);
return Munin::Node::SNMPConfig->new(
@@ -374,32 +375,6 @@
### Running plugins and analysing responses ####################################
-sub prepare_plugin_environment
-{
- my ($plugins) = @_;
-
- Munin::Common::Defaults->export_to_environment();
-
- # Export some variables plugins might be interested in
- $ENV{MUNIN_DEBUG} = $config->{PIDEBUG};
- $ENV{FQDN} = $config->{fqdn} || Munin::Node::OS->get_fq_hostname();
-
- # Some locales use "," as decimal separator. This can mess up a lot
- # of plugins.
- $ENV{LC_ALL} = 'C';
-
- $config->{defuser} = getpwnam($Munin::Common::Defaults::MUNIN_PLUGINUSER)
- unless defined $config->{defuser};
- $config->{defgroup} = getgrnam($Munin::Common::Defaults::MUNIN_GROUP)
- unless defined $config->{defgroup};
-
- $config->process_plugin_configuration_files();
- $config->apply_wildcards($plugins->names);
-
- return;
-}
-
-
# Runs the plugin with argument $mode (eg. 'suggest', 'autoconf') and runs
# tests on the results. Assuming no errors were detected, returns a list
# of the lines printed to STDOUT, with any debug output removed.
|
[-]
[+]
|
Changed |
munin-1.4.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 2672 2009-10-23 13:36:35Z ligne $
+# $Id: munin-run 2807 2009-11-02 13:34:02Z ligne $
#
use strict;
@@ -34,18 +34,16 @@
use Munin::Node::OS;
use Munin::Node::Service;
-my %services;
-my %nodes;
-
-my $FQDN = "";
+my $FQDN = "";
my $defuser = getpwnam($Munin::Common::Defaults::MUNIN_PLUGINUSER);
my $defgroup = getgrnam($Munin::Common::Defaults::MUNIN_GROUP);
-my $paranoia = 0;
+my $paranoia = 0;
my $config = Munin::Node::Config->instance();
+
sub main
{
# "Clean" environment to disable taint-checking on the environment. We _know_
@@ -59,12 +57,16 @@
$0 =~ /^(.*)$/;
$0 = $1;
- # Make build time configuration settings available at runtime.
- Munin::Common::Defaults->export_to_environment();
-
my ($plugin, $arg) = parse_args();
- merge_node_config();
+ # Loads the settings from munin-node.conf.
+ # Ensures that, where options can be set both in the config and in
+ # @ARGV, the latter takes precedence.
+ $paranoia = $config->{paranoia};
+
+ die "Fatal error. Bailing out.\n"
+ unless Munin::Node::OS->check_perms($config->{conffile});
+ $config->parse_config_from_file($config->{conffile});
die "Fatal error. Bailing out.\n"
unless (Munin::Node::OS->check_perms($config->{servicedir}));
@@ -72,9 +74,6 @@
$defuser = $config->{defuser} if defined $config->{defuser};
$defgroup = $config->{defgroup} if defined $config->{defgroup};
- # Override the hostname if everything else fails
- $config->{fqdn} ||= Munin::Node::OS->get_fq_hostname();
-
$config->reinitialize({
%$config,
@@ -83,20 +82,12 @@
paranoia => $paranoia,
});
- # Some locales uses "," as decimal separator. This can mess up a lot
- # of plugins.
- $ENV{LC_ALL} = 'C';
-
- # Export some variables plugins might be interested in
- $ENV{MUNIN_DEBUG} = $config->{PIDEBUG};
- $ENV{FQDN} = $config->{fqdn};
-
unless (Munin::Node::Service->is_a_runnable_service($plugin)) {
print STDERR "# Unknown service '$plugin'\n";
exit 1;
}
- load_service_configs($plugin);
+ Munin::Node::Service->prepare_plugin_environment($plugin);
# no need for a timeout -- the user can kill this process any
# time they want.
@@ -108,41 +99,6 @@
}
-# Loads the settings from munin-node.conf.
-# Ensures that, where options can be set both in the config and in
-# @ARGV, the former takes precedence.
-sub merge_node_config
-{
- # Cache them here, and restore them after parsing the config.
- $paranoia = $config->{paranoia};
-
- die "Fatal error. Bailing out.\n"
- unless Munin::Node::OS->check_perms($config->{conffile});
- $config->parse_config_from_file($config->{conffile});
-
- # Restore them
- $config->{paranoia} = $paranoia if defined $paranoia;
-
- return;
-}
-
-
-sub load_service_configs
-{
- my ($plugin) = @_;
-
- if ($config->{sconffile}) {
- $config->parse_plugin_config_file($config->{sconffile});
- }
- else {
- $config->process_plugin_configuration_files();
- }
-
- $config->apply_wildcards($plugin);
- return;
-}
-
-
sub parse_args
{
# Default configuration values
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/node/t/munin_node_configure_plugin.t
^
|
@@ -96,52 +96,6 @@
}
-### _set_complement
-### _set_intersection
-{
- my @tests = (
- [
- [ [qw/a b c/], [qw/a b c/] ], [ [], [qw/a b c/] ],
- 'Equal sets',
- ],
- [
- [ [qw/a b c/], [qw/d e f/] ], [ [qw/a b c/], [] ],
- 'Disjoint sets',
- ],
- [
- [ [qw/a b c/], [qw/c d e/] ], [ [qw/a b/], [qw/c/] ],
- 'Intersecting sets',
- ],
- [
- [ [], [qw/a b c/] ], [ [], [] ],
- 'First set is empty',
- ],
- [
- [ [qw/a b c/], [] ], [ [qw/a b c/], [] ],
- 'Second set is empty',
- ],
- [
- [ [], [] ], [ [], [] ],
- 'Both sets are empty',
- ],
- );
-
- foreach (@tests) {
- my ($sets, $expected, $msg) = @$_;
- is_deeply(
- [ Munin::Node::Configure::Plugin::_set_difference(@$sets) ],
- $expected->[0],
- "$msg - complement"
- );
- is_deeply(
- [ Munin::Node::Configure::Plugin::_set_intersection(@$sets) ],
- $expected->[1],
- "$msg - intersection"
- );
- }
-}
-
-
### _remove
### _add
### _same
@@ -266,6 +220,7 @@
is_deeply($p->_suggested_links, [], 'no suggestions by default');
is_deeply($p->_suggested_wild , [], 'no suggested wildcards by default');
+ $p->{default} = 'yes'; # it's ok to run it now
$p->add_instance('memory');
is_deeply($p->_installed_links, ['memory'], 'one link installed');
is_deeply($p->_installed_wild , [], 'no wildcards reported');
@@ -278,6 +233,7 @@
is_deeply($wcp->_suggested_links, [], 'no suggestions by default');
is_deeply($wcp->_suggested_wild , [], 'no suggested wildcards by default');
+ $wcp->{default} = 'yes'; # it's ok to run it now
$wcp->add_instance('if_eth0');
is_deeply($wcp->_installed_links, ['if_eth0'], 'one link installed');
is_deeply($wcp->_installed_wild , ['eth0'], 'one wildcard');
@@ -292,7 +248,8 @@
}
{
my $sp = gen_plugin('snmp__load');
-
+
+ $sp->{default} = 'yes'; # it's ok to run it now
$sp->add_instance('snmp_switch.example.com_load');
is_deeply($sp->_installed_links, ['snmp_switch.example.com_load'], 'one link installed');
is_deeply($sp->_installed_wild , ['switch.example.com'], 'one wildcard');
@@ -309,6 +266,7 @@
{
my $swcp = gen_plugin('snmp__if_');
+ $swcp->{default} = 'yes'; # it's ok to run it now
$swcp->add_instance('snmp_switch.example.com_if_1');
is_deeply($swcp->_installed_links, ['snmp_switch.example.com_if_1'], 'one link installed');
is_deeply($swcp->_installed_wild , ['switch.example.com/1'], 'one wildcard');
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/node/t/munin_node_utils.t
^
|
@@ -0,0 +1,54 @@
+use strict;
+use warnings;
+
+use Test::More 'no_plan';
+
+use Munin::Node::Utils;
+
+
+### _set_complement
+### _set_intersection
+{
+ my @tests = (
+ [
+ [ [qw/a b c/], [qw/a b c/] ], [ [], [qw/a b c/] ],
+ 'Equal sets',
+ ],
+ [
+ [ [qw/a b c/], [qw/d e f/] ], [ [qw/a b c/], [] ],
+ 'Disjoint sets',
+ ],
+ [
+ [ [qw/a b c/], [qw/c d e/] ], [ [qw/a b/], [qw/c/] ],
+ 'Intersecting sets',
+ ],
+ [
+ [ [], [qw/a b c/] ], [ [], [] ],
+ 'First set is empty',
+ ],
+ [
+ [ [qw/a b c/], [] ], [ [qw/a b c/], [] ],
+ 'Second set is empty',
+ ],
+ [
+ [ [], [] ], [ [], [] ],
+ 'Both sets are empty',
+ ],
+ );
+
+ foreach (@tests) {
+ my ($sets, $expected, $msg) = @$_;
+ is_deeply(
+ [ Munin::Node::Utils::set_difference(@$sets) ],
+ $expected->[0],
+ "$msg - complement"
+ );
+ is_deeply(
+ [ Munin::Node::Utils::set_intersection(@$sets) ],
+ $expected->[1],
+ "$msg - intersection"
+ );
+ }
+}
+
+
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/lib/Munin/Plugin/SNMP.pm
^
|
@@ -24,7 +24,7 @@
# pattern. Please maintain it in the same way.
-# $Id: SNMP.pm 2464 2009-09-22 21:28:27Z ligne $
+# $Id: SNMP.pm 2935 2009-11-10 13:10:25Z ligne $
=head1 NAME
@@ -208,7 +208,8 @@
# Common options.
my @options = (-hostname => $host,
-port => $port,
- -version => $version);
+ -version => $version,
+ );
# User defined options
if (defined($userargs[0])) {
@@ -470,11 +471,11 @@
print STDERR "# Getting single $oid...\n" if $::DEBUG;
- my $response = $handle->get_request ($oid);
+ my $response = $handle->get_request($oid);
- if (!defined $response->{$oid}) {
- print STDERR "# Error getting $oid: ",$handle->error(),"\n"
- if $::DEBUG;
+ if (!defined $response->{$oid} or $handle->error_status) {
+ print STDERR "# Error getting $oid: ",$handle->error(),"\n"
+ if $::DEBUG;
return;
}
return $response->{$oid};
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/plugins/node.d.linux/bonding_err_.in
^
|
@@ -0,0 +1,98 @@
+#!@@GOODSH@@
+# -*- sh -*-
+
+: <<EOF
+
+=head1 NAME
+
+bonding_err_ - Wildcard plugin to graph bonding interface errors
+
+=head1 CONFIGURATION
+
+This is a wildcard plugin. The link name extension is the bonding
+interface to monitor.
+
+=head1 AUTHORS
+
+Copyright Bjørn Ruberg 2009
+
+=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 suggest
+
+=cut
+
+EOF
+
+PROCDIR="/proc/net/bonding"
+MYSELF=$(basename $0)
+FILENAME="bonding_err_"
+
+if [ "$1" = "autoconf" ]; then
+ if [ -d "${PROCDIR}" ]; then
+ echo "yes"
+ else
+ echo "no (No ${PROCDIR})"
+ fi
+ exit 0
+fi
+
+if [ "$1" = "suggest" ]; then
+ ls -1 ${PROCDIR}
+ exit 0
+fi
+
+if [ "$1" = "config" ]; then
+ if [ "$MYSELF" = "$FILENAME" ]; then
+ echo "Can't run config on un-symlinked plugin. Please run the plugin with 'suggest' before attempting this."
+ exit 0
+ else
+ BONDINGIF=$(echo $MYSELF | sed "s/^$FILENAME//")
+ echo "graph_title Bonding interface errors for $BONDINGIF"
+ 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"
+ done
+ fi
+ exit 0
+fi
+
+if [ "$MYSELF" = "$FILENAME" ]; then
+ echo "Can't run an un-symlinked plugin. Please run the plugin with 'suggest' before attempting this."
+ exit 0
+fi
+
+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 "
+ grep -A 2 "^Slave Interface: ${if}" ${PROCDIR}/${BONDINGIF} | grep "Link Failure Count:" | cut -d " " -f 4
+done
+
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d.linux/df.in
^
|
@@ -45,7 +45,7 @@
=head1 VERSION
-$Id: df.in 2493 2009-09-28 11:01:10Z feiner.tom $
+$Id: df.in 2777 2009-10-30 11:50:35Z knan $
=head1 AUTHOR
@@ -60,8 +60,8 @@
use strict;
use Munin::Plugin;
-# For these filesystem types use the mount point, the device is useless
-my %usemntpt = ( tmpfs => 1 );
+# 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)));
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d.linux/df_abs.in
^
|
@@ -1,28 +1,51 @@
#!@@BASH@@
# -*- sh -*-
-#
-# $Id: df_abs.in 1966 2009-04-01 12:24:27Z kjellm $
-#
-# Script to monitor absolute disk usage.
-#
-# Parameters understood:
-#
-# config (required)
-# autoconf (optional - used by munin-config)
-#
-# Environment
-# exclude: space separated list if fs types to exclude.
-# iso9660 by default
-# warning: Warning _percentage_, default 92
-# critical: Critical _percentage_, default 98
-#
-# Magic markers (optional - used by munin-config and installation
-# scripts):
-#
-# $Id: df_abs.in 1966 2009-04-01 12:24:27Z kjellm $
-#
-#%# family=manual
-#%# capabilities=autoconf
+
+: <<EOF
+
+=head1 NAME
+
+df_abs - Plugin to monitor absolute disk usage
+
+=head1 CONFIGURATION
+
+The following configuration parameters are used by this plugin
+
+ [df_abs]
+ env.exclude - space separated list of file system types to exclude
+ env.warning - Warning percentage
+ env.critical - Critical percentage
+
+=head2 DEFAULT CONFIGURATION
+
+ [df_abs]
+ env.exclude iso9660
+ env.warning 92
+ env.critical 98
+
+=head1 AUTHORS
+
+Unknown author
+
+=head1 LICENSE
+
+Unknown license
+
+=head1 BUGS
+
+Does not handle cases where the block special device is the same for
+multiple mounts. On Ubuntu systems, this is commonly "none" for
+non-disk file systems like fusectl, debugfs, securityfs, devpts,
+tmpfs, etc...
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+ #%# capabilities=autoconf
+
+=cut
+
+EOF
. $MUNIN_LIBDIR/plugins/plugin.sh
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d.linux/df_inode.in
^
|
@@ -36,10 +36,10 @@
use strict;
use Munin::Plugin;
-# For these filesystem types use the mount point, the device is useless
-my %usemntpt = ( tmpfs => 1 );
+# 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 $exclude=$ENV{'exclude'} || 'none unknown iso9660 squashfs udf romfs ramfs vfat';
my $dfopts = "-P -l -i ".join(' -x ',('',split('\s+',$exclude)));
sub print_values() {
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d.linux/diskstat_.in
^
|
@@ -4,7 +4,7 @@
=head1 NAME
-diskstat_ - Munin plugin to monitor various values provided
+diskstat_ - Munin wildcard plugin to monitor various values provided
via C</proc/diskstats>
=head1 APPLICABLE SYSTEMS
@@ -12,6 +12,17 @@
Linux 2.6 systems with extended block device statistics enabled.
+=head1 CONFIGURATION
+
+None needed.
+
+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:
+
+ [diskstat_*]
+ user root
+
=head1 INTERPRETATION
Among the more self-describing or well-known values like C<throughput>
@@ -92,7 +103,7 @@
=head1 VERSION
- $Id: diskstat_.in 2533 2009-10-07 07:17:58Z janl $
+ $Id: diskstat_.in 2923 2009-11-09 11:57:44Z janl $
=head1 MAGIC MARKERS
@@ -630,6 +641,8 @@
my $pretty_name = translate_lvm_name($entry);
+ $entry =~ s|/dev/||;
+
return defined $pretty_name ? $pretty_name : $entry;
}
@@ -659,6 +672,7 @@
$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";
}
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d.linux/ip_.in
^
|
@@ -9,13 +9,19 @@
=head1 CONFIGURATION
-=head2 PLUGIN PRIVILEGES
+This plugin needs to be run as root for iptables to work.
-This plugin needs to be run as root for iptables to work. Example
-configuration:
+Additionally you can change the graph title from the ip address to a
+hostname by setting hostname in the configuration.
+
+Example configuration follows. Only the first stanza is needed:
+
+ [ip_*]
+ user root
+
+ [ip_192.168.0.1]
+ env.hostname host.example.com
- [ip_*]
- user root
=head2 ENVIRONMENT VARIABLES
@@ -137,7 +143,11 @@
if [ "$1" = "config" ]; then
echo "graph_order out in"
- echo "graph_title $IP traffic"
+ title=$IP
+ if [ -n "$hostname" ]; then
+ title="$hostname"
+ fi
+ echo "graph_title $title traffic"
echo 'graph_args --base 1000'
echo 'graph_vlabel bits per ${graph_period}'
echo 'graph_category network'
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d.linux/proc_pri.in
^
|
@@ -38,8 +38,9 @@
echo 'graph_title Processes priority'
echo 'graph_order low high locked'
echo 'graph_category processes'
- echo 'graph_info This graph shows the processes priority'
+ echo 'graph_info This graph shows nuber of processes at each priority'
echo 'graph_args --base 1000 -l 0'
+ echo 'graph_vlabel Number of processes'
echo 'high.label high priority'
echo 'high.draw STACK'
echo 'high.info The number of high-priority processes (tasks)'
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/apache_accesses.in
^
|
@@ -3,7 +3,7 @@
=head1 NAME
-apache_processes - Munin plugin to monitor the number of accesses to
+apache_accesses - Munin plugin to monitor the number of accesses to
Apache servers. It handles a list of ports passed in from a plugin
configuration file.
@@ -57,7 +57,7 @@
=head1 VERSION
- $Id: apache_accesses.in 2632 2009-10-21 00:48:00Z janl $
+ $Id: apache_accesses.in 2957 2009-11-11 13:43:12Z feiner.tom $
=head1 BUGS
@@ -73,6 +73,8 @@
=cut
+use strict;
+use warnings;
use Munin::Plugin;
my $ret = undef;
@@ -132,7 +134,8 @@
print "accesses$port.type DERIVE\n";
print "accesses$port.max 1000000\n";
print "accesses$port.min 0\n";
-
+ print "accesses$port.info The number of accesses (pages and other items"
+ . " served) globaly on the Apache server\n";
print_thresholds("accesses$port");
}
exit 0;
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/apache_processes.in
^
|
@@ -68,7 +68,7 @@
=head1 VERSION
- $Id: apache_processes.in 2632 2009-10-21 00:48:00Z janl $
+ $Id: apache_processes.in 2957 2009-11-11 13:43:12Z feiner.tom $
=head1 AUTHOR
@@ -80,6 +80,8 @@
=cut
+use strict;
+use warnings;
use Munin::Plugin;
my $ret = undef;
@@ -179,7 +181,7 @@
print "idle$port.value U\n";
}
if ($response->content =~ /^(Scoreboard: .*)$/m) {
- $count = () = $1 =~ /\./g;
+ my $count = () = $1 =~ /\./g;
print "free$port.value $count\n";
} else {
print "free$port.value U\n";
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/apache_volume.in
^
|
@@ -58,7 +58,7 @@
=head1 VERSION
- $Id: apache_volume.in 2632 2009-10-21 00:48:00Z janl $
+ $Id: apache_volume.in 2957 2009-11-11 13:43:12Z feiner.tom $
=head1 BUGS
@@ -74,6 +74,8 @@
=cut
+use strict;
+use warnings;
use Munin::Plugin;
my $ret = undef;
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/asterisk_channels.in
^
|
@@ -56,7 +56,6 @@
=head1 MAGIC MARKERS
#%# family=contrib
- #%# capabilities=autoconf
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/asterisk_channelstypes.in
^
|
@@ -63,7 +63,6 @@
=head1 MAGIC MARKERS
#%# family=contrib
- #%# capabilities=autoconf
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/asterisk_codecs.in
^
|
@@ -69,7 +69,6 @@
=head1 MAGIC MARKERS
#%# family=contrib
- #%# capabilities=autoconf
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/asterisk_meetme.in
^
|
@@ -56,7 +56,6 @@
=head1 MAGIC MARKERS
#%# family=contrib
- #%# capabilities=autoconf
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/asterisk_meetmeusers.in
^
|
@@ -57,7 +57,6 @@
=head1 MAGIC MARKERS
#%# family=contrib
- #%# capabilities=autoconf
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/asterisk_sipchannels.in
^
|
@@ -65,7 +65,6 @@
=head1 MAGIC MARKERS
#%# family=contrib
- #%# capabilities=autoconf
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/asterisk_sippeers.in
^
|
@@ -56,7 +56,6 @@
=head1 MAGIC MARKERS
#%# family=contrib
- #%# capabilities=autoconf
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/asterisk_voicemail.in
^
|
@@ -61,7 +61,6 @@
=head1 MAGIC MARKERS
#%# family=contrib
- #%# capabilities=autoconf
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/bind9.in
^
|
@@ -79,6 +79,7 @@
my $k;
print "graph_title DNS Queries by type
+graph_category BIND
graph_vlabel Queries / \${graph_period}
query_other.label Other
query_other.type DERIVE
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/bind9_rndc.in
^
|
@@ -46,40 +46,33 @@
my $querystats = $ENV{querystats} || '/var/run/named.stats';
my %IN;
-system("$rndc stats") if $rndc;
-
+# open the log file, and get its size
open(my $stats, '<', $querystats) or die "$querystats: $!\n";
-seek($stats , -400, 2); # go nearly to the end of the file
- # to avoid reading it all
+my $size = (stat $stats)[7];
+# call rdnc and go directly to the correct offset
+system("$rndc stats") if $rndc;
+seek($stats , $size, 0);
-while (my $line = <$stats>) {
- chomp $line;
+# We want the last block like this in the file
+#+++ Statistics Dump +++ (1087277501)
+#success 106183673
+#referral 2103636
+#nxrrset 43534220
+#nxdomain 47050478
+#recursion 37303997
+#failure 17522313
+#--- Statistics Dump --- (1087277501)
- # We want the last block like this in the file
- #+++ Statistics Dump +++ (1087277501)
- #success 106183673
- #referral 2103636
- #nxrrset 43534220
- #nxdomain 47050478
- #recursion 37303997
- #failure 17522313
- #--- Statistics Dump --- (1087277501)
-
- if ($line =~ m/\+\+\+ Statistics Dump \+\+\+/) {
- # reset
- undef %IN;
- } else {
- my ($what, $nb)= split('\s+', $line);
- if ($what && ($what ne '---')) {
- $IN{$what} = $nb;
- }
- }
+while (my $line = <$stats>) {
+ next unless $line =~ /^(\w+) (\d+)$/;
+ $IN{$1} = $2;
}
close($stats);
if (defined($ARGV[0]) and ($ARGV[0] eq 'config')) {
print "graph_title DNS Queries by status\n";
print "graph_vlabel queries / \${graph_period}\n";
+ print "graph_category BIND\n";
for my $key (keys %IN) {
print "query_$key.label $key\n";
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/exim_mailqueue.in
^
|
@@ -1,7 +1,7 @@
#!@@GOODSH@@
# -*- sh -*-
-: << =cut
+: << EOF
=head1 NAME
@@ -53,7 +53,8 @@
#%# capabilities=autoconf
=cut
-# ' end quote entered inside pod
+
+EOF
# You cannot trust the exit status of which
EXIQGREP=$(which exiqgrep 2>/dev/null)
@@ -90,15 +91,15 @@
echo 'mails.label queued mails'
# Use "AREASTACK" in munin 1.3.3 and later
echo 'mails.draw STACK'
- echo "mails.warning $QUEUEWARN"
- echo "mails.critical $QUEUECRIT"
+ echo "mails.warning 0:$QUEUEWARN"
+ echo "mails.critical 0:$QUEUECRIT"
echo 'mails.colour 00AA00'
echo 'frozen.label frozen mails'
# Use "AREASTACK" in munin 1.3.3 and later
echo 'frozen.draw AREA'
- echo "frozen.warning $FROZENWARN"
- echo "frozen.critical $FROZENCRIT"
+ echo "frozen.warning 0:$FROZENWARN"
+ echo "frozen.critical 0:$FROZENCRIT"
echo 'frozen.colour 0022FF'
exit 0
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/plugins/node.d/extinfo_tester.in
^
|
@@ -0,0 +1,22 @@
+#!@@BASH@@
+
+#%# family=test
+
+do_ () {
+ cat <<EOF
+pending.value 2
+pending.extinfo +dash +diffutils
+hold.value 0
+EOF
+}
+
+do_config () {
+ cat <<EOF
+graph_title Extinfo tester
+pending.label pending
+pending.warning 0:0
+hold.label hold
+EOF
+}
+
+do_$1
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/foldingathome_wu.in
^
|
@@ -1,17 +1,37 @@
#!@@GOODSH@@
# -*- sh -*-
-#
-# Folding@Home WU submited
-#
-# Parameters:
-#
-# config (required)
-# autoconf (optional - only used by munin-config)
-#
-# Magic markers (optional - used by munin-config and some installation
-# scripts):
-#%# family=contrib
-#%# capabilities=autoconf
+
+: <<EOF
+
+=head1 NAME
+
+foldingathome_wu - Plugin to graph the number of working units
+submitted to folding@home
+
+=head1 CONFIGURATION
+
+No configuration
+
+=head1 AUTHORS
+
+Unknown author
+
+=head1 LICENSE
+
+Unknown license
+
+=head1 BUGS
+
+Plugin has capabilities "autoconf", but "autoconf" seems broken.
+
+=head1 MAGIC MARKERS
+
+ #%# family=contrib
+ #%# capabilities=autoconf
+
+=cut
+
+EOF
statefile=$MUNIN_PLUGSTATE/plugin-fah_wu.state
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/id.in
^
|
@@ -1,6 +1,8 @@
#!@@GOODSH@@
# -*- sh -*-
+: << =cut
+
=head1 NAME
id - Plugin for testing user and group statements in the plugin config.
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/ifx_concurrent_sessions_.in
^
|
@@ -1,8 +1,6 @@
-#!@@PERL@@ -Tw
+#!@@PERL@@ -w
# -*- perl -*-
#
-#%# family=contrib
-#%# capabilities=autoconf suggest
=head1 NAME
@@ -38,10 +36,13 @@
=head1 VERSION
- $Id: ifx_concurrent_sessions_.in 2431 2009-09-16 10:04:17Z janl $
+ $Id: ifx_concurrent_sessions_.in 2965 2009-11-12 02:38:54Z janl $
=head1 BUGS
+This plugin hangs during autoconf - at least on systems without
+informix. Therefore capabilities magic marker has been removed.
+
May not autoconfigure correctly as noted above.
=head1 AUTHOR
@@ -52,6 +53,10 @@
GPLv2
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+
=cut
use strict;
@@ -92,7 +97,7 @@
if ($ARGV[0] eq 'autoconf') {
if (@infdir) {
print "yes\n";
- exit;
+ exit 0;
}
else {
print "no (Could not find oninit on this host)\n";
@@ -123,7 +128,7 @@
print "$dir.$1\n" if $infsrv =~ /DBSERVERNAME\s+(\S+)/;
}
}
- exit;
+ exit 0;
}
# Retreive vital Informix environment from plugin's name
@@ -143,7 +148,7 @@
};
$config =~ s/^\s+//gm;
print $config;
- exit;
+ exit 0;
}
#printf "%s\n%s\n", @ENV{qw(INFORMIXDIR INFORMIXSERVER)};exit;
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/ipmi_sensor_.in
^
|
@@ -10,7 +10,7 @@
Copyright (c) 2006 Logilab
-Inspired by code writtent by Peter Palfrader
+Inspired by code written by Peter Palfrader
=head1 CONFIGURATION
@@ -124,7 +124,10 @@
return sensors
def get_sensor_names():
- p = Popen(["ipmitool","-I","open","sensor"], shell=False, stdout=PIPE)
+ try:
+ p = Popen(["ipmitool","-I","open","sensor"], shell=False, stdout=PIPE)
+ except OSError:
+ return
data = p.stdout.readlines()
units = {}
@@ -149,9 +152,15 @@
if curtime-mtime>CACHEAGE:
if not SENSORS:
- p = Popen(["ipmitool","-I","open","sensor"], shell=False, stdout=PIPE)
+ try:
+ p = Popen(["ipmitool","-I","open","sensor"], shell=False, stdout=PIPE)
+ except OSError:
+ return
else:
- p = Popen(["ipmitool","-I","open","sensor", "get"] + SENSORS, shell=False, stdout=PIPE)
+ try:
+ p = Popen(["ipmitool","-I","open","sensor", "get"] + SENSORS, shell=False, stdout=PIPE)
+ except OSError:
+ return
data = p.stdout.read()
try:
f = file(cache_filename,"w")
@@ -279,7 +288,7 @@
def suggest():
names = get_sensor_names()
- if not os.access(CONFIG, F_OK):
+ if not access(CONFIG, F_OK):
f = file(CONFIG, "w")
for key, sensors in names.items():
f.write("%s = %s\n" % (key, ",".join(sensors)))
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/plugins/node.d/memcached_.in
^
|
@@ -0,0 +1,244 @@
+#!@@PERL@@
+# -*- cperl -*-
+#
+# Plugin to monitor memcache statistics
+#
+# This module has 3 seperate graph datasets:
+# rates
+# bytes
+# counters
+#
+# For each of them, symlink the memcached_ script to memcached_FOO where foo is
+# the datset name.
+#
+# Parameters supported:
+#
+# config
+# autoconf
+#
+# Configurable variables
+#
+# host Host of the memcache daemon
+# port Port of the memcache daemon
+#
+# Author: Robin H. Johnson <robbat2@gentoo.org>
+# Slightly based on the original version by Joshua Thijssen
+# <jthijssen@noxlogic.nl>
+#
+# Included in trunk for 1.4 by Nicolai Langfeldt. Set family to contrib
+# and disabled autoconf due to lack of "suggest".
+#
+# Magic markers:
+#%# family=contrib
+#%# capabilities=noautoconf
+use strict;
+my $ret = undef;
+if (! eval "require Cache::Memcached;") {
+ $ret = "Cache::Memcached not found";
+}
+my $HOST = exists $ENV{'host'} ? $ENV{'host'} : "127.0.0.1";
+my $PORT = exists $ENV{'port'} ? $ENV{'port'} : 11211;
+if ( exists $ARGV[0] and $ARGV[0] eq "autoconf" ) {
+ if ($ret) {
+ print "no ($ret)\n";
+ exit 1;
+ }
+# Todo: we can always connect to a memcache server without any errors so I cannot really
+# find a way to detect the presence of a memcache instance. Maybe a forced write/read/delete
+# but there should be a better way somewhere...
+ print "yes\n";
+ exit 0;
+}
+
+if($ret) {
+ print "no ($ret)\n";
+ exit 1;
+}
+
+# We do everything by this array
+my %all_vars = (
+ rates => {
+ master => {
+ graph_title => 'Memcached - Commands',
+ graph_args => '--base 1000',
+ graph_vlabel => '/${graph_period}',
+ graph_category => 'memcache',
+ },
+ memcache_cache_hits => {
+ label => 'Cache hits',
+ type => 'DERIVE',
+ min => '0',
+ max => '5000',
+ draw => 'LINE2',
+ info => 'Number of cache hits',
+ stat_group => 'misc',
+ stat_name => 'get_hits'
+ },
+ memcache_cache_misses => {
+ label => 'Cache misses',
+ type => 'DERIVE',
+ min => '0',
+ max => '5000',
+ draw => 'LINE2',
+ info => 'Number of cache misses',
+ stat_group => 'misc',
+ stat_name => 'get_misses'
+ },
+ memcache_cmd_get => {
+ label => 'GET requests',
+ type => 'DERIVE',
+ min => '0',
+ max => '5000',
+ draw => 'LINE2',
+ info => 'Number of GET commands seen',
+ stat_group => 'misc',
+ stat_name => 'cmd_get'
+ },
+ memcache_cmd_set => {
+ label => 'SET requests',
+ type => 'DERIVE',
+ min => '0',
+ max => '5000',
+ draw => 'LINE2',
+ info => 'Number of SET commands seen',
+ stat_group => 'misc',
+ stat_name => 'cmd_set'
+ },
+ memcache_total_items => {
+ label => 'New items*5',
+ type => 'DERIVE',
+ min => '0',
+ max => '5000',
+ draw => 'LINE2',
+ info => 'New items*5',
+ cdef => 'memcache_total_items,5,*',
+ stat_group => 'misc',
+ stat_name => 'total_items'
+ },
+ memcache_total_connections => {
+ label => 'New connections*100',
+ type => 'DERIVE',
+ min => '0',
+ max => '5000',
+ cdef => 'memcache_total_connections,100,*',
+ draw => 'LINE2',
+ info => 'New connections*100',
+ stat_group => 'misc',
+ stat_name => 'total_connections'
+ },
+ },
+ bytes => {
+ master => {
+ graph_title => 'Memcached - Network traffic',
+ graph_args => '--base 1000',
+ graph_vlabel => 'bytes in(-)/out(+) per ${graph_period}',
+ graph_category => 'memcache',
+ },
+ memcache_bytes_read => {
+ label => 'Bytes read',
+ type => 'COUNTER',
+ draw => 'LINE2',
+ max => '1000000',
+ info => 'Bytes read from network',
+ graph => 'no',
+ stat_group => 'misc',
+ stat_name => 'bytes_read'
+ },
+ memcache_bytes_written => {
+ label => 'Bytes written',
+ negative => 'memcache_bytes_read',
+ type => 'COUNTER',
+ max => '1000000',
+ draw => 'LINE2',
+ info => 'Bytes written to network',
+ stat_group => 'misc',
+ stat_name => 'bytes_written'
+ },
+ },
+ counters => {
+ master => {
+ graph_title => 'Memcached - Current values',
+ graph_args => '--base 1000',
+ #graph_args => '--base 1000 --loga',
+ graph_vlabel => 'Totals',
+ graph_category => 'memcache',
+ graph_scale => 'no',
+ },
+ memcache_curr_items => {
+ label => 'Current items',
+ type => 'GAUGE',
+ min => '0',
+ draw => 'LINE2',
+ info => 'Number of items in cache',
+ stat_group => 'misc',
+ stat_name => 'curr_items'
+ },
+ memcache_curr_connections => {
+ label => 'Current connections*100',
+ type => 'GAUGE',
+ min => '0',
+ draw => 'LINE2',
+ cdef => 'memcache_curr_connections,100,*',
+ info => 'Number of connections*100',
+ stat_group => 'misc',
+ stat_name => 'curr_connections'
+ },
+ memcache_bytes_allocated => {
+ label => 'Bytes allocated (KiB)',
+ type => 'GAUGE',
+ min => '0',
+ draw => 'LINE2',
+ cdef => 'memcache_bytes_allocated,1024,/',
+ info => 'Bytes allocated (KiB)',
+ stat_group => 'misc',
+ stat_name => 'bytes'
+ },
+ }
+ );
+
+$0 =~ /memcached_(.+)*$/;
+my $func = $1;
+exit 2 unless defined $func;
+my %vars = %{$all_vars{$func}};
+
+# STAT rusage_user 3941.052868
+# STAT rusage_system 18436.366246
+# STAT connection_structures 1112
+# STAT bytes 382985002
+# STAT limit_maxbytes 536870912
+
+if ( exists $ARGV[0] and $ARGV[0] eq "config" ) {
+ my %v = %{$vars{'master'}};
+ foreach my $k ( keys %v ) {
+ print "$k ".$v{$k}."\n"
+ }
+ print 'graph_order ';
+ foreach my $k ( sort(keys %vars) ) {
+ if($k eq 'master') { next; }
+ print $k." ";
+ }
+ print "\n";
+ foreach my $k ( sort(keys %vars) ) {
+ if($k eq 'master') { next; }
+ my %v = %{$vars{$k}};
+ foreach my $k2 (keys %v) {
+ if($k2 eq 'stat_group' or $k2 eq 'stat_name') { next; }
+ print "$k.$k2 ".$v{"$k2"}."\n";
+ }
+ }
+ exit 0;
+}
+my $mc = new Cache::Memcached { 'servers' => [ "$HOST:$PORT" ] };
+my $stats = $mc->stats ('misc');
+
+foreach my $k ( sort(keys %vars) ) {
+ if($k eq 'master') { next; }
+ my %v = %{$vars{$k}};
+ if($v{type} eq 'COMPUTE') { next; }
+ my $sg = $v{stat_group};
+ my $sn = $v{stat_name};
+ my $value = $stats->{hosts}->{"$HOST:$PORT"}->{$sg}->{$sn};
+ defined($value) or $value = 'U';
+ print "$k.value ".$value."\n";
+}
+# vim:syntax=perl ts=4 sw=4:
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/mhttping.in
^
|
@@ -125,7 +125,7 @@
next if ($file =~ /^\./) ;
print "$file.label $file\n" ;
print "$file.type GAUGE\n" ;
- print "$file.warn $timeout\n" ;
+ print "$file.warning $timeout\n" ;
} # end for $file
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/multigraph_tester.in
^
|
@@ -3,42 +3,10 @@
#%# family=test
#%# capabilities=autoconf
-# The two is_ functions should be put in plugin.sh and Munin::Plugin
+. $MUNIN_LIBDIR/plugins/plugin.sh || exit 1
-# Hardwire capabilities until node fully interacts with them.
-MUNIN_CAP_MULTIGRAPH=1
-# MUNIN_CAP_DIRTYCONFIG=1
-
-is_multigraph () {
- # echo Testing $MUNIN_CAP_MULTIGRAPH:$1
- case $MUNIN_CAP_MULTIGRAPH:$1 in
- 1:*) return;; # Yes! Rock and roll!
-
- *:autoconf)
- echo 'no (no multigraph support)'
- exit 0
- ;;
-
- *:config)
- echo 'graph_title This plugin needs multigraph support'
- echo 'multigraph.label No multigraph here'
- echo 'multigraph.info This plugin has been installed in a munin-node that is too old to know about multigraph plugins. Even if your munin master understands multigraph plugins this is not enough, the node too needs to be new enough. Version 1.4.0 or later should work.'
- exit 0
- ;;
-
- *: ) echo 'multigraph.value 0'
- exit 0
- ;;
- esac
-}
-
-is_dirtyconfig () {
- # Detect if node/server supports dirty config
- case $MUNIN_CAP_DIRTYCONFIG in
- 1) exit 1;;
- *) exit 0;;
- esac
-}
+# Handle the case where the munin node does not understand multigraph.
+is_multigraph "$@"
# Plugin itself starts here
@@ -75,6 +43,8 @@
graph_info The root graph is used to click into sub-graph page. Eventually the root graph should be able to borrow data from the sub graphs in a fairly easy manner. But not right now.
one.label number 1
two.label number 2
+two.warning 0:100
+two.critical 0:1000
three.label number 3
#
multigraph multigraph_tester.en
@@ -89,16 +59,15 @@
multigraph multigraph_tester.tre
graph_title The number 3 sub-graph
three.label number 3
+three.warning 0:1
+three.critical 0:5
#
multigraph multigraph_outofscope
graph_title The out of namespace graph
-graph_info The "multigraph protocol keyword allows the plugin to place data anywhere in the host/node namespace. The intended use is to be able to produce multiple root graphs and sub-graph spaces, but this is not enforced.
+graph_info The "multigraph protocol keyword allows the plugin to place data anywhere in the host namespace. The intended use is to be able to produce multiple root graphs and sub-graph spaces, but as you see it needs not have a sub-graph space at all.
i.label number i
EOF
- if is_dirtyconfig; then
- do_
- fi
exit 0
}
@@ -107,8 +76,6 @@
exit 0
}
-is_multigraph "$@"
-
# Main is here
do_$1 2>/dev/null || {
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/munin_stats.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_stats.in 2620 2009-10-20 17:14:22Z ligne $
+# $Id: munin_stats.in 2940 2009-11-10 14:22:08Z feiner.tom $
#
# Magic markers (used by munin-node-configure and some installation scripts):
#%# family=auto
@@ -29,18 +29,25 @@
use Munin::Plugin;
my @logs = qw/update graph html limits/;
-my $logdir = $ENV{'MUNIN_LOGDIR'} || '@@LOGDIR@@';
+my $logdir = ($ENV{'logdir'} || $ENV{'MUNIN_LOGDIR'} || '@@LOGDIR@@');
if ($ARGV[0] and $ARGV[0] eq 'autoconf') {
- foreach my $log (@logs) {
- my $update = "$logdir/munin-$log.log";
- unless ( -r $update) {
- print "no (Can't read $update)\n";
- exit 0;
- }
- }
- print "yes";
- exit 0;
+ my $munin_update_location =
+ "$Munin::Common::Defaults::MUNIN_LIBDIR/munin-update";
+
+ if (! -e $munin_update_location) {
+ print "no (munin-update was not found at $munin_update_location).\n";
+ exit 0;
+ }
+
+ if (! -x $munin_update_location) {
+ print "no ($munin_update_location was found, but is not executable)\n";
+ exit 0;
+ }
+ else {
+ print "yes\n";
+ exit 0;
+ }
}
if ($ARGV[0] and $ARGV[0] eq "config") {
@@ -56,7 +63,6 @@
exit 0;
}
-
my %positions = restore_state();
my %times;
@@ -64,6 +70,12 @@
my $logfile = "$logdir/munin-$log.log";
my $time = 'U';
+ if (! -r $logfile) {
+ print "$log.extinfo Can't open $logfile for reading\n";
+ print "$log.value $time\n";
+ next;
+ }
+
if (exists $positions{$log}) {
my ($LOGFILE, undef) = tail_open($logfile, $positions{$log});
while (<$LOGFILE>) {
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/plugins/node.d/mysql_.in
^
|
@@ -0,0 +1,1283 @@
+#!@@PERL@@
+# -*- perl -*-
+
+=encoding utf8
+
+=head1 NAME
+
+mysql_ - Munin plugin to display misc MySQL server status
+
+=head1 APPLICABLE SYSTEMS
+
+Any MySQL platform, tested by the author on MySQL 5.1.29 and 5.0.51
+
+=head1 CONFIGURATION
+
+This script is used to generate data for several graphs. To generate
+data for one specific graph, you need to create a symbolic link with a
+name like mysql_<GRAPH> to this script.
+
+To get a list of symlinks that can be created, run:
+
+ ./mysql_ suggest
+
+In addition you might need to specify connection parameters in the
+plugin configuration to override the defaults. These are the defaults:
+
+ [mysql_*]
+ env.mysqlconnection DBI:mysql:mysql
+ env.mysqluser root
+
+Non-default example:
+
+ [mysql_*]
+ env.mysqlconnection DBI:mysql:mysql;host=127.0.0.1;port=3306
+ env.mysqluser root
+ env.mysqlpassword geheim
+
+
+=head1 DEPENDENCIES
+
+=over
+
+=item Cache::Cache
+
+The plugin uses shared memory to cache the statistics gathered from
+MySQL. This ensures minimal inpact on the MySQL server.
+
+=item DBD::Mysql
+
+=back
+
+=head1 INTERPRETATION
+
+=head2 InnoDB
+
+The statistics from innodb are mainly collected from the command
+
+ SHOW ENGINE INNODB STATUS
+
+A nice walk through is found at
+L<http://www.mysqlperformanceblog.com/2006/07/17/show-innodb-status-walk-through/>
+
+=head2 The graphs
+
+FIX point to relevant sections in the MySQL manual and other www
+resources for each graph
+
+=over
+
+=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.
+
+=back
+
+=head1 LICENSE
+
+Copyright (C) 2008,2009 Kjell-Magne Øierud
+
+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.
+
+=head1 VERSION
+
+git-master + a few munin modifications
+
+This plugin was downloaded from L<http://github.com/kjellm/munin-mysql/>
+
+=head1 MAGICK MARKERS
+
+ #%# family=auto
+ #%# capabilities=suggest autoconf
+
+=cut
+
+use warnings;
+use strict;
+use utf8;
+
+use DBI;
+use File::Basename;
+use Math::BigInt; # Used to append "=> lib 'GMP'" here, but GMP caused
+ # segfault on some occasions. Removed as I don't
+ # think the tiny performance boost is worth the
+ # debugging effort.
+
+my $has_cache;
+
+BEGIN {
+ eval 'require Cache::SharedMemoryCache';
+ $has_cache = $@ ? 0 : 1;
+}
+
+
+#---------------------------------------------------------------------
+# C O N F I G
+#---------------------------------------------------------------------
+
+my %config = (
+ 'dsn' => $ENV{'mysqlconnection'} || 'DBI:mysql:mysql',
+ 'user' => $ENV{'mysqluser'} || 'root',
+ 'password' => $ENV{'mysqlpassword'} || '',
+);
+
+
+#---------------------------------------------------------------------
+# C A C H E
+#---------------------------------------------------------------------
+
+my %cache_options = (
+ 'namespace' => 'munin_mysql',
+ 'default_expires_in' => 60,
+);
+
+my $shared_memory_cache ;
+if ($has_cache)
+{
+ $shared_memory_cache = Cache::SharedMemoryCache->new(\%cache_options)
+ or die("Couldn't instantiate SharedMemoryCache");
+}
+
+#---------------------------------------------------------------------
+# G R A P H D E F I N I T I O N S
+#---------------------------------------------------------------------
+
+# These are defaults to save typing in the graph definitions
+my %defaults = (
+ global_attrs => {
+ args => '--base 1000',
+ },
+ data_source_attrs => {
+ min => '0',
+ type => 'DERIVE',
+ draw => 'AREASTACK',
+ },
+);
+
+# %graphs contains the graph definitions, it is indexed on the graph
+# name. The information stored for each graph is used for both showing
+# data source values and for printing the graph configuration. Each
+# graph follows the followingformat:
+#
+# $graph{NAME} => {
+# config => {
+# # The global attributes for this graph
+# global_attrs => {}
+# # Attributes common to all data sources in this graph
+# data_source_attrs => {}
+# },
+# data_sources => [
+# # NAME - The name of the data source (e.g. variable names
+# # from SHOW STATUS)
+# # DATA_SOURCE_ATTRS - key-value pairs with data source
+# # attributes
+# {name => 'NAME', (DATA_SOURCE_ATTRS)},
+# {...},
+# ],
+my %graphs = ();
+
+#---------------------------------------------------------------------
+
+$graphs{bin_relay_log} = {
+ config => {
+ global_attrs => {
+ title => 'Binary/Relay Logs',
+ vlabel => 'Log activity',
+ },
+ data_source_attrs => {
+ draw => 'LINE1',
+ },
+ },
+ data_sources => [
+ {name => 'Binlog_cache_disk_use', label => 'Binlog Cache Disk Use'},
+ {name => 'Binlog_cache_use', label => 'Binlog Cache Use'},
+ {name => 'ma_binlog_size', label => 'Binary Log Space'},
+ {name => 'relay_log_space', label => 'Relay Log Space'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{commands} = {
+ config => {
+ global_attrs => {
+ title => 'Command Counters',
+ vlabel => 'Commands per ${graph_period}',
+ total => 'Questions',
+ },
+ data_source_attrs => {},
+ },
+ data_sources => [
+ {name => 'Com_delete', label => 'Delete'},
+ {name => 'Com_insert', label => 'Insert'},
+ {name => 'Com_insert_select', label => 'Insert select'},
+ {name => 'Com_load', label => 'Load Data'},
+ {name => 'Com_replace', label => 'Replace'},
+ {name => 'Com_replace_select', label => 'Replace select'},
+ {name => 'Com_select', label => 'Select'},
+ {name => 'Com_update', label => 'Update'},
+ {name => 'Com_update_multi', label => 'Update multi'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{connections} = {
+ config => {
+ global_attrs => {
+ title => 'Connections',
+ vlabel => 'Connections per ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE1',
+ },
+ },
+ data_sources => [
+ {name => 'max_connections', label => 'Max connections',
+ type => 'GAUGE',
+ draw => 'AREA',
+ colour => 'cdcfc4'},
+ {name => 'Max_used_connections', label => 'Max used',
+ type => 'GAUGE',
+ draw => 'AREA',
+ colour => 'ffd660'},
+ {name => 'Aborted_clients', label => 'Aborted clients'},
+ {name => 'Aborted_connects', label => 'Aborted connects'},
+ {name => 'Threads_connected', label => 'Threads connected',
+ type => 'GAUGE'},
+ {name => 'Connections', label => 'New connections'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{files_tables} = {
+ config => {
+ global_attrs => {
+ title => 'Files and tables',
+ vlabel => 'Tables',
+ },
+ data_source_attrs => {
+ type => 'GAUGE',
+ draw => 'LINE1',
+ },
+ },
+ data_sources => [
+ {name => 'table_open_cache', label => 'Table cache',
+ draw => 'AREA',
+ colour => 'cdcfc4'},
+ {name => 'Open_files', label => 'Open files'},
+ {name => 'Open_tables', label => 'Open tables'},
+ {name => 'Opened_tables', label => 'Opened tables',
+ type => 'GAUGE'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{innodb_bpool} = {
+ config => {
+ global_attrs => {
+ title => 'InnoDB Buffer Pool',
+ vlabel => 'Pages',
+ base => '1024',
+ },
+ data_source_attrs => {
+ draw => 'LINE2',
+ type => 'GAUGE',
+ },
+ },
+ data_sources => [
+ {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_modpages', label => 'Modified pages'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{innodb_bpool_act} = {
+ config => {
+ global_attrs => {
+ title => 'InnoDB Buffer Pool Activity',
+ vlabel => 'Activity per ${graph_period}',
+ total => 'Total',
+ },
+ data_source_attrs => {
+ draw => 'LINE2',
+ },
+ },
+ data_sources => [
+ {name => 'ib_bpool_read', label => 'Pages read'},
+ {name => 'ib_bpool_created', label => 'Pages created'},
+ {name => 'ib_bpool_written', label => 'Pages written'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{innodb_insert_buf} = {
+ config => {
+ global_attrs => {
+ title => 'InnoDB Insert Buffer',
+ vlabel => 'Activity per ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE1',
+ },
+ },
+ data_sources => [
+ {name => 'ib_ibuf_inserts', label => 'Inserts'},
+ {name => 'ib_ibuf_merged_rec', label => 'Merged Records'},
+ {name => 'ib_ibuf_merges', label => 'Merges'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{innodb_io} = {
+ config => {
+ global_attrs => {
+ title => 'InnoDB IO',
+ vlabel => 'IO operations per ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE1',
+ },
+ },
+ data_sources => [
+ {name => 'ib_io_read', label => 'File reads'},
+ {name => 'ib_io_write', label => 'File writes'},
+ {name => 'ib_io_log', label => 'Log writes'},
+ {name => 'ib_io_fsync', label => 'File syncs'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{innodb_io_pend} = {
+ config => {
+ global_attrs => {
+ title => 'InnoDB IO Pending',
+ vlabel => 'Pending operations',
+ },
+ data_source_attrs => {
+ draw => 'LINE1',
+ },
+ },
+ data_sources => [
+ {name => 'ib_iop_log', label => 'AIO Log'},
+ {name => 'ib_iop_sync', label => 'AIO Sync'},
+ {name => 'ib_iop_flush_bpool', label => 'Buf Pool Flush'},
+ {name => 'ib_iop_flush_log', label => 'Log Flushes'},
+ {name => 'ib_iop_ibuf_aio', label => 'Insert Buf AIO Read'},
+ {name => 'ib_iop_aioread', label => 'Normal AIO Reads'},
+ {name => 'ib_iop_aiowrite', label => 'Normal AIO Writes'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{innodb_log} = {
+ config => {
+ global_attrs => {
+ title => 'InnoDB Log',
+ vlabel => 'Log activity per ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE1',
+ },
+ },
+ data_sources => [
+ {name => 'innodb_log_buffer_size', label => 'Buffer Size',
+ type => 'GAUGE',
+ draw => 'AREA',
+ colour => 'fafd9e'},
+ {name => 'ib_log_flush', label => 'KB Flushed'},
+ {name => 'ib_log_written', label => 'KB Written'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{innodb_rows} = {
+ config => {
+ global_attrs => {
+ title => 'InnoDB Row Operations',
+ vlabel => 'Operations per ${graph_period}',
+ total => 'Total',
+ },
+ data_source_attrs => {},
+ },
+ data_sources => [
+ {name => 'Innodb_rows_deleted', label => 'Deletes'},
+ {name => 'Innodb_rows_inserted', label => 'Inserts'},
+ {name => 'Innodb_rows_read', label => 'Reads'},
+ {name => 'Innodb_rows_updated', label => 'Updates'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{innodb_semaphores} = {
+ config => {
+ global_attrs => {
+ title => 'InnoDB Semaphores',
+ vlabel => 'Semaphores per ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE1',
+ },
+ },
+ data_sources => [
+ {name => 'ib_spin_rounds', label => 'Spin Rounds'},
+ {name => 'ib_spin_waits', label => 'Spin Waits'},
+ {name => 'ib_os_waits', label => 'OS Waits'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{innodb_tnx} = {
+ config => {
+ global_attrs => {
+ title => 'InnoDB Transactions',
+ vlabel => 'Transactions per ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE1',
+ },
+ },
+ data_sources => [
+ {name => 'ib_tnx', label => 'Transactions created'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{myisam_indexes} = {
+ config => {
+ global_attrs => {
+ title => 'MyISAM Indexes',
+ vlabel => 'Requests per ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE2',
+ },
+ },
+ data_sources => [
+ {name => 'Key_read_requests', label => 'Key read requests'},
+ {name => 'Key_reads', label => 'Key reads'},
+ {name => 'Key_write_requests', label => 'Key write requests'},
+ {name => 'Key_writes', label => 'Key writes'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{network_traffic} = {
+ config => {
+ global_attrs => {
+ title => 'Network Traffic',
+ args => '--base 1024',
+ vlabel => 'Bytes received (-) / sent (+) per ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE2',
+ },
+ },
+ data_sources => [
+ {name => 'Bytes_received', label => 'Bytes transfered',
+ graph => 'no'},
+ {name => 'Bytes_sent', label => 'Bytes transfered',
+ negative => 'Bytes_received'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{qcache} = {
+ config => {
+ global_attrs => {
+ title => 'Query Cache',
+ vlabel => 'Commands per ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE1',
+ },
+ },
+ data_sources => [
+ {name => 'Qcache_queries_in_cache', label => 'Queries in cache'},
+ {name => 'Qcache_hits', label => 'Cache hits'},
+ {name => 'Qcache_inserts', label => 'Inserts'},
+ {name => 'Qcache_not_cached', label => 'Not cached'},
+ {name => 'Qcache_lowmem_prunes', label => 'Low-memory prunes'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{qcache_mem} = {
+ config => {
+ global_attrs => {
+ title => 'Query Cache Memory',
+ vlabel => 'Bytes',
+ args => '--base 1024 --lower-limit 0',
+ },
+ data_source_attrs => {
+ draw => 'AREA',
+ type => 'GAUGE',
+ },
+ },
+ data_sources => [
+ {name => 'query_cache_size', label => 'Cache size'},
+ {name => 'Qcache_free_memory', label => 'Free mem'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{replication} = {
+ config => {
+ global_attrs => {
+ title => 'Replication',
+ vlabel => 'Activity',
+ },
+ data_source_attrs => {
+ draw => 'LINE1',
+ },
+ },
+ data_sources => [
+ {name => 'slave_running', label => 'Slave Running',
+ type => 'GAUGE',
+ draw => 'AREA'},
+ {name => 'slave_stopped', label => 'Slave Stopped',
+ type => 'GAUGE',
+ draw => 'AREA'},
+ {name => 'Slave_retried_transactions', label => 'Retried Transactions'},
+ {name => 'Slave_open_temp_tables', label => 'Open Temp Tables'},
+ {name => 'seconds_behind_master', label => 'Secs Behind Master',
+ type => 'GAUGE'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{select_types} = {
+ config => {
+ global_attrs => {
+ title => 'Select types',
+ vlabel => 'Commands per ${graph_period}',
+ total => 'Total',
+ },
+ data_source_attrs => {},
+ },
+ data_sources => [
+ {name => 'Select_full_join', label => 'Full join'},
+ {name => 'Select_full_range_join', label => 'Full range'},
+ {name => 'Select_range', label => 'Range'},
+ {name => 'Select_range_check', label => 'Range check'},
+ {name => 'Select_scan', label => 'Scan'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{slow} = {
+ config => {
+ global_attrs => {
+ title => 'Slow Queries',
+ vlabel => 'Slow queries per ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE2',
+ },
+ },
+ data_sources => [
+ {name => 'Slow_queries', label => 'Slow queries'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{sorts} = {
+ config => {
+ global_attrs => {
+ title => 'Sorts',
+ vlabel => 'Sorts / ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE2',
+ },
+ },
+ data_sources => [
+ {name => 'Sort_rows', label => 'Rows sorted'},
+ {name => 'Sort_range', label => 'Range'},
+ {name => 'Sort_merge_passes', label => 'Merge passes'},
+ {name => 'Sort_scan', label => 'Scan'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{table_locks} = {
+ config => {
+ global_attrs => {
+ title => 'Table locks',
+ vlabel => 'locks per ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE2',
+ },
+ },
+ data_sources => [
+ {name => 'Table_locks_immediate', label => 'Table locks immed'},
+ {name => 'Table_locks_waited', label => 'Table locks waited'},
+ ],
+};
+
+#---------------------------------------------------------------------
+
+$graphs{tmp_tables} = {
+ config => {
+ global_attrs => {
+ title => 'Temporary objects',
+ vlabel => 'Objects per ${graph_period}',
+ },
+ data_source_attrs => {
+ draw => 'LINE2',
+ },
+ },
+ data_sources => [
+ {name => 'Created_tmp_disk_tables', label => 'Temp disk tables'},
+ {name => 'Created_tmp_tables', label => 'Temp tables'},
+ {name => 'Created_tmp_files', label => 'Temp files'},
+ ],
+};
+
+
+#---------------------------------------------------------------------
+# M A I N
+#---------------------------------------------------------------------
+
+
+#
+# Global hash holding the data collected from mysql.
+#
+our $data; # Was 'my'. Changed to 'our' to facilitate testing.
+
+
+sub main {
+ my $graph = substr(basename($0), length('mysql_'));
+ my $command = $ARGV[0] || 'show';
+
+ my %command_map = (
+ 'autoconf' => \&autoconf,
+ 'config' => \&config,
+ 'show' => \&show,
+ 'suggest' => \&suggest,
+ );
+
+ die "Unknown command: $command"
+ unless exists $command_map{$command};
+
+ die "Missing dependency Cache::Cache"
+ unless $has_cache || $command eq 'autoconf';
+
+ return $command_map{$command}->($graph);
+}
+
+
+#---------------------------------------------------------------------
+# C O M M A N D H A N D L E R S
+#---------------------------------------------------------------------
+
+# Each command handler should return an apropriate exit code
+
+
+# http://munin.projects.linpro.no/wiki/ConcisePlugins#autoconf
+sub autoconf {
+ unless ($has_cache) {
+ print "no (Missing dependency Cache::Cache)\n";
+ return 1;
+ }
+
+ eval {
+ db_connect();
+ };
+ if ($@) {
+ my $err = $@;
+ $err =~ s{\s at \s \S+ \s line .*}{}xms;
+ print "no ($err)\n";
+ return 1;
+ }
+ print "yes\n";
+ return 0;
+}
+
+
+# http://munin.projects.linpro.no/wiki/ConcisePlugins#suggest
+sub suggest {
+
+ # What is the best way to decide which graphs is applicable to a
+ # given system?
+ #
+ # Does the database use InnoDB? A zero count from:
+ #
+ # SELECT COUNT(*)
+ # FROM tables
+ # WHERE table_type = 'base table'
+ # AND engine = 'innodb'
+ #
+ # Does the database use binary logs? 'OFF' as the result from:
+ #
+ # SHOW GLOBAL variables LIKE 'log_bin'
+ #
+ # Is the database setup as a slave? Empty result from:
+ #
+ # SHOW SLAVE STATUS
+
+ local $_;
+ print "mysql_$_\n" for (sort keys(%graphs));
+
+ return 0;
+}
+
+
+sub config {
+ my $graph_name = shift;
+
+ # In MySQL 5.1 (and probably erlier versions as well) status
+ # variables are unique when looking at the last 19 characters.
+ #
+ # SELECT RIGHT(variable_name, 19), COUNT(*)
+ # FROM information_schema.global_status
+ # GROUP BY RIGHT(variable_name, 19)
+ # HAVING COUNT(*) > 1;
+ #
+ # Empty set (0.06 sec)
+ #
+ # There is one duplicate when looking at server variables
+ #
+ # SELECT RIGHT(variable_name, 19), COUNT(*)
+ # FROM information_schema.global_variables
+ # GROUP BY RIGHT(variable_name, 19)
+ # HAVING COUNT(*) > 1;
+ #
+ # +--------------------------+----------+
+ # | RIGHT(variable_name, 19) | COUNT(*) |
+ # +--------------------------+----------+
+ # | OW_PRIORITY_UPDATES | 2 |
+ # +--------------------------+----------+
+ # 1 row in set (0.05 sec)
+ #
+ # show global variables like '%OW_PRIORITY_UPDATES';
+ #
+ # +--------------------------+-------+
+ # | Variable_name | Value |
+ # +--------------------------+-------+
+ # | low_priority_updates | OFF |
+ # | sql_low_priority_updates | OFF |
+ # +--------------------------+-------+
+ # 2 rows in set (0.00 sec)
+ #
+ # Not a problem since we don't graph these
+
+ die 'Unknown graph ' . ($graph_name ? $graph_name : '')
+ unless $graphs{$graph_name};
+
+ my $graph = $graphs{$graph_name};
+
+ my %conf = (%{$defaults{global_attrs}}, %{$graph->{config}{global_attrs}});
+ while (my ($k, $v) = each %conf) {
+ print "graph_$k $v\n";
+ }
+ print "graph_category mysql2\n";
+
+ my $i = 0;
+ for my $ds (@{$graph->{data_sources}}) {
+ my %ds_spec = (
+ %{$defaults{data_source_attrs}},
+ %{$graph->{config}{data_source_attrs}},
+ %$ds,
+ );
+ while (my ($k, $v) = each %ds_spec) {
+ # 'name' is only used internally in this script, not
+ # understood by munin.
+ next if ($k eq 'name');
+
+ # AREASTACK is part of munin as of version 1.3.3 (not
+ # released yet). Until then ...
+ if ($k eq 'draw' && $v eq 'AREASTACK') {
+ printf("%s.%s %s\n",
+ clean_fieldname($ds->{name}), $k, ($i ? 'STACK' : 'AREA'));
+ }
+ else {
+ printf("%s.%s %s\n", clean_fieldname($ds->{name}), $k, $v);
+ }
+ $i++;
+ }
+ }
+
+ return 0;
+}
+
+sub show {
+ my $graph_name = shift;
+
+ die 'Unknown graph ' . ($graph_name ? $graph_name : '')
+ unless $graphs{$graph_name};
+
+ my $graph = $graphs{$graph_name};
+
+ update_data();
+
+ die "Can't show data for '$graph_name' because InnoDB is disabled."
+ if $graph_name =~ /innodb_/ && $data->{_innodb_disabled};
+
+ for my $ds (@{$graph->{data_sources}}) {
+ printf "%s.value %s\n",
+ clean_fieldname($ds->{name}), $data->{$ds->{name}};
+ }
+
+ return 0;
+}
+
+
+
+#---------------------------------------------------------------------
+# U T I L I T Y S U B S
+#---------------------------------------------------------------------
+
+
+sub db_connect {
+ my $dsn = "$config{dsn};mysql_connect_timeout=5";
+
+ return DBI->connect($dsn, $config{user}, $config{password}, {
+ RaiseError => 1,
+ PrintError => 0,
+ FetchHashKeyName => 'NAME_lc',
+ });
+}
+
+
+sub update_data {
+ $data = $shared_memory_cache->get('data');
+ return if $data;
+
+ #warn "Need to update cache";
+
+ $data = {};
+
+ my $dbh = db_connect();
+
+ # Set up defaults in case the server is not a slave
+ $data->{relay_log_space} = 0;
+ $data->{slave_running} = 0;
+ $data->{slave_stopped} = 0;
+
+ # Set up defaults in case binlog is not enabled
+ $data->{ma_binlog_size} = 0;
+
+ update_variables($dbh);
+ update_innodb($dbh);
+ update_master($dbh);
+ update_slave($dbh);
+
+ $shared_memory_cache->set('data', $data);
+}
+
+
+sub update_variables {
+ my ($dbh) = @_;
+ my @queries = (
+ 'SHOW GLOBAL STATUS',
+ 'SHOW GLOBAL VARIABLES',
+ );
+
+ my %variable_name_map = (
+ table_cache => 'table_open_cache', # table_open_cache was
+ # previously known as
+ # table_cache in MySQL
+ # 5.1.2 and earlier.
+ );
+
+ for my $query (@queries) {
+ $data->{$query} = {};
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute();
+ while (my $row = $sth->fetch) {
+ my $var = $variable_name_map{$row->[0]} || $row->[0];
+ $data->{$var} = $row->[1];
+ }
+ $sth->finish();
+ }
+}
+
+
+sub update_innodb {
+ my ($dbh) = @_;
+
+ my $sth = $dbh->prepare('SHOW /*!50000 ENGINE*/ INNODB STATUS');
+ eval {
+ $sth->execute();
+ };
+ if ($@) {
+ if ($@ =~ /Cannot call SHOW INNODB STATUS because skip-innodb is defined/) {
+ $data->{_innodb_disabled} = 1;
+ return;
+ }
+ die $@;
+ }
+ my $row = $sth->fetchrow_hashref();
+ my $status = $row->{'status'};
+ $sth->finish();
+
+ parse_innodb_status($status);
+}
+
+
+sub update_master {
+ my ($dbh) = @_;
+
+ my $sth = $dbh->prepare('SHOW MASTER LOGS');
+ eval {
+ $sth->execute();
+ };
+ if ($@) {
+ # SHOW MASTER LOGS failed becuase binlog is not enabled
+ return if $@ =~ /You are not using binary logging/;
+ die $@;
+ }
+
+ while (my $row = $sth->fetch) {
+ $data->{ma_binlog_size} += $row->[1];
+ }
+
+ $sth->finish();
+}
+
+
+sub update_slave {
+ my ($dbh) = @_;
+
+ my $sth = $dbh->prepare('SHOW SLAVE STATUS');
+ $sth->execute();
+ my $row = $sth->fetchrow_hashref();
+ return unless $row;
+ while (my ($k, $v) = each %$row) {
+ $data->{$k} = $v;
+ }
+ $sth->finish();
+
+ # undef when slave is stopped, or when MySQL fails to calculate
+ # the lag (which happens depresingly often). (mk-heartbeat fixes
+ # 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};
+
+
+}
+
+
+#
+# In 'SHOW ENGINE INNODB STATUS' 64 bit integers are not formated as
+# plain integers. They are either:
+#
+# - split in two and needs to be shifted together,
+# - or hexadecimal
+#
+sub innodb_bigint {
+ my ($x, $y) = @_;
+
+ return defined $y
+ ? Math::BigInt->new($x)->blsft(32) + $y
+ : 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
+#---------------------------------------------------------------------
+
+
+# A nice walk through
+# http://www.mysqlperformanceblog.com/2006/07/17/show-innodb-status-walk-through/
+
+# The parsing is split in one subrutine per section. Each subroutine
+# should parse a block with the following structure
+#
+# block body ...
+# more lines ....
+# ----------
+
+sub parse_innodb_status {
+ local $_ = shift;
+
+ # Add a dummy section to the end in case the innodb status output
+ # has been truncated (Happens for status > 64K characters)
+ $_ .= "\n----------\nDUMMY\n";
+
+ my %section_map = (
+
+ 'BUFFER POOL AND MEMORY' => \&parse_buffer_pool_and_memory,
+ 'FILE I/O' => \&parse_file_io,
+ 'INSERT BUFFER AND ADAPTIVE HASH INDEX'
+ => \&parse_insert_buffer_and_adaptive_hash_index,
+ 'LATEST DETECTED DEADLOCK' => \&skip,
+ 'LATEST FOREIGN KEY ERROR' => \&skip,
+ 'LOG' => \&parse_log,
+ 'ROW OPERATIONS' => \&skip,
+ 'SEMAPHORES' => \&parse_semaphores,
+ 'TRANSACTIONS' => \&parse_transactions,
+ 'BACKGROUND THREAD' => \&skip,
+ );
+
+ skip_heading();
+ for (;;) {
+ m/\G(.*)\n/gc;
+ my $sec = $1;
+
+ last if $sec eq 'END OF INNODB MONITOR OUTPUT';
+ if ($sec eq 'DUMMY') {
+ handle_incomplete_innodb_status();
+ last;
+ }
+
+ die "Unknown section: $1" unless exists $section_map{$sec};
+ die "Parse error. Expected a section separator" unless m/\G-+\n/gc;
+
+ $section_map{$sec}->();
+ }
+}
+
+
+# This regular expression handles the different formating of 64-bit
+# integers in different versions of the innodb engine. Either two
+# decimal 32-bit integers seperated by a space, or a single
+# hexadecimal 64-bit integer.
+my $innodb_bigint_rx = qr{([[a-fA-F\d]+)(?: (\d+))?};
+
+
+sub match_dashes { return m/\G-+\n/gc; }
+
+
+sub skip_line { return m/\G.*\n/gc; }
+
+
+sub skip_heading {
+ # Heading is 6 lines
+ for my $foo (1...6) {
+ skip_line or die('Parse error');
+ }
+}
+
+
+sub parse_section {
+ my ($parser) = @_;
+
+ #warn substr($_, pos(), 10);
+ for (;;) {
+ return if match_dashes();
+ next if $parser->();
+ skip_line();
+ }
+}
+
+
+sub skip { parse_section(sub {}); }
+
+
+sub parse_semaphores {
+ parse_section(
+ sub {
+ m/\GMutex spin waits (\d+), rounds (\d+), OS waits (\d+)\n/gc && do {
+ $data->{ib_spin_waits} = $1;
+ $data->{ib_spin_rounds} = $2;
+ $data->{ib_os_waits} = $3;
+ return 1;
+ };
+ }
+ );
+}
+
+
+sub parse_transactions {
+ parse_section(
+ sub {
+ m/\GTrx id counter $innodb_bigint_rx\n/gc && do {
+ $data->{ib_tnx} = innodb_bigint($1, $2);
+ return 1;
+ };
+ m/\GPurge done for trx's n:o < $innodb_bigint_rx undo n:o < $innodb_bigint_rx\n/gc && do {
+ if (defined $3) {
+ # old format
+ $data->{ib_tnx_prg} = innodb_bigint($1, $2);
+ # FIX add to data? innodb_bigint($3, $4);
+ }
+ else {
+ # new format
+ $data->{ib_tnx_prg} = innodb_bigint($1);
+ # FIX add to data? innodb_bigint($2);
+ }
+ return 1;
+ };
+ m/\GHistory list length (\d+)\n/gc && do {
+ $data->{ib_tnx_hist} = $1;
+ return 1;
+ };
+ }
+ );
+
+}
+
+
+sub parse_file_io {
+ parse_section(
+ sub {
+ m/\GPending normal aio reads: (\d+), aio writes: (\d+),\n\s*ibuf aio reads: (\d+), log i\/o's: (\d+), sync i\/o's: (\d+)\n/gc && do {
+ $data->{ib_iop_aioread} = $1;
+ $data->{ib_iop_aiowrite} = $2;
+ $data->{ib_iop_ibuf_aio} = $3;
+ $data->{ib_iop_log} = $4;
+ $data->{ib_iop_sync} = $5;
+ return 1;
+ };
+ m/\GPending flushes \(fsync\) log: (\d+); buffer pool: (\d+)\n/gc && do {
+ $data->{ib_iop_flush_log} = $1;
+ $data->{ib_iop_flush_bpool} = $2;
+ return 1;
+ };
+ m/\G(\d+) OS file reads, (\d+) OS file writes, (\d+) OS fsyncs\n/gc && do {
+ $data->{ib_io_read} = $1;
+ $data->{ib_io_write} = $2;
+ $data->{ib_io_fsync} = $3;
+ return 1;
+ };
+ }
+ );
+}
+
+
+sub parse_insert_buffer_and_adaptive_hash_index {
+ parse_section(
+ sub {
+ m/\G(\d+) inserts, (\d+) merged recs, (\d+) merges\n/gc && do {
+ $data->{ib_ibuf_inserts} = $1;
+ $data->{ib_ibuf_merged_rec} = $2;
+ $data->{ib_ibuf_merges} = $3;
+ return 1;
+ };
+ }
+ );
+}
+
+
+sub parse_log {
+ parse_section(
+ sub {
+ m/\GLog sequence number $innodb_bigint_rx\n/gc && do {
+ $data->{ib_log_written} = innodb_bigint($1, $2);
+ return 1;
+ };
+ m/\GLog flushed up to\s+$innodb_bigint_rx\n/gc && do {
+ $data->{ib_log_flush} = innodb_bigint($1, $2);
+ return 1;
+ };
+ m/\G(\d+) log i\/o's done.*\n/gc && do {
+ $data->{ib_io_log} = $1;
+ return 1;
+ };
+ }
+ );
+}
+
+
+sub parse_buffer_pool_and_memory {
+ parse_section(
+ sub {
+ m/\GBuffer pool size\s+(\d+)\n/gc && do {
+ $data->{ib_bpool_size} = $1;
+ return 1;
+ };
+ m/\GFree buffers\s+(\d+)\n/gc && do {
+ $data->{ib_bpool_free} = $1;
+ return 1;
+ };
+ m/\GDatabase pages\s+(\d+)\n/gc && do {
+ $data->{ib_bpool_dbpages} = $1;
+ return 1;
+ };
+ m/\GModified db pages\s+(\d+)\n/gc && do {
+ $data->{ib_bpool_modpages} = $1;
+ return 1;
+ };
+ m/\GPages read (\d+), created (\d+), written (\d+)\n/gc && do {
+ $data->{ib_bpool_read} = $1;
+ $data->{ib_bpool_created} = $2;
+ $data->{ib_bpool_written} = $3;
+ return 1;
+ };
+ }
+ );
+}
+
+
+sub handle_incomplete_innodb_status {
+
+ warn "Output from SHOW ENGINE INNDOB STATUS was truncated. "
+ . "This happens if the output of SEIS exceeds 64KB. "
+ . "Several of the InnoDB graphs might be affected by this.";
+
+ # FIX Is it possible to find some of the missing values from SHOW
+ # STATUS?
+}
+
+
+exit main() unless caller;
+
+
+1;
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/mysql_bytes.in
^
|
@@ -28,8 +28,8 @@
=head1 MAGIC MARKERS
-#%# family=auto
-#%# capabilities=autoconf
+ #%# family=manual
+ #%# capabilities=autoconf
=cut
@@ -58,6 +58,7 @@
echo 'graph_title MySQL throughput'
echo 'graph_args --base 1024'
echo 'graph_vlabel bytes received (-) / sent (+) per ${graph_period}'
+ echo 'graph_info Note that this is a old plugin which is no longer installed by default. It is retained for compatability with old installations.'
echo 'graph_category mysql'
echo 'recv.label transfer rate'
echo 'recv.type DERIVE'
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/mysql_innodb.in
^
|
@@ -87,7 +87,7 @@
=end comment
- #%# family=auto
+ #%# family=manual
#%# capabilities=autoconf
=cut
@@ -199,7 +199,14 @@
innodb_free() {
ver=$(mysql_version)
if [ "$ver" ">" "5.0" ]; then
- innodb_free_new
+ case $ver in
+ 5.0.*|5.1.?|5.1.1?|5.1.2[0123])
+ innodb_free_old
+ ;;
+ *)
+ innodb_free_new
+ ;;
+ esac
else
innodb_free_old
fi
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/mysql_isam_space_.in
^
|
@@ -6,6 +6,9 @@
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,
@@ -42,8 +45,8 @@
=end comment
- #%# family=auto
- #%# capabilities=suggest autoconf
+ #%# family=manual
+ #%# capabilities=suggest autoconf
=cut
@@ -90,6 +93,7 @@
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})
{
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/mysql_queries.in
^
|
@@ -1,8 +1,5 @@
#!@@PERL@@
# -*- perl -*-
-#
-#%# family=auto
-#%# capabilities=autoconf
=head1 NAME
@@ -41,7 +38,12 @@
=head1 VERSION
-$Id: mysql_queries.in 2293 2009-07-13 18:53:38Z ligne $
+ $Id: mysql_queries.in 2964 2009-11-12 02:28:47Z janl $
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+ #%# capabilities=autoconf
=cut
@@ -95,6 +97,7 @@
graph_args --base 1000
graph_vlabel queries / \${graph_period}
graph_category mysql
+graph_info Note that this is a old plugin which is no longer installed by default. It is retained for compatability with old installations.
graph_total total\n");
for my $key (keys %WANTED) {
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/mysql_slowqueries.in
^
|
@@ -24,7 +24,7 @@
=head1 MAGIC MARKERS
- #%# family=auto
+ #%# family=manual
#%# capabilities=autoconf
=cut
@@ -55,6 +55,8 @@
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel slow queries / ${graph_period}'
echo 'graph_category mysql'
+ echo 'graph_info Note that this is a old plugin which is no longer installed by default. It is retained for compatability with old installations.'
+
echo 'queries.label slow queries'
echo 'queries.type DERIVE'
echo 'queries.min 0'
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/mysql_threads.in
^
|
@@ -37,7 +37,7 @@
=end comment
- #%# family=auto
+ #%# family=manual
#%# capabilities=autoconf
=cut
@@ -67,6 +67,8 @@
echo 'graph_title MySQL threads'
echo 'graph_vlabel threads'
echo 'graph_category mysql'
+ echo 'graph_info Note that this is a old plugin which is no longer installed by default. It is retained for compatability with old installations.'
+
echo 'threads.label mysql threads'
echo 'graph_args --base 1000'
exit 0
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/ntp_kernel_err.in
^
|
@@ -1,23 +1,35 @@
#!@@GOODSH@@
# -*- sh -*-
-#
+
+: <<EOF
+
+=head1 NAME
+
+ntp_kernel_err - Plugin to monitor the PLL estimated error for the
+kernel NTP status
+
+=head1 CONFIGURATION
+
+No configuration
+
+=head1 AUTHORS
+
+Unknown author
+
+=head1 LICENSE
+
+Unknown license
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=cut
+
+EOF
+
# $Id: ntp_kernel_err.in,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
-#
-# Plugin to monitor the estimated error for the kernel NTP
-# status.
-#
-# Usage: Link or copy into /etc/munin/node.d/
-#
-# Magic markers (optional - only used by munin-config and some
-# installation scripts):
-#
-#%# family=auto
-#%# capabilities=autoconf
-
-# If run with the "autoconf"-parameter, give our opinion on wether we
-# should be run on this system or not. This is optinal, and only used by
-# munin-config. In the case of this plugin, we should most probably
-# always be included.
if [ "$1" = "autoconf" ]; then
# Not all ntpdc's are equal
@@ -25,7 +37,7 @@
awk 'BEGIN { ev=1; }
/^estimated error:/ { ev=0; }
END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
- exit $?
+ exit 0
fi
if [ "$1" = "config" ]; then
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/ntp_kernel_pll_freq.in
^
|
@@ -1,30 +1,49 @@
#!@@GOODSH@@
# -*- sh -*-
-#
+
+: <<EOF
+
+=head1 NAME
+
+ntp_kernel_pll_freq - Plugin to monitor the kernel's PLL frequency for
+the NTP status
+
+=head1 CONFIGURATION
+
+No configuration
+
+This plugin optionally reads the file @@CONFDIR@@/ntp-freq-comp, which
+should contain a number to be added to the frequency read by ntpdc.
+
+=head1 AUTHORS
+
+Unknown author
+
+=head1 LICENSE
+
+Unknown license
+
+=head1 BUGS
+
+Handling of $fcomp is unquoted, and may cause trouble.
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=cut
+
+EOF
+
# $Id: ntp_kernel_pll_freq.in,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
-#
-# Plugin to monitor the kernel's PLL frequency for the NTP
-# status.
-#
-# Usage: Link or copy into /etc/munin/node.d/
-#
-# Magic markers (optional - only used by munin-config and some
-# installation scripts):
-#
-#%# family=auto
-#%# capabilities=autoconf
-
-# If run with the "autoconf"-parameter, give our opinion on wether we
-# should be run on this system or not. This is optinal, and only used by
-# munin-config. In the case of this plugin, we should most probably
-# always be included.
if [ "$1" = "autoconf" ]; then
ntpdc -c kern 2>/dev/null |
awk 'BEGIN { ev=1; }
/^pll frequency:/ { ev=0; }
END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
- exit $?
+ exit 0
fi
if [ -f @@CONFDIR@@/ntp-freq-comp ]; then
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/ntp_kernel_pll_off.in
^
|
@@ -1,30 +1,42 @@
#!@@GOODSH@@
# -*- sh -*-
-#
+
+: <<EOF
+
+=head1 NAME
+
+ntp_kernel_pll_off - Plugin to monitor the kernel's PLL offset for the
+NTP status
+
+=head1 CONFIGURATION
+
+No configuration
+
+=head1 AUTHORS
+
+Unknown author
+
+=head1 LICENSE
+
+Unknown license
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=cut
+
+EOF
+
# $Id: ntp_kernel_pll_off.in,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
-#
-# Plugin to monitor the kernel's PLL offset for the NTP
-# status.
-#
-# Usage: Link or copy into /etc/munin/node.d/
-#
-# Magic markers (optional - only used by munin-config and some
-# installation scripts):
-#
-#%# family=auto
-#%# capabilities=autoconf
-
-# If run with the "autoconf"-parameter, give our opinion on wether we
-# should be run on this system or not. This is optinal, and only used by
-# munin-config. In the case of this plugin, we should most probably
-# always be included.
if [ "$1" = "autoconf" ]; then
ntpdc -c kern 2>/dev/null |
awk 'BEGIN { ev=1; }
/^pll offset:/ { ev=0; }
END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
- exit $?
+ exit 0
fi
if [ "$1" = "config" ]; then
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/ntp_states.in
^
|
@@ -1,23 +1,42 @@
#!@@PERL@@ -w
# -*- perl -*-
-#
-# Plugin to monitor NTP states
-#
-# Parameters understood:
-#
-# config (required)
-# autoconf (optional - used by lrrd-config)
-#
-# Config variables:
-#
-# lowercase - lowercase hostnames after lookup
-#
-# Magic markers - optional - used by installation scripts and
-# lrrd-config:
-#
-#%# family=manual
-#%# capabilities=autoconf
-#
+
+=head1 NAME
+
+ntp_states - Plugin to monitor NTP states
+
+=head1 CONFIGURATION
+
+No configuration
+
+This plugin must run as the user "root"
+
+The following configuration parameters are used by this plugin
+
+ [ntp_states]
+ env.lowercase - Lowercase hostnames after lookup
+
+Set the variable env.lowercase to anything lowercase hostnames.
+
+=head2 DEFAULT CONFIGURATION
+
+ [ntp_states]
+ env.lowercase <undefined>
+
+=head1 AUTHORS
+
+Unknown author
+
+=head1 LICENSE
+
+Unknown license
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+ #%# capabilities=autoconf
+
+=cut
use strict;
use Net::hostent;
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/nut_misc.in
^
|
@@ -1,13 +1,37 @@
#!@@PERL@@
# -*- perl -*-
-#
-# Plugin to monitor UPS via the upsc command
-#
-# Parameters:
-#
-# env.upsname <name@host> (default: "bertha@127.0.0.1")
-# env.upsc <command> (default: "upsc")
-#
+
+=head1 NAME
+
+nut_misc - Plugin to monitor UPS via the upsc command
+
+=head1 CONFIGURATION
+
+The following configuration parameters are used by this plugin
+
+ [nut_misc]
+ env.upsname - <name@host>
+ env.upsc - <command>
+
+=head2 DEFAULT CONFIGURATION
+
+ [nut_misc]
+ env.upsname bertha@127.0.0.1
+ env.upsc upsc
+
+=head1 AUTHORS
+
+Unknown author
+
+=head1 LICENSE
+
+Unknown license
+
+=head1 MAGIC MARKERS
+
+ #%# family=contrib
+
+=cut
use strict;
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/nutups_.in
^
|
@@ -29,7 +29,7 @@
done
fi
-function voltages() {
+voltages() {
if [ "$1" = "config" ]; then
echo "graph_title $UPS voltages"
@@ -51,7 +51,7 @@
fi
}
-function charge() {
+charge() {
if [ "$1" = "config" ]; then
echo "graph_title $UPS charge"
@@ -76,7 +76,7 @@
fi
}
-function frequency() {
+frequency() {
if [ "$1" = "config" ]; then
echo "graph_title $UPS input AC frequency"
@@ -91,7 +91,7 @@
fi
}
-function current() {
+current() {
if [ "$1" = "config" ]; then
echo "graph_title $UPS output current"
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/openvpn.in
^
|
@@ -82,7 +82,7 @@
} else {
print "no (logfile not found)\n";
}
- exit 1;
+ exit 0;
}
if ($ARGV[0] and $ARGV[0] eq "config" ){
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/pm3users_.in
^
|
@@ -1,39 +1,43 @@
#!@@PERL@@ -w
# -*- perl
-#
-# Graphs busy channels on L(ivingston|ucent) Portmaster 3 Network Access
-# Servers (maybe PM2 and PM4, too. Dunno 'bout that)...
-#
-# Usage: Copy or link into /etc/munin/plugins/
-#
-# Magic Name:
-#
-# pm3users_<hostname>
-# pm3users_<ip address>
-#
-# Requirements:
-#
-# Perl Net::SNMP
-#
-# Parameters supported:
-#
-# config (required)
-#
-# Configurable variables:
-#
-# host - Host name or IP address to poll (default: undefined)
-# port - Port number (default: 161)
-# community - SNMP read community to use (default: public)
-# maxpstn - Number of analog modems onboard the PM3 (default: 20)
-# maxisdn - Number of ISDN channels available (default: 30 == a full E1 line)
-#
-# Bugs:
-#
-# None known (I'll regret saying that, I know)
-#
-# Magic markers:
-#%# family=contrib
-#%# capabilities=
+=pod
+
+=head1 NAME
+
+pm3users_ - SNMP wildcard plugin to monitor busy channels on L(ivingston|ucent) Portmaster Network Access Servers
+
+=head1 APPLICABLE SYSTEMS
+
+L(ivingston|ucent) Portmaster 3 (maybe PM2 and PM4, too. Dunno 'bout that)...
+
+=head1 CONFIGURATION
+
+Link into plugin dir with name pm3users_<hostname> or pm3users_<ip address>
+
+ [pm3users_somewherehost]
+ env.host - Host name or IP address to poll (default: guessed from symlink, i.e. somewherehost)
+ env.port - Port number (default: 161)
+ env.community - SNMP read community to use (default: public)
+ env.maxpstn - Number of analog modems onboard the PM3 (default: 20)
+ env.maxisdn - Number of ISDN channels available (default: 30 == a full E1 line)
+
+=head1 BUGS
+
+Should be rewritten as a snmp__pm3users plugin using the Plugin::SNMP module.
+
+=head1 AUTHOR
+
+(C) 2004, Jacques Caruso
+
+=head1 LICENSE
+
+Unknown license
+
+=head1 MAGIC MARKERS
+
+ #%# family=contrib
+
+=cut
use Net::SNMP;
use strict;
@@ -74,19 +78,19 @@
print("pstn.max $maxpstn\n");
print("pstn.type GAUGE\n");
print("pstn.draw AREA\n");
+ print("pstn.colour 50f0ff\n");
print("isdn.label ISDN\n");
print("isdn.max $maxisdn\n");
print("isdn.type GAUGE\n");
print("isdn.draw STACK\n");
+ print("isdn.colour 9598dd\n");
print("total.label Total\n");
print("total.max $maxtotal\n");
print("total.type GAUGE\n");
print("total.draw LINE1\n");
+ print("total.colour 000000\n");
# These options are unsupported in the current version:
-# print("pstn.colour 50f0ff\n");
-# print("isdn.colour 9598dd\n");
-# print("total.colour 000000\n");
# print("hrules $maxpstn:ff8800:Max PSTN users,$maxisdn:ff0000:Max ISDN users\n");
exit(0);
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/postfix_mailqueue.in
^
|
@@ -18,17 +18,19 @@
=item maildrop
-Messages that have been submitted via the Postfix sendmail(1) command, but not
-yet brought into the main Postfix queue by the pickup(8) service.
+Messages that have been submitted via the Postfix sendmail(1) command,
+but not yet brought into the main Postfix queue by the pickup(8)
+service.
=item hold
-Messages placed in the "hold" queue stay there until the administrator intervenes
+Messages placed in the "hold" queue stay there until the administrator
+intervenes
=item incoming
-Inbound mail from the network, or mail picked up by the local pickup(8) daemon
-from the maildrop directory.
+Inbound mail from the network, or mail picked up by the local
+pickup(8) daemon from the maildrop directory.
=item active
@@ -50,8 +52,9 @@
=head1 CONFIGURATION
By default "postconf -h queue_directory" is used to determine the
-spool directory. This can be overridden by the "spooldir" environment
-variable like so:
+spool directory. Is postconf is not available in the $PATH then
+/var/spool/postfix is assumed. This can be overridden by the
+"spooldir" environment variable like so:
[postfix_mailqueue]
env.spooldir /var/spool/postfix
@@ -78,15 +81,18 @@
=cut
-# Can be set via environment, but default is /var/spool/postfix
-POSTCONFSPOOL=$(postconf -h queue_directory)
+# atempt to get spooldir via postconf, but environment overrides.
+
+# Remember that postconf is not available unless postfix is.
+POSTCONFSPOOL="$(postconf -h queue_directory 2>/dev/null || echo /var/spool/postfix)"
SPOOLDIR=${spooldir:-$POSTCONFSPOOL}
. $MUNIN_LIBDIR/plugins/plugin.sh
case $1 in
autoconf|detect)
- if [ -d $SPOOLDIR/ ] ; then
+
+ if [ -d $SPOOLDIR ] ; then
echo yes
exit 0
else
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/processes.in
^
|
@@ -110,6 +110,7 @@
echo "graph_info This graph shows the number of processes"
echo "graph_category processes"
echo "graph_args --base 1000 -l 0"
+ echo "graph_vlabel Number of processes"
# OS specific flags
if [ "$OPERSYS" = "Linux" ]; then
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/psu_.in
^
|
@@ -1,22 +1,45 @@
#!@@GOODSH@@
# -*- sh -*-
-#
-# Wildcard-script to monitor number of processes running as a given user.
-# To monitor a user, link psu_<program> to this file. E.g.
-#
-# ln -s /usr/share/munin/node/plugins-auto/psu_ /etc/munin/node.d/psu_munin
-#
-# ...will monitor number of processes owned by 'munin'.
-#
-# Parameters:
-#
-# config (required)
-# autoconf (optional - used by munin-config)
-# suggest (optional - used by munin-config)
-#
-# Magic markers (optional):
-#%# family=manual
-#%# capabilities=autoconf suggest
+
+: <<EOF
+
+=head1 NAME
+
+psu_ - Wildcard plugin to graph the number of processes by a given
+user.
+
+=head1 CONFIGURATION
+
+This is a wildcard plugin. The link name extension is the user name
+we wish to graph.
+
+Example:
+
+ ln -s @@LIBDIR@@/plugins/psu_ @@CONFDIR@@/plugins/psu_foo
+
+...will monitor the user "foo"
+
+=head1 AUTHORS
+
+Unknown author
+
+=head1 LICENSE
+
+Unknown license
+
+=head1 BUGS
+
+Plugin is "autoconf suggest", but "suggest" will always return no
+suggestions.
+
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+ #%# capabilities=autoconf suggest
+
+=cut
+
+EOF
name=`basename $0 | sed 's/^psu_//g'`
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/slapd_.in
^
|
@@ -1,4 +1,5 @@
#!@@PERL@@ -w
+# -*- perl -*-
# vim: ft=perl
# Copyright Bjorn Ruberg <bjorn@ruberg.no>
@@ -22,9 +23,13 @@
#%# family=auto
#%# capabilities=autoconf suggest
-# use strict;
-use Net::LDAP;
-#use Data::Dumper;
+use strict;
+
+my $ret = '';
+
+if (! eval "require Net::LDAP;") {
+ $ret = "Net::LDAP not found";
+}
use vars qw ( $config $param $act $scope $descr $cn $vlabel
$info $title $label);
@@ -162,7 +167,7 @@
for (my $i = 0 ; $i < $max ; $i++) {
my $entry = $mesg->entry ($i);
my $cn = $entry->get_value ('cn');
- $name = $action . "_" . lc ($cn);
+ my $name = $action . "_" . lc ($cn);
print "$name.label $cn\n";
print "$name.type DERIVE\n";
print "$name.min 0\n";
@@ -184,15 +189,17 @@
if ($ARGV[0]) {
if ($ARGV[0] eq 'autoconf') {
# Check for Net::LDAP
- if (! eval "require Net::LDAP;") {
- print "no (Net::LDAP not found)";
- exit 0;
- }
+ if ($ret) {
+ print "no ($ret)\n";
+ exit 0;
+ }
+
# Check for LDAP version 3
my $ldap = Net::LDAP->new ($server, version => 3)
- or do { print "no (Needs LDAPv3)\n"; exit };
+ 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 };
+ or do { print "no (Can't log in, check env file)\n"; exit 0; };
+
} elsif ($ARGV[0] eq "config") {
if ($0 =~ /slapd_([\w\d_]+)$/) {
my $action = $1;
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/slapd_bdb_cache_.in
^
|
@@ -1,5 +1,6 @@
#!@@PERL@@ -w
-
+# -*- perl -*-
+#
# Plugin copyright Bjorn Ruberg <bjorn@ruberg.no> 2005-2009
#
# Licensed under GPLv2. Be nice.
@@ -42,18 +43,15 @@
#%# family=auto
#%# capabilities=autoconf suggest
-
use strict;
use vars qw ( $measure $config $dbdir $dbstat $warning);
my $arg = shift (@ARGV);
# Finding db_stat should be done here
$dbstat = ($ENV{'dbstat'} || "/usr/bin/db4.6_stat");
-die ("Can't execute db_stat file '$dbstat'") unless -x $dbstat;
# Also the LDAP database files
$dbdir = ($ENV{'dbdir'} || "/var/lib/ldap");
-die ("Can't open database directory '$dbdir'") unless (-d $dbdir && -r $dbdir);
# And the graph title
my $title = ($ENV{'title'} || '');
@@ -76,7 +74,13 @@
if ($arg && $arg eq "config") {
$config = 1;
} elsif ($arg && $arg eq "autoconf") {
- print "yes\n";
+ if (! -x $dbstat) {
+ print "no (Can't execute db_stat file '$dbstat')\n";
+ } elsif (-d $dbdir && -r $dbdir) {
+ print "no (Can't open database directory '$dbdir')";
+ } else {
+ print "yes\n";
+ }
exit 0;
} elsif ($arg && $arg eq "suggest") {
print "pages\n";
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/smart_.in
^
|
@@ -371,11 +371,14 @@
sys.exit(0)
elif sys.argv[1]=="autoconf" :
if os.path.exists(os.getenv('smartpath','/usr/sbin/smartctl')) :
- print('yes')
+ if not find_smart_drives():
+ print('no (no drives accessible)')
+ else :
+ print('yes')
sys.exit(0)
else :
print('no (smartmontools not found)')
- sys.exit(1)
+ sys.exit(0)
elif sys.argv[1]=="suggest" :
for drive in find_smart_drives() :
print(drive)
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/snmp__fc_if_.in
^
|
@@ -130,14 +130,14 @@
print "recv.graph no\n";
print "recv.cdef recv,8,*\n";
print "recv.max 4000000000\n";
- print "recv.warn ", (-$warn), "\n" if defined $warn;
+ print "recv.warning ", (-$warn), "\n" if defined $warn;
print "send.label bps\n";
print "send.type DERIVE\n";
print "send.min 0\n";
print "send.negative recv\n";
print "send.cdef send,8,*\n";
print "send.max 4000000000\n";
- print "send.warn $warn\n" if defined $warn;
+ print "send.warning $warn\n" if defined $warn;
exit 0;
}
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/snmp__if_.in
^
|
@@ -54,7 +54,7 @@
=head1 VERSION
- $Id: snmp__if_.in 1966 2009-04-01 12:24:27Z kjellm $
+ $Id: snmp__if_.in 2835 2009-11-04 12:52:33Z janl $
=head1 BUGS
@@ -221,14 +221,14 @@
print "recv.cdef recv,8,*\n";
print "recv.max $speed\n";
print "recv.min 0\n";
- print "recv.warn ", (-$warn), "\n" if defined $warn;
+ 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.min 0\n";
- print "send.warn $warn\n" if defined $warn;
+ print "send.warning $warn\n" if defined $warn;
exit 0;
}
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/snmp__if_err_.in
^
|
@@ -48,7 +48,7 @@
=head1 VERSION
- $Id: snmp__if_err_.in 2314 2009-08-03 11:28:34Z ssm $
+ $Id: snmp__if_err_.in 2835 2009-11-04 12:52:33Z janl $
=head1 BUGS
@@ -145,12 +145,12 @@
print "recv.type DERIVE\n";
print "recv.graph no\n";
print "recv.min 0\n";
- print "recv.warn ", (-$warn), "\n" if defined $warn;
+ print "recv.warning ", (-$warn), "\n" if defined $warn;
print "send.label errors\n";
print "send.type DERIVE\n";
print "send.negative recv\n";
print "send.min 0\n";
- print "send.warn $warn\n" if defined $warn;
+ print "send.warning $warn\n" if defined $warn;
exit 0;
}
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/snmp__if_multi.in
^
|
@@ -41,17 +41,21 @@
=head1 MIB INFORMATION
This plugin requires the IF-MIB the standard IETF MIB for network
-interfaces. It reports the contents of the
+interfaces.
+
+It reports the contents of the
IF-MIB::ifHCInOctets/IF-MIB::ifHCOutOctets if available,
IF-MIB::ifInOctets/IF-MIB::ifOutOctets if not. The former are 64 bit
counters only available with SNMP 2 and later. The later are 32 bit
counters (see FEATURES below).
+For errors it reports ifInErrors + ifINDiscards and ifOutErrors +
+ifOutDiscards.
+
=head1 MAGIC MARKERS
- #%# familyyyyy=snmpauto
- #%# familyyyyy=contrib
- #%# capabilitiesssss=snmpconf
+ #%# family=snmpauto
+ #%# capabilities=snmpconf
=head1 VERSION
@@ -97,7 +101,7 @@
=head1 AUTHOR
Copyright (C) 2004-2009 Jimmy Olsen, Dagfinn Ilmari Mannsaaker,
-Nicolai Langfeldt and Redpill Linpro AS.
+Nicolai Langfeldt, Redpill Linpro AS and others.
Original snmp__if_ plugin: Copyright (C) 2004-2009 Jimmy Olsen, Dagfinn
Ilmari Mannsaaker.
@@ -107,7 +111,7 @@
Documentation, porting to Munin::Plugin::SNMP and
further grooming by Nicolai Langfeldt.
-Reworked to snmp__if_multi by Nicolai Langfeldt
+Reworked to snmp__if_multi by Nicolai Langfeldt.
=head1 LICENSE
@@ -196,16 +200,13 @@
8 => 'ifOperStatus',
10 => 'ifInOctets',
11 => 'ifInUcastPkts',
- 12 => 'ifInNUcastPkts', # Depreciated
13 => 'ifInDiscards',
14 => 'ifInErrors',
15 => 'ifUnUnknownProtos',
16 => 'ifOutOctets',
- 17 => 'ifOutUcastPkts', # Depreciated
18 => 'ifOutNUcastPkts',
19 => 'ifOutDiscards',
20 => 'ifOutErrors',
- 21 => 'ifOutQLen', # Depreciated
});
@@ -221,12 +222,54 @@
18 => 'ifAlias',
});
-sub do_config_if {
- my ($host,$version,$if) = @_;
- print "multigraph if/bytes/$if config\n";
+sub do_config_root {
+ my ($host) = @_;
- print "host_name $host\n" unless $host eq 'localhost';
+ print "multigraph if_bytes\n";
+ print "graph_title $host interface traffic\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_category network\n";
+ print "graph_info This graph shows the total traffic for $host\n";
+
+ print "send.info Bits sent/received by $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.type DERIVE\n";
+ print "send.negative recv\n";
+ print "send.cdef send,8,*\n";
+ print "send.min 0\n";
+
+ print "multigraph if_errors\n";
+ print "graph_title $host interface errors\n";
+ print "graph_order recv send\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 "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.type DERIVE\n";
+ print "send.negative recv\n";
+ print "send.cdef send,8,*\n";
+ print "send.min 0\n";
+}
+
+
+sub do_config_if {
+ my ($host,$version,$if) = @_;
my $alias = $snmpinfo->{$if}->{ifDescr} || "Interface $if";
@@ -241,6 +284,11 @@
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;
}
}
@@ -248,12 +296,7 @@
my $speed = undef;
if (defined ($speed = $snmpinfo->{$if}->{ifSpeed})) {
- $warn = $speed/8;
-
- # Warn at 1/8th of actuall speed? Or just remove warning?
- # Tempted to set warning at 80%. 80% over 5 minutes is
- # pretty busy. But probably not relevant as a warning on
- # a NFS server?
+ $warn = $speed*100/75;
my $textspeed = scaleNumber($speed,,'bps','',
'The interface speed is %.1f%s%s.');
@@ -275,6 +318,8 @@
if $version == 1;
}
+ print "multigraph if_bytes.if_$if\n";
+
print "graph_title Interface $alias traffic\n";
print "graph_order recv send\n";
print "graph_args --base 1000\n";
@@ -288,28 +333,108 @@
print "recv.cdef recv,8,*\n";
print "recv.max $speed\n";
print "recv.min 0\n";
- print "recv.warn ", (-$warn), "\n" if defined $warn;
+ 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.min 0\n";
- print "send.warn $warn\n" if defined $warn;
+ 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_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 "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.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";
}
-sub do_fetch_if ($) {
+sub do_fetch_root {
+ # Construct root graphs fro the if_bytes and if_error spaces
+
+ my $in = 0;
+ my $out = 0;
+ my $inerr = 0;
+ my $outerr = 0;
+
+ foreach my $if (keys %{$snmpinfo}) {
+ # Do not take interface up or down-ness into account, the
+ # interface counters are not reset when the interface goes up
+ # so we must always account for all interfaces.
+
+ # But note that do_fetch_if has previously removed all
+ # interfaces with a "fishy" status. That is a possible bug.
+ # Or a feature. We'll see.
+
+ $in += $response = $snmpinfo->{$if}->{ifHCInOctets} ||
+ $snmpinfo->{$if}->{ifInOctets};
+
+ $out += $snmpinfo->{$if}->{ifHCOutOctets} ||
+ $snmpinfo->{$if}->{ifOutOctets};
+
+ $inerr += ( $snmpinfo->{$if}->{ifInErrors} || 0 ) +
+ ( $snmpinfo->{$if}->{ifInDiscards} || 0 );
+
+ $outerr += ( $snmpinfo->{$if}->{ifOutErrors} || 0 ) +
+ ( $snmpinfo->{$if}->{ifOutDiscards} || 0 );
+
+ }
+
+ print "multigraph if_bytes\n";
+ print "recv.value $in\n";
+ print "send.value $out\n";
+
+ print "multigraph if_errors\n";
+ print "recv.value $inerr\n";
+ print "send.value $outerr\n";
+}
+
+
+sub do_fetch_if {
my($if) = @_;
- print "multigraph if/bytes/$if fetch\n";
+ my $status = $snmpinfo->{$if}->{ifOperStatus} || 1;
+
+ my $response;
+
+ # 1 means up
+ # 2 means set to down
+ # Everything else we ignore.
- if (defined ($response = $snmpinfo->{$if}->{ifOperStatus}) and
- $response == 2) {
+ 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";
- return;
+ print "send.extinfo This interface is down\n";
+ goto if_errors;
}
if (defined ($response = $snmpinfo->{$if}->{ifHCInOctets} ||
@@ -318,7 +443,7 @@
} else {
# No response...
print "recv.value U\n";
- }
+ }
if (defined ($response = $snmpinfo->{$if}->{ifHCOutOctets} ||
$snmpinfo->{$if}->{ifOutOctets})) {
@@ -327,29 +452,58 @@
# No response...
print "send.value U\n";
}
+
+ if_errors:
+
+ print "multigraph if_errors.if_$if\n";
+
+ if ($status == 2) {
+ print "recv.value U\n";
+ print "send.value U\n";
+ print "send.extinfo This interface is down\n";
+ return;
+ }
+
+ $response = ( $snmpinfo->{$if}->{ifInErrors} || 0 ) +
+ ( $snmpinfo->{$if}->{ifInDiscards} || 0 );
+
+ print "recv.value $response\n";
+
+ $response = ( $snmpinfo->{$if}->{ifOutErrors} || 0 ) +
+ ( $snmpinfo->{$if}->{ifOutDiscards} || 0 );
+
+ print "send.value $response\n";
}
+
sub do_config {
my ($host,undef,$version) = Munin::Plugin::SNMP->config_session();
+ print "host_name $host\n" unless $host eq 'localhost';
+
# Also do overview graph with all ports summarized
foreach my $if (sort {$a <=> $b} keys %{$snmpinfo}) {
do_config_if($host,$version,$if);
- do_fetch_if($if); # if $dirtyconfig;
}
+
+ do_config_root($host);
}
+
sub do_fetch {
# Also do overview graph with all ports summarized and collected
# meta information in graph_info.
# Add to this error graphs and so on. And meta information about
# interface type.
+
foreach my $if (sort {$a <=> $b} keys %{$snmpinfo}) {
do_fetch_if($if);
}
+ do_fetch_root();
}
+
if ($ARGV[0] and $ARGV[0] eq "config") {
do_config();
exit 0;
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/plugins/node.d/snort_alerts.in
^
|
@@ -0,0 +1,19 @@
+#!@@GOODSH@@
+
+# Proof of concept snort plugin written by Edward Bjarte Fjellskål.
+
+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 'graph_category Snort'
+
+ exit 0
+fi
+
+echo -n "alerts.value "
+echo $( tail -n1 /your/path/to/snort.stats| awk -F, '{ print $4 }')
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/plugins/node.d/snort_bytes_pkt.in
^
|
@@ -0,0 +1,19 @@
+#!@@GOODSH@@
+
+# Proof of concept snort plugin written by Edward Bjarte Fjellskål.
+
+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 'graph_category Snort'
+
+ exit 0
+fi
+
+echo -n "bytespkt.value "
+echo $( tail -n1 /your/path/to/snort.stats| awk -F, '{ print $6 }')
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/plugins/node.d/snort_drop_rate.in
^
|
@@ -0,0 +1,20 @@
+#!@@GOODSH@@
+
+# Proof of concept snort plugin written by Edward Bjarte Fjellskål.
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title Snort Drop Rate'
+ echo 'graph_args --base 1000 -l 0'
+ echo 'graph_vlabel % percent'
+ echo 'graph_scale no'
+ echo 'droprate.label % percent'
+ # To tell Nagios
+ echo 'droprate.warning 1'
+ echo 'droprate.critical 2'
+ echo 'graph_category Snort'
+
+ exit 0
+fi
+
+echo -n "droprate.value "
+echo $( tail -n1 /your/path/to/snort.stats| awk -F, '{ print $2 }')
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/plugins/node.d/snort_pattern_match.in
^
|
@@ -0,0 +1,20 @@
+#!@@GOODSH@@
+
+# Proof of concept snort plugin written by Edward Bjarte Fjellskål.
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title Snort Pattern Match'
+ echo 'graph_args --base 1000 -l 0'
+ echo 'graph_vlabel % percent'
+ echo 'graph_scale no'
+ echo 'pattmatch.label % percent'
+ #For Nagios
+ #echo 'pattmatch.warning 14'
+ #echo 'pattmatch.critical 25'
+ echo 'graph_category Snort'
+
+ exit 0
+fi
+
+echo -n "pattmatch.value "
+echo $( tail -n1 /your/path/to/snort.stats| awk -F, '{ print $7 }')
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/plugins/node.d/snort_pkts.in
^
|
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Proof of concept snort plugin written by Edward Bjarte Fjellskål.
+
+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_scale no'
+ echo 'pktsec.label Packets/second'
+ #echo 'pktsec.warning 80'
+ #echo 'pktsec.critical 92'
+ 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
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/plugins/node.d/snort_traffic.in
^
|
@@ -0,0 +1,17 @@
+#!@@GOODSH@@
+
+# Proof of concept snort plugin written by Edward Bjarte Fjellskål.
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title Snort Traffic'
+ echo 'graph_args --base 1000 -l 0'
+ echo 'graph_vlabel Mbits / second'
+ echo 'graph_scale no'
+ echo 'traffic.label Mbits/second'
+ echo 'graph_category Snort'
+
+ exit 0
+fi
+
+echo -n "traffic.value "
+echo $( tail -n1 /your/path/to/snort.stats| awk -F, '{ print $3 }')
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/squeezebox_.in
^
|
@@ -39,7 +39,7 @@
=head1 VERSION
- $Id: squeezebox_.in 2765 2009-10-29 16:07:21Z bjorn $
+ $Id: squeezebox_.in 2919 2009-11-09 10:45:14Z bjorn $
=head1 BUGS
@@ -65,13 +65,13 @@
if [ "$1" = "autoconf" ]; then
if [ ! "which $NC 1>/dev/null 2>&1" ]; then
echo "no (no netcat/nc binary found)"
- exit 1
+ exit 0
fi
echo exit | $NC $HOST $PORT 1>/dev/null 2>&1
RET=$?
if [ "$RET" != "0" ]; then
echo "no (no connection on $HOST port $PORT)"
- exit 1
+ exit 0
fi
VERSION=$(printf "%b" "version ?\nexit\n" | $NC $HOST $PORT 2>/dev/null)
if [ "$VERSION" != "" ]; then
@@ -79,7 +79,7 @@
exit 0
else
echo "no (socket responding but version not found: something is weird)"
- exit 1
+ exit 0
fi
fi
@@ -154,7 +154,9 @@
echo "graph_args --base 1000 -l 0"
# echo -n "graph_order "
# echo $years_array | tr '[:space:]' " y"
- echo "graph_order y0"
+ # echo "graph_order y0"
+ echo -n "graph_order y"; echo $years_array | sed 's/ / y/g'
+
for i in `seq 0 $no_of_years`; do
year=$(echo ${arr1[$i]})
if [ $year = 0 ]; then
@@ -177,21 +179,26 @@
done
elif [ "$CMD" = "signalstrength" -o "$CMD" = "mixer volume" ]; then
if [ "$1" = "config" ]; then
- echo "graph_title $TITLE"
- echo "graph_category Squeezebox"
- printf "%b" "$CMD ?\nexit\n"| $NC $HOST $PORT | sed "s/$CMD//" | while read node value; do
- node2=$(echo $node | sed 's/%3A//g')
- node2print=$(echo $node2 | tr '.' '_')
- echo "${node2print}.label ${node2}"
- done
- exit 0
+ echo "graph_title $TITLE"
+ echo "graph_category Squeezebox"
+ COUNT=$(printf "%b" "player count ?\nexit\n" | $NC $HOST $PORT | cut -d " " -f 3)
+ (( COUNT-- ))
+ for ID in $(seq 0 $COUNT); do
+ MAC=$(printf "%b" "player id $ID ?\nexit\n" | $NC $HOST $PORT | cut -d " " -f 4 | sed 's/%3A/:/g')
+ NAME=$(printf "%b" "player name $MAC ?\nexit\n" | $NC $HOST $PORT | cut -d " " -f 4 | sed 's/%20/ /g')
+ MAC2=$(echo $MAC | sed 's/://g; s/\./_/g')
+ echo "$MAC2.label $NAME"
+ done
+ exit 0
fi
- printf "%b" "$CMD ?\nexit\n"| $NC $HOST $PORT | sed "s/$CMD//" | while read node value; do
- node2=$(echo $node | sed 's/%3A//g')
- node2print=$(echo $node2 | tr '.' '_')
- echo "${node2print}.value ${value}"
- done
-
+ COUNT=$(printf "%b" "player count ?\nexit\n" | $NC $HOST $PORT | cut -d " " -f 3)
+ (( COUNT-- ))
+ for ID in $(seq 0 $COUNT); do
+ MAC=$(printf "%b" "player id $ID ?\nexit\n" | $NC $HOST $PORT | cut -d " " -f 4 | sed 's/%3A/:/g')
+ VAL=$(printf "%b" "$MAC $CMD ?\nexit\n"| $NC $HOST $PORT | cut -d " " -f 2- | sed "s/$CMD //")
+ MAC2=$(echo $MAC| sed 's/://g')
+ echo "$MAC2.value $VAL"
+ done
else
if [ "$1" = "config" ]; then
echo "graph_title Number of $ATTR"
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/plugins/node.d/testplugin
^
|
@@ -0,0 +1,147 @@
+#!/usr/bin/perl
+
+# 21:59 < janll> 1. good config, no fetch
+# 22:00 < janll> 2. no config, good fetch
+# 22:00 < janll> 3. no config, no fetch
+# 22:00 < janll> 4. broken config, good fetch
+# 22:00 < janll> 5. good config, broken fetch
+# 22:00 < janll> 6. broken everything
+#
+# 22:03 < janll> modes of breakage: mistyped keywords, missing keywords, missing
+# values, illegal values
+
+# Plugin filename = testplugin
+#
+# env.config {good,bad}
+# - good: working output
+# - bad: non-working output
+#
+# env.fetch {good,bad}
+# - good: working output
+# - bad: non-working output
+#
+# env.aspect {minimal,normal,broken,weird}
+# - minimal: barebone requirements
+# - normal: a regular run
+# - broken: regular identifiers, broken values
+# - weird: broken identifiers, regular output
+#
+# env.other {sleep,die,disturb}
+# - sleep: waits 30 seconds before giving any output
+# - die: exits right away, weird exit code.
+# - disturb: swaps config and regular run
+#
+# Plugin basename = testplugin_
+
+# use strict;
+use Data::Dumper;
+use vars qw ($configure_mode %aspects %config %fetch);
+
+my $config = ($ENV{'config'} || 'good');
+my $fetch = ($ENV{'fetch'} || 'good');
+my $aspect = ($ENV{'aspect'} || 'normal');
+my $other = ($ENV{'other'} || '');
+
+my $arg = $ARGV[0];
+if ($arg eq "config") {
+ $configure_mode = 1;
+}
+
+%config = (
+ good => {
+ minimal => {
+ 'graph_title' => 'Test plugin',
+ 'test.label' => 'Test',
+ },
+ normal => {
+ 'graph_title' => 'Test plugin',
+ 'graph_args' => '--base 1000 -l 0',
+ 'graph_category' => 'Test',
+ 'test.label' => 'Test',
+ },
+ broken => {
+ 'graph_title' => 'Uærk*^~',
+ 'graph_category' => 'Test',
+ 'test.label' => '',
+ },
+ weird => {
+ 'gräph_ärgs' => '--base 768',
+ 'test.label' => 'gnørk',
+ },
+ },
+ bad => {
+ minimal => {
+ 'graph_title' => '',
+ 'test.label' => 'Test',
+ },
+ normal => {
+ 'graph_title' => '',
+ 'graph_args' => '--base 1000 -l 0',
+ 'graph_category' => 'Test',
+ 'test.label' => 'Test',
+ },
+ broken => {
+ 'graph_categöry' => 'Uærk*^~',
+ 'test.label' => '',
+ },
+ weird => {
+ 'graph_args' => '--base -14',
+ 'test.label' => 'gnørk',
+ },
+ },
+ );
+%fetch = (
+ good => {
+ minimal => {
+ 'test.value' => 42,
+ },
+ normal => {
+ 'test.value' => 42,
+ },
+ broken => {
+ 'test.value' => '42,34',
+ },
+ weird => {
+ 'test.value' => 'ø',
+ }
+ },
+ bad => {
+ minimal => {
+ 'test.value' => '',
+ },
+ normal => {
+ 'test.value' => '',
+ },
+ broken => {
+ 'test.valüe' => '',
+ },
+ weird => {
+ 'test.value' => 'ø',
+ },
+ },
+ );
+
+my $line;
+
+if ($other eq 'sleep') {
+ sleep 30;
+} elsif ($other eq 'die') {
+ exit 17;
+}
+
+if ($other eq 'disturb') {
+ $configure_mode -= 1;
+}
+
+
+if ($configure_mode) {
+ foreach $line (keys %{$config{$config}->{$aspect}}) {
+ print $line, " ", $config{$config}->{$aspect}->{$line}, "\n";
+ }
+} else {
+ foreach $line (keys %{$fetch{$fetch}->{$aspect}}) {
+ print $line, " ", $fetch{$fetch}->{$aspect}->{$line}, "\n";
+ }
+}
+
+
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/tomcat_access.in
^
|
@@ -46,7 +46,7 @@
=head1 MAGIC MARKERS
- #%# family=contrib
+ #%# family=manual
#%# capabilities=autoconf
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/tomcat_jvm.in
^
|
@@ -58,7 +58,7 @@
=head1 MAGIC MARKERS
- #%# family=contrib
+ #%# family=manual
#%# capabilities=autoconf
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/tomcat_threads.in
^
|
@@ -45,7 +45,7 @@
=head1 MAGIC MARKERS
- #%# family=contrib
+ #%# family=manual
#%# capabilities=autoconf
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/tomcat_volume.in
^
|
@@ -66,7 +66,7 @@
=head1 MAGIC MARKERS
- #%# family=contrib
+ #%# family=manual
#%# capabilities=autoconf
=cut
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/varnish_.in
^
|
@@ -52,7 +52,9 @@
session, session_herd
You can link them yourself with something like this:
-ln -s /foo/varnish_ /etc/munin/plugins/varnish_data_structures
+
+ ln -s @@LIBDIR@@/plugins/varnish_ \
+ @@CONFDIR@@/plugins/varnish_data_structures
=head1 INTERPERTATION
|
[-]
[+]
|
Added |
munin-1.4.tar.bz2/plugins/node.d/warning_tester.in
^
|
@@ -0,0 +1,33 @@
+#!@@BASH@@
+# -*- sh -*-
+
+#%# family=test
+
+do_ () {
+ cat <<EOF
+one.value 6
+two.value 10
+three.value 24
+EOF
+}
+
+do_config () {
+ cat <<'EOF'
+graph_title Made to send warnings
+graph_info Warnings and just warnings
+one.label Warning #1
+one.warning 0:5
+one.critical 0:9
+two.label Warning #2
+two.warning 0:7
+two.critical 0:9
+three.label No warning here
+three.warning 0:42
+three.critical 0:84
+EOF
+}
+
+do_$1 2>/dev/null || {
+ echo "Do what now?">&2
+ exit 1
+}
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/node.d/zimbra_.in
^
|
@@ -83,9 +83,14 @@
use warnings;
use Fcntl;
-use Text::CSV_XS;
use Tie::File;
+my $ret = "";
+
+if (!eval "require Text::CSV_XS;") {
+ $ret = "No Text::CSV_XS";
+}
+
my $csvpath = ($ENV{'csvpath'} || '/opt/zimbra/zmstat');
# The possible measurements
@@ -848,13 +853,16 @@
die ("Can't run config without a symlinked name\n");
}
} elsif ($ARGV[0] eq "autoconf") {
- if (chdir $csvpath)
+ if ($ret ne "") {
+ print "no ($ret)\n";
+ }
+ elsif (chdir $csvpath)
{
print "yes\n";
}
else
{
- print "no\n";
+ print "no (chdir to $csvpath failed)\n";
}
} elsif ($ARGV[0] eq "suggest") {
foreach my $key ( keys %ops )
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/plugin.sh.in
^
|
@@ -4,6 +4,9 @@
clean_fieldname () {
# Clean up field name so it complies with munin requirements.
+ # Even though most versions of munin sanitises field names
+ # this at least avoids getting .s in field names which will
+ # very much still break munin.
#
# usage: name="$(clean_fieldname "$item")"
#
@@ -65,6 +68,47 @@
fi
}
+
+is_multigraph () {
+ # Multigraph feature is available in Munin 1.4.0 and later.
+ # But it also needs support on the node to stay perfectly
+ # compatible with old munin-masters.
+ #
+ # Using this procedure at the start of a multigraph plugin makes
+ # sure it does not interact with old node installations at all
+ # and thus does not break anything.
+ #
+ case $MUNIN_CAP_MULTIGRAPH:$1 in
+ 1:*) return;; # Yes! Rock and roll!
+ *:autoconf)
+ echo 'no (no multigraph support)'
+ exit 0
+ ;;
+
+ *:config)
+ echo 'graph_title This plugin needs multigraph support'
+ echo 'multigraph.label No multigraph here'
+ echo 'multigraph.info This plugin has been installed in a munin-node that is too old to know about multigraph plugins. Even if your munin master understands multigraph plugins this is not enough, the node too needs to be new enough. Version 1.4.0 or later should work.'
+ exit 0
+ ;;
+
+ *: ) echo 'multigraph.value 0'
+ exit 0
+ ;;
+ esac
+}
+
+
+is_dirtyconfig () {
+ # Detect if node/server supports dirty config (feature not yet supported)
+ case $MUNIN_CAP_DIRTYCONFIG in
+ 1) exit 1;;
+ *) exit 0;;
+ esac
+}
+
+
+
# janl_: can I in a shell script save STDOUT so I can restore it after
# a "exec >>somefile"?
# james: exec 2>&4 etc.
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/plugins/plugins.history.in
^
|
@@ -1,9 +1,7 @@
-
#
-# This file contains plugin history. It only contains history for plugins in
-# the "auto" family. The history started as of 0.9.8.
+# This file contains plugin history.
+# The history started as of 0.9.8.
#
-
[0.0.0]
[0.9.2]
[0.9.3]
@@ -124,7 +122,6 @@
digitemp_
[1.3.3]
aix/load
-digitemp_
env
freebsd/uptime
id
@@ -132,9 +129,8 @@
linux/cpuspeed
linux/nfs4_client
linux/proc_pri
-linux/quota_usage_
+linux/quota_usage_digitemp_
linux/threads
-linux/yum
lpstat
multiping
netbsd
@@ -152,11 +148,9 @@
netbsd/memory
netbsd/memory_pools
netbsd/memory_types
-netbsd/netstat
netbsd/nfs_client
netbsd/nfsd
netbsd/open_files
-netbsd/processes
netbsd/sensors_
netbsd/swap
netbsd/uptime
@@ -178,7 +172,6 @@
tomcat_jvm
tomcat_threads
tomcat_volume
-users
[1.3.4]
colour_tester
darwin/if_
@@ -197,7 +190,6 @@
ifx_concurrent_sessions_
linux/nfsd4
munin_stats
-netstat
ntp_offset
nvidia_
postgres_block_read_
@@ -213,3 +205,107 @@
snmp__netstat
snmp__swap
squid_objectsize
+
+[1.4.0]
+mysql_
+extinfo_tester
+warning_tester
+linux/bonding_err_
+memcached_
+testplugin
+postgres_users
+postgres_tuples_
+slony_lag_
+postgres_scans_
+linux/vserver_cpu_
+linux/vserver_loadavg
+linux/vserver_resources
+asterisk_channels
+asterisk_channelstypes
+asterisk_codecs
+asterisk_meetme
+asterisk_meetmeusers
+asterisk_sipchannels
+asterisk_sippeers
+asterisk_voicemail
+ipmi_sensor_
+openvpn
+multigraph_tester
+nomadix_users_
+jmx_
+fail2ban
+zimbra_
+linux/diskstat_
+tomcat_
+squeezebox_
+snmp__netapp_diskusage_
+snmp__netapp_inodeusage_
+mysql_innodb
+slapd_
+slapd_bdb_cache_
+postgres_bgwriter
+postgres_cache_
+postgres_checkpoints
+postgres_xlog
+postgres_connections_
+postgres_connections_db
+postgres_locks_
+postgres_querylength_
+postgres_size_
+postgres_transactions_
+sunos/if_err_
+varnish_
+amavis
+apc_envunit_
+apc_nis
+bind9
+bind9_rndc
+cmc_tc_sensor_
+courier_
+courier_mta_mailqueue
+courier_mta_mailstats
+courier_mta_mailvolume
+cupsys_pages
+dhcpd3
+exim_mailqueue_alt
+foldingathome
+foldingathome_rank
+foldingathome_wu
+hddtemp2
+hddtemp_smartctl
+http_loadtime
+ipac-ng
+ircu
+loggrep
+mailman
+mailscanner
+mbmon_
+mhttping
+multips
+munin_update
+named
+ntp_states
+nut_misc
+nut_volts
+perdition
+ping_
+pm3users_
+pop_stats
+postfix_mailvolum
+psu_
+samba
+snmp__if_multi
+nginx_request
+nginx_status
+hp-ux/df
+hp-ux/df_inode
+haproxy_
+freebsd/systat
+freebsd/iostat
+qmailqstat
+snort_alerts
+snort_bytes_pkt
+snort_drop_rate
+snort_pattern_match
+snort_pkts
+snort_traffic
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/resources/crontab-generic-munin.in
^
|
@@ -5,4 +5,3 @@
#
0,5,10,15,20,25,30,35,40,45,50,55 * * * * if [ -x @@BINDIR@@/munin-cron ]; then @@BINDIR@@/munin-cron; fi
-10 10 * * * if [ -x @@LIBDIR@@/munin-limits ]; then @@LIBDIR@@/munin-limits --force --contact nagios --contact old-nagios; fi
|
[-]
[+]
|
Changed |
munin-1.4.tar.bz2/resources/linux-cron.d_munin.in
^
|
@@ -1,8 +1,7 @@
#
-# cron-jobs for munin
+# cron-jobs for munin, drop in /etc/cron.d on a Linux machine.
#
MAILTO=root
*/5 * * * * munin if [ -x @@BINDIR@@/munin-cron ]; then @@BINDIR@@/munin-cron; fi
-10 10 * * * munin if [ -x @@LIBDIR@@/munin-limits ]; then @@LIBDIR@@/munin-limits --force --contact nagios --contact old-nagios; fi
|