Data Input Method / Script is executed for each output field

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
AlphaLinux
Posts: 4
Joined: Thu Nov 09, 2023 4:08 pm

Data Input Method / Script is executed for each output field

Post by AlphaLinux »

Hi
using a script as Data Input method. Script provides 3 key-value pairs which are mapped to 3 Output Fields.
Then created 3 Data Sources (1 for each Output Field), created a Graph Template with those 3 Data Source items.

Every time the poller is executed, the script is called 3 times. (see attached cacti log)
i assumed that the script is called once, since data/values for all 3 Output Fields are available by calling the script.

Did i something wrong ? Feedback very much appreciated
cacti-log.png
cacti-log.png (68.34 KiB) Viewed 1029 times
data-input-method.png
data-input-method.png (17.48 KiB) Viewed 1029 times
data-source-volt-l1.png
data-source-volt-l1.png (28.38 KiB) Viewed 1029 times
graph-template.png
graph-template.png (39.61 KiB) Viewed 1029 times
data-source.png
data-source.png (12.6 KiB) Viewed 1029 times
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Data Input Method / Script is executed for each output field

Post by TheWitness »

The reason that it is polled three times is that you should have created only one Data Template with the three Data Sources, instead, you created three Data Templates with just one Data Source each. So, simply delete all the Graphs, and modify first Data Template to include the other two Data Sources, update the Graph Template and create again.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
AlphaLinux
Posts: 4
Joined: Thu Nov 09, 2023 4:08 pm

Re: Data Input Method / Script is executed for each output field

Post by AlphaLinux »

That's it !
Thank you very much for feedback :oops:
AlphaLinux
Posts: 4
Joined: Thu Nov 09, 2023 4:08 pm

Re: Data Input Method / Script is executed for each output field

Post by AlphaLinux »

While re-using one of the Data Source Item's in an another Graph (by Graph Template) is see the script is getting executed one more time.
expected behavior ?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Data Input Method / Script is executed for each output field

Post by TheWitness »

When you Edit the Graph Template, you will find a Sub-Section called Graph Item Input. You likely have an item from one of the old Data Templates with objects selected. Edit each one of them and you will see a checkbox for each Associated Graph Items. There will likely be at least one where none or just one is selected. The ones that have none selected must be removed. It's a little quirk that you have to clean up after you've initially messed up the development of a Template.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
AlphaLinux
Posts: 4
Joined: Thu Nov 09, 2023 4:08 pm

Re: Data Input Method / Script is executed for each output field

Post by AlphaLinux »

mmh, that was also my first guess.
i deleted the previous Graph Template and created a new one; still seeing the same script executed two times.
cati.log attached

Also Data Source Template with all the Data Source Items in question
data-source-template-data-source-items.png
data-source-template-data-source-items.png (21.59 KiB) Viewed 964 times
Graph Template Power with Graph Item Inputs
graph-template-power.png
graph-template-power.png (58.97 KiB) Viewed 964 times
Graph Template Volt with Graph Item Inputs
graph-template-volt.png
graph-template-volt.png (16.58 KiB) Viewed 964 times
Cacti-log
cacti-log-2.png
cacti-log-2.png (109.42 KiB) Viewed 964 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests