Webhits graph is empty

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

Moderators: Developers, Moderators

Post Reply
brakhage
Posts: 4
Joined: Fri Mar 11, 2005 4:57 am

Webhits graph is empty

Post by brakhage »

Hello,


I am new to Cacti, even if I already put it on a few servers. Until now, I just used the basic available graphs, without searching to do something new. But now, I have to do some of them, so I am into the documentation for a few days.

Actuallty, I am trying to check webhits on my server.

So I put the script webhits as defined on the Cacti website :

Code: Select all

#!/usr/bin/perl

if ($ARGV[0] eq "") {
        $log_path = "/usr/local/apache/logs/access_log";
}else{
        $log_path = $ARGV[0];
}

$webhits = `wc -l $log_path`;
$webhits =~ s/[\s]*([0-9]+).*//;

print $1;
When I su to cactiuser (aka nobody, the apache, chmoded to nobody, rra/, log/ and access_log), and I perl webhits.pl, the scripts give me informations :

Code: Select all

bash-2.05b$ whoami
nobody
bash-2.05b$ perl webhits.pl
2398
When I refresh a web page, it changes by the number of hits from the web pages, so I guess the perl script is okay.

Now, in Cacti, I did the above stuff :

Data Input Method:

Name: Apache Hits
Input type: Script/Command
Input string: perl <path_cacti>/scripts/webhits.pl
Output fields: webhits with the "Update RRD File" checkboxes

Data Template:

Name: Unix - Apache Hits
Data Input Method: Apache Hits
Internal Data Source Name: apache_hits
Output Field: webhits - Apache Hits

Data Source:

Selected Data Template: Unix - Apache Hits
Host: Localhost
Data Source Path: <path_rra>/localhost_apache_hits_18.rrd

Graph Management:

Selected Graph Template: Unix - Apache Hits
Host: Localhost
Data Source [apache_hits]: Localhost - Apache Hits (apache_hits)


I did all of this, as I read the cacti manual, so I guess it should work. But, unfortunatly, it doesn't. The graph stay empty.

Any idea ?
brakhage
Posts: 4
Joined: Fri Mar 11, 2005 4:57 am

Post by brakhage »

I found the problem.
When the webhits are more than 500, the graph is empty.

So, I changed the Maximum Value in the Data Template to 500000, but I still have nothing...

another idea ?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests