Graph doesn't get polled

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
schoeppchen
Posts: 2
Joined: Wed Mar 08, 2006 7:58 am

Graph doesn't get polled

Post by schoeppchen »

Hi all,

I'm new to CACTI and have a problem creating a graph. I followed the steps in the HOWTO and set up a script that polls Apache requests per second and currently beeing processed and want to graph those. Unfortunately the event doesn't get polled automatically when all other services (ping, load average) get polled. Maybe someone can help!

The script is called apache.pl:

Code: Select all

#!/usr/bin/perl

$output = `/bin/bash -c 'wget --quiet -O - \"https:\/\/localhost\/server-status"'`;
$output =~ /(.*) requests\/sec/;
print "requests_per_second:".$1." ";
$output =~ /(.*) requests currently being processed/;
print "requests_currently:".$1;
The script output is as follows:
requests_per_second:.00521 requests_currently:1
I've set up CACTI as follows (screenshots):

Data Input Methods:
http://tinypic.com/view/?pic=qz51rm

Data Templates:
http://tinypic.com/view/?pic=qz525k

Date Sources:
http://tinypic.com/view/?pic=qz52cp

Graph Templates:
http://tinypic.com/view/?pic=qz52q1

Graph Management:
http://tinypic.com/view/?pic=qz52xg

Unfortunately the RRA Files never gets written and I have no graph. Where is the problem? I enabled the graph in devices for localhost and the device poller lists the event:

http://tinypic.com/view/?pic=qz54li

When I execute the command on shell, the RRA apears:

Code: Select all

/usr/bin/rrdtool create /usr/share/apache/monitoring/cacti/rra/localhost_requests_per_second_13.rrd --step 300  DS:requests_currently:GAUGE:600:0:100 DS:requests_per_second:GAUGE:600:0:100 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797
THanks for any help!
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) please dont host pictures off site.

2) It's better practice to have the script spit out all the data at once, instead of several times during its execution

3) Data Input Methods - you should be using the full path to perl (cactid compatability)

4) Data Input Methods - your script outputs requests_per_second and requests_currently, but you told the data input to look for "reqsec" and "reqcur". Your script doesn't output that, so cacti wont find it and collect the data.

You might want to read this too: http://forums.cacti.net/viewtopic.php?t=11288
schoeppchen
Posts: 2
Joined: Wed Mar 08, 2006 7:58 am

Post by schoeppchen »

BSOD2600 wrote: 1) please dont host pictures off site.
Sorry, did not know that this is a problem.
BSOD2600 wrote: 2) It's better practice to have the script spit out all the data at once, instead of several times during its execution
I don't quiet understand what you mean by that. The script spits out all data at once (with only one call), or what am I getting wrong?
BSOD2600 wrote: 3) Data Input Methods - you should be using the full path to perl (cactid compatability)
Done!
BSOD2600 wrote: 4) Data Input Methods - your script outputs requests_per_second and requests_currently, but you told the data input to look for "reqsec" and "reqcur". Your script doesn't output that, so cacti wont find it and collect the data.
Ok, already configured it like that, but formerly this did not change a thing.

So, I changed all the things but nothing happened. So for testing purposed I removed the graph from the device and tried to reset it to the device. So I chose 'Create Graphs for this Host' but the entry "Apache Requests" did not show up anymore in the select box. After searching for some time I found an entry "Host Templates" -> "Local Linux Machine" wher I could chose "Apache Requests" ----> e voila, the graph gets drawn.

What makes me think is that the guide I followed (the one you linked below) says:

"Apply the Graph Template to your Device. No go to the Devices and select the one of your choice."

Which is exactly what I did but now it seems that I should have gone the other way via "Host Templates" -> "Local Linux Machine". Why that?
BSOD2600 wrote: You might want to read this too: http://forums.cacti.net/viewtopic.php?t=11288
This was exactly the guide I was following when setting up this service, I must have missed something.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest