I was updating one of our internal maps today, and made it use some handy new 0.9 features. It's a temperature map, showing the current readings on a series of 1-Wire iButtonLink sensors that we have around the datacentre, in the floor, racks and cable trays, and around the power and cooling plant. Some custom Perl scripts read those values into RRDs, produce some html and images, and then Weathermap maps them out over a plan of the DC.
The cool part today was that by using the same node name as the rrd filename and the graph and HTML filenames, I was able to add new nodes to the map with 2 lines, and they work by 'magic'. Just the NODE and POSITION commands are needed! Everything else (OVERLIBGRAPH, INFOURL, LABEL, TARGET, SCALE, MAXVALUE) is defined in the DEFAULT node. The few non-standard nodes have TARGETS and so on defined to override the default, but it made my config file a whole lot shorter (5 lines per node), and easier to maintain (1 edit instead of 20+ for each node):
# DEFAULT definitions:
NODE DEFAULT
LABEL {node:this:bandwidth_in:%0.2f}
LABELFONT 2
OVERLIBCAPTION History for {node:this:name}
OVERLIBGRAPH http://intranet/temp/graphs/temp_{node:this:name}.png
TARGET gauge:/var/rra/temp_{node:this:name}.rrd:temp:temp
INFOURL http://intranet/temp/graphs/temp_{node:this:name}.html
OVERLIBWIDTH 445
OVERLIBHEIGHT 192
MAXVALUE 50
NODE Generator
POSITION 83 65
NODE DC_PatchPanel
POSITION 678 534
- Howie's blog
- Login or register to post comments