Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Jun 24, 2019 5:19 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: phpBB2 scripts
PostPosted: Thu Feb 17, 2005 6:09 am 
Offline

Joined: Mon Feb 14, 2005 1:28 pm
Posts: 7
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.


Attachments:
File comment: phpBB2 Users (includes perl-script and xml)
phpbb2users.zip [3.33 KiB]
Downloaded 2117 times
File comment: phpBB2 Statistics (includes perl-script and xml)
phpbb2stats.zip [3.51 KiB]
Downloaded 1923 times
Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 17, 2005 7:00 am 
Offline

Joined: Mon Feb 14, 2005 1:28 pm
Posts: 7
Some screenshots of the graphs:


Attachments:
File comment: phpBB2 Statistics graph
phpBB2stats.png
phpBB2stats.png [ 8.18 KiB | Viewed 39652 times ]
File comment: phpBB2 Users On-Line graph
phpBB2users.png
phpBB2users.png [ 13.25 KiB | Viewed 39652 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 24, 2005 9:22 am 
Offline

Joined: Thu Mar 24, 2005 9:15 am
Posts: 10
Thank you for these scripts !

phpbb2stats does work for me but phpbb2users doesn't:

Code:
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.

Using mysql-4.0.20-i486-1... any hints to resolve this would be much appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 29, 2005 8:51 am 
Offline
Cacti User

Joined: Fri Sep 05, 2003 9:20 am
Posts: 150
Location: London
Looks like you're missing an S somewhere...

Code:
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.


That should probably read TIMESTAMP or something like that. Did you copy the script? Check that your line wraps are ok.

=)

_________________
uname -a


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 29, 2005 4:44 pm 
Offline

Joined: Thu Mar 24, 2005 9:15 am
Posts: 10
How simple a solution it can be; linewraps did kill the script.

Thank you very much !

8)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 17, 2005 12:22 pm 
Offline

Joined: Fri Apr 15, 2005 10:36 am
Posts: 2
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/zips/6xx-builds-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/zips/6xx-builds-only/DBI.zip
for DBD
http://ppm.activestate.com/PPMPackages/zips/6xx-builds-only/DBD-mysql-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.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 17, 2005 12:37 pm 
Offline

Joined: Fri Apr 15, 2005 10:36 am
Posts: 2
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?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 18, 2005 8:28 am 
Offline
Lead Developer

Joined: Sat Oct 13, 2001 7:00 pm
Posts: 2237
Location: Carlisle, PA
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


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 15, 2005 3:08 pm 
Offline

Joined: Mon Feb 14, 2005 1:28 pm
Posts: 7
Nice that you guys liked the scripts! Thoug there seems to be some stange thing with the guest count sometimes... Once in a while it shows to many guests. This is probably due to the session handeling in phpBB, if anybody has a solution to this problem it would be nice!

Regards,
Sam Salonen


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 15, 2005 5:25 pm 
Offline
Lead Developer

Joined: Sat Oct 13, 2001 7:00 pm
Posts: 2237
Location: Carlisle, PA
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.

-Ian


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 16, 2005 1:22 pm 
Offline

Joined: Mon Feb 14, 2005 1:28 pm
Posts: 7
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.

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).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 01, 2005 3:56 pm 
Offline

Joined: Fri May 13, 2005 9:55 am
Posts: 4
Location: Oslo, Norway
It works! :D

_________________
www.gbps.no

cacti.gbps.no


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 6:51 pm 
Offline

Joined: Sun Dec 07, 2003 1:22 pm
Posts: 6
i had some problems with errors like:

06/10/2005 01:45:12 AM - CACTID: Poller[0] Host[1] WARNING: Result from SCRIPT not valid. Partial Result: posts1h:0 posts3h:0 ...

fixed it by removing the space after the last "echo" thingy in the pl files.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 9:55 am 
Offline

Joined: Thu Sep 01, 2005 9:53 am
Posts: 3
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?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 05, 2006 7:52 am 
Offline
Cacti User
User avatar

Joined: Tue May 03, 2005 4:29 pm
Posts: 163
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group