Attached is a rather large patch, which replaces function render_msg in module dm_tests.pm. In the original code, there are three places where the flags (attributes) of an OID (variable), such as {MyOid.color}, are replaced by their current value. It was found that they behave differently. Function parse_deps is renamed to render_msg_line, and is extended to handle a single line from the message template. It also handles the substitution of variables for a row in a table. The logic to render a table is moved to function render_msg_table.
This patch results in a consistent way of recognising and handling the flags of OIDs. For instance, {MyOid.thresh:red} can now be used in the message in file thresholds. Moreover, some small bugs are resolved which could cause a known OID not to be substituted. This patch descreases the size of module dm_tests.pm.
A separate function named map_leaf_name is introduced. It serves as a hook to implement a site-specific naming convention for the RRD files, and thus the ordering of graphs. For example, at NLR it is used to map the names of interfaces of Cisco switches. It maps a name like ‘Gi1/0/2’ on ‘Gi1/0/02’, causing the associated graph to appear before the graph of ‘Gi1/0/10’.
This patch includes patches number 24, 27 and 34, and it relies on patch number 23 to be installed.
Attached is both the difference and the current version of the module. The latter is included as the changes are hard to understand from the differences only.
And the second attachment.
Attached is a patch for this patch, containing two improvements.
A- The errormessages shown at the top of the page were followed by an empty line. One newline is removed from those messages.
B- One line of code was forgotten: it truncates the numbers to be stored in an RRD-table to an integer value. It is added by this patch, but only if the type of the associated dataset is either COUNTER or DERIVE. For other types of datasets, no truncation to an interger value is performed.