For some reason (speed and efficiency especially), i am trying to transform an xml file and its php script from Data Queries based on the standard "Get Script Data (Indexed)" data input method to an other Data input method which allow polling to be run by the php script_server.php script.
I've read carefully this post describe something similar to what i'm trying to do.
Here is th diff b
Code: Select all
3c3,5
< <script_path>|path_php_binary| -q |path_cacti|/scripts/plop.php</script_path>
---
> <script_path>|path_cacti|/scripts/ss_plop.php</script_path>
> <script_function>ss_plop</script_function>
> <script_server>php</script_server>
42,55c44,57
Code: Select all
cd /usr/share/cacti
php script_server.php
scripts/ss_plop.php ss_plop ... ... ...
I have had a look at the "Poller Cache Items", and i see things like that :
Code: Select all
Script: /usr/share/cacti/scripts/ss_plop.php 10.11.12.13 1 get someName 1
Code: Select all
Script Server: /usr/share/cacti/scripts/ss_plop.php ss_plop 10.11.12.13 1 get someName 1
I have also read some code in the lib/utility.php file (especially the update_poller_cache function, wich fill in the poller_item table) and tried to replay some sql request, like this one (the resulat is stored in the data_input variable) :
Code: Select all
select
data_input.id,
data_input.type_id,
data_template_data.id as data_template_data_id,
data_template_data.data_template_id,
data_template_data.active
from (data_template_data,data_input)
where data_template_data.data_input_id=data_input.id
and data_template_data.local_data_id=1606;
Code: Select all
+----+---------+-----------------------+------------------+--------+
| id | type_id | data_template_data_id | data_template_id | active |
+----+---------+-----------------------+------------------+--------+
| 11 | 4 | 1671 | 49 | on |
+----+---------+-----------------------+------------------+--------+
Code: Select all
grep '"DATA_INPUT_TYPE_' ../include/config_constants.php
define("DATA_INPUT_TYPE_SCRIPT", 1);
define("DATA_INPUT_TYPE_SNMP", 2);
define("DATA_INPUT_TYPE_SNMP_QUERY", 3);
define("DATA_INPUT_TYPE_SCRIPT_QUERY", 4);
define("DATA_INPUT_TYPE_PHP_SCRIPT_SERVER", 5);
define("DATA_INPUT_TYPE_QUERY_SCRIPT_SERVER", 6);
Anyway, i'm not sure all what i wrote is clear, but if someone understand me, i would be very happy to get some help...
thanks !