The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Max Bandwidth Setting Not Correct...

Discussion in 'General Discussion' started by nitromax, Mar 4, 2002.

  1. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    I have several hosting account packages setup in the WHM, and each package has a different bandwidth limit. But when I use the &cpanel print=&$CPDATA{'BWLIMIT'}&& command in my CPanel theme it reports a huge number. It looks like it tacking on a large number infront of the one I specified.

    For example, one package has 8000 MB of bandwidth specified. But when you look at the /var/cpanel/user file for a customer setup with that package it says this:

    BWLIMIT=8388608000

    See the 8000 on the end. My other packages are the same way. The correct number is on the end, but when you print that BWLIMIT variable in the theme it prints that huge number above.

    Any fix for this? Or is there a way to call that differently so it displays the correct limit.
     
  2. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    That's the correct figure, but it's measured in bytes.
     
  3. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    By the way, since you are running your own theme, you can create a script more or less like this:

    #!/usr/bin/perl -wT
    #Shows maximum monthly data transfer in GB

    $ENV{'PATH'} = '/bin:/usr/bin';
    delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};

    print $Cpanel::CPDATA{'BWLIMIT'}/1024/1024/1024;
    1; # for CPanel to show our output

    (I'm a bit paranoid, you see), and then invoke it with a perl tag:

    &perl /path/to/script/maxbw.cgi&

    Basically, you can do whatever you want if you're careful enough.
     
  4. Michael-MS

    Michael-MS Well-Known Member

    Joined:
    Apr 16, 2003
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    Great script... thanks! :)

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page