plugin:rrdgraph
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:rrdgraph [2015-10-18 21:04] – 93.104.60.140 | plugin:rrdgraph [2023-04-26 20:07] (current) – screenshot Aleksandr | ||
---|---|---|---|
Line 5: | Line 5: | ||
author | author | ||
email : developer@flashsystems.de | email : developer@flashsystems.de | ||
- | type : syntax, action, admin, helper, render | + | type : syntax, action, helper, render |
- | lastupdate : 2015-10-10 | + | lastupdate : 2019-01-12 |
- | compatible : Ponder Stibbons, Hrun, Detritus+ | + | compatible : Detritus, Elenor Of Tsort, Frusterick Manners, Greebo |
- | screenshot_img : http:// | + | tags : images, |
- | tags : | + | |
- | downloadurl: | + | downloadurl: |
- | bugtracker : http:// | + | bugtracker : |
- | sourcerepo | + | sourcerepo : https:// |
+ | |||
+ | screenshot_img | ||
---- | ---- | ||
+ | |||
+ | :!: **This Plugin is no longer maintained. If you want to take over maintaining it go ahead and contact me.** :!: | ||
===== Installation ===== | ===== Installation ===== | ||
- | :!: **Important Warning:** The RRDgraph plugin uses the cache to store the generated images and the recipes. Please make sure you have a [[https:// | ||
- | Install the plugin | + | :!: **Important Warning:** The RRDgraph |
+ | |||
+ | Search | ||
+ | |||
+ | ==== Prerequisites ==== | ||
+ | |||
+ | To use this plugin your PHP installation must have been compiled with __GD support__ and the __rrd extension__ must be installed and activated. Regarding GD support also see [[tips: | ||
+ | |||
+ | If one of these prerequisites is not met the RRDgraph plugin will display an error message at the top of each wiki page. | ||
===== Introduction ===== | ===== Introduction ===== | ||
+ | |||
The RRDtool website says " | The RRDtool website says " | ||
==== Ahead of time generation ==== | ==== Ahead of time generation ==== | ||
+ | |||
This is the classical way to embed RRD graphs into DokuWiki pages. The graphs are generated by a cron job and stored as image files. These images are embedded into wiki pages. | This is the classical way to embed RRD graphs into DokuWiki pages. The graphs are generated by a cron job and stored as image files. These images are embedded into wiki pages. | ||
Line 40: | Line 52: | ||
==== Just in time generation ==== | ==== Just in time generation ==== | ||
+ | |||
The instructions and options for generating the RRD graphs are stored withing the DokuWiki documents. The graphs are generated on the fly by a plugin. | The instructions and options for generating the RRD graphs are stored withing the DokuWiki documents. The graphs are generated on the fly by a plugin. | ||
Line 54: | Line 67: | ||
===== Examples/ | ===== Examples/ | ||
+ | |||
The RRDgraph DokuWiki plugin supplies the necessary infrastructure to implement just in time generation of RRD graphs on DokuWiki pages. | The RRDgraph DokuWiki plugin supplies the necessary infrastructure to implement just in time generation of RRD graphs on DokuWiki pages. | ||
==== Generating graphs ==== | ==== Generating graphs ==== | ||
+ | |||
RRDtool gets its drawing instructions via the command line. There are [[http:// | RRDtool gets its drawing instructions via the command line. There are [[http:// | ||
Line 64: | Line 79: | ||
==== Syntax ==== | ==== Syntax ==== | ||
+ | |||
The RRDgraph plugin provides the ''< | The RRDgraph plugin provides the ''< | ||
Line 74: | Line 90: | ||
OPT:h=100 | OPT:h=100 | ||
LINE: | LINE: | ||
- | </ttd> | + | </rrd> |
</ | </ | ||
Line 86: | Line 102: | ||
=== RRDgraph commands === | === RRDgraph commands === | ||
+ | |||
RRDgraph extends the RRDtool command set to allow for a consistent syntax. | RRDgraph extends the RRDtool command set to allow for a consistent syntax. | ||
== OPT == | == OPT == | ||
+ | |||
This command defines a command line option. There are two flavours of the '' | This command defines a command line option. There are two flavours of the '' | ||
Line 113: | Line 131: | ||
| | ||
== RANGE == | == RANGE == | ||
+ | |||
RRDtool needs a time range to draw graphs for. You can define one or more time ranges via the '' | RRDtool needs a time range to draw graphs for. You can define one or more time ranges via the '' | ||
Line 124: | Line 143: | ||
== INCLUDE == | == INCLUDE == | ||
+ | |||
The '' | The '' | ||
Line 130: | Line 150: | ||
=== Using templates === | === Using templates === | ||
+ | |||
The RRDgraph '' | The RRDgraph '' | ||
Line 146: | Line 167: | ||
=== Ganging === | === Ganging === | ||
+ | |||
Sometimes you have to RRD graphs that show different aspects of a data set. Like CPU load and clock frequency. Wouldn' | Sometimes you have to RRD graphs that show different aspects of a data set. Like CPU load and clock frequency. Wouldn' | ||
Line 155: | Line 177: | ||
=== Conditions === | === Conditions === | ||
+ | |||
Sometimes you want to hide some lines in longer time ranges because they clutter up the graph. Or you want to show additional information if the graph is clicked and displayed full screen. Conditions can be used to accomplish this. You can prefix any command with a question mark and add a condition. The commands are automatically ignored if the condition is false. A simple RPN parser is available for more complex setups. | Sometimes you want to hide some lines in longer time ranges because they clutter up the graph. Or you want to show additional information if the graph is clicked and displayed full screen. Conditions can be used to accomplish this. You can prefix any command with a question mark and add a condition. The commands are automatically ignored if the condition is false. A simple RPN parser is available for more complex setups. | ||
Line 185: | Line 208: | ||
| '' | | '' | ||
| '' | | '' | ||
- | | '' | + | | '' |
| '' | | '' | ||
=== Changing the border color === | === Changing the border color === | ||
+ | |||
RRDgraph sets the color of the graph border to a nice shade of gray. If you want to override this you have to override the options '' | RRDgraph sets the color of the graph border to a nice shade of gray. If you want to override this you have to override the options '' | ||
< | < | ||
Line 200: | Line 224: | ||
OPT: | OPT: | ||
</ | </ | ||
+ | |||
+ | ==== SVG binding mode ==== | ||
+ | |||
+ | Sometimes you want a more prominent appearance of your RRD data than just lines on a graph. Maybe the current network utilization should be shown on a real network map or the current temperature outside the building should be displayed in big letters. This can be achieved via the SVG binding mode. It takes a SVG image from the media library and processes it to insert values from the RRD. | ||
+ | |||
+ | === Preparing the SVG file === | ||
+ | |||
+ | SVG files are XML documents. They contain XML tags specifying what the web-browser should draw on the screen. One tool to easily create SVG files is [[https:// | ||
+ | |||
+ | To allow SVG binding the XML syntax of an SVG file is extended with the non standard '' | ||
+ | |||
+ | < | ||
+ | <?xml version=" | ||
+ | <svg xmlns: | ||
+ | <g id=" | ||
+ | <circle r=" | ||
+ | | ||
+ | < | ||
+ | | ||
+ | < | ||
+ | | ||
+ | </g> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | This SVG file shows the white Text '' | ||
+ | |||
+ | The '' | ||
+ | |||
+ | The next section shows how these variables are defined. | ||
+ | |||
+ | === Binding the data === | ||
+ | |||
+ | Recipes for binding RRD data look almost the same as normal recipes for RRD graphs. The SVG binding mode is enabled by specifying the '' | ||
+ | |||
+ | * They can only have __one__ range. This is the default range and it is used to select the data that should be processed. | ||
+ | * The created command line (see chapter OPT) is not passed to RRDgraph but to [[http:// | ||
+ | * There is the new '' | ||
+ | |||
+ | :!: **Important: | ||
+ | |||
+ | As the '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | < | ||
+ | <rrd bind=" | ||
+ | RANGE:1 Tag:now - 1day:now | ||
+ | DEF: | ||
+ | BDEF: | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | This example will read the last 24 hours of data for the RRA called '' | ||
+ | |||
+ | === Binding attributes === | ||
+ | Sometimes it's necessary to not just replace the bind tag with the formatted value but to set an attribute to a specific value based on the binding value. This can be achieved by using the '' | ||
+ | |||
+ | < | ||
+ | <bind var=" | ||
+ | <circle r=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | This example will set the '' | ||
==== Configuration options ==== | ==== Configuration options ==== | ||
+ | |||
This plugin has two configuration options. | This plugin has two configuration options. | ||
=== RRD image cache timeout === | === RRD image cache timeout === | ||
+ | |||
The timeout of the internal cache. As long as this time has not elapsed the graph is not generated again and the image from the cache is used. This value is set in seconds. | The timeout of the internal cache. As long as this time has not elapsed the graph is not generated again and the image from the cache is used. This value is set in seconds. | ||
=== Check ACL for included RRD templates === | === Check ACL for included RRD templates === | ||
+ | |||
If a template is included by using the '' | If a template is included by using the '' | ||
Line 213: | Line 310: | ||
The graphs do ACL checking by themselves. If the user can not access the DokuWiki page the graph is on it will not display. | The graphs do ACL checking by themselves. If the user can not access the DokuWiki page the graph is on it will not display. | ||
+ | |||
+ | === Virtual namespace for RRD graphs === | ||
+ | |||
+ | This sets up the virtual namespace that is used for the generated graphs. This media namespace is not visible within the media manager. | ||
+ | |||
+ | :!: **Important Warning:** Please make sure this namespace does not collide with an already existing namespace within the media manager. If a collision occurs the existing namespace will be inaccessible until you change this setting. | ||
+ | |||
+ | The default setting is '' | ||
===== Change Log ===== | ===== Change Log ===== | ||
+ | |||
* **2014-12-10** Release 1 | * **2014-12-10** Release 1 | ||
* Initial Release | * Initial Release | ||
Line 220: | Line 326: | ||
* Better locking (readers-writer-lock) while updating the rrd images within the cache. This should prevent incomplete images on well frequented graphs. | * Better locking (readers-writer-lock) while updating the rrd images within the cache. This should prevent incomplete images on well frequented graphs. | ||
* **2015-10-10** Release 3 | * **2015-10-10** Release 3 | ||
- | * Minor update for compatibility DokuWiki release " | + | * Minor update for compatibility |
- | | + | * **2016-01-23** Release 4 |
+ | * Compatibility with PHP7 (thanks to splitbrain). | ||
+ | * Implemented RRD binding mode to create SVG files showing values from the RRD database. | ||
+ | * **2016-08-28** Release 5 | ||
+ | * Update for DokuWiki release " | ||
+ | * Using a configurable media namespace for image rendering. This solves problems with initializing DokuWiki from within graph.php on some installations. | ||
+ | * Show a nice error message if GD or rrdgraph are missing. | ||
+ | * **2017-06-21** Release 6 | ||
+ | * Litte bug-fix to make rrdgraph compatible with PHP 7 (again). | ||
+ | * **2017-06-21** Release 7 | ||
+ | * Minor bug-fix: If the drop down menu is used for range switching instead of the tabs (on small screens) this only works one time and then goes completely haywire. | ||
+ | * **2019-01-12** Release 8 | ||
+ | * Minor bug-fix: Missing quotes on string constant. | ||
+ | * Converted all line endings to LF. | ||
+ | |||
+ | | ||
===== FAQ ===== | ===== FAQ ===== | ||
+ | |||
No FAQ yet. | No FAQ yet. |
plugin/rrdgraph.1445195077.txt.gz · Last modified: 2015-10-18 21:04 by 93.104.60.140