2 differents script in Data Query & Data Input Method?

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
ricardcc
Posts: 4
Joined: Thu Feb 17, 2011 3:22 pm

2 differents script in Data Query & Data Input Method?

Post by ricardcc »

Hi,

I'm working to graph values from a csv file to output statistics from traffic shapper.
This csv value have this fields: Pipe Name, TotalBandwith, Bandwith in, Bandwith out, Connections.....

Manufacturer sends me a script that shows these fields by a PipeName. This script is called by sintax script.pl <pipename>
and shows this output tbw:xx bwin:xx bwout:xx ....
I put this script in Data Input Method, I create a graph & data template associated to it and it works fine.
Manually, I can create Data Sources & Graphs, and it works.

My problem is that this csv have 200 rows, and I must create 200 graphs, whis this associated Data Source. I'm trying to automate it.

I've developed a script that shows Pipe Names to select it by means of Data Query when you add a device. I have an xml file associated to it, and seems that it works fine. When I create a device and associated it this Data Query, it shows all PipeNames to contains the csv file.

How must I configure cacti to pass the |query_fieldnameX| in the input field in the Data Input Method? I try to put into input custom value in Data Template, but it does'nt work :cry:

Thanks!
ricardcc
Posts: 4
Joined: Thu Feb 17, 2011 3:22 pm

Re: 2 differents script in Data Query & Data Input Method?

Post by ricardcc »

Viewing the Poll Cache, it seems that |query_fieldname| is not translated to real name. My field is named nompipe in data query xml file and i call this field by means of |query_nompipe|.

If I go to Poller Cache, i can view:

Script: perl /var/www/cacti/scripts/nx2cacti.pl |query_nompipe|
RRD: /var/www/cacti/rra/allot_netxplorer_outbw_1562.rrd



Thanks,
dignome
Posts: 8
Joined: Sat Jan 29, 2011 4:01 pm

Re: 2 differents script in Data Query & Data Input Method?

Post by dignome »

Hi. I remember when adding index support to my script it was necessary to check "Use Per-Graph Value (Ignore this Value)" under the graph template definition for "Title (--title)." Then under "Data Queries" for the associated graph template one would add a field for "Suggested Values -> Graph Template - ...." Here is a sample from my query definition:


Graph Template - UBNT - Station List - Client Connection Quality (CCQ):
title |host_description| - Station CCQ (|query_staMAC| - |query_staLastIP| - |query_staName|)

where "title" is the field name.

staMAC, staLastIP, and staName from XML file:

Code: Select all

        <staMAC>
            <name>WLAN MAC</name>
            <direction>input</direction>
            <query_name>mac</query_name>
        </staMAC>
        
        <staName>
            <name>Unit Name</name>
            <direction>input</direction>
            <query_name>name</query_name>
        </staName>

        <staLastIP>
            <name>Last IP</name>
            <direction>input</direction>
            <query_name>lastip</query_name>
        </staLastIP>
Then to see the change you would go to "Graph Management" and for the action choose to "Reapply Suggested Names" for the selected graphs.
qmesbah
Posts: 2
Joined: Thu Jan 04, 2007 8:21 am

Re: 2 differents script in Data Query & Data Input Method?

Post by qmesbah »

Hi ricardcc,
Does your script working properly?
Would you please suggest me how can i generate utilization graph for all the Line, Pipe and VC form NetXplorer Server.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests