mirror of
https://github.com/drewkerrigan/nagios-http-json.git
synced 2024-11-22 18:33:49 +01:00
fixed indentation and and print statements
* clean up from previous merges
This commit is contained in:
parent
8e469e3d98
commit
95318954bf
@ -65,8 +65,8 @@ class NagiosHelper:
|
|||||||
def append_unknown(self, unknown_message):
|
def append_unknown(self, unknown_message):
|
||||||
self.unknown_message += unknown_message
|
self.unknown_message += unknown_message
|
||||||
|
|
||||||
def append_metrics(self, (performance_data,
|
def append_metrics(self, performance_data,
|
||||||
warning_message, critical_message)):
|
warning_message, critical_message):
|
||||||
self.performance_data += performance_data
|
self.performance_data += performance_data
|
||||||
self.append_warning(warning_message)
|
self.append_warning(warning_message)
|
||||||
self.append_critical(critical_message)
|
self.append_critical(critical_message)
|
||||||
@ -307,7 +307,7 @@ class JsonRuleProcessor:
|
|||||||
|
|
||||||
def checkUnknown(self):
|
def checkUnknown(self):
|
||||||
unknown = ''
|
unknown = ''
|
||||||
if self.rules.key_value_list_unknown != None:
|
if self.rules.key_value_list_unknown is not None:
|
||||||
unknown += self.checkEquality(self.rules.key_value_list_unknown)
|
unknown += self.checkEquality(self.rules.key_value_list_unknown)
|
||||||
return unknown
|
return unknown
|
||||||
|
|
||||||
@ -432,7 +432,7 @@ def debugPrint(debug_flag, message, pretty_flag=False):
|
|||||||
if pretty_flag:
|
if pretty_flag:
|
||||||
pprint(message)
|
pprint(message)
|
||||||
else:
|
else:
|
||||||
print message
|
print(message)
|
||||||
|
|
||||||
if __name__ == "__main__" and len(sys.argv) >= 2 and sys.argv[1] == 'UnitTest':
|
if __name__ == "__main__" and len(sys.argv) >= 2 and sys.argv[1] == 'UnitTest':
|
||||||
import unittest
|
import unittest
|
||||||
@ -658,5 +658,5 @@ if __name__ == "__main__":
|
|||||||
nagios.append_metrics(processor.checkMetrics())
|
nagios.append_metrics(processor.checkMetrics())
|
||||||
nagios.append_unknown(processor.checkUnknown())
|
nagios.append_unknown(processor.checkUnknown())
|
||||||
# Print Nagios specific string and exit appropriately
|
# Print Nagios specific string and exit appropriately
|
||||||
print nagios.getMessage()
|
print(nagios.getMessage())
|
||||||
exit(nagios.getCode())
|
exit(nagios.getCode())
|
||||||
|
Loading…
Reference in New Issue
Block a user