![]() |
Use MRTG to graph new posts and online users!
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! |
I've actually got this working now! Sheesh, lots of dependancies, although that was the first time I have used cpan - updates things nice and easily.
I had to use force install DBD::mysql because for some reason it couldn't connect to mysql with the username and password it was trying with during testing. Few tweaks and typo removals means I should now be working ok: http://forums.utassault.net/mrtg/vb/ Many thanks for this hack. |
I installed this.. no problem at all getting it to work.. but it seems to report way more sessions than really exist.
For example, my forum reports "Most users ever online was 55 on 04-24-2003 at 11:39 PM.", however, my mrtg stats page says "Max Online 66.0 Users" Any idea on why this happens and/or how to fix it? |
Quote:
274 users online is being reported as 146 :( |
Wow... good work integrating vB with MRTG...
|
this is great feedback to administrators and users (if needed) .. however, can the images be directly linked (embedded) into another page?
|
Quote:
http://www.fu-1.net/mrtg/posts-day.png |
That's so cool...
|
Quote:
Anybody heard from the author? https://vborg.vbsupport.ru/ |
Looks a bit complicated to me :p
|
Quote:
|
Quote:
I amm just looking over the code and I still can't work out what the issue is here is the query Quote:
|
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. |
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 |
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 Quote:
Code:
kMG[totaltp]: ,, Quote:
|
I still think this qualifies as a hack. I am moving it... :)
|
Quote:
These forums really are sunforum hell :) discore - many thanks for the update - this is really great :) http://www.fu-1.net/mrtg/ |
Looks great Dave. :)
Use the "Old Layout" link from the homepage. :) |
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 |
The rateup warning will happen the first time you run the script when the log files are first populated - it's normal
|
Quote:
|
Quote:
I realise that it's not that hard to edit your hack queries and it will be necessary to add another variable at the top of your script since you dont include gobal.php but it should still be done. |
Does anyone have this working normally on VB3? There are some updated files on here but he links are no longer valid. Help, I loved having this on VB2, now I want it back on VB3.
|
bump for help with vb3
|
anyone update ????
|
anyone please update for vb3
|
well i have got it loggin online users
http://alpha.webrats.com/mrtg/online.html this is total users on guest and members but i am havin a problem with total post threas etc my script keeps adding a comma to the out put which screws up mrtg if anyone could help convert my php to sh/perl that would be great |
wrong forum...
|
Quote:
|
All times are GMT. The time now is 05:14 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|