No graph displayed

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

Moderators: Developers, Moderators

Post Reply
alexnderit
Posts: 3
Joined: Tue Jan 30, 2007 1:51 am

No graph displayed

Post by alexnderit »

I have a problem graphing perl output values with cacti. I follwed the random2.pl example given in this site, to the letter and my graph is not showing correctly. Its picking a value of 0 instead of varying values so i have a line running at 0. Here is my perl script
------------------------------------------------------------------------------------------------------
#!/usr/local/bin/perl
$file = '/usr/local/www/data/pcf/mombasa';#Open file
open(INFO, "<$file"); # Open the file
@lines = <INFO>; # Read it into an array
#print @lines[18]; # Print the array
$master = "@lines[18]"; #Assign master entry to a string
@connected_master = split ' ', $master;#Split the string to an array
#print int(@connected_master[1]); #Get the second element(connected user) from the array

$slave = "@lines[19]";
@connected_slave = split ' ', $slave;
$total= int(@connected_master[1]) + int(@connected_slave[1]);#Total the master and slave;
#chop $total;
#print int(@connected_slave[1]); #Get the second element(connected user) from the array
chomp ($total);
print int($total);
---------------------------------------------------------------------------------------------------
I want to graph the $total. Running it from the shell gives correct values. I have also set permission for the perl script to 777 to eliminate permission issues.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Does cactiser have access to the file that is read by this pgm?
Reinhard
alexnderit
Posts: 3
Joined: Tue Jan 30, 2007 1:51 am

Post by alexnderit »

I had also set permission to the file to 777 but cacti was still not graphing.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Are you running cactid? If yes, please provide /full/path/to/perl when defining the Data Input Method
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest