Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-4845

RrdUtils.createRRD log message is unclear

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.90
    • Fix Version/s: 18.0.0
    • Component/s: Data Output - RRD
    • Security Level: Default (Default Security Scheme)
    • Labels:

      Description

      org.opennms.netmgt.rrd.RrdUtils has a method createRRD() which is used to create the RRD files for the data collections. This method logs an informational log message of 'createRRD: creating RRD file ${rrdFile}' for every call to that method.

      Unfortunately, this isn't really true. The RRD file is only created if the file does not already exist. RrdStrategy.createDefinition() will return null if the underlying file already exists.

      This will cut down on some unnecessary logging, and also be more informative to the admin's on when the files are actually created.

      diff --git a/opennms-rrd/opennms-rrd-api/src/main/java/org/opennms/netmgt/rrd/RrdUtils.java b/opennms-rrd/opennms-rrd-api/src/main/java/org/opennms/netmgt/rrd/RrdUtils.java
      index 02cd883..dc5de2a 100644
      — a/opennms-rrd/opennms-rrd-api/src/main/java/org/opennms/netmgt/rrd/RrdUtils.java
      +++ b/opennms-rrd/opennms-rrd-api/src/main/java/org/opennms/netmgt/rrd/RrdUtils.java
      @@ -181,10 +181,11 @@ public abstract class RrdUtils {

      String completePath = directory + File.separator + fileName;

      • log().info("createRRD: creating RRD file " + completePath);
        -
        try
        Unknown macro: { Object def = getStrategy().createDefinition(creator, directory, rrdName, step, dataSources, rraList);+ if (def != null) { + log().info("createRRD: creating RRD file " + completePath); + } getStrategy().createFile(def); return true; }

        catch (Throwable e) {

        Attachments

          Activity

            People

            • Assignee:
              seth Seth Leger
              Reporter:
              ronald.roskens@biworldwide.com Ron Roskens
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: