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.
No graph displayed
Moderators: Developers, Moderators
-
- Posts: 3
- Joined: Tue Jan 30, 2007 1:51 am
Who is online
Users browsing this forum: No registered users and 1 guest