Accept timestamp within one second.. Probably our fault it's off anyway:)
Actually quit if we don't get the required arguments....
This commit is contained in:
@@ -179,8 +179,12 @@ class UpdateRRD:
|
|||||||
self.toupdate['net_dnat'] += input_dict['net_dnat']
|
self.toupdate['net_dnat'] += input_dict['net_dnat']
|
||||||
self.toupdate['loc-net'] += input_dict['loc-net']
|
self.toupdate['loc-net'] += input_dict['loc-net']
|
||||||
elif input_dict['timestamp'] < self.toupdate['timestamp']:
|
elif input_dict['timestamp'] < self.toupdate['timestamp']:
|
||||||
logging.error('Newly fetched data is older than what we have in the queue already. Passing.')
|
diff = self.toupdate['timestamp'] - input_dict['timestamp']
|
||||||
logging.error('Difference is ' + str(input_dict['timestamp'] - self.toupdate['timestamp']) + ' seconds')
|
if diff == 1:
|
||||||
|
#Might be because something is a bit slow sometimes?
|
||||||
|
input_dict['timestamp'] = self.toupdate['timestamp']
|
||||||
|
else:
|
||||||
|
logging.error('Newly fetched data is older than what we have in the queue already. Passing.')
|
||||||
else:
|
else:
|
||||||
logging.error('Not sure what to do here? ' + str(input_dict) + str(self.toupdate))
|
logging.error('Not sure what to do here? ' + str(input_dict) + str(self.toupdate))
|
||||||
|
|
||||||
@@ -191,6 +195,7 @@ def main():
|
|||||||
client_host = sys.argv[1]
|
client_host = sys.argv[1]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
logging.error('Need hostname/ip as first argument')
|
logging.error('Need hostname/ip as first argument')
|
||||||
|
sys.exit()
|
||||||
try:
|
try:
|
||||||
client_port = int(sys.argv[2])
|
client_port = int(sys.argv[2])
|
||||||
except (ValueError, IndexError):
|
except (ValueError, IndexError):
|
||||||
|
|||||||
Reference in New Issue
Block a user