The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Use MRTG to graph new posts and online users! Details »» | |||||||||||||||||||||||||||
Use MRTG to graph new posts and online users!
Developer Last Online: Nov 2014
Well this isn't really a hack so let's post it here.
If you're the type of person who would prefer everything had a graph, this "hack" is for you. Example: http://flamevault.com/mrtg/board The installation of this is a bit hardcore if you don't have MRTG, Perl, or a common Perl module (DBI) installed. A bit of Unix background could help too (oh yeh, it only works on Unix/Linux/etc servers for now). See attachment for scripts, mrtg config, and installation instructions. I'll help as much as I can if you're having trouble installing so feel free to ask. Updated 12-01-03 to fix errors discussed below! Show Your Support
|
Comments |
#12
|
||||
|
||||
Quote:
|
#13
|
|||
|
|||
Quote:
I amm just looking over the code and I still can't work out what the issue is here is the query Quote:
|
#14
|
|||
|
|||
Hi! Glad to see some people are enjoying this little hack. Now if only it worked correctly!
I reviewed the script and figured out major flaw #1: It wasn't calculating guests, only registered users. That is now fixed, all online users are accounted for. The second flaw is more complex. vB's "Who's Online" uses the Cookie Timeout from your vB options to decide who is currently online. This is by default set at 900 seconds (15 minutes). MRTG by nature runs every 5 minutes (300 seconds). To get truely accurate graphs you should set $cookie_expire in the .pl script to 300 seconds, hence only counting users who have been active in the last 5 minutes. This will report considerably less users than vB does, simply because you limit the time range. Alternately, to report what vB's "Who's Online" says, set this to whatever your Cookie Timeout is. It's up to you. Personally I prefer accuracy and use 300 seconds. Furthermore, it's still slightly inaccurate if you set $cookie_timeout to your vB setting. I was testing it with $cookie_timeout set at 900 seconds (my vB setting) and Who's Online showed 13-15 users, but the .pl script reported 16-17. The query the .pl script uses to get these numbers is so straightforward it seems hard to make a mistake. Maybe a true vB guru can comment on who Who's Online numbers are gathered vs how the .pl script gets them. At least it's much more accurate now that guests are counted Here is an updated copy of the .pl script. If you already had this working, this is the only file changed. I also fixed some typos in the other scripts and rewrote parts of the README file to be clearer for anyone who chooses to install this in the future. The attachment in the first post has been updated. I'll keep an eye on this thread, but feel free to email too. |
#15
|
|||
|
|||
Thanks for the update - have put your updated code in the script - will see how that pans out.
Couple of comments now we have your attention The script only allows one value for $data and this gets passed to mrtg - this is fine but I have modified your script to graph some other data like registered users, totposts and total threads http://www.fu-1.net/mrtg/regusers.html http://www.fu-1.net/mrtg/totposts.html http://www.fu-1.net/mrtg/totthreads.html I'd like to be able to graph threads/posts on the same graph but am struggling with the Perl Also do you know how to to stop MRTG converting values into K ie 6.4K rather than 6,400? Finally I am using this remotely so your script calls uptime on the box running mrtg not the mysql box Again - thanks for doing this - VERY cool |
#16
|
|||
|
|||
Quote:
But we can at least combine Total Posts/Threads. Use this script which adds a new "totaltp" section and makes displaying 2 numbers possible. Then add this to your MRTG config file: Code:
# Total threads/posts Target[totaltp]: `/etc/mrtg/vB.pl totaltp` MaxBytes[totaltp]: 10000000 Title[totaltp]: Total Threads/Posts PageTop[totaltp]: <H1>Total Threads/Posts</H1> ShortLegend[totaltp]: Threads/Posts YLegend[totaltp]: Threads/Posts Legend1[totaltp]: Total Threads Legend2[totaltp]: Total Posts LegendI[totaltp]: Threads LegendO[totaltp]: Posts Options[totaltp]: growright,nopercent,gauge Quote:
Code:
kMG[totaltp]: ,, Quote:
|
#17
|
||||
|
||||
I still think this qualifies as a hack. I am moving it...
|
#18
|
|||
|
|||
Quote:
These forums really are sunforum hell discore - many thanks for the update - this is really great http://www.fu-1.net/mrtg/ |
#19
|
||||
|
||||
Looks great Dave.
Use the "Old Layout" link from the homepage. |
#20
|
||||
|
||||
This hack does not take into consideration TABLE_PREFIX. booo.
Also anyone know what this means? It still creates the log files and images though, I'm not sure if they work though because the images dont have any data to plot so far. Code:
Rateup WARNING: /usr/bin/rateup could not read the primary log file for posts Rateup WARNING: /usr/bin/rateup The backup log file for posts was invalid as wel l Rateup WARNING: /usr/bin/rateup Can't remove posts.old updating log file Rateup WARNING: /usr/bin/rateup Can't rename posts.log to posts.old updating log file Rateup WARNING: /usr/bin/rateup could not read the primary log file for users Rateup WARNING: /usr/bin/rateup The backup log file for users was invalid as wel l Rateup WARNING: /usr/bin/rateup Can't remove users.old updating log file Rateup WARNING: /usr/bin/rateup Can't rename users.log to users.old updating log file |
#21
|
|||
|
|||
The rateup warning will happen the first time you run the script when the log files are first populated - it's normal
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|