[XML] ApacheStats version 0.4

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Rolf Poser
Posts: 42
Joined: Wed Dec 10, 2003 7:19 am

[XML] ApacheStats version 0.4

Post by Rolf Poser »

Hello Everyone!

After numerous bugs and simplifications, I thought it would be prudent to put out a newer release of apachestats.

It now uses LWP by default to keep things simple, but a high-speed version is also provided. The templates have been cleaned up significantly, and there is a new graph for threads - busy/idle threads expressed as % of total threads. See the documentation for further details.

I'm attaching the intro readme.txt:

==============================================
ApacheStats v 0.4 - Copyright Rolf Poser - GNU Public License

RELEASED 20 May 2004

Please see the various documents in the "docs/" subdirectory.

Notably, the docs/TOC.txt tells you where to find what information.

Yes, all of this documentation will be made available in html form
eventually. But for now, it is content before form!

Thanks -- Rolf. (rolf@stasolutions.co.za)

QUICK INSTALL GUIDE:
=====================
(NOTE: a more detailed version of this is in docs/INSTALL.txt)

For those that can't wait to read through all of the finer detail:

(0. Do you have perl > 5.x and cacti > 0.8.5a ? This is fairly important!)

1. Pick a script - the default ws_apachestats.pl should be good for most
people (see docs/TUNING.txt for a high-speed version).

2. Copy the script to $cacti_path/scripts and make sure to name it
"ws_apachestats.pl".

3. Ensure that the apache server you are targeting has the ExtendedStatus On
and has permissions to allow for queries (look for /server-status).

4. Import the host xml file for apachestats from the xml directory.

5. Define a new graph and enter the hostname information as per usual (I'm
assuming you know how cacti works).

5. Have a cup of coffee - the graphs will only get created and populated after
two cycles of cacti querying the web server (~10 minutes on system).

6. You're welcome to post questions for help on the message board at
www.raxnet.net/board if you get stuck, although I can't promise to always be
responsive.

ApacheStats v 0.4 - Copyright Rolf Poser - GNU Public License
Attachments
apachestats-0.4.zip
ApacheStats - includes scripts, docs and xml host template
(21.75 KiB) Downloaded 8541 times
testtest
Posts: 25
Joined: Mon May 17, 2004 7:19 am
Location: Europe

Re: [XML] ApacheStats version 0.4

Post by testtest »

Rolf Poser wrote:... 0.4...
:D Rolf, thanks again for your restless work :) - you are a maniac :wink: !!

So trying to do also something, providing you at least with some testing output, since coding is for me still " dreamland" :oops:

It works now with parameter "localhost" and "127.0.0.1" for me. Going on to test it - Great work again from you !!

Greets :)
[url=http://stef.funpic.de/index.html]Stef.s small Fan Page[/url]
Free your brain with trashing away MS - no pain, no torture, no troubles of learning Linux can compete with your Freedom using it.
Rolf Poser
Posts: 42
Joined: Wed Dec 10, 2003 7:19 am

Thanks !

Post by Rolf Poser »

Testtest:

You're welcome!

Actually I'd been stalling on releasing 0.3 for a few months - been very busy with "real" (i.e. the stuff that pays the bills) work.

I realised that part of the problem was my sucky understanding of cacti templates and that the ones released with 0.2 weren't working for many people (i.e. the hostname wasn't being substituted). Also, the more I can include in the documentation, the less of a pain it is for someone trying to figure out what's wrong.

Thanks again for your assistance - I appreciate all comments, since this is my first real open source project. (My second one is Squidstats which I'll hopefully update to release 0.2 this weekend.)

Thanks,
Rolf.

PS: I don't really qualify as a seasoned programmer - most of what you see in apachestats is code that was contributed by others to this project...
Maybe 10% is mine. (OK the documentation is all mine, but that doesn't count as code.)
testtest
Posts: 25
Joined: Mon May 17, 2004 7:19 am
Location: Europe

Re: Thanks !

Post by testtest »

Rolf Poser wrote:Testtest:

You're welcome!
THX :oops:
Actually I'd been stalling on releasing 0.3 for a few months - been very busy with "real" (i.e. the stuff that pays the bills) work.
Of course :) - the bills, bills - i have tooo much, too :)
I realised that part of the problem was my sucky understanding of cacti templates and that the ones released with 0.2 weren't working for many people (i.e. the hostname wasn't being substituted). Also, the more I can include in the documentation, the less of a pain it is for someone trying to figure out what's wrong.

