Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created php script for cacti which outputs data in format like: <variable>:<value>
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[0] 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.

Script code:

/*$content = file_get_contents("http://".$ARGV[0]);
$air_temperature = null;
$air_humidity = null;

$xml = simplexml_load_string($content);
$air_temperature = $xml->Item[1]->Value;
$air_humidity = $xml->Item[2]->Value;

echo "temperature:".$air_temperature." humidity:".$air_humidity;*/
echo "temperature:20 humidity:15";

RRD file is not created automattically, of course after running command which is given when I turn on debug, I got my rrd file. But NaN values are shown for each needed value.

share|improve this question
Are you running the script as your Cacti user? – HTTP500 Aug 6 '12 at 15:07
What do You mean by that? I try to run script from command line, it works. And I add my script as data input method. – Daniels Pitkevičs Aug 7 '12 at 6:11
You may get a better response on the Cact forums. – jftuga Aug 7 '12 at 23:30
I already asked, but in 24 hours, there is just a few views and no replies. – Daniels Pitkevičs Aug 8 '12 at 6:03
Could you show us the output of ls -al /path/to/cacti/rra? With the actual path to the cacti directory of course. – Kenny Rasschaert Aug 23 '12 at 9:07

There are a wide variety of problems that can cause NaN in Cacti graphs.

The best thing to do is to work through the debugging checklist in the Cacti documentation.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.