I have created php script for cacti which outputs data in format like:
Output of my script: temperature:20 humidity:15 Then I created data input method where input string is:
php <path_cacti>/scripts/getTempHumData.php <host>
Script is placed in cacti folder / scripts.
Input field is hostname - in script I use it as $ARGV variable.
Output fields are two - temperature and humidity.
Then I assigned that script to device, added everything it needed, turned off SNMP usage for device. Device status is 'up'.
Then I created graph template and graph and assigned it to graph tree. But graph cannot be seen - it just shows that image cannot be found (that small red x in browser).
I edited my script to pass contant values in the same format, I looked in cacti/log/cacti.log but there is no entries with my host IP.
Also, there are no rrd file which graph needs - in debug mode it tries to create, but there is no rrd file created. Also in data source path rrd file which is pointed does not exists.
How can I solve this error?
Thank You in advance.
/*$content = file_get_contents("http://".$ARGV);
$air_temperature = null;
$air_humidity = null;
$xml = simplexml_load_string($content);
$air_temperature = $xml->Item->Value;
$air_humidity = $xml->Item->Value;
echo "temperature:".$air_temperature." humidity:".$air_humidity;*/
echo "temperature:20 humidity:15";