diff options
author | Edmondo Tommasina | 2010-05-12 14:39:03 +0200 |
---|---|---|
committer | Pim van den Berg | 2010-05-13 14:18:30 +0200 |
commit | 69dbd9d549b7a285ef3ffceee8e368680b756bf4 (patch) | |
tree | 5697bd21cb471f4b951e41669909f864dfb414c3 | |
parent | plugin/memory: add locked state (diff) | |
download | apt-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>
-rw-r--r-- | conf/config.php | 3 | ||||
-rw-r--r-- | type/Default.class.php | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/conf/config.php b/conf/config.php index d31b129..a36c083 100644 --- a/conf/config.php +++ b/conf/config.php | |||
@@ -9,6 +9,9 @@ $CONFIG['datadir'] = '/var/lib/collectd/rrd'; | |||
9 | # rrdtool executable | 9 | # rrdtool executable |
10 | $CONFIG['rrdtool'] = '/usr/bin/rrdtool'; | 10 | $CONFIG['rrdtool'] = '/usr/bin/rrdtool'; |
11 | 11 | ||
12 | # rrdtool special options | ||
13 | $CONFIG['rrdtool_opts'] = ''; | ||
14 | |||
12 | # category of hosts to show on main page | 15 | # category of hosts to show on main page |
13 | #$CONFIG['cat']['category1'] = array('host1', 'host2'); | 16 | #$CONFIG['cat']['category1'] = array('host1', 'host2'); |
14 | 17 | ||
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 @@ | |||
5 | class Type_Default { | 5 | class 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'; |