From OpenNMS
This file contains the base templates that are used to render adhoc graphs. These are the interactively designed, one-time/adhoc, graphs created in the Resource Graphs section of the web application (accessible under "Reports"), when using the "Custom Resource Performance Reports" chooser. It's uncommon to make changes to this file, but feel free if you have the need.
As for snmp-graph.properties, historically the graphs were only of data values collected by SNMP, stored in RRD files, and graphed using rrdtool. This helps explain the name of the file, and some of the syntax and concepts used. However, OpenNMS has come a long way, and the graphs can be generated from any values collected and stored by OpenNMS, not just via SNMP. Further, these days the data is usually stored in JRobin (JRB) files, and graphed using the JRobin library, rather than by a call out to rrdtool.
The format is a standard Java "Properties" file, with all the quoting and escaping rules that implies. See [1] for a description of those rules (does anyone have a link to a canonical document from Oracle/Sun about this?)
Contents |
Reloading behaviour
OpenNMS will automatically reload this file if there are any changes made to it that cause the modified timestamp to increase.
Configuration properties
The specific properties that are used are as follows:
command.prefix
The initial prefix of all graphing commands, as used to invoke rrdtool. Only used in installations that are still using RRD files for storing data points, which hasn't been the default since 1.3.2. The string {1} and {2} will be replaced at graph generation time by the epoch-based start and end timestamps (respectively) of the timespan the graph should display. You probably don't need to mess with this. Ever.
Can use substitutions 0-3 only
output.mime
Not used anymore but still required; image/png is assumed and required to be generated by rrdtool or JRobin. The webapp will always send image/png as the mime type.
adhoc.command.title
The template to be used to generate the section of the graph 'command' which normally includes the title (so is in fact, more of a 'header' or 'prefix'). This is where you would add any other graph-level (as opposed to datasource- or line- level) configuration arguments (e.g. one of the RRD graph controls like --height). Remember that these will apply to all adhoc graphs, so only a few possibilities are likely to be truly useful (like --height and --width)
Can use substitutions 0-3 only
adhoc.command.ds
The template for the DEF lines (that extract data from the round robin database). It is highly unlikely you would *ever* want to change the default.
Can use substitutions 0-9
adhoc.command.graphline
The template used for each data item (graphline is an unfortunate naming choice). You probably want to leave the default value alone, but you could modify it in a few interesting ways to force graphs to look certain ways (or perhaps always use a particular consolidation function etc).
Can use substitutions 0-9
Available substitutions
All of the above properties can contain tokens that will be replaced at graph definition time with values supplied by the user. These are number 0-9, and must be surrounded by braces, e.g. {3}. The default configuration uses this heavily, so look there for examples.
The numeric values available are
| Substitution number | Content |
|---|---|
| 0 | RRD filename |
| 1 | start time in seconds (integer) |
| 2 | end time in seconds (integer) |
| 3 | graph title (can have spaces) |
| 4 | datasource abbreviation (arbitrary) |
| 5 | datasource name (official, from rrd) |
| 6 | datasource aggregation function |
| 7 | graph style (LINE1, LINE2, LINE3, AREA, STACK, etc.) |
| 8 | color (in html hex style, but minus the leading #) |
| 9 | datasource graph title (can have spaces) |






