Prefabricated Standard Graphs
Subscribe

From OpenNMS

Jump to: navigation, search


OpenNMS provides a great number of prefabricated standard graphs for a lot of different hardware, software and different data values such as mib2 interface values, temperature, cpu load, disk usage etc..

Using Prefabricated Standard Reports

These reports are used when you select a node and go to the "Resource Graphs" menu item. They can also be extracted/embedded in other documents

Configuration

The configuration file is snmp-graph.properties. Though the name "snmp" it also allows to define graphs for other collected data too, see the graph for jboss in the config file.

When changing this file care should be taken to the upgrade process as this file might get overwritten (unless you are installing from packaging). If your changes provide new graphs that might be of interest for other users too feel free to open an enhancement bug at http://bugzilla.opennms.org. If your graphs get it into the standard distribution it relieves you from reconfiguring them after every upgrade of OpenNMS.

See SNMP_Reports_How-To for a detailed description on adding new graphs.

Brief Syntax Overview

Notes:

 * While you edit this file take care to safe only valid configurations as the config file will be read everytime a graph has to be drawn. Saving incomplete configurations might brake graphs for other users. While testing this makes it easier: just save your changed configuration file and reload your graph to see the changes, you don't have to restart OpenNMS or some of it's daemons.
 * See snmp-graph.properties for full and detailed documentation; this is just an overview


Near the top of the configuration file snmp-graph.properties there should be some entries like

reports=mib2.HCbits, mib2.bits, mib2.percentdiscards, mib2.percenterrors, \
mib2.discards, mib2.errors, mib2.packets, \
mib2.nonucastpackets, \
mib2.tcpopen, mib2.tcpcurrent, mib2.tcperrs, mib2.tcpsegs, \
mib2.icmp.msgs, mib2.icmp.problems, mib2.icmp.info, mib2.icmp.echoes, \
mib2.powerethernet, \

Add the name of the report you wish to configure here. The syntax is

 reports=repname1, repname2, repname3, \
 repname4, \
 repname

Don't forget the semicolon after each but the very last name and, if needed, the backslash for the continuation lines. The reports normally are in alphabetical order, but it's easier for upgrading the config files to add modifications at the end.

repname
internally used name of the report to reference the report definitions below. You will see it by example as "Graph Type" when defining KSC Graphs. It has to appear in the definitions of the report like
report.repname.name=Sample
report.repname.columns=
report.repname.type=
report.repname.command=
...

Where the name (here "Sample") entered in the line

report.repname.name=Sample

goes to I really don't know, if you know it please correct this here.

Next define the variables you want to graph. These variable names are coming from the rrd or jrb files, see SNMP_Reports_How-To for details.

report.repname.name=Sample
report.repname.columns=Var1,Var2,Var3
report.repname.type=
report.repname.command=
...

When creating a graph OpenNMS looks for the existing variables in the appropriate directory of the rrd-files for the node the graphs should be created for.

Note: There is no reference here to the actual rrd- or jrb file name! The reference is created by OpenNMS using the information about the node (to find his directory) and the variable names.

There might be rrd or jrb files in the node's directory. Those have to be referenced by

report.repname.type=nodeSnmp

while files from subdirectories have to be referenced by

report.repname.type=interfaceSnmp

even if they are for http-, JMX-, JVM-collections etc.

Now we are ready to define how the graph should look like. This part is "pure RRD" and described on the RRD wiki in detail so here only a brief review.

report.repname.name=Sample
report.repname.columns=Var1,Var2,Var3
report.repname.type=interfaceSnmp
report.repname.command=--title "Title of Sample Graph" \
...

The title entered here will be displayed at the top of the graph. As you see the line ends with a backslash: all following lines but the last one need this backslash, in reality this are all arguments for the call to rrd graphing tool.

report.netsnmp.memory.name=Sample
report.netsnmp.memory.columns=Var1,Var2,Var3
report.netsnmp.memory.type=interfaceSnmp
report.netsnmp.memory.command=--title "Title of Sample Graph" \
  --vertical-label bytes \
  DEF:lVar1={rrd1}:Var1:AVERAGE \
  DEF:lVar2={rrd2}:Var2:AVERAGE \
  DEF:lVar3={rrd3}:Var3:AVERAGE \
  LINE1:lVar1#FF0000:"Variable 1" \
  LINE2:lVar2#00FF00:"Variable 2" \
  LINE3:lVar3#0000FF:"Variable 3" \
  GPRINT:lVar1:AVERAGE:"Avg  \\: %8.1lf %s" \
  GPRINT:lVar1:MIN:"Min  \\: %8.1lf %s" \
  GPRINT:lVar1:MAX:"Max  \\: %8.1lf %s\\n" \
  GPRINT:lVar2:AVERAGE:"Avg  \\: %8.1lf %s" \
  GPRINT:lVar2:MIN:"Min  \\: %8.1lf %s" \
  GPRINT:lVar2:MAX:"Max  \\: %8.1lf %s\\n" \
  GPRINT:lVar3:AVERAGE:"Avg  \\: %8.1lf %s" \
  GPRINT:lVar3:MIN:"Min  \\: %8.1lf %s" \
  GPRINT:lVar3:MAX:"Max  \\: %8.1lf %s\\n" \

The DEF - statements define local variable names (lVar in the sample) from the variables included in the rrd- or jrb-files that can be used for calculations etc. and are referenced in the LINE and GPRINT statements. If you don't do any calculations it will just contain the values of the original variables from the rrd- or jrb-files.

The LINE - statements define which variable will be drawn as a line, it's colour code (RGB coded) and the name for the line in the legend.

the GPRINT statements finally print out the average, minimum and maximum values for the local variables.