[XML] ApacheStats version 0.4
Moderators: Developers, Moderators
-
- Posts: 42
- Joined: Wed Dec 10, 2003 7:19 am
Great !
Paul:
Thanks - I've been searching for something like this, so thanks for pointing it out. Will give it a spin...
Regards,
Rolf.
Thanks - I've been searching for something like this, so thanks for pointing it out. Will give it a spin...
Regards,
Rolf.
-
- Posts: 42
- Joined: Wed Dec 10, 2003 7:19 am
MIB looking good!
Judging by the MIB it has some additional information that I like. Again, thanks for pointing it out to me...
Will take this further for the release after version 0.6....
Let me finish the current documentation and then I'll get started on that one.
I'm hoping to churn out a new ApacheStats release about once a month or so.
Regards,
Rolf.
Will take this further for the release after version 0.6....
Let me finish the current documentation and then I'll get started on that one.
I'm hoping to churn out a new ApacheStats release about once a month or so.
Regards,
Rolf.
I have an erreur after import template i have in Data Input Methods --> Input String
perl lt;path_cactigt;/scripts/ws_apachestats.pl lt;hostnamegt;
I must have
perl <path_cacti>/scripts/ws_apachestats.pl <hostname>
do you have a solution please ?
log of poller.php
Can't open perl script "lt": No such file or directory
sh: path_cactigt: not found
sh: /scripts/ws_apachestats.pl: not found
sh: hostnamegt: not found
Can't open perl script "lt": No such file or directory
sh: path_cactigt: not found
sh: /scripts/ws_apachestats.pl: not found
sh: hostnamegt: not found
Can't open perl script "lt": No such file or directory
sh: path_cactigt: not found
sh: /scripts/ws_apachestats.pl: not found
sh: hostnamegt: not found
Can't open perl script "lt": No such file or directory
sh: path_cactigt: not found
sh: /scripts/ws_apachestats.pl: not found
sh: hostnamegt: not found
Can't open perl script "lt": No such file or directory
sh: path_cactigt: not found
sh: /scripts/ws_apachestats.pl: not found
sh: hostnamegt: not found
perl lt;path_cactigt;/scripts/ws_apachestats.pl lt;hostnamegt;
I must have
perl <path_cacti>/scripts/ws_apachestats.pl <hostname>
do you have a solution please ?
log of poller.php
Can't open perl script "lt": No such file or directory
sh: path_cactigt: not found
sh: /scripts/ws_apachestats.pl: not found
sh: hostnamegt: not found
Can't open perl script "lt": No such file or directory
sh: path_cactigt: not found
sh: /scripts/ws_apachestats.pl: not found
sh: hostnamegt: not found
Can't open perl script "lt": No such file or directory
sh: path_cactigt: not found
sh: /scripts/ws_apachestats.pl: not found
sh: hostnamegt: not found
Can't open perl script "lt": No such file or directory
sh: path_cactigt: not found
sh: /scripts/ws_apachestats.pl: not found
sh: hostnamegt: not found
Can't open perl script "lt": No such file or directory
sh: path_cactigt: not found
sh: /scripts/ws_apachestats.pl: not found
sh: hostnamegt: not found
sorry my englisch is very bad.
ich have ah problem, i use https and port 443
the error are:
the ws_apachestats.pl are:
in httpd.conf:
ich have ah problem, i use https and port 443
the error are:
Code: Select all
reanimation:/opt/cacti/scripts # perl ws_apachestats.pl localhost 443
Global symbol "$URL" requires explicit package name at ws_apachestats.pl line 48.
Global symbol "$fullURL" requires explicit package name at ws_apachestats.pl line 57.
Execution of ws_apachestats.pl aborted due to compilation errors.
Code: Select all
#
# YOU SHOULDN"T NEED TO CHANGE ANYTHING BEYOND THIS POINT..
#
# Ensure that we have access to the right modules:
use strict;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
# First get hold of any supplied hostname, otherwise set to "localhost"
my ($hostname, $port);
if ($ARGV[0]) {
$hostname = $ARGV[0];
chomp $hostname;
} else {
$hostname = 'localhost';
}
if ($ARGV[1]) {
$port = $ARGV[1];
chomp $port;
} else {
$port = 443;
}
# Set the query URL:
$URL = "https:\/\/".$hostname.":".$port."\/server-status?auto";
# Define a user agent:
my $userAgent = new LWP::UserAgent;
$userAgent->agent("ApacheStats/0.4 ");
# Run the query:
my $request = new HTTP::Request('GET', $fullURL);
my $response = $userAgent->request($request);
# Parse the output and put out the stats to STDOUT:
if ($response->is_success) {
$response->content =~ /Total Accesses: (.*)/;
print "apache_total_hits:".$1." ";
$response->content =~ /Total kBytes: (.*)/;
print "apache_total_kbytes:".$1." ";
$response->content =~ /Busy.*: (.*)/;
print "apache_busy_workers:".$1." ";
$response->content =~ /Idle.*: (.*)/;
print "apache_idle_workers:".$1;
} else {
print $response->error_as_HTML;
}
# FIN
whats the problem?<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 192.168.1.6
Allow from localhost
Allow from 127.0.0.1
Allow from foobar.com
</Location>
You have use strict; on. When you do that, you need to declare the scope of your variables.
change:
to:
And a few lines later where you're making your request, change $fullURL, which you're neither declaring nor putting anything in, to $URL.
Should work then
change:
Code: Select all
$URL = "https:\/\/".$hostname.":".$port."\/server-status?auto";
Code: Select all
my $URL = "https:\/\/".$hostname.":".$port."\/server-status?auto";
Should work then
FreeBSD/RHEL
cacti-0.8.7i, spine 0.8.7i, PIA 3.1+boost 5.1
MySQL 5.5/InnoDB
RRDtool 1.2.27, PHP 5.1.6
cacti-0.8.7i, spine 0.8.7i, PIA 3.1+boost 5.1
MySQL 5.5/InnoDB
RRDtool 1.2.27, PHP 5.1.6
the script running with the folling error:
why?reanimation:/opt/cacti/scripts # perl ws_apachestats.pl localhost 443
<HTML>
<HEAD><TITLE>An Error Occurred</TITLE></HEAD>
<BODY>
<H1>An Error Occurred</H1>
401 Authorization Required
</BODY>
</HTML>
reanimation:/opt/cacti/scripts # perl ws_apachestats.pl 127.0.0.1 443
<HTML>
<HEAD><TITLE>An Error Occurred</TITLE></HEAD>
<BODY>
<H1>An Error Occurred</H1>
401 Authorization Required
</BODY>
</HTML>
okey, delete the .htaccess file
and this error:
the config:
[/quote]
and this error:
Code: Select all
reanimation:/opt/cacti/scripts # perl ws_apachestats.pl 127.0.0.1 443
Use of uninitialized value in concatenation (.) or string at ws_apachestats.pl line 64.
Use of uninitialized value in concatenation (.) or string at ws_apachestats.pl line 66.
apache_total_hits:
apache_total_kbytes:
apache_busy_workers:1
apache_idle_workers:5
reanimation:/opt/cacti/scripts #
Code: Select all
if ($response->is_success) {
$response->content =~ /Total Accesses: (.*)/;
[b]print "apache_total_hits:".$1." "; [/b]
$response->content =~ /Total kBytes: (.*)/;
[b]print "apache_total_kbytes:".$1." ";[/b]
$response->content =~ /Busy.*: (.*)/;
print "apache_busy_workers:".$1." ";
$response->content =~ /Idle.*: (.*)/;
print "apache_idle_workers:".$1;
} else {
print $response->error_as_HTML;
ERROR: Could not parse color in ''
Hello,
i get this error when i turn on debug for "Apache Statistics - Bytes / Request". No graph is created. Same error for "Apache Statistics - Thread Details (%)"
I'm using cacti0.8.6d.
Another question is, where the hell is apachestats0.6? The sample screenshot looks cool.
i get this error when i turn on debug for "Apache Statistics - Bytes / Request". No graph is created. Same error for "Apache Statistics - Thread Details (%)"
I'm using cacti0.8.6d.
Another question is, where the hell is apachestats0.6? The sample screenshot looks cool.
-
- Posts: 23
- Joined: Mon Jun 06, 2005 11:15 am
i am trying to use the apache template,
but i have these problems :
Apache Statistics - Bytes / Request :
not working -> RRDTool DEBUG -> ERROR: Could not parse color in ''
Apache Statistics - Hits / s :
working but i have no title nor legends ..
Apache Statistics - kBits / s120x500
working but i have no title nor legends ..
Apache Statistics - Thread Details
working but i have no title nor legends ..
Apache Statistics - Thread Details (%)
not working -> RRDTool DEBUG -> ERROR: Could not parse color in ''
i am sorry, maybe its because i dont use cacti correctly .. i am a beginner with it. But i would appreciate any answer. Thank you.
but i have these problems :
Apache Statistics - Bytes / Request :
not working -> RRDTool DEBUG -> ERROR: Could not parse color in ''
Apache Statistics - Hits / s :
working but i have no title nor legends ..
Apache Statistics - kBits / s120x500
working but i have no title nor legends ..
Apache Statistics - Thread Details
working but i have no title nor legends ..
Apache Statistics - Thread Details (%)
not working -> RRDTool DEBUG -> ERROR: Could not parse color in ''
i am sorry, maybe its because i dont use cacti correctly .. i am a beginner with it. But i would appreciate any answer. Thank you.
[My config :
Windows XP Service Pack 2
ActivePerl-5.8.6.811-MSWin32-x86-122208
cacti-0.8.6d
mysql-4.1.12-win32
php-5.0.4-Win32
rrdtool-cygwin-1.2.9
net-snmp-5.2.1
apache_2.0.54-win32-x86-no_ssl]
Windows XP Service Pack 2
ActivePerl-5.8.6.811-MSWin32-x86-122208
cacti-0.8.6d
mysql-4.1.12-win32
php-5.0.4-Win32
rrdtool-cygwin-1.2.9
net-snmp-5.2.1
apache_2.0.54-win32-x86-no_ssl]
-
- Posts: 9
- Joined: Sat Sep 13, 2003 3:46 pm
- Location: Los Angeles, CA
Hi all
Thanks for this code, it look great But I've a problem with LWP. I have errors when I want to install it, and I don't understadn what is the problem...
Here's my log when I try to install LWP using 'install Bundle::LWP' in perl CPAN shell :
I don't undestand where is the problem, if anyone can help me...
Thanks
Thanks for this code, it look great But I've a problem with LWP. I have errors when I want to install it, and I don't understadn what is the problem...
Here's my log when I try to install LWP using 'install Bundle::LWP' in perl CPAN shell :
Code: Select all
cpan> install Bundle::LWP
Running install for module MIME::Base64
Running make for G/GA/GAAS/MIME-Base64-3.05.tar.gz
Is already unwrapped into directory /root/.cpan/build/MIME-Base64-3.05
Has already been processed within this session
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Digest::MD5 is up to date.
Running install for module URI
Running make for G/GA/GAAS/URI-1.35.tar.gz
Is already unwrapped into directory /root/.cpan/build/URI-1.35
Has already been processed within this session
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Running install for module Net::FTP
Running make for G/GB/GBARR/libnet-1.19.tar.gz
Is already unwrapped into directory /root/.cpan/build/libnet-1.19
Has already been processed within this session
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Running install for module HTML::Tagset
Running make for S/SB/SBURKE/HTML-Tagset-3.04.tar.gz
Is already unwrapped into directory /root/.cpan/build/HTML-Tagset-3.04
Has already been processed within this session
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Running install for module HTML::Parser
Running make for G/GA/GAAS/HTML-Parser-3.45.tar.gz
Is already unwrapped into directory /root/.cpan/build/HTML-Parser-3.45
Has already been processed within this session
Running make test
---- Unsatisfied dependencies detected during [G/GA/GAAS/HTML-Parser-3.45.tar.gz] -----
HTML::Tagset
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]
Running make install
make had returned bad status, install seems impossible
Delayed until after prerequisites
Running install for module HTML::HeadParser
Running make for G/GA/GAAS/HTML-Parser-3.45.tar.gz
Is already unwrapped into directory /root/.cpan/build/HTML-Parser-3.45
Has already been processed within this session
Delayed until after prerequisites
Running make test
Can't test without successful make
Delayed until after prerequisites
Running make install
make had returned bad status, install seems impossible
Delayed until after prerequisites
Running install for module LWP
Running make for G/GA/GAAS/libwww-perl-5.803.tar.gz
Is already unwrapped into directory /root/.cpan/build/libwww-perl-5.803
Has already been processed within this session
Running make test
---- Unsatisfied dependencies detected during [G/GA/GAAS/libwww-perl-5.803.tar.gz] -----
URI
Compress::Zlib
HTML::Parser
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]
Running make install
make had returned bad status, install seems impossible
Delayed until after prerequisites
Bundle summary: The following items in bundle Bundle::LWP had installation
problems:
MIME::Base64 URI Net::FTP HTML::Tagset HTML::Parser HTML::HeadParser LWP
Running install for module URI
Running make for G/GA/GAAS/URI-1.35.tar.gz
Is already unwrapped into directory /root/.cpan/build/URI-1.35
Has already been processed within this session
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Running install for module Compress::Zlib
Running make for P/PM/PMQS/Compress-Zlib-1.34.tar.gz
Is already unwrapped into directory /root/.cpan/build/Compress-Zlib-1.34
Has already been processed within this session
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Running install for module HTML::Parser
Running make for G/GA/GAAS/HTML-Parser-3.45.tar.gz
Is already unwrapped into directory /root/.cpan/build/HTML-Parser-3.45
Has already been processed within this session
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Running make for G/GA/GAAS/libwww-perl-5.803.tar.gz
Is already unwrapped into directory /root/.cpan/build/libwww-perl-5.803
Has already been processed within this session
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Running install for module HTML::Tagset
Running make for S/SB/SBURKE/HTML-Tagset-3.04.tar.gz
Is already unwrapped into directory /root/.cpan/build/HTML-Tagset-3.04
Has already been processed within this session
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Running make for G/GA/GAAS/HTML-Parser-3.45.tar.gz
Is already unwrapped into directory /root/.cpan/build/HTML-Parser-3.45
Has already been processed within this session
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Thanks
Well, I didn't find what was the problem while installing LWP via perl, but a simple solve my problem
Thanks for this great code
Code: Select all
apt-get install libwww-perl
Thanks for this great code
Who is online
Users browsing this forum: No registered users and 3 guests