Skip to content

Commit

Permalink
set to always exit zero since geneos won't take the output otherwise
Browse files Browse the repository at this point in the history
  • Loading branch information
HariSekhon committed Aug 3, 2019
1 parent 0e99524 commit 1b15ca1
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions adapter_geneos.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
sys.exit(4)

__author__ = 'Hari Sekhon'
__version__ = '0.4.0'
__version__ = '0.4.1'

# pylint: disable=too-few-public-methods

Expand All @@ -66,14 +66,22 @@ def __init__(self):
self.headers = ['NAME', 'STATUS', 'DETAILS']

def output(self):
output = "{name},{status},{message}".format(name=os.path.basename(self.args[0].split()[0]), status=self.status, message=self.message)
output = "{name},{status},{message}"\
.format(name=os.path.basename(self.args[0].split()[0]),
status=self.status,
message=self.message)
for val in self.perfdata:
output += self.separator + val
print(self.separator.join(self.headers))
print(output)


if __name__ == '__main__':
AdapterGeneos().main()
# Must always exit zero for Geneos otherwise it won't take the output and will show as raw error
sys.exit(0)
try:
AdapterGeneos().main()
except Exception as _: # pylint: disable=broad-except
print(traceback.format_exc(), end='')
sys.exit(0)
except SystemExit:
sys.exit(0)

0 comments on commit 1b15ca1

Please sign in to comment.