aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/type
diff options
context:
space:
mode:
authorEdmondo Tommasina2010-05-12 14:39:03 +0200
committerPim van den Berg2010-05-13 14:18:30 +0200
commit69dbd9d549b7a285ef3ffceee8e368680b756bf4 (patch)
tree5697bd21cb471f4b951e41669909f864dfb414c3 /type
parentplugin/memory: add locked state (diff)
downloadapt-panopticon_cgp-69dbd9d549b7a285ef3ffceee8e368680b756bf4.zip
apt-panopticon_cgp-69dbd9d549b7a285ef3ffceee8e368680b756bf4.tar.gz
apt-panopticon_cgp-69dbd9d549b7a285ef3ffceee8e368680b756bf4.tar.bz2
apt-panopticon_cgp-69dbd9d549b7a285ef3ffceee8e368680b756bf4.tar.xz
Allow to define alternate options for rrdtool in config file
Since I'm using a non standard installation of rrdtool, I always have to define the --font options when colling the rrdtool binary. I tried to implement this change in a general way to define locally rrdtool options in the config.local.php. Signed-off-by: Edmondo Tommasina <edmondo@eriadon.com>
Diffstat (limited to 'type')
-rw-r--r--type/Default.class.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/type/Default.class.php b/type/Default.class.php
index 20b2745..c08745d 100644
--- a/type/Default.class.php
+++ b/type/Default.class.php
@@ -5,6 +5,7 @@
5class Type_Default { 5class Type_Default {
6 var $datadir; 6 var $datadir;
7 var $rrdtool; 7 var $rrdtool;
8 var $rrdtool_opts;
8 var $cache; 9 var $cache;
9 var $args; 10 var $args;
10 var $seconds; 11 var $seconds;
@@ -26,6 +27,7 @@ class Type_Default {
26 function __construct($config) { 27 function __construct($config) {
27 $this->datadir = $config['datadir']; 28 $this->datadir = $config['datadir'];
28 $this->rrdtool = $config['rrdtool']; 29 $this->rrdtool = $config['rrdtool'];
30 $this->rrdtool_opts = $config['rrdtool_opts'];
29 $this->cache = $config['cache']; 31 $this->cache = $config['cache'];
30 $this->parse_get(); 32 $this->parse_get();
31 $this->rrd_files(); 33 $this->rrd_files();
@@ -156,6 +158,8 @@ class Type_Default {
156 function rrd_options() { 158 function rrd_options() {
157 $rrdgraph[] = $this->rrdtool; 159 $rrdgraph[] = $this->rrdtool;
158 $rrdgraph[] = 'graph - -a PNG'; 160 $rrdgraph[] = 'graph - -a PNG';
161 if ($this->rrdtool_opts != '')
162 $rrdgraph[] = $this->rrdtool_opts;
159 $rrdgraph[] = sprintf('-w %d', is_numeric($this->width) ? $this->width : 400); 163 $rrdgraph[] = sprintf('-w %d', is_numeric($this->width) ? $this->width : 400);
160 $rrdgraph[] = sprintf('-h %d', is_numeric($this->heigth) ? $this->heigth : 175); 164 $rrdgraph[] = sprintf('-h %d', is_numeric($this->heigth) ? $this->heigth : 175);
161 $rrdgraph[] = '-l 0'; 165 $rrdgraph[] = '-l 0';