diff --git a/plugins/apt/deb_packages/deb_packages.py b/plugins/apt/deb_packages/deb_packages.py index f0c37e11..c15ef299 100755 --- a/plugins/apt/deb_packages/deb_packages.py +++ b/plugins/apt/deb_packages/deb_packages.py @@ -500,7 +500,7 @@ class PackageStat(defaultdict): "multigraph {graphName}_{type}\n"\ "graph_title {type} Debian packages sorted by {option}\n"\ "graph_info {type} Debian packages sorted by {option} of its repository\n"\ - "graph_category debian\n"\ + "graph_category security\n"\ "graph_vlabel packages".format(**d) def printConfig(self): @@ -855,3 +855,111 @@ if __name__=='__main__': muninPlugin = Munin() muninPlugin.execute() # import IPython; IPython.embed() + + +### The following is the smart_ plugin documentation, intended to be used with munindoc + +""" +=head1 NAME + +deb_packages - plugin to monitor update resources and pending packages on Debian + +=head1 APPLICABLE SYSTEMS + +This plugin has checked on Debian - Wheezy and squeeze. If you want to use it +on older installations, tell me whether it works or which errors you had. It +shoud run past python-apt 0.7 and python 2.5. + +=head1 DESCRIPTION + +With this plugin munin can give you a nice graph and some details where your +packages come from, how old or new your installation is. Furtermore it tells +you how many updates you should have been installed, how many packages are +outdated and where they come from. + +You can sort installed or upgradable Packages by 'archive', 'origin', 'site', +'label' and 'component' and even some of them at once. + +The script uses caching cause it is quite expensive. It saves the output to a +cachefile and checks on each run, if dpkg-status or downloaded Packagefile have +changed. If one of them has changed, it runs, if not it gives you the cached +version + +=head1 INSTALLATION + +check out this git repository from + +=over 2 + + aptitude install python-apt + git clone git://github.com/munin-monitoring/contrib.git + cd contrib/plugins/apt/deb_packages + sudo cp deb_packages.py /etc/munin/plugins/deb_packages + sudo cp deb_packages.munin-conf /etc/munin/plugin-conf.d/deb_packages + +=back + +Verify the installation by + +=over 2 + + sudo munin-run deb_packages + +=back + + +=head1 CONFIGURATION + +If you copied deb_packages.munin-conf to plugin-conf.d you have a starting point. + +A typical configuration looks like this + +=over 2 + + [deb_packages] + # plugin is quite expensive and has to write statistics to cache output + # so it has to write to plugins.cache + user munin + + # Packagelists to this size are printed as extra information to munin.extinfo + env.MAX_LIST_SIZE_EXT_INFO 50 + + # Age in seconds an $CACHE_FILE can be. If it is older, the script updates + # default if not set is 3540 (one hour) + # at the moment this is not used, the plugin always runs (if munin calls it) + # + env.CACHE_FILE_MAX_AGE 3540 + + # All these numbers are only for sorting, so you can use env.graph01_sort_by_0 + # and env.graph01_sort_by_2 without using env.graph01_sort_by_1. + # sort_by values ... + # possible values are 'label', 'archive', 'origin', 'site', 'component' + env.graph00_type installed + env.graph00_sort_by_0 label + env.graph00_sort_by_1 archive + env.graph00_show_ext_0 origin + env.graph00_show_ext_1 site + + env.graph01_type upgradable + env.graph01_sort_by_0 label + env.graph01_sort_by_1 archive + env.graph01_show_ext_0 origin + env.graph01_show_ext_1 site + +=back + +You can sort_by one or some of these possible Values + + +=head1 AUTHOR + +unknown + +=head1 LICENSE + +Default for Munin contributions is GPLv2 (http://www.gnu.org/licenses/gpl-2.0.txt) + +=cut + + +""" diff --git a/plugins/apt/deb_packages/example-graphs/deb_packages.py-week.png b/plugins/apt/deb_packages/example-graphs/deb_packages.py-week.png new file mode 100644 index 00000000..4c2515d0 Binary files /dev/null and b/plugins/apt/deb_packages/example-graphs/deb_packages.py-week.png differ diff --git a/plugins/db2/db2_cnx b/plugins/db2/db2_cnx index d6d60ad1..9a8ace0d 100755 --- a/plugins/db2/db2_cnx +++ b/plugins/db2/db2_cnx @@ -7,7 +7,7 @@ . /home/db2inst1/sqllib/db2profile echo "graph_title Number of connections" -echo "graph_category DB2" +echo "graph_category db" echo "graph_args -l 0" db2 list application | tail +5 | awk ' /^[A-Z]/ { print $1 }' | sort | uniq -c > $HOME/run/$(basename $0).txt diff --git a/plugins/mail/amavis-debian b/plugins/mail/amavis-debian index 18ac8658..62fa352f 100755 --- a/plugins/mail/amavis-debian +++ b/plugins/mail/amavis-debian @@ -47,7 +47,7 @@ fi if [ "$1" = "config" ]; then echo 'graph_title Amavis filter statistics' - echo 'graph_category postfix' + echo 'graph_category antivirus' echo 'graph_order total clean spam virus other' echo 'graph_vlabel Mails filtered' echo 'graph_scale no' diff --git a/plugins/mail/amavis_ b/plugins/mail/amavis_ index ca14adba..c27d9cb2 100755 --- a/plugins/mail/amavis_ +++ b/plugins/mail/amavis_ @@ -69,7 +69,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") { if ($stats_type eq "cache") { print "graph_title Amavis cache hit / miss ratio\n"; print "graph_args --lower-limit 0 --upper-limit 100 --rigid\n"; - print "graph_category mail\n"; + print "graph_category antivirus\n"; print "graph_info The ratio of cache hits and misses for AMaViSd-new.\n"; print "graph_order hits misses\n"; print "graph_scale no\n"; @@ -84,7 +84,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") { print "misses.min 0\n"; } elsif ($stats_type eq "content") { print "graph_title Amavis scanned mails\n"; - print "graph_category mail\n"; + print "graph_category antivirus\n"; print "graph_period minute\n"; print "graph_vlabel msgs / \${graph_period}\n"; foreach my $type (qw(total clean spam spammy virus)) { @@ -100,7 +100,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") { } elsif ($stats_type eq "time") { print "graph_title Amavis average scan time\n"; print "graph_info Average time spent in each phase of the mail scanning process, per mail.\n"; - print "graph_category mail\n"; + print "graph_category antivirus\n"; print "graph_vlabel sec / mail\n"; print "graph_scale no\n"; diff --git a/plugins/mail/amavis_awk b/plugins/mail/amavis_awk index ca361ec6..04a7a942 100755 --- a/plugins/mail/amavis_awk +++ b/plugins/mail/amavis_awk @@ -33,7 +33,7 @@ fi if [ "$1" = "config" ]; then echo 'graph_title Amavis message filtering' - echo 'graph_category mail' + echo 'graph_category antivirus' echo 'graph_vlabel Mails per minute' echo 'graph_args --base 1000 -l 0' diff --git a/plugins/mail/clamav b/plugins/mail/clamav index 46565d77..042a3d4e 100755 --- a/plugins/mail/clamav +++ b/plugins/mail/clamav @@ -18,7 +18,7 @@ if [ "$1" = "config" ]; then graph_title ClamAV stats graph_args --base 1000 -l 0 graph_vlabel virus/day -graph_category Mail +graph_category antivirus virus.label virus virus.type DERIVE virus.min 0 diff --git a/plugins/mail/mailman-queue-check b/plugins/mail/mailman-queue-check index 4c75c792..3a9deab3 100755 --- a/plugins/mail/mailman-queue-check +++ b/plugins/mail/mailman-queue-check @@ -17,7 +17,7 @@ if [ "$1" = "config" ]; then echo "graph_title Mailman Queue" - echo "graph_category mailman" + echo "graph_category mailinglist" echo "graph_args --base 1000 -l 0" echo "archive.label Archive" echo "archive.draw LINE2" diff --git a/plugins/mail/mailman_subscribers b/plugins/mail/mailman_subscribers index 85181e73..a5809d4f 100755 --- a/plugins/mail/mailman_subscribers +++ b/plugins/mail/mailman_subscribers @@ -58,7 +58,7 @@ if ($ARGV[0] and $ARGV[0] eq "config" ){ print "graph_args --base 1000 -l 0\n"; print "graph_scale yes\n"; print "graph_vlabel subscribers\n"; - print "graph_category mailman\n"; + print "graph_category mailinglist\n"; print "graph_total Total\n"; print 'graph_info Plugin available at http://rodolphe.quiedeville.org/hack/munin/mailman/'."\n";