Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
Is there a guide for new users of Cacti to the Script Server? I can find in the manual only information about migrating existing scripts to it - but no step by step to develop a new script.
I have made a very basic script called ss_cactitest.php which is just returning a random value, the output correct shows when using the script_server from the CLI
root@debian:/usr/share/cacti/site# php script_server.php
PHP Script Server has Started - Parent is cmd
scripts/ss_cactitest.php ss_cactitest
testval:317
I've setup a Data query, Data template, Data Source and Associated the data query with localhost. I've obviously missed something because I've enabled Statistics logging but there's nothing showing up on the log for my test script.
I'm happy to keep reading about this and work it out - but I'm just not even sure where to start looking
Well I made a little progress, but not seeing results.
I'm also a little confused about the Data Query xml needed, the documentation says the opening tag should be <query> however both of the example xmls (host_cpu.xml, host_disk.xml) use <interface>. Is <query> correct for PHP Server Scripts?
The documentation also says that you may need to restart the script server, but gives no instructions how that should be done.
For information, the Data Query debug information from the Device tab shows this
Data Query Debug Information
+ Running data query [11].
+ Found type = '6' [Script Query - Script Server].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_server/ss_cactitest.xml'
+ XML file parsed ok.
+ <arg_num_indexes> missing in XML file, 'Index Count Changed' not supported
+ Executing script for list of indexes '"/usr/bin/php" -q /usr/share/cacti/site/scripts/ss_cactitest.php ' Index Count: 1
+ Found index: testval:814
Actually I have just found http://docs.cacti.net/manual:088:3a_adv ... alkthrough which, although it's in the 8.8 manual pages looks to be a direct copy+paste from the same section of 8.7. I understand there were minor changes with the xml format but I will try to follow this guide. Certainly the php script in the example is doing more than mine is.