[XML] successor to apachestats 0.4

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

Moderators: Developers, Moderators

Post Reply
uno
Posts: 32
Joined: Mon Aug 27, 2007 7:22 am

Re: [XML] successor to apachestats 0.4

Post by uno »

I noticed that the thread detail and thread detail % graphs work if I don't have ExtendedStatus On. But then the remaining graphs don't work, of course. The output looks correct for both, except some return data is missing when ExtendedStatus is off.
uno wrote:Hi.
I am using this script+template to graph an apache server status.
My problem is that the cpu load and all the"threads" graphs are empty and show nan for all values. I can see in the cacti log that the script gets the correct values from Apache.

Server-status:

Code: Select all

Total Accesses: 22599
Total kBytes: 1847842
CPULoad: .000292752
Uptime: 75149
ReqPerSec: .300723
BytesPerSec: 25179.2
BytesPerReq: 83728.9
BusyWorkers: 2
IdleWorkers: 18
Scoreboard: ._____.__..._.K._._W.._.__....___..._.._..........
Cacti log:

Code: Select all

10/05/2010 02:30:17 PM - SPINE: Poller[0] Host[158] TH[1] DS[4232] SS[4] SERVER: /usr/local/cacti/scripts/ss_apache_stats.php ss_apache_stats hostname, output: apache_total_hits:22355 apache_total_kbytes:1825947 apache_cpuload:.000373747 apache_busy_workers:23 apache_idle_workers:18 thread_W:18 threadS:0 threadR:0 threadW:2 threadK:15 threadD:0 threadC:6 threadL:0 threadG:0 threadI:0 thread_O:215 
ocoralan
Posts: 21
Joined: Mon Apr 25, 2011 7:38 pm

Re: [XML] successor to apachestats 0.4

Post by ocoralan »

I met another question, all graphs work fine except the CPU load, there is no data on the graph. I manually execute the rrdtool command as the following:

Code: Select all

C:\rrdtool>rrdtool fetch c:\AppServ\www\netvisual\rra\apache_web_server_apache_cpuload_17.rrd AVERAGE
The result is:

Code: Select all

...
1306902600: nan
1306902900: nan
1306903200: nan
1306903500: 0.0000000000e+00
1306903800: nan
1306904100: nan
1306904400: nan
1306904700: nan
I had checked the log, it says:

Code: Select all

06/01/2011 01:17:01 PM - CMDPHP: Poller[0] Host[3] DS[17] WARNING: Result from SERVER not valid. Partial Result: U
I donn't know what had happened? I hope somebody can help me.
My environment is cacti 0.8.7g + PA v2.8 on windows xp and the apache server is installed on the localhost.
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: [XML] successor to apachestats 0.4

Post by noname »

ocoralan wrote:I had checked the log, it says:

Code: Select all

06/01/2011 01:17:01 PM - CMDPHP: Poller[0] Host[3] DS[17] WARNING: Result from SERVER not valid. Partial Result: U
Please perform this and post its result:
% perl ws_apachestats.pl <your_hostname>
catchvjay
Posts: 22
Joined: Tue May 17, 2011 11:39 am

Re: [XML] successor to apachestats 0.4

Post by catchvjay »

Hi,

I have apache installed in /apps/apache folder. httpd.conf and all logs files are the in /apps/apache. Do i need to make any change in the script to refer to those locations? Rightnow i am not getting any out put in the graph. I am using cacti 0.8.7g.

Regards,
Vijay
Attachments
Apache Stat Graph
Apache Stat Graph
Apache_Stats.png (24.06 KiB) Viewed 7452 times
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Re: [XML] successor to apachestats 0.4

Post by hid3 »

Hello everyone.

I'm using the apachestats described in the very first post.

I have noticed that the author says it uses 7 .rrd files to hold the same data. Was there any update on that to get rid of 6 'duplicate' files? Is there any manual way to get rid of them?

Thanks!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: [XML] successor to apachestats 0.4

Post by gandalf »

hid3 wrote:Was there any update on that to get rid of 6 'duplicate' files?
No, this can"t be solved on the template side.
Is there any manual way to get rid of them?
Yes, and this should be described more than once already. Shortly speaking, delete all superfluous data sources and keep only one of them. Then change the generated graph definitions and point those "invalid" data source references to those that have been left.
R.
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Re: [XML] successor to apachestats 0.4

Post by hid3 »

gandalf wrote:Yes, and this should be described more than once already. Shortly speaking, delete all superfluous data sources and keep only one of them. Then change the generated graph definitions and point those "invalid" data source references to those that have been left.
R.
Thanks for quick reply. I've found the two ways of getting rid of the duplicate RRDs on the very 1st page of discussion. However, it's really worth to mention I have had some problems with all of this. So here's the problem and how to solve it:

