phpBB2 scripts
Moderators: Developers, Moderators
-
- Posts: 7
- Joined: Mon Feb 14, 2005 1:28 pm
phpBB2 scripts
Here is two scripts to log your phpBB2 activity, users on-line (guests and registered users) and activity (posts and topics for the last 1 hour/3 hours).
Enjoy and feel free to do changes to the scripts and xml to fit your needs.
Enjoy and feel free to do changes to the scripts and xml to fit your needs.
- Attachments
-
- phpbb2stats.zip
- phpBB2 Statistics (includes perl-script and xml)
- (3.51 KiB) Downloaded 2054 times
-
- phpbb2users.zip
- phpBB2 Users (includes perl-script and xml)
- (3.33 KiB) Downloaded 2217 times
-
- Posts: 7
- Joined: Mon Feb 14, 2005 1:28 pm
Thank you for these scripts !
phpbb2stats does work for me but phpbb2users doesn't:
Using mysql-4.0.20-i486-1... any hints to resolve this would be much appreciated.
phpbb2stats does work for me but phpbb2users doesn't:
Code: Select all
DBD::mysql::st execute failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'TAMP(NOW()) AND session_logged_in=0' at line 2 at phpbb2users.pl line 28.
DBD::mysql::st fetchrow_array failed: fetch() without execute() at phpbb2users.pl line 29.
DBD::mysql::st execute failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'TAMP(NOW()) AND session_logged_in=1' at line 2 at phpbb2users.pl line 38.
DBD::mysql::st fetchrow_array failed: fetch() without execute() at phpbb2users.pl line 39.
Looks like you're missing an S somewhere...
That should probably read TIMESTAMP or something like that. Did you copy the script? Check that your line wraps are ok.
=)
Code: Select all
MySQL server version for the right syntax to use near 'TAMP(NOW()) AND session_logged_in=1' at line 2 at phpbb2users.pl line 38.
=)
uname -a
With MYSql 4.1.11
Perl 5.6.1
Php 5.0.4
MySQL 4.1.11 does NOT support the --old-passwords option, so you will have to go into mysql by doing the following.
Log into Mysql
myServer# mysql -u root -p
Check for users with the 16 length encrypted password
SELECT Host, User, Password FROM mysql.user
WHERE LENGTH(Password) > 16;
should display something like:
+-----------------+-----------+-------------------------------------------+
| Host | User | Password |
+-----------------+-----------+-------------------------------------------+
*2764989343C1984926E85917C4F43171D846B09F |
| localhost | cactiuser | *2764989343C1984926E85917C4F43171D846B09F |
+-----------------+-----------+-------------------------------------------+
then you change the new password style of Mysql 4.1.xx to the OLD_PASSWORD style of pre mysql4.0 and older 3.20 versions.
UPDATE mysql.user SET Password = OLD_PASSWORD('new_password') WHERE Host = 'localhost' AND User = 'cactiuser';
For PERL, you need to download and install the following libraries if you are getting the DBI:: and DBD:: messages.
first. check what version of PERL you are running.
perl -v
for 5.6.1 users, go here
http://ppm.activestate.com/PPMPackages/ ... ilds-only/
for 5.8.x users, go here
http://ppm.activestate.com/PPMPackages/ ... ilds-only/
Pick your "Flavor"
# HP-UX/
# Linux/
# Solaris/
# Windows/
and download the appropriate packages.
DBI and DBD-MySQL
( you are on your own after that, because I have read several documents that DBI in 5.8.x is buggy and so I downgraded my install to 5.6.1, and had no issues whatsoever with my Cacti Install and scripts)
for MySQL 4.1.11 users download these Packages.
for DBI
http://ppm.activestate.com/PPMPackages/ ... ly/DBI.zip
for DBD
http://ppm.activestate.com/PPMPackages/ ... 2.9004.zip
to install the packages
unzip DBI.zip
ppm install DBI.ppd
then unzip DBD-mysql-2.9004.zip
ppm install DBD-mysql.ppd
This of course ASSUMES that you have ppm installed.. (This work applies to BOTH *nix and Windows users)
This ALSO assumes that you have your Databases properly configured.
Perl 5.6.1
Php 5.0.4
MySQL 4.1.11 does NOT support the --old-passwords option, so you will have to go into mysql by doing the following.
Log into Mysql
myServer# mysql -u root -p
Check for users with the 16 length encrypted password
SELECT Host, User, Password FROM mysql.user
WHERE LENGTH(Password) > 16;
should display something like:
+-----------------+-----------+-------------------------------------------+
| Host | User | Password |
+-----------------+-----------+-------------------------------------------+
*2764989343C1984926E85917C4F43171D846B09F |
| localhost | cactiuser | *2764989343C1984926E85917C4F43171D846B09F |
+-----------------+-----------+-------------------------------------------+
then you change the new password style of Mysql 4.1.xx to the OLD_PASSWORD style of pre mysql4.0 and older 3.20 versions.
UPDATE mysql.user SET Password = OLD_PASSWORD('new_password') WHERE Host = 'localhost' AND User = 'cactiuser';
For PERL, you need to download and install the following libraries if you are getting the DBI:: and DBD:: messages.
first. check what version of PERL you are running.
perl -v
for 5.6.1 users, go here
http://ppm.activestate.com/PPMPackages/ ... ilds-only/
for 5.8.x users, go here
http://ppm.activestate.com/PPMPackages/ ... ilds-only/
Pick your "Flavor"
# HP-UX/
# Linux/
# Solaris/
# Windows/
and download the appropriate packages.
DBI and DBD-MySQL
( you are on your own after that, because I have read several documents that DBI in 5.8.x is buggy and so I downgraded my install to 5.6.1, and had no issues whatsoever with my Cacti Install and scripts)
for MySQL 4.1.11 users download these Packages.
for DBI
http://ppm.activestate.com/PPMPackages/ ... ly/DBI.zip
for DBD
http://ppm.activestate.com/PPMPackages/ ... 2.9004.zip
to install the packages
unzip DBI.zip
ppm install DBI.ppd
then unzip DBD-mysql-2.9004.zip
ppm install DBD-mysql.ppd
This of course ASSUMES that you have ppm installed.. (This work applies to BOTH *nix and Windows users)
This ALSO assumes that you have your Databases properly configured.
Okay.. after that post, I noticed something.
I am getting data when I run the perl scripts manually
it is properly returning data:
perl phpbb2users.pl
guests:3 registered:22
perl phpbb2stats.pl
posts1h:10 posts3h:44 topics1h:6 topics3h:8
but there is no data showing on the graph.
After hours of checking the scripts, RRD is updating.. but nothing I can see is causing the graphs not to be produced.
Data in RRD files and manually running Perl Script.
No Graphs. Any ideas?
I am getting data when I run the perl scripts manually
it is properly returning data:
perl phpbb2users.pl
guests:3 registered:22
perl phpbb2stats.pl
posts1h:10 posts3h:44 topics1h:6 topics3h:8
but there is no data showing on the graph.
After hours of checking the scripts, RRD is updating.. but nothing I can see is causing the graphs not to be produced.
Data in RRD files and manually running Perl Script.
No Graphs. Any ideas?
Great job! I added these graphs to the server which houses forums.cacti.net. Check it out:
http://querx.com/cacti/graph_view.php?a ... leaf_id=53
-Ian
http://querx.com/cacti/graph_view.php?a ... leaf_id=53
-Ian
-
- Posts: 7
- Joined: Mon Feb 14, 2005 1:28 pm
-
- Posts: 7
- Joined: Mon Feb 14, 2005 1:28 pm
That might be one reason to these peaks, though the peaks should (logically) also show up on phpBB users online. This however does not happend (strange).raX wrote:I always figured that the spike in guest users is due to search engine spiders. This would make sense since they often come from many different IP address and as a result create multiple PHP sessions.
-
- Posts: 3
- Joined: Thu Sep 01, 2005 9:53 am
Would it be possible if someoen can upload their users script? I'm having problems with mine as the topics one is working I get errors when I try to run it from command line. I changed the tmp to timestamp but other then that I'm getting errors when I try to run it. Does anyone have an updated version?
- Diggit2001
- Cacti User
- Posts: 195
- Joined: Tue May 03, 2005 4:29 pm
- Location: MD, US
I'm having trouble getting this working and I think it's prolly cuz I am hosting my phpbb site on full SQL instead of MySQL. I had to go this route cuz I had another app on this server that required full SQL. My error when I try to run the script manually is this:
DBI connect ('mydbname:servername' , 'mydbname',...) failed: Can't connect to MySQL server on 'myservername' (111) at phpbb2stats.pl line 22
Can't call method "prepare" on an undefined value at phpbb2stats.pl line 27.
If I am correct in my assumption, what do I need to do to get this to work with full SQL?
Much thanks.
-Chris
DBI connect ('mydbname:servername' , 'mydbname',...) failed: Can't connect to MySQL server on 'myservername' (111) at phpbb2stats.pl line 22
Can't call method "prepare" on an undefined value at phpbb2stats.pl line 27.
If I am correct in my assumption, what do I need to do to get this to work with full SQL?
Much thanks.
-Chris
Who is online
Users browsing this forum: No registered users and 2 guests