Basically what the software does is write textfiles with data i want to graph. For example, i can graph the total number of users connected. What MRTG does is a cat of a file that looks like this:
Code: Select all
6
7
0 15:47
I created a Data Input Method that looks like this:
Then i created a Data Query that looks like this:
with an XML file that looks like this:
Code: Select all
<urls>
<name>Get Total Users</name>
<script_path>cat /spider/mrtg/totalusers</script_path>
<arg_prepend>|host_id|</arg_prepend>
<arg_num_indexes>count</arg_num_indexes>
<arg_index>index</arg_index>
<arg_query>query</arg_query>
<arg_get>get</arg_get>
<output_delimeter></output_delimeter>
<fields>
<avg>
<name>avg</name>
<direction>output</direction>
<query_name>avg</query_name>
</values>
<max>
<name>max</name>
<direction>output</direction>
<query_name>max</query_name>
</max>
<cur>
<name>cur</name>
<direction>output</direction>
<query_name>cur</query_name>
</cur>
</fields>
</urls>
Code: Select all
+ Running data query [11].
+ Found type = '4' [Script Query].
+ Found data query XML file at '/usr/share/cacti/site/plugins/dxspider/xml/dxspider.xml'
+ Error parsing XML file into an array.
+ Found data query XML file at '/usr/share/cacti/site/plugins/dxspider/xml/dxspider.xml'
+ Found data query XML file at '/usr/share/cacti/site/plugins/dxspider/xml/dxspider.xml'
+ Found data query XML file at '/usr/share/cacti/site/plugins/dxspider/xml/dxspider.xml'
This is done without reading (or finding, for that matter) a step-by-step guide on how to develop for Cacti and this is my first attempt to write something for Cacti, so i'm probably doing a zillion things wrong.
Any help or links to help is appreciated.
Thanks,
Ton.