Commit 65fa1686 by JR Dalrymple

For the sake of completeness - added the ability to specify units in bytes explicitly

parent 857b910a
...@@ -38,7 +38,9 @@ OIDIfDescr = '.1.3.6.1.2.1.2.2.1.2' ...@@ -38,7 +38,9 @@ OIDIfDescr = '.1.3.6.1.2.1.2.2.1.2'
OIDIfInBytes = '.1.3.6.1.2.1.2.2.1.10.1.' OIDIfInBytes = '.1.3.6.1.2.1.2.2.1.10.1.'
OIDIfOutBytes = '.1.3.6.1.2.1.2.2.1.16.1.' OIDIfOutBytes = '.1.3.6.1.2.1.2.2.1.16.1.'
unitMultipliers = { 'k' : 1024, unitMultipliers = { 'b' : 1,
'B' : 1,
'k' : 1024,
'K' : 1024, 'K' : 1024,
'm' : 1024 * 1024, 'm' : 1024 * 1024,
'M' : 1024 * 1024, 'M' : 1024 * 1024,
...@@ -48,7 +50,7 @@ unitMultipliers = { 'k' : 1024, ...@@ -48,7 +50,7 @@ unitMultipliers = { 'k' : 1024,
'T' : 1024 * 1024 * 1024 * 1024, 'T' : 1024 * 1024 * 1024 * 1024,
} }
limitMatch = re.compile(r"([0-9]+)([kKmMgGtT]{0,1})") limitMatch = re.compile(r"([0-9]+)([bBkKmMgGtT]{0,1})")
#USAGE #USAGE
def usage(): def usage():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment