[modules/cpu] Add configurable warning and critical thresholds
The cpu module now has cpu.warning and cpu.critical thresholds. If the CPU utilization is higher than any of those values, the widget's state changes to warning or critical, respectively. see #23
This commit is contained in:
parent
87e76b9e40
commit
225d471c6a
5 changed files with 60 additions and 17 deletions
|
@ -18,19 +18,19 @@ def main():
|
|||
inp=inp,
|
||||
)
|
||||
|
||||
try:
|
||||
engine.run()
|
||||
except KeyboardInterrupt as error:
|
||||
inp.stop()
|
||||
sys.exit(0)
|
||||
except bumblebee.error.BaseError as error:
|
||||
inp.stop()
|
||||
sys.stderr.write("fatal: {}\n".format(error))
|
||||
sys.exit(1)
|
||||
except Exception as error:
|
||||
inp.stop()
|
||||
sys.stderr.write("fatal: {}\n".format(error))
|
||||
sys.exit(2)
|
||||
engine.run()
|
||||
# try:
|
||||
# except KeyboardInterrupt as error:
|
||||
# inp.stop()
|
||||
# sys.exit(0)
|
||||
# except bumblebee.error.BaseError as error:
|
||||
# inp.stop()
|
||||
# sys.stderr.write("fatal: {}\n".format(error))
|
||||
# sys.exit(1)
|
||||
# except Exception as error:
|
||||
# inp.stop()
|
||||
# sys.stderr.write("fatal: {}\n".format(error))
|
||||
# sys.exit(2)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue