Shane:
It seems sys.exit doesn't matter to the zencommand, I get the same result.
Meaning if the script has the line:
logging.basicConfig(filename=logname, level=logLevel, filemode='w', format=formatString)
Then I get following:
2012-04-01 10:13:15,126 DEBUG zen.zencommand: running '/usr/local/zenoss/scripts/check.py'
2012-04-01 10:13:15,126 DEBUG zen.zencommand: cmd line: '/bin/sh -c exec /usr/local/zenoss/scripts/check.py'
2012-04-01 10:13:15,128 DEBUG zen.zencommand: Process check.py started
2012-04-01 10:13:15,129 DEBUG zen.zencommand: Next command in 8 seconds
2012-04-01 10:13:15,227 DEBUG zen.zencommand: Received exit code: 1
If I mask the logging.basicConfig with # like this:
#logging.basicConfig(filename=logname, level=logLevel, filemode='w', format=formatString)
I get the following:
2012-04-01 10:13:25,305 DEBUG zen.zencommand: Command: '/bin/sh -c exec /usr/local/zenoss/scripts/check.py'
2012-04-01 10:13:25,306 DEBUG zen.zencommand: Output: 'COMMAND OK|test=1\n'
2012-04-01 10:13:25,306 DEBUG zen.zencommand: Process check.py stopped (47), 0.07 seconds elapsed
2012-04-01 10:13:25,306 DEBUG zen.zencommand: The result of "/usr/local/zenoss/scripts/check.py" was "'COMMAND OK|test=1\n'"
2012-04-01 10:13:25,307 DEBUG zen.zencommand: Queueing event {'severity': 3, 'performanceData': 'test=1', 'component': '', 'agent': 'zencommand', 'summary': 'COMMAND OK', 'manager': 'zenossu.il.check.com', 'eventKey': 'Check', 'device': '10.1.13.118', 'message': 'COMMAND OK', 'eventClass': '/Cmd/Fail', 'monitor': 'localhost'}
2012-04-01 10:13:25,307 DEBUG zen.zencommand: Total of 1 queued events
2012-04-01 10:13:25,308 DEBUG zen.zencommand: Next command in 9 seconds
2012-04-01 10:13:26,952 DEBUG zen.zencommand: Received exit code: 0