Cacti: [1.2.0 Beta2] Any data template with script data input method missing 'output field'

Created on 26 Oct 2018  路  7Comments  路  Source: Cacti/cacti

The 'output field' is missing in data template edit page:
image 2

Compare to 1.1.38:
image 1

Without this field, user cannot map multiple key:value from script output to the ds in data template.

beta blocker bug

All 7 comments

The reason you cannot see that field is because the code has a check to see what the type_id of the input is. In the case of the above template that is type 1. For any inputs that are type 1 - 4 or 6, the editing of that field is disabled.

I do not understand type_id. I cannot map script output like 'key1:value1 key2:value2' into data template anymore?

This was part of this commit so I will defer to @cigamit as to the correctness of this:

commit 4db6d4638b11af729bc1bc6043edfbfac1598fee
Author: cigamit <[email protected]>
Date:   Sat Aug 18 09:11:44 2018 -0500

    Feature: Remove confusion when dealing with snmp get

    - Do not allow second data source to be added to an SNMP Get data
    - Additionally clean up some messy code
    - Do data source rra removal through callback

Hmm, I might have some templates impacted by this

In fact, even if there is only one ds in script data template, this change still causes a problem. An output of script may be "enqueued:1000". Although this format is correct, it will not be accepted by template made by Cacti 1.2. Because of script data template has no mapping info now, Cacti cannot recognize script's output that have "keys".

Here is the debug message with my Cacti 1.2:

2018/10/27 08:30:01 - SPINE: Poller[Main Poller] Device[Cacti] HT[1] DS[Cacti - Syslog Status] Graphs[Cacti - Syslog Stats] SCRIPT: bash /opt/cacti-web/scripts/enqueued.sh, output: enqueued:17810

Above message shows Cacti now put whole "enqueued:17810" as the "value". This is incorrect.

If I import a script data template made by Cacti 1.1.38, which has correct mapping info, the debug message will be:

2018/10/27 08:30:01 - SPINE: Poller[Main Poller] Device[Cacti] HT[1] DS[Cacti - Syslog Status] Graphs[Cacti - Syslog Stats] SCRIPT: bash /opt/cacti-web/scripts/enqueued.sh 'enqueued:', output: 17810

This change may break script output format.

So, the simply way to correct this would to remove the type restriction, I'm just waiting on confirmation before I do that as to the impact reinstating that may have against fixes put in.

That was likely midnight logic. Resolved.

Was this page helpful?
0 / 5 - 0 ratings