diff options
-rw-r--r-- | graph.php | 3 | ||||
-rw-r--r-- | plugin/df.json | 3 | ||||
-rw-r--r-- | type/Base.class.php | 3 |
3 files changed, 8 insertions, 1 deletions
@@ -92,6 +92,9 @@ if (isset($plugin_json[$type]['datasize']) and $plugin_json[$type]['datasize']) | |||
92 | if (isset($plugin_json[$type]['scale'])) | 92 | if (isset($plugin_json[$type]['scale'])) |
93 | $obj->scale = $plugin_json[$type]['scale']; | 93 | $obj->scale = $plugin_json[$type]['scale']; |
94 | 94 | ||
95 | if (isset($plugin_json[$type]['base'])) | ||
96 | $obj->base = $plugin_json[$type]['base']; | ||
97 | |||
95 | if (isset($plugin_json[$type]['legend_format'])) | 98 | if (isset($plugin_json[$type]['legend_format'])) |
96 | $obj->rrd_format = $plugin_json[$type]['legend_format']; | 99 | $obj->rrd_format = $plugin_json[$type]['legend_format']; |
97 | 100 | ||
diff --git a/plugin/df.json b/plugin/df.json index 8820b89..ad345e4 100644 --- a/plugin/df.json +++ b/plugin/df.json | |||
@@ -17,7 +17,8 @@ | |||
17 | "color": "ff0000" | 17 | "color": "ff0000" |
18 | } | 18 | } |
19 | }, | 19 | }, |
20 | "legend_format": "%5.1lf%sB" | 20 | "legend_format": "%5.1lf%sB", |
21 | "base": "1024" | ||
21 | }, | 22 | }, |
22 | "df_inodes": { | 23 | "df_inodes": { |
23 | "title": "Free inodes ({{PI}})", | 24 | "title": "Free inodes ({{PI}})", |
diff --git a/type/Base.class.php b/type/Base.class.php index 4cb9e18..40f3df0 100644 --- a/type/Base.class.php +++ b/type/Base.class.php | |||
@@ -17,6 +17,7 @@ class Type_Base { | |||
17 | var $rrd_vertical; | 17 | var $rrd_vertical; |
18 | var $rrd_format = '%5.1lf%s'; | 18 | var $rrd_format = '%5.1lf%s'; |
19 | var $scale = 1; | 19 | var $scale = 1; |
20 | var $base; | ||
20 | var $width; | 21 | var $width; |
21 | var $height; | 22 | var $height; |
22 | var $graph_type; | 23 | var $graph_type; |
@@ -253,6 +254,8 @@ class Type_Base { | |||
253 | $rrdgraph[] = $this->rrdtool_opts; | 254 | $rrdgraph[] = $this->rrdtool_opts; |
254 | if ($this->graph_smooth) | 255 | if ($this->graph_smooth) |
255 | $rrdgraph[] = '-E'; | 256 | $rrdgraph[] = '-E'; |
257 | if ($this->base) | ||
258 | $rrdgraph[] = '--base '.$this->base; | ||
256 | $rrdgraph[] = sprintf('-w %d', is_numeric($this->width) ? $this->width : 400); | 259 | $rrdgraph[] = sprintf('-w %d', is_numeric($this->width) ? $this->width : 400); |
257 | $rrdgraph[] = sprintf('-h %d', is_numeric($this->height) ? $this->height : 175); | 260 | $rrdgraph[] = sprintf('-h %d', is_numeric($this->height) ? $this->height : 175); |
258 | $rrdgraph[] = '-l 0'; | 261 | $rrdgraph[] = '-l 0'; |