From 2e5609e32581cc6748d252febea47f91140141e7 Mon Sep 17 00:00:00 2001 From: Jan Astrup Date: Mon, 14 May 2012 20:26:46 +0200 Subject: [PATCH] Added support for mysqlconfig in plugin configuration file --- plugins/newznab/nn_ | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/plugins/newznab/nn_ b/plugins/newznab/nn_ index 46bbeb42..f044e10b 100644 --- a/plugins/newznab/nn_ +++ b/plugins/newznab/nn_ @@ -13,6 +13,35 @@ data for one specific graph, you need to create a symbolic link with a name like nn_ to this script. To get a graph over numbers of users use nn_users +=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 nn_ to this script. + +connection parameters - use this in your plugin configuration file. + +[nn*] +env.mysqlconnection DBI:mysql:;host=127.0.0.1;port=3306 +env.mysqluser +env.mysqlpassword + + +=head1 DEPENDENCIES + +=over + +=item DBD::mysql + +=back + +=head1 THANKS +A special thanks to Kjell-Magne Øierud for the mysql_ plugin in munin which +gave me the inspiration and reusable code to create this plugin. =head1 LICENSE @@ -46,9 +75,9 @@ use File::Basename; #-- CONFIG --# my %config = ( - 'dsn' => $env{'mysqlconnection'} || 'dbi:mysql:newznab', - 'user' => $env{'mysqluser'} || 'test', - 'password' => $env{'mysqlpassword'} || 'test', + 'dsn' => $ENV{'mysqlconnection'} || 'dbi:mysql:newznab', + 'user' => $ENV{'mysqluser'} || 'test1', + 'password' => $ENV{'mysqlpassword'} || 'test', ); my %defaults = (