diff --git a/checks/nc_groupquota b/checks/nc_groupquota index 39ec708..f180817 100644 --- a/checks/nc_groupquota +++ b/checks/nc_groupquota @@ -35,17 +35,17 @@ def check_nc_groupquota(item, params, info): return perfdata = [ - ( "quota", int(group[2]), int(group[1])/100*params["levels"][0], int(group[1])/100*params["levels"][1] ), + ( "quota", int(group[2])/1024/1024, int(group[1])/1024/1024/100*params[0], int(group[1])/1024/1024/100*params[1] ), ] #check counter - if 100*int(group[2])/int(group[1]) >= params["levels"][1]: - yield 2, "quota using {} exceeted crit level of {}%".format(100*int(group[2])/int(group[1]), params["levels"][1]), perfdata + if 100*int(group[2])/int(group[1]) >= params[1]: + yield 2, "quota using {} exceeted crit level of {}%".format(int(100*int(group[2])/int(group[1])), params[1]), perfdata return - if 100*int(group[2])/int(group[1]) >= params["levels"][0]: - yield 1, "quota using {} exceeted warn level of {}%".format(100*int(group[2])/int(group[1]), params["levels"][0]), perfdata + if 100*int(group[2])/int(group[1]) >= params[0]: + yield 1, "quota using {} exceeted warn level of {}%".format(int(100*int(group[2])/int(group[1])), params[0]), perfdata return - if 100*int(group[2])/int(group[1]) < params["levels"][0]: - yield 0, "quota using {}%".format(100*int(group[2])/int(group[1])), perfdata + if 100*int(group[2])/int(group[1]) < params[0]: + yield 0, "quota using {}%".format(int(100*int(group[2])/int(group[1]))), perfdata return yield 3, "error occured in check plugin."