my graph for availability doesn't work

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
tecker2010
Posts: 24
Joined: Mon Jul 24, 2006 9:11 am
Location: Germany
Contact:

my graph for availability doesn't work

Post by tecker2010 »

hi,

i need a graph which shows the availability of a device, therefore i made the following script:

Code: Select all

<?php

mysql_connect( "localhost", "root", "mysqlroot" );
mysql_select_db("cacti");

$ausgabe = "SELECT status from host WHERE id=2";
$result = mysql_query( $ausgabe );
$datensatz = mysql_fetch_row ($result );

foreach ( $datensatz as $wert)

if ( $wert > 2 )
echo 1;

else echo 0;

?>
then i created a data input method with input type "script command" , output field and right string. and then a data template with these data input method and its outputfield. i have also a graph template which is associated to the devic and with status "is being graphed
2.
my debugs are ok. rrdtool says ok and there are no errors at the debug of my data source.

the graph is there but no values ... i get NaN. any ideas what i can do or where i have to start with searching?

greets
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please try second link of my signature to debug NaN's
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests