Advertisement
mikjaer

Untitled

Jan 13th, 2018
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. """MCS Exchanger Module"""
  2.  
  3. from maf_exchanger import HandlerModule
  4.  
  5. class ModStats(HandlerModule):
  6.     """Stats handler"""
  7.  
  8.     counter = 0    
  9.  
  10.     def __init__(self):
  11.         self.interval = 1
  12.  
  13.     def start(self, exchanger):
  14.         exchanger.log("Collecting stats")
  15.         exchanger.execute("/opt/exchanger/stats/disk-usage.php")
  16.  
  17.     def stop(self, exchanger):
  18.         pass
  19.    
  20.     def tick(self, exchanger):
  21.         """handler update method"""
  22.  
  23.         exchanger.log("Statscount:" + `self.counter`);
  24.         self.counter = self.counter + 1;
  25.  
  26.         if self.counter > 10*1:
  27.                 self.counter = 0;
  28.                 exchanger.log("Collecting stats")
  29.                 exchanger.execute("/opt/exchanger/stats/disk-usage.php")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement