Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


[XML] successor to apachestats 0.4
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
leonardo_gyn
Cacti User


Joined: 22 Jan 2005
Posts: 65

PostPosted: Wed Feb 01, 2006 11:16 am    Post subject: Use of uninitialized value in concatenation Reply with quote

Hi Guys,

I have installed template on a new Fedora Core 4 machine and got the following errors when running the script:


[root@proxy scripts]# perl ws_apachestats.pl www.mymachine.com
Use of uninitialized value in concatenation (.) or string at ws_apachestats.pl line 63.
Use of uninitialized value in concatenation (.) or string at ws_apachestats.pl line 65.
Use of uninitialized value in concatenation (.) or string at ws_apachestats.pl line 67.
Use of uninitialized value in concatenation (.) or string at ws_apachestats.pl line 69.
Use of uninitialized value in concatenation (.) or string at ws_apachestats.pl line 71.
Use of uninitialized value in split at ws_apachestats.pl line 91.
Use of uninitialized value in concatenation (.) or string at ws_apachestats.pl line 105.
apache_total_hits: apache_total_kbytes: apache_busy_workers: apache_idle_workers: apache_reqs_second: thread_O:0 threadC:0 threadD:0 threadG:0 threadI:0 threadK:0 threadL:0 threadR:0 threadS:0 threadW:0 thread_W:0 apache_cpuload:
[root@proxy scripts]#


Error is happening from console with root and with cacti user as well, the user i run cacti processes.

Strange is that I have this script running on some Red Hat 9 machines and got no errors at all.

Is this a new check from newer Perl versions ???
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12604
Location: Muenster, Germany

PostPosted: Wed Feb 01, 2006 2:37 pm    Post subject: Reply with quote

Please tell us what your browser returns when entering www.mymachine.com/server-status?auto as URL. The script awaits some output like
Code:
$output =~ /Total Accesses: (.*)/;
$out .= "apache_total_hits:".$1." ";
$output =~ /Total kBytes: (.*)/;
$out .= "apache_total_kbytes:".$1." ";
$output =~ /Busy.*: (.*)/;
$out .= "apache_busy_workers:".$1." ";
$output =~ /Idle.*: (.*)/;
$out .= "apache_idle_workers:".$1." ";
Please note the apache version
Reinhard
Back to top
leonardo_gyn
Cacti User


Joined: 22 Jan 2005
Posts: 65

PostPosted: Thu Feb 02, 2006 4:55 pm    Post subject: Reply with quote

I dont know if this is related, but i upgraded perl and the warnings are gone. Unfortunely i have no fedora core 4 with original perl ... i will have one on the next days and i will redo tests on it.

I will post results until the weekend.
Back to top
dust2k
Cacti User


Joined: 04 Dec 2005
Posts: 85

PostPosted: Fri Feb 03, 2006 9:06 am    Post subject: Reply with quote

does that pl script work under windows ?

I run it manually at command line and I got

perl G:/root/web/cacti/scripts/ws_apachestats.pl 192.168.1.20
The system cannot find the path specified.
Use of uninitialized value in concatenation (.) or string at G:/root/web/cacti/scripts/ws_apachestats.pl line 63.
Use of uninitialized value in concatenation (.) or string at G:/root/web/cacti/scripts/ws_apachestats.pl line 65.
Use of uninitialized value in concatenation (.) or string at G:/root/web/cacti/scripts/ws_apachestats.pl line 67.
Use of uninitialized value in concatenation (.) or string at G:/root/web/cacti/scripts/ws_apachestats.pl line 69.
Use of uninitialized value in split at G:/root/web/cacti/scripts/ws_apachestats.pl line 89.
Use of uninitialized value in concatenation (.) or string at G:/root/web/cacti/scripts/ws_apachestats.pl line 103.
apache_total_hits: apache_total_kbytes: apache_busy_workers: apache_idle_workers: thread_O:0 threadC:0 threadD:0 threadG:0 threadI:0 threadK:0 threadL:0 threadR:0 threadS:0 threadW:0 thread_W:0 apache_cpuload:

I compare the new script with original one and found new script actually use high speed version which use wget or lynx which I don't have on my windows box, what I can do now?
Back to top
dust2k
Cacti User


Joined: 04 Dec 2005
Posts: 85

PostPosted: Fri Feb 03, 2006 9:29 am    Post subject: Reply with quote

Found the problem,

Apache doesn't accept IP as server name to show server-status and I need reconfig the internal DNS name to make it work.

also get wget and modify the script to use right path, everything is alright now.
Back to top
dust2k
Cacti User


Joined: 04 Dec 2005
Posts: 85

PostPosted: Fri Feb 03, 2006 10:09 am    Post subject: Re: Use of uninitialized value in concatenation Reply with quote

leonardo_gyn wrote:

Error is happening from console with root and with cacti user as well, the user i run cacti processes.


Your Apache's problem, server-status?auto didn't return proper values.
Back to top
leonardo_gyn
Cacti User


Joined: 22 Jan 2005
Posts: 65

PostPosted: Sat Feb 11, 2006 4:47 pm    Post subject: Re: Use of uninitialized value in concatenation Reply with quote

dust2k wrote:

Your Apache's problem, server-status?auto didn't return proper values.


Yeah, i think you are sure ..... i couldnt reproduce the problem and unfortunelly i didnt check server-status?auto URL when I was having the problem. I have tried all combination of things, restarting apache, perl stock and updated versions on FC4 but couldnt, not even one single time, reproduce the error.

I can get server-status page using my IP address (http://192.168.X.X/server-status), dont think that was the problem. In fact i was using www.myserver.com and not IP address ...

Well, i would like to have found a way of reproducing the error so we could handle it, but i couldnt ...

By the time, graphs are working perfectly !!!



apache hits.jpg
 Description:
 Filesize:  47.2 KB
 Viewed:  9057 Time(s)

apache hits.jpg


Back to top
dust2k
Cacti User


Joined: 04 Dec 2005
Posts: 85

PostPosted: Sun Feb 12, 2006 3:02 am    Post subject: Reply with quote

it's bit weired for me to implement it as well, first time it doesn't work, so I changed the httpd.conf and restarted apache, it still not working, even I just brower to test the url, but 5 mins later, everything start working, then I re-test other, everything is working..hehe .
Back to top
leonardo_gyn
Cacti User


Joined: 22 Jan 2005
Posts: 65

PostPosted: Sun Feb 12, 2006 6:10 am    Post subject: Reply with quote

I think we should call that 'Believe it or not' TV show

But are your graphs finally working now, all of them ?
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12604
Location: Muenster, Germany

PostPosted: Sun Feb 12, 2006 6:52 am    Post subject: Reply with quote

dust2k wrote:
it's bit weired for me to implement it as well, first time it doesn't work, so I changed the httpd.conf and restarted apache, it still not working, even I just brower to test the url, but 5 mins later, everything start working, then I re-test other, everything is working..hehe .
The 5 mins are commonly known as the poller interval. This perfectly normal that it would take at least 5 min (for GAUGE data sources) or up to 10 mins (for COUNTER data sources, difference between two polling cycles will be needed) for data to come up...
Reinhard
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12604
Location: Muenster, Germany

PostPosted: Sun Feb 12, 2006 7:03 am    Post subject: Reply with quote

Here's a snippet from my /etc/http/conf/httpd.conf
Code:
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
ExtendedStatus On
and later
Code:
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.
#
<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from .team-scheck.de
    Allow from 127.0.0.1
</Location>
as well as a module
Code:
LoadModule status_module modules/mod_status.so
After changing the httpd.cond, refresh/restart of apache will be necessary. Of course you'll need tpo customize the Allow directives to your needs.
Verify this by entering sth like
Code:
http://localhost/server-status
as URL to your browser to see sth like the attached picture
Reinhard



Bildschirmfoto-1.png
 Description:
Apache's server-status page (example)
 Filesize:  53.08 KB
 Viewed:  9048 Time(s)

Bildschirmfoto-1.png


Back to top
dust2k
Cacti User


Joined: 04 Dec 2005
Posts: 85

PostPosted: Mon Feb 13, 2006 9:00 am    Post subject: Reply with quote

leonardo_gyn wrote:
But are your graphs finally working now, all of them ?


yes, all of them, works beautifully, the only issue I have now, the graph doesn't have pure connection chart like the IIS one, but that's ok, not a big problem anyway.

and thanks for lvm's post, it should come bit early then will save me lots of time.
Back to top
jmeyerdo



Joined: 02 May 2005
Posts: 26
Location: Dortmund, Germany

PostPosted: Wed Feb 15, 2006 2:44 am    Post subject: Reply with quote

Hello!

Great tool - it is running on another server since several weeks.
With a new installation I have one problem. I read both major threads for "apachestats" now - but can't find a solution.

I installed apachestats yesterday (and the improved version this morning). Installation was without problems, the perl-script can grab the details.

But the graphs are not displayed:

Code:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Localhost - Apache Statistics - Hits / s" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Hits/sec" \
AREA:#AAABA1:"Hits/sec"  \
GPRINT::LAST:"Current\:%8.2lf %s"  \
GPRINT::AVERAGE:"Average\:%8.2lf %s"  \
GPRINT::MAX:"Maximum\:%8.2lf %s\n"  \
COMMENT:"                            Represents the number of hits per second\n"  \
COMMENT:"                                 ApacheStats v0.4 - Rolf Poser\n"
RRDTool Says:

ERROR: can't parse '#AAABA1:Hits/sec'

I am using rrdtool-1.0.49.

Any hint to solve this problem would be great - thank you!

Kind regards, Jens
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12604
Location: Muenster, Germany

PostPosted: Thu Feb 16, 2006 1:27 pm    Post subject: Reply with quote

Seems that importing was not ok. The DEF statements are missing for the rrdtool graph. Please re-import the templates and send a screenshot/list of the outcome
Reinhard
Back to top
jmeyerdo



Joined: 02 May 2005
Posts: 26
Location: Dortmund, Germany

PostPosted: Thu Feb 16, 2006 3:00 pm    Post subject: Reply with quote

Hello!

Thank you for your answer.
I re-imported (without deletion - is this ok?) the xml-template.
FInd output attached to this post.

Kind regards (from Dortmund), Jens



screenshot_import_apachexml.jpg
 Description:
Screenshot (re-) import XML-file.
 Filesize:  96.49 KB
 Viewed:  8987 Time(s)

screenshot_import_apachexml.jpg


Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 2 of 9

 



Powered by phpBB © 2001, 2005 phpBB Group