Problem with Custom "Script Query"

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

Moderators: Developers, Moderators

Post Reply
dennism
Posts: 1
Joined: Mon Nov 28, 2005 2:03 pm

Problem with Custom "Script Query"

Post by dennism »

Platform: FC3
Cacti Version 0.8.6g: Fresh and Patched with the lastest patches.

I'm attempting to create a custom script query for some ServerIron Vips on my network.

Here's an example of my script output via cli:
[web@someserver scripts]$ ./query_si_vips.pl si001 index
ttt1
ttt2
http1
http2
smtp1
smtp2
ns3
ns4


[web@someserver scripts]$ ./query_si_vips.pl si001 query vips
ttt1:0
ttt2:4472
http1:4207
http2:0
smtp1:9
smtp2:0
ns3:0
ns4:4370

Here's my Script Query .xml File:
<query>
<name>Get ServerIron VIP Data</name>
<description>Get ServerIron VIP Data.</description>
<script_path>perl |path_cacti|/scripts/query_si_vips.pl</script_path>
<arg_prepend>|host_hostname|</arg_prepend>
<arg_index>index</arg_index>
<arg_query>query</arg_query>
<arg_get>get</arg_get>
<output_delimeter>:</output_delimeter>
<index_order>vipName:vipNcc</index_order>
<index_order_type>alphabetic</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>

<fields>
<vipName>
<name>Vip Name</name>
<direction>input</direction>
<query_name>vips</query_name>
</vipName>
<vipNcc>
<name>Number of Current Connections</name>
<direction>output</direction>
<query_name>vips</query_name>
</vipNcc>
</fields>
</query>

And finally here's my .xml parsed debug output from cacti:

Data Query Debug Information
+ Running data query [11].
+ Found type = '4 '[script query].
+ Found data query XML file at '/spln/src/cacti/resource/script_queries/si_vips.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl /spln/src/cacti/scripts/query_si_vips.pl si001 index'
+ Executing script query 'perl /spln/src/cacti/scripts/query_si_vips.pl si001 query vips'
+ Found data query XML file at '/spln/src/cacti/resource/script_queries/si_vips.xml'
+ Found data query XML file at '/spln/src/cacti/resource/script_queries/si_vips.xml'
+ Found data query XML file at '/spln/src/cacti/resource/script_queries/si_vips.xml'

Every thing seems to run but it yeilds "Success [0 Items, 0 Rows]" Note the zero Items and Rows.

I can't seem to figure out why It's not getting the data I see on the cli.

The problem goes a bit deeper but I'm starting here cause i believe this to be the root of my problems.

Any help would be GREATLY appreciated. I've read the ENTIRE cacti manual, and have been ALL over the net and cacti forum. This is my last resort :(
yar!
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Moved to general, since this is not an Informational/HOWTO's
jalba
Posts: 2
Joined: Fri Jul 21, 2006 3:24 pm

hy

Post by jalba »

I have exactly the same problem. I don't know what to do. Did you find any answer?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

One problem with that script is that there are hard returns after each value. Cacti doesnt like that. Keep them all on the same line.
jalba
Posts: 2
Joined: Fri Jul 21, 2006 3:24 pm

Post by jalba »

The problem is with perl script (i'll find it). Even so

[root@server scripts]# ./query_unix_partitions.pl index
/dev/hda1
/dev/hda2
/dev/hda3

is more than one line and work perfect.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Problem with Custom "Script Query"

Post by gandalf »

dennism wrote: <fields>
<vipName>
<name>Vip Name</name>
<direction>input</direction>
<query_name>vips</query_name>
</vipName>
<vipNcc>
<name>Number of Current Connections</name>
<direction>output</direction>
<query_name>vips</query_name>
</vipNcc>
</fields>
</query>
<query_name>vips occurs twice. Without digging deeper this seems strange to me. And please report the outcome of a "get" call.
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests