Search code examples
opennms

OpenNMS - Monitor VPN Tunnel Traffic


Is it possible to generate a SINGLE graph which lists all the active VPN tunnels/session's traffic? (Single line for each tunnel, example, 10 tunnels will be represented by 10 individual lines)

Note:

  1. In the agent device, active tunnels and their traffic 'counter' is stored in a tables, I'm retrieving it through 'snmpwalk'.
  2. I've created 'resourceType' and associated it with group/mibObj.
  3. OpenNMS creates multiple 'sub directories' and relevant rrd files.
  4. Each sub directory (for each sessions) have an 'alias' rrd file.
  5. I need to access the 'alias' files (btw all these files have the same name) which are located in different 'paths' to generate such a graph, does OpenNMS has a way to do so?

Thank you.


Solution

  • There are a couple of ways to do this.

    1) The traditional way

    First it helps to understand how OpenNMS stores data in the RRD files. Usually they are stored in a directory structure that starts off /opt/opennms/share/rrd/snmp. The next directory is usually the nodeid for the device. Anything that is a "node" level value (i.e. only occurs once per device) is stored there. Interface level data is stored in a subdirectory made up of the interface description and its MAC address. Generic resource types (like the one you created) are stored in a subdirectory starting with the resource type name.

    OpenNMS defines graphs in the files found in snmp-graph.properties.d. The two values of interest to this discussion are "type" and "columns". The "type" tells OpenNMS where to look for the RRD file: nodeSnmp is the nodeid directory, interfaceSnmp would be the interface directory, and "resourceType" would be the name of the generic resource. The "columns" value tells OpenNMS to look for a file with that name.

    For example, if I have:

    report.name.type=nodeSnmp report.name.columns=columnA,columnB

    Then OpenNMS is looking for two files in the device's node directory called columnA.rrd and columnB.rrd. If they exist, it will try to run the report.

    So, a kludge is that you can create symlinks and then use those names to create an RRD report.

    I usually only do this for known or important values. For example, let's say that I have three peer points: New York, Chicago and San Francisco. I could then go to a particular node directory and symlink the ifHCInOctets.rrd file for the NYC router to NYC-in.rrd and the ifHCOutOctets.rrd for that router to NYC-out.rrd. Rinse and repeat for ORD and SFO. Then you just create a report with a type of "nodeSnmp" and the columns of NYC-in,NYC-out,ORD-in,ORD-out,SFO-in and SFO-out.

    As I mentioned, it is a kludge, which is why you can use:

    2) The Grafana method

    OpenNMS was the first third party plugin for the Grafana data visualization tool. If you set up Grafana and tie it to your OpenNMS instance you can create a template to do what you want. There is a good post about how to do that here: http://www.jessewhite.ca/opennms/grafana/2016/04/15/opennms-grafana-template-queries.html