rejetto forum

Bandwith Meter Help

Guest · 7 · 4158

0 Members and 1 Guest are viewing this topic.

Sonny Saters

  • Guest
I want to put a bandwith meter on my html page. What is the code to make it appear. I found out part of the code but its no appear unless its in the url address bar.

~img_graph600x36

Please Reply


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
Welcome Sonny

It's not clear what you mean with bandwith meter, so i will answer to two different things.

1. If you want to integrate the graf  '~img_graph' in your template, look at the [progress] section of the template. Without lot of coding using iframes and refresh, you will only get a static image. And reloading at intervals an iframe only slows down your server. It is really not useful in a template.

2. If you want something in your template that would allow your visitors to test their connection bandwidth (like for example you can do at: http://www.speedtest.net/index.php, then i can only say that even the best home dsl or cable connections don't make it feasable to host such a service! Give them a link to such a page.
your computer has no brain - use your own !


Offline Kremlin

  • Tireless poster
  • ****
    • Posts: 137
    • View Profile
I believe he meant the graph as in the RAWR templates are displayed. Anyway I Believe TSG and GE made a module (Statistics I believe) in their template's that would refresh each 10 secs? This (code) might be a good starting point to which you can apply it to the graph which is displayed on you hfs web-page.


Sonny Saters

  • Guest
I found it out how to do it after doing some google searching. This a graph image so that it does not do a kill on the server, this so visitors knows the current bandwith activity on the server.

Also, i know this is off topic but I would like to recommend a feature to HFS.

Can you guys add a feature to do whois IP feature in the shell somehow? So like in the log or on connection, we see a ip, want to know the who is on that ip, would like this to right click and menu pops and click on WHOIS IP, not sure what site u link it too but u guys can add a setting option to set a url site or something. This an idea.

Also, I have a awsome template I made myself. It is still the standard HFS Background and icons and stuff, this the layout is a bit different.

Below is a link to my server on the template I made up.
http://spyshadow.dyndns.org:90/

Please note, I am going to be installing Windows XP soon. Been having Huge Hard Drive Related problems on my machine. I thought it was the Operating System but it was one of my Hard Drives freezing up the computer. It broke down so I did lost some of my Files. important ones. But got to keep my awsome template I made.

Anyways, thanks for the help guys. =)


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
1. Bandwidth graph
For most normal users that connect to any page, there is no interest in knowing what bandwidth a server uses: they want quick loading of pages and fast downloads, nothing more. But as it can be very usefull or even essential to nerds and techies  ;) , here the way it can be done:

To display the bandwith graph without forcing page refreshs with <meta> and <iframe>, you can use a small javascript function and two lines of code in your html template.

A) Place this code int the header section of your template:
Code: [Select]
<script type="text/javascript">
// script by bacter
var c=0,t;
function reloadimg()
{c++;document.getElementById('bwused').src="/~img_graph200x42?c="+'\"'+c+'\"';t=setTimeout("reloadimg()",5000);}
</script>
This will reload a graph with dimension 200x42 pixels every 5 seconds. Change size and timing to fit your needs. The value urlvar c is used to avoid that the browser reloads from caché.

B)Insert in your template in the place you want that graph this two lines:
Code: [Select]
<img id="bwused" src ="/~img_graph200x42" />
<script type="text/javascript">reloadimg();</script>

2. Possible request:
Also if to me displaying the used bandwidth on a website seems meaningless, it goes really useless if the 'webmaster' accesses his server on localhost or somebody does access from lan: beside a local speed (10..100 MBytes/s) , wan traffic (with home DSL speed below 100 kBytes/s) will not more be seen! To be more usefull, hfs would need an exclude-list for ip(-range) , so that traffic with those ips would not be considered in the graph, nor in %speed-in% and %speed-out%.

3. Feature Whois
With macros you could already get some localization info, but most sites that provide this information only allow a limited number of free requests from one ip, so that it makes no sense to publish some code to do this. Whois as feature of hfs? May be, but at the same time as a dvdburning tool, in irc server and a spreadsheet  :D :D :D
your computer has no brain - use your own !


Sonny Saters

  • Guest
Well, ok then. mmm, one last thing I might change to template I notice. You notice on my template I made up, there is a link to view active downloads on the server. Well, one thing I did not know, is that it only applies to current user. Is there a way to list All Downloads for All users from HFS?

Thanks


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
To know more about active downloads (and uploads) you could write some event scripts with macros. You find the list of available events at: http://www.rejetto.com/wiki/index.php/HFS:_Event_scripts
In this scripts you can use global static variables (#this_is_static), and this data can be available with macros in your template.

good luck! ;)

PD: I can understand that a webmaster may want to know who connects to his server with whois, but i can not understand what interest users could have to see who is downloading what at any time! ;D ;D ;D
ohhh, i forgot you are spyshadow.. that remembers me 'spy vs. spy' from MAD  ;D ;D ;D

« Last Edit: November 10, 2009, 12:52:16 PM by bacter »
your computer has no brain - use your own !