View Single Post
  #16  
Old 12-01-2003, 02:05 PM
discore discore is offline
 
Join Date: Jun 2002
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave#
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
2 things is no problem. MRTG can't graph more than 2 things at a time (as far as I know). Maybe other graphing programs like Cricket are more flexible, not sure.

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
Changing the the path to vB.pl of course. That will give you graphs that look like this. Doesn't look that great with my board's 1:20ish thread to post ratio, but the new code and configuration should make further modifications easier.

Quote:
Originally Posted by Dave#
Also do you know how to to stop MRTG converting values into K ie 6.4K rather than 6,400?
The best way I've found is by adding:

Code:
kMG[totaltp]: ,,
To the MRTG config. "totaltp" gets replaced by whatever label is appropiate. This doesn't change the digits on the YLegend (left side digits on the graphic), probably because they'd get too big to fit in the image. All of the configuration directives can be found here. Maybe there's a better way.

Quote:
Originally Posted by Dave#
Finally I am using this remotely so your script calls uptime on the box running mrtg not the mysql box
Hehe, you could maybe run SNMP on the database server and rewrite the script to get date/time of remote machine via SNMP, but that's quite a bit of work for something as arbitrary as uptime. You're probably best off simply adding "noinfo" to the Options for each label to supress the whole bit about uptime.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01184 seconds
  • Memory Usage 1,778KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete