Data Input Method Script runs multiple times

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

Moderators: Developers, Moderators

Post Reply
cessna_driver
Posts: 4
Joined: Wed Mar 07, 2007 5:38 pm

Data Input Method Script runs multiple times

Post by cessna_driver »

Hello.

I created a Data Input Method that executes a short perl script. The output is:

Breaker_1:1.2 Breaker_2:3.4........ This continues up to Breaker_84.

I have a Data Input Method and created output fields for each expected output.

Breaker_1 has a Field output of Breaker_1

I created a data source for each of the DIM's with the output name in the box Data source Item equal to that of the DIM.

I then created a graph for each data source.

Each time the poller runs it appears to execute the sctipt to gater the breaker values rather than use the expected output values.

Any ideas ??

Cacti Version 0.8.6j
Sun Solaris 10


[/img]
Attachments
1.JPG
1.JPG (108.11 KiB) Viewed 1497 times
2.JPG
2.JPG (86.42 KiB) Viewed 1497 times
3.JPG
3.JPG (128.09 KiB) Viewed 1497 times
4.JPG
4.JPG (197.01 KiB) Viewed 1497 times
5.JPG
5.JPG (192.05 KiB) Viewed 1497 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

I suggest you read over this on how to set up a script template in cacti: http://docs.cacti.net/node/200

Looks like you're script is running multiple times for the same device for each Data Source. Very inefficient.
cessna_driver
Posts: 4
Joined: Wed Mar 07, 2007 5:38 pm

Post by cessna_driver »

Thanks for the reply.
The results of the script come from one host (device) only. This is a power monitoring device connected to our circuit breaker box (84 breakers in all).

The sctipt gets the raw log a parses out the info looking for the amp values then returns Breaker_1:<Value> Breaker_2:<Value>......Breaker_n:<Value>

I used the example in the manual (http://www.cacti.net/downloads/docs/htm ... graph.html)
as a guide. The example script only returns one value... my script returns 84.... what am I missing ?...


also I did not see anything regards script template in the docs.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I assume, that your script spits out all 84 values for each call. And I assume, that you decided to graph only one breaker per graph, that is: you have 84 graphs, each for one breaker.
By creating each of this graphs, cacti associates the script with each of them. By doing so, cacti adds a new call to the script and creates a new rrd file (each holding data for all 84 breakers) for each one. Obviously, this yields a big overhead.
I recommend deleting 83 graphs along with their datasources first.
To avoid this, only create the first graph as usual (the one you've left when deleting unwanted stuff). Please create the other one's from Graph Management by adding a new Graph here, referring to the Host and to your Graph Template. As a data source item, please select one of those already existing at the first rrd file created (you will be provided with a dropdown select box).
Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

BSOD2600 wrote:I suggest you read over this on how to set up a script template in cacti: http://docs.cacti.net/node/200

Looks like you're script is running multiple times for the same device for each Data Source. Very inefficient.
Perhaps the better link would be http://docs.cacti.net/node/343, but this one is not finished. If you read the first link AND this one, this should do for most users
Reinhard
cessna_driver
Posts: 4
Joined: Wed Mar 07, 2007 5:38 pm

Post by cessna_driver »

Thanks...
cessna_driver
Posts: 4
Joined: Wed Mar 07, 2007 5:38 pm

Post by cessna_driver »

I follow what you are saying..

What is the relationship between the Data source and the Data Input Method's Output field ?

I cant see how the data source(s) link to the data input methods.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

When defining a Data Template, you'll have to select the DATA INPUT METHOD (upper half of the page). SAVE. Then, when defining a data source item, there's a dropdown that allows selecting one of the "Output Items" defined. That's for the Templates.

Using the method from above, you will have to create a Graph on your own, referencing your Graph Template and the host. If in doubt where to fill in what, please post a screenshot of this page
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests