A graph definition needs to have a TITLE and a YAXIS setting. These are texts shown as the title of the graph, and the YAXIS heading respectively. (The X-axis is always time-based).
If a fixed set of RRD files are used for the graph, you just write those in the RRDtool definitions. Note that Xymon keeps all RRD files for a host in a separate directory per host, so you need not worry about the hostname being part of the RRD filename.
For graphs that use multiple RRD files as input, you specify a filename pattern in the FNPATTERN statement, and optionally a pattern of files to exclude from the graph with EXFNPATTERN (see "[tcp]" for an example). When FNPATTERN is used, you can use "@[email protected]" in the RRDtool definitions to pick up each filename. "@[email protected]" is an index (starting at 0) for each file in the set. "@[email protected]" contains the first word extracted from the pattern of files (see e.g. "[memory]" how this is used). "@[email protected]" picks a new color for each graph automatically.
The remainder of the lines in each definition are passed directly to the RRDtool rrd_graph() routine.
The following is an example of how the "la" (cpu) graph is defined. This is a simple definition that uses a single RRD-file, la.rrd:
TITLE CPU Load
AREA:la#00CC00:CPU Load Average
GPRINT:la:LAST: : %5.1lf (cur)
GPRINT:la:MAX: : %5.1lf (max)
GPRINT:la:MIN: : %5.1lf (min)
GPRINT:la:AVERAGE: : %5.1lf (avg)\n
Here is an example of a graph that uses multiple RRD-files, determined automatically at run-time via the FNPATTERN setting. Note how it uses the @[email protected] to define a unique RRD parameter per input-file, and the @[email protected] and @[email protected] items to pick unique colors and a matching text for the graph legend:
TITLE Disk Utilization
YAXIS % Full
DEF:[email protected]@[email protected]@:pct:AVERAGE
LINE2:[email protected]@#@[email protected]:@[email protected]
GPRINT:[email protected]@:LAST: : %5.1lf (cur)
GPRINT:[email protected]@:MAX: : %5.1lf (max)
GPRINT:[email protected]@:MIN: : %5.1lf (min)
GPRINT:[email protected]@:AVERAGE: : %5.1lf (avg)\n
The /usr/local/bin/graphtitle command is then called with the hostname, the graphtype, the period string, and all of the RRD files used as parameters. The script must generate one line of output, which is then used as the title of the graph. Each of the RRD pathname parameters will be enclosed in double quotes.