Thanks again for your assistance - I appreciate all comments, since this is my first real open source project. (My second one is Squidstats which I'll hopefully update to release 0.2 this weekend.)

Thanks,
Rolf.

PS: I don't really qualify as a seasoned programmer - most of what you see in apachestats is code that was contributed by others to this project...
Maybe 10% is mine. (OK the documentation is all mine, but that doesn't count as code.)
That's more than many others have, including me :lol: - so the respect and honor is YOURS. So i hope to provide, one time to come, also something useful here :).
My biggest problem is: Having been a mere, dumb MS Slut (:oops: sorry) with all shitty stuff MCE, MCNE etc. Now i am glad and proud, i've been able to leaf that disease behind. So still a lot to learn, but as i always say: never give up ... :)

BTW., Rolf, i have posted and afterwards deleted questions regarding the poss. to "graph" and "log" ports usage, like i've seen some around.
IMHO it would be not a hard task, since it could be done with maybe "netstat -t or -n | grep -c SOEMTHING", but the standard unix_tcp_connections.pl does not make a difference between specific ports, like port:21 port:22 and s.o. - so having a neat and nice graph showing connections for FTP, SSH, HTTP etc. - i 've tested today a lil bit around, but i'm stuck at getting a result of splitting the specific ports.
Have you seen somewhere a script, dealing with this feature ?

Back to your 0.4 - have it now running, not facing any error, or problem so far.
Have Lynx also on my test system, already tested both versions, Wget and Lynx - proving your "performance" results.
On my server, 1.2 GHz, 256 KB Ram, SuSE 9.0 wget is simply the fastest option, so far .

Again, greets to you :)
[url=http://stef.funpic.de/index.html]Stef.s small Fan Page[/url]
Free your brain with trashing away MS - no pain, no torture, no troubles of learning Linux can compete with your Freedom using it.
Rolf Poser
Posts: 42
Joined: Wed Dec 10, 2003 7:19 am

I've just written one:

Post by Rolf Poser »

testest

I've just released a tool that does some or perhaps all of what you're looking for.

In this forum you should find SocketStats-0.1

Good luck
Rolf.
Guest

Re: I've just written one:

Post by Guest »

Rolf Poser wrote:...
I've just released a tool that does some or perhaps all of what you're looking for...In this forum you should find SocketStats-0.1...Good luck Rolf.
:D i'm already "on the run" !! Will look and search for it, of course.
Will also post results later ! Big thanks :)
testtest
Posts: 25
Joined: Mon May 17, 2004 7:19 am
Location: Europe

Re: I've just written one:

Post by testtest »

I've just released a tool that does some or perhaps all of what you're looking for...In this forum you should find SocketStats-0.1...Good luck Rolf.
:D i'm already "on the run" !! Will look and search for it, of course.
Will also post results later ! Big thanks :)

:oops: , not logged in :oops: thx SF
[url=http://stef.funpic.de/index.html]Stef.s small Fan Page[/url]
Free your brain with trashing away MS - no pain, no torture, no troubles of learning Linux can compete with your Freedom using it.
norbert
Posts: 1
Joined: Tue May 25, 2004 8:57 am

A quick stats script for Apache2

Post by norbert »

Hello,

I adjusted the script from the scripts page to work with apache2 and be less cryptic (1 doc line, plus output naming)

Have some fun with it
testtest
Posts: 25
Joined: Mon May 17, 2004 7:19 am
Location: Europe

Re: A quick stats script for Apache2

Post by testtest »

norbert wrote:Hello,

I adjusted the script from the scripts page to work with apache2 and be less cryptic (1 doc line, plus output naming)

Have some fun with it
:) Hello Norbert, which script and where to find ? Greets Stef. :)
[url=http://stef.funpic.de/index.html]Stef.s small Fan Page[/url]
Free your brain with trashing away MS - no pain, no torture, no troubles of learning Linux can compete with your Freedom using it.
Roderik
Posts: 6
Joined: Sun Dec 07, 2003 1:22 pm

Post by Roderik »

works great! thx
irishpadres
Posts: 9
Joined: Sat Sep 13, 2003 3:46 pm
Location: Los Angeles, CA

A suggestion...

Post by irishpadres »

I've come across the problem that if a host is down, the wget process will hang there longer than 5 minutes and throw the entire cactid process out of control. So, I added -t 3 and -T 5 to the wget options to change the number of retries from unlimited to 3 and the timeout to 5 seconds.

-=Kevin=-
Last edited by irishpadres on Sun Aug 15, 2004 10:59 am, edited 1 time in total.
Guest

Post by Guest »

Hi Irishpadres
where do yo uadd these variables exactly? I think I need these variables to stop cacti showing blank images
irishpadres
Posts: 9
Joined: Sat Sep 13, 2003 3:46 pm
Location: Los Angeles, CA

Post by irishpadres »

You would modify the ws_apachestats.pl script and change the $RETRIEVER variable from

$RETRIEVER="/usr/bin/wget --user-agent=\"ApacheStats\/0.4 wget\/1.8\" -q -O -";

to

$RETRIEVER="/usr/bin/wget --user-agent=\"ApacheStats\/0.4 wget\/1.8\" -q -O - -t 3 -T 5";

-t is the number of retries
-T is the number of seconds for all timeout values (dns, connect, and read)
Rolf Poser
Posts: 42
Joined: Wed Dec 10, 2003 7:19 am

Thanks !

Post by Rolf Poser »

Thank you very much !

I'll add this to the next version of ApacheStats.

Regards,
Rolf.
Entity
Posts: 9
Joined: Sat Oct 02, 2004 12:44 pm

Post by Entity »

Very nice script and templates. Thanks for sharing them

I'm using Cacti 0.86 and Apache2 and found it working with the directive

allow from 127.0.0.1

The only thing that fooled me at first, was rrdtools complaining about all graphs and CDEFs. It turned out to be some problem with the template import. In the graph templates for the stats I had to step into each "Graph Template Item" which uses any collected data (like CDEFs) and simply save it again or otherwise the datasource wouldn't even be added to the "Graph Items Input" list.

Best regards,

Entity
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests