Skip to main content

Bulk Reset Package Bandwidth Limit for all users on multiple servers

Comments

5 comments

  • cPanelMichael
    in our infrastructure we have a lot of cPanel servers (100+) and we have bandwidth limits on packages controlled by Puppet. Recently we changed BW limit but this limits are changed only on newly created accounts the old ones stay the same.

    Hello @fatidol, If you changed the bandwidth limit itself on a package, the new limit should automatically apply to any accounts assigned that package. If that did not happen, could you let us know the full steps you took to edit the existing package? Or, are you attempting to simply reset the existing bandwidth usage for multiple accounts, regardless of the value associated with the package assigned to the account? Thank you.
    0
  • fatidol
    Or, are you attempting to simply reset the existing bandwidth usage for multiple accounts, regardless of the value associated with the package assigned to the account?

    sorry for the confusion, i would like to reset the existing bandwidth limit for multiple accounts if that is possible. Best, A.
    0
  • cPanelMichael
    sorry for the confusion, i would like to reset the existing bandwidth limit for multiple accounts if that is possible.

    Hello @fatidol, There's no option to do this for multiple accounts, but simply editing the package associated with the accounts using WHM >> Edit a Package will achieve the same result. It automatically updates the assigned bandwidth limit for any account assigned that package to the new bandwidth limit. Thank you.
    0
  • fatidol
    There's no option to do this for multiple accounts, but simply editing the package associated with the accounts using WHM >> Edit a Package will achieve the same result. It automatically updates the assigned bandwidth limit for any account assigned that package to the new bandwidth limit.

    Hey, thank you for your suggestion, this issue was resolved with the following command that searches for all packages that have BWLIMIT set to 100000000 and changes only for them. while read -u 9 package ; do whmapi1 editpkg name=$package bwlimit=100000000; done 9< <( cd /var/cpanel/packages/ ; fgrep -R -l 'BWLIMIT=100000000' )
    Hope this helps anyone who is looking for similar action. Best, A. Note: This also generated email for each changed package to default sysadmin address, so proceed with caution.
    0
  • cPanelMichael
    Hello @fatidol, I'm glad to see you were able to solve the issue. Thank you for sharing the solution.
    0

Please sign in to leave a comment.