I had tens of (apache) servers monitored. Many of them had THolds for Hits/sec and some other graphs (THold woks really strange with Apache Stats; when an alert is issued, a message in e-mail comes with 'CPU Load' graph regardless of what is actually over a threshold but that's another story). What I did was go to Data sources, select particular server and change all data sources to one file. I did this for all servers. RRDClean plugin took care of the useless files. The problem is that THold started acting strange: it did not update the threshold values after each poll besides the values were out of norm and NOT representing any real data.

After much digging here and there I tried to to this: I came back to Data Sources of each server and found the original Data Source and it's file. I changed the file to 'nonexistent.rrd'; that allowed me to see which actually graph had the 'original file' which I duplicated to all Data Sources on each particular server. Knowing it, I restored the 'nonexistent' back to original. Then go to Graph management and delete ALL (webserver) graphs on particular server EXCEPT the 'original' one. Select to delete all Data Sources when asked. After that, add missing graphs via the Add button in Graph Management section, one by one.

Done. Re-add any spoiled/deleted thresholds. Now everything works awesome and you'll end up in a little saved disk space (in my case it was nearly 30 GBs).
Mika2008
Posts: 26
Joined: Tue Dec 01, 2009 4:24 pm

Re: [XML] successor to apachestats 0.4

Post by Mika2008 »

hello,
my config :

Code: Select all

Date 	Thu, 08 Dec 2011 13:50:49 +0100
Cacti Version 	0.8.7h
Cacti OS 	unix
SNMP Version 	NET-SNMP version: 5.4.2.1
RRDTool Version 	RRDTool 1.3.x
Hosts 	18
Graphs 	130
Data Sources 	Script/Command: 31
SNMP: 18
SNMP Query: 69
Script Query: 1
Script - Script Server (PHP): 1
Script Query - Script Server: 13
Total: 133
i m using u template that's greeat !!

some graph :

Image
Image
Image
Image

thanks.
maybe u know why the graph of the Thread Scoreboard is all value at nought ?

well
but i want using it with ssh : http://forums.cacti.net/viewtopic.php?f=6&t=26478

well i need to duplicate your data Input Methods to change the script command :
Image

Uploaded with ImageShack.us

well i need to change data input :

Code: Select all

perl <path_cacti>/scripts/ws_apachestats.pl <hostname>
by

Code: Select all

ssh catiuser@<hostname> -p <port> "script_ws_apache.sh"
so i want add two date input one by ssh and other by ur method.

so please explain me how to add the new data input with duplicated your data input.

thanks
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: [XML] successor to apachestats 0.4

Post by stormonts »

I am having the same issue that others are having, where the Threads % graph shows values correctly, but the details show 0s. If you click on the graph, then the details are displayed correctly. This is on Cacti .8.7 i with all updates installed.
The main image that is displayed.
The main image that is displayed.
main.jpg (70.71 KiB) Viewed 6821 times
Then when you click on the graph, you see the values.
Click on the graph and the values show up.
Click on the graph and the values show up.
clicked.jpg (63.73 KiB) Viewed 6821 times
sharifu
Posts: 13
Joined: Mon Apr 16, 2012 10:08 am

Re: [XML] successor to apachestats 0.4

Post by sharifu »

I have set this up for my remote webserver but i get erors in the cacti log.

If i run from command line it works fine and i can see the results

the following works from command line

Code: Select all

/usr/bin/wget --user-agent=\"ApacheStats\/0.4 wget\/1.8\" -q -O - -t3 -T5 http://www.domain.com/server-status?auto

Total Accesses: 17767
Total kBytes: 195038
CPULoad: .0358505
Uptime: 136651
ReqPerSec: .130017
BytesPerSec: 1461.53
BytesPerReq: 11241
BusyWorkers: 1
IdleWorkers: 4
Scoreboard: .__..._W._



Here is the warning in cacti

Code: Select all

04/16/2012 05:22:43 PM - CMDPHP: Poller[0] Host[53] DS[1299] WARNING: Result from CMD not valid. Partial Result: U
04/16/2012 05:22:25 PM - CMDPHP: Poller[0] Host[53] DS[1301] WARNING: Result from CMD not valid. Partial Result: U
04/16/2012 05:22:07 PM - CMDPHP: Poller[0] Host[53] DS[1302] WARNING: Result from CMD not valid. Partial Result: U
04/16/2012 05:21:49 PM - CMDPHP: Poller[0] Host[53] DS[1303] WARNING: Result from CMD not valid. Partial Result: U
04/16/2012 05:21:31 PM - CMDPHP: Poller[0] Host[53] DS[1304] WARNING: Result from CMD not valid. Partial Result: U
04/16/2012 05:21:13 PM - CMDPHP: Poller[0] Host[53] DS[1305] WARNING: Result from CMD not valid. Partial Result: U
04/16/2012 05:20:55 PM - CMDPHP: Poller[0] Host[53] DS[1300] WARNING: Result from CMD not valid. Partial Result: U
Can anyone help?
sharifu
Posts: 13
Joined: Mon Apr 16, 2012 10:08 am

Re: [XML] successor to apachestats 0.4

Post by sharifu »

If you are using a proxy to access the internet, add the following to make it on line 26

Code: Select all

$RETRIEVER="export http_proxy=http://proxy.uk.domain.com:3128 && /usr/bin/wget --user-agent=\"ApacheStats\/0.4 wget\/1.8\" -q -O - -t3 -T5";

comment out line 34 and 35 and move line 35 to the bottom and uncomment if needed
TommyGun
Posts: 12
Joined: Mon Jul 11, 2011 8:08 am

Re: different port

Post by TommyGun »

Smux wrote:
amacks wrote:I've got some servers running on port 8000. Would there be an easy way to configure the template to take a new arg of "port number" so I can set it for these servers?
A
Hi amacks, i change the perl script for your question, just change var $url and add var $port:

search to my $hostname.. and add follow:

Code: Select all

 my $port = $ARGV[1];
now search to var $URL and change to:

Code: Select all

$URL = "http:\/\/".$hostname.":".$port."\/server-status?auto";
Alright, now this script support any ports.

Now go to your cacti and go to "Data Input Methods", look for "WebServer - Apache Statistics" or your Apache statistics template and add <port> after <hostname> in "Input String":

before:

Code: Select all

perl <path_cacti>/scripts/ws_apachestats.pl <hostname>
after:

Code: Select all

perl <path_cacti>/scripts/ws_apachestats.pl <hostname> <port>
Save and return to same template. In "Input Fields" click in add and make in attached screenshot. Save again and everything will be done.

Try it and reply this post. I hope that I have helped you.

Regards and sorry for my bad english
The config for 0.8 is entirely different; any chance of doing this customization for that version also? Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests