Get Script Data: Error parsing XML file into an array

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

Moderators: Developers, Moderators

Post Reply
ayouk
Posts: 2
Joined: Fri Oct 02, 2020 4:48 am

Get Script Data: Error parsing XML file into an array

Post by ayouk »

Hi,

I have problems creating a script data query.
I'm following this walthtough: https://docs.cacti.net/manual:087:3a_ad ... alkthrough
When trying the script I have this error:

Total: 0.000000, Delta: 0.000000, Found data query XML file at '/usr/share/cacti/resource/script_queries/XXX.xml'
Total: 0.000000, Delta: 0.000000, Running Data Query [20].
Total: 0.000000, Delta: 0.000000, Found Type = '4' [Script Query].
Total: 0.000000, Delta: 0.000000, Found data query XML file at '/usr/share/cacti/resource/script_queries/XXX.xml'
Total: 0.000000, Delta: 0.000000, Error parsing XML file into an array.

There seems to be no issue when trying to convert the file into an array using this website: https://wtools.io/convert-xml-to-php-array

I tried using the tag <interface> as shown here: https://docs.cacti.net/manual:087:3a_ad ... alkthrough and the tag <query> as shown here: https://www.cacti.net/downloads/docs/ht ... y_xml.html but both of them give me the same result.

My CACTI version is 1.2.8 and you can see below my XML file.

Any help would be very appreciated, thanks !

Code: Select all


<query>
        <name>Get ARP Table</name>
        <description>Queries a list of number of ARP entries per interface.</description>
        <script_path>sh |path_cacti|/scripts/hydra_arp_counter.sh</script_path>
        <arg_prepend>|host_hostname|</arg_prepend>
        <arg_index>index</arg_index>
        <arg_query>query</arg_query>
        <arg_get>get</arg_get>
        <arg_num_indexes>num_indexes</arg_num_indexes>
        <output_delimeter>:</output_delimeter>
        <index_order>fwDevice</index_order>
        <index_order_type>alphabetic</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>
        <fields>
                <fwDevice>
                        <name>Firewall IP</name>
                        <direction>input</direction>
                        <query_name>device</query_name>
                </fwDevice>
                <fwInterface>
                        <name>Interface Name</name>
                        <direction>output</direction>
                        <query_name>int</query_name>
                </fwInterface>
                <fwARPs>
                        <name>ARP Entries</name>
                        <direction>output</direction>
                        <query_name>arp</query_name>
                </fwARPs>
        </fields>
</query>

User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Get Script Data: Error parsing XML file into an array

Post by Osiris »

Move to 1.2.14 ASAP. There were some issues between 1.2.4 and 1.2.10.
Before history, there was a paradise, now dust.
ayouk
Posts: 2
Joined: Fri Oct 02, 2020 4:48 am

Re: Get Script Data: Error parsing XML file into an array

Post by ayouk »

That did the trick, thanks !
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests