monitoringplugin.py 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. __version__ = '0.0.100802'
  2. __all__ = ['MonitoringPlugin', 'SNMPMonitoringPlugin']
  3. import optparse, os, re, sys
  4. try:
  5. import netsnmp
  6. except ImportError:
  7. pass
  8. class MonitoringPlugin(object):
  9. RETURNSTRINGS = { 0: "OK", 1: "WARNING", 2: "CRITICAL", 3: "UNKNOWN", 127: "UNKNOWN" }
  10. RETURNCODE = { 'OK': 0, 'WARNING': 1, 'CRITICAL': 2, 'UNKNOWN': 3 }
  11. returncode_priority = [2, 1, 3, 0]
  12. powers_binary = ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']
  13. powers_binary_lower = [ p.lower() for p in powers_binary]
  14. powers_si = ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z']
  15. powers_si_lower = [ p.lower() for p in powers_si]
  16. def __init__(self, *args, **kwargs):
  17. self.__pluginname = kwargs.get('pluginname') or ''
  18. self.__version = kwargs.get('version') or None
  19. self.__tagforstatusline = kwargs.get('tagforstatusline') or ''
  20. self.__tagforstatusline = self.__tagforstatusline.replace('|', ' ')
  21. self.__description = kwargs.get('description') or None
  22. self.__output = []
  23. self.__multilineoutput = []
  24. self.__performancedata = []
  25. self.__returncode = []
  26. self.__brain_checks = []
  27. self.__brain_perfdata = []
  28. self.__brain_perfdatalabels = []
  29. self.__optparser = optparse.OptionParser(version=self.__version, description=self.__description)
  30. self._cmdlineoptions_parsed = False
  31. def add_cmdlineoption(self, shortoption, longoption, dest, help, **kwargs):
  32. self.__optparser.add_option(shortoption, longoption, dest=dest, help=help, **kwargs)
  33. def parse_cmdlineoptions(self):
  34. if self._cmdlineoptions_parsed:
  35. return
  36. # self.__optparser.add_option('-V', '--version', action='version', help='show version number and exit')
  37. self.__optparser.add_option('-v', '--verbose', dest='verbose', help='Verbosity, more for more ;-)', action='count')
  38. (self.options, self.args) = self.__optparser.parse_args()
  39. self._cmdlineoptions_parsed = True
  40. def range_to_limits(self, range):
  41. # Check if we must negate result
  42. if len(range) > 0 and range[0] == '@':
  43. negate = True
  44. range = range[1:]
  45. else:
  46. negate = False
  47. # Look for a ':'...
  48. if range.find(':') >= 0:
  49. # ... this is a range
  50. (low, high) = range.split(':')
  51. if not low:
  52. low = float(0.0)
  53. elif low[0] == '~':
  54. low = float('-infinity')
  55. else:
  56. low = float(low)
  57. if high:
  58. high = float(high)
  59. else:
  60. high = float('infinity')
  61. elif len(range) == 0:
  62. low = float('-infinity')
  63. high = float('infinity')
  64. else:
  65. # ... this is just a number
  66. low = float(0.0)
  67. high = float(range)
  68. return (low, high, negate)
  69. def value_in_range(self, value, range):
  70. if range not in ['', None]:
  71. (low, high, negate) = self.range_to_limits(range)
  72. else:
  73. return True
  74. if value < low or value > high:
  75. result = False
  76. else:
  77. result = True
  78. if negate:
  79. result = not result
  80. return result
  81. def value_wc_to_returncode(self, value, range_warn, range_crit):
  82. if not self.value_in_range(value, range_crit):
  83. return 2
  84. elif not self.value_in_range(value, range_warn):
  85. return 1
  86. return 0
  87. def is_float(self, string):
  88. try:
  89. float(string)
  90. return True
  91. except ValueError:
  92. return False
  93. def special_value_wc_to_returncode(self, value, warn, crit):
  94. # Special add on: WARN > CRIT
  95. if self.is_float(warn) and self.is_float(crit) and float(warn) > float(crit):
  96. # Test if value is *smaller* than thresholds
  97. warn = '@0:' + warn
  98. crit = '@0:' + crit
  99. return self.value_wc_to_returncode(value, warn, crit)
  100. def add_output(self, value):
  101. self.__output.append(value)
  102. def add_multilineoutput(self, value):
  103. self.__multilineoutput.append(value)
  104. def format_performancedata(self, label, value, unit, *args, **kwargs):
  105. label = label.lstrip().rstrip()
  106. if re.search('[=\' ]', label):
  107. label = '\'' + label + '\''
  108. perfdata = label + '=' + str(value)
  109. if unit:
  110. perfdata += str(unit).lstrip().rstrip()
  111. for key in ['warn', 'crit', 'min', 'max']:
  112. perfdata += ';'
  113. if key in kwargs and kwargs[key]!=None:
  114. perfdata += str(kwargs[key])
  115. return perfdata
  116. def add_performancedata(self, perfdata):
  117. self.__performancedata.append(perfdata)
  118. def format_add_performancedata(self, label, value, unit, *args, **kwargs):
  119. self.add_performancedata(self.format_performancedata(label, value, unit, *args, **kwargs))
  120. def add_returncode(self, value):
  121. self.__returncode.append(value)
  122. def tagtarget(self, tag, target):
  123. if target:
  124. return str(tag) + ':' + str(target)
  125. else:
  126. return str(tag)
  127. def remember_check(self, tag, returncode, output, multilineoutput=None, perfdata=None, target=None):
  128. check = {}
  129. check['tag'] = tag
  130. check['returncode'] = returncode
  131. check['output'] = output
  132. check['multilineoutout'] = multilineoutput
  133. check['perfdata'] = perfdata
  134. check['target'] = target
  135. self.remember_perfdata(perfdata)
  136. self.__brain_checks.append(check)
  137. return check
  138. def remember_perfdata(self, perfdata=None):
  139. if perfdata:
  140. for pd in perfdata:
  141. if pd['label'] in self.__brain_perfdatalabels:
  142. pdidx = self.__brain_perfdatalabels.index(pd['label'])
  143. self.__brain_perfdata[pdidx] = pd
  144. else:
  145. self.__brain_perfdata.append(pd)
  146. self.__brain_perfdatalabels.append(pd['label'])
  147. def dump_brain(self):
  148. return (self.__brain_checks, self.__brain_perfdata)
  149. def brain2output(self):
  150. out = [[], [], [], []]
  151. for check in self.__brain_checks:
  152. tagtarget = self.tagtarget(check['tag'], check.get('target'))
  153. returncode = check.get('returncode') or 0
  154. self.add_returncode(returncode)
  155. out[returncode].append(tagtarget)
  156. #if returncode == 0:
  157. # self.add_output(tagtarget)
  158. #else:
  159. # self.add_output(tagtarget + '(' + check.get('output') + ') ')
  160. self.add_multilineoutput(self.RETURNSTRINGS[returncode] + ' ' + tagtarget + ' - ' + check.get('output'))
  161. if check.get('multilineoutput'):
  162. self.add_multilineoutput(check.get('multilineoutput'))
  163. statusline = []
  164. for retcode in self.returncode_priority:
  165. if len(out[retcode]):
  166. statusline.append(str(len(out[retcode])) + ' ' + self.RETURNSTRINGS[retcode] + ': ' + ' '.join(out[retcode]))
  167. statusline = ', '.join(statusline)
  168. self.add_output(statusline)
  169. for pd in self.__brain_perfdata:
  170. self.format_add_performancedata(**pd)
  171. def value_to_human_binary(self, value, unit=''):
  172. for power in self.powers_binary:
  173. if value < 1024.0:
  174. return "%3.1f%s%s" % (value, power, unit)
  175. value /= 1024.0
  176. if float(value) not in [float('inf'), float('-inf')]:
  177. return "%3.1fYi%s" % (value, unit)
  178. else:
  179. return value
  180. def value_to_human_si(self, value, unit=''):
  181. for power in self.powers_si:
  182. if value < 1000.0:
  183. return "%3.1f%s%s" % (value, power, unit)
  184. value /= 1000.0
  185. if float(value) not in [float('inf'), float('-inf')]:
  186. return "%3.1fY%s" % (value, unit)
  187. else:
  188. return value
  189. def human_to_number(self, value, total=None):
  190. if total:
  191. if not self.is_float(total):
  192. total = self.human_to_number(total)
  193. if self.is_float(value):
  194. return float(value)
  195. elif value[-1] == '%':
  196. if total:
  197. return float(value[:-1])/100.0 * float(total)
  198. else:
  199. return float(value[:-1])
  200. elif value[-1].lower() in self.powers_si_lower:
  201. return 1000.0 ** self.powers_si_lower.index(value[-1].lower()) * float(value[:-1])
  202. elif value[-2:].lower() in self.powers_binary_lower:
  203. return 1024.0 ** self.powers_binary_lower.index(value[-2:].lower()) * float(value[:-2])
  204. else:
  205. return value
  206. def range_dehumanize(self, range, total=None):
  207. newrange = ''
  208. if len(range):
  209. if range[0] == '@':
  210. newrange += '@'
  211. range = range[1:]
  212. parts = range.split(':')
  213. newrange += str(self.human_to_number(parts[0], total))
  214. if len(parts) > 1:
  215. newrange += ':' + str(self.human_to_number(parts[1], total))
  216. if range != newrange:
  217. self.verbose(3, 'Changed range/thresold from "' + range + '" to "' + newrange + '"')
  218. return newrange
  219. else:
  220. return ''
  221. def verbose(self, level, output):
  222. if level <= self.options.verbose:
  223. print 'V' + str(level) + ': ' + output
  224. def max_returncode(self, returncodes):
  225. for rc in self.returncode_priority:
  226. if rc in returncodes:
  227. break
  228. return rc
  229. def exit(self):
  230. returncode = self.max_returncode(self.__returncode)
  231. self.back2nagios(returncode, statusline=self.__output, multiline=self.__multilineoutput, performancedata=self.__performancedata)
  232. def back2nagios(self, returncode, statusline=None, multiline=None, performancedata=None, subtag=None, exit=True):
  233. # FIXME: Make 'returncode' also accept strings
  234. # Build status line
  235. out = self.__tagforstatusline
  236. if subtag:
  237. out += '(' + subtag.replace('|', ' ') + ')'
  238. out += ' ' + self.RETURNSTRINGS[returncode]
  239. # Check if there's a status line text and build it
  240. if statusline:
  241. out += ' - '
  242. if type(statusline) == str:
  243. out += statusline
  244. elif type(statusline) in [list, tuple]:
  245. out += ', '.join(statusline).replace('|', ' ')
  246. # Check if we have multi line output and build it
  247. if multiline:
  248. if type(multiline) == str:
  249. out += '\n' + multiline.replace('|', ' ')
  250. elif type(multiline) in [list, tuple]:
  251. out += '\n' + '\n'.join(multiline).replace('|', ' ')
  252. # Check if there's perfdata
  253. if performancedata:
  254. out += '|'
  255. if type(performancedata) == str:
  256. out += performancedata
  257. elif type(performancedata) in [list, tuple]:
  258. out += ' '.join(performancedata).replace('|', ' ')
  259. # Exit program or return output line(s)
  260. if exit:
  261. print out
  262. sys.exit(returncode)
  263. else:
  264. return (returncode, out)
  265. ##############################################################################
  266. class SNMPMonitoringPlugin(MonitoringPlugin):
  267. def __init__(self, *args, **kwargs):
  268. # Same as "MonitoringPlugin.__init__(*args, **kwargs)" but a little bit more flexible
  269. #super(MonitoringPlugin, self).__init__(*args, **kwargs)
  270. MonitoringPlugin.__init__(self, *args, **kwargs)
  271. self.add_cmdlineoption('-H', '', 'host', 'Host to check', default='127.0.0.1')
  272. self.add_cmdlineoption('-P', '', 'snmpversion', 'SNMP protocol version', default='1')
  273. self.add_cmdlineoption('-C', '', 'snmpauth', 'SNMP v1/v2c community OR SNMP v3 quadruple', default='public')
  274. self.add_cmdlineoption('', '--snmpcmdlinepath', 'snmpcmdlinepath', 'Path to "snmpget" and "snmpwalk"', default='/usr/bin')
  275. # FIXME
  276. self.add_cmdlineoption('', '--nonetsnmp', 'nonetsnmp', 'Do not use NET-SNMP python bindings', action='store_true')
  277. # self.__optparser.add_option('', '--nonetsnmp', dest='nonetsnmp', help='Do not use NET-SNMP python bindings', action='store_true')
  278. self.__SNMP_Cache = {}
  279. self.__use_netsnmp = False
  280. self.__prepared_snmp = False
  281. def prepare_snmp(self):
  282. if not self._cmdlineoptions_parsed:
  283. self.parse_cmdlineoptions()
  284. if not self.options.nonetsnmp:
  285. try:
  286. import netsnmp
  287. self.__use_netsnmp = True
  288. except ImportError:
  289. pass
  290. if self.__use_netsnmp:
  291. self.verbose(1, 'Using NET-SNMP Python bindings')
  292. self.SNMPGET_wrapper = self.__SNMPGET_netsnmp
  293. self.SNMPWALK_wrapper = self.__SNMPWALK_netsnmp
  294. if self.options.snmpversion == '2c':
  295. self.options.snmpversion = '2'
  296. else:
  297. self.verbose(1, 'Using NET-SNMP command line tools')
  298. self.SNMPGET_wrapper = self.__SNMPGET_cmdline
  299. self.SNMPWALK_wrapper = self.__SNMPWALK_cmdline
  300. # Building command lines
  301. self.__CMDLINE_get = os.path.join(self.options.snmpcmdlinepath, 'snmpget') + ' -OqevtU '
  302. self.__CMDLINE_walk = os.path.join(self.options.snmpcmdlinepath, 'snmpwalk') + ' -OqevtU '
  303. if self.options.snmpversion in [1, 2, '1', '2', '2c']:
  304. if self.options.snmpversion in [2, '2']:
  305. self.options.snmpversion = '2c'
  306. self.__CMDLINE_get += ' -v' + str(self.options.snmpversion) + ' -c' + self.options.snmpauth + ' '
  307. self.__CMDLINE_walk += ' -v' + str(self.options.snmpversion) + ' -c' + self.options.snmpauth + ' '
  308. elif options.snmpversion == [3, '3']:
  309. # FIXME: Better error handling
  310. try:
  311. snmpauth = self.options.snmpauth.split(':')
  312. self.__CMDLINE_get += ' -v3 -l' + snmpauth[0] + ' -u' + snmpauth[1] + ' -a' + snmpauth[2] + ' -A' + snmpauth[3] + ' '
  313. self.__CMDLINE_walk += ' -v3 -l' + snmpauth[0] + ' -u' + snmpauth[1] + ' -a' + snmpauth[2] + ' -A' + snmpauth[3] + ' '
  314. except:
  315. self.back2nagios(3, 'Could not build SNMPv3 command line, need "SecLevel:SecName:AuthProtocol:AuthKey"')
  316. else:
  317. self.back2nagios(3, 'Unknown SNMP version "' + str(self.options.snmpversion) + '"')
  318. self.__CMDLINE_get += ' ' + self.options.host + ' %s 2>/dev/null'
  319. self.__CMDLINE_walk += ' ' + self.options.host + ' %s 2>/dev/null'
  320. self.verbose(3, 'Using commandline: ' + self.__CMDLINE_get)
  321. self.verbose(3, 'Using commandline: ' + self.__CMDLINE_walk)
  322. self.__prepared_snmp = True
  323. def find_index_for_value(self, list_indexes, list_values, wanted):
  324. self.verbose(2, 'Look for "' + str(wanted) + '"')
  325. index = None
  326. if len(list_indexes) != len(list_values):
  327. self.verbose(1, 'Length of index and value lists do not match!')
  328. return None
  329. try:
  330. index = list_values.index(wanted)
  331. index = list_indexes[index]
  332. except ValueError:
  333. pass
  334. if index:
  335. self.verbose(2, 'Found "' + str(wanted) +'" with index "' + str(index) + '"')
  336. else:
  337. self.verbose(2, 'Nothing found!')
  338. return index
  339. def find_in_table(self, oid_index, oid_values, wanted):
  340. self.verbose(2, 'Look for "' + str(wanted) + '" in "' + str(oid_values) +'"')
  341. index = None
  342. indexes = list(self.SNMPWALK(oid_index))
  343. values = list(self.SNMPWALK(oid_values))
  344. if len(indexes) != len(values):
  345. self.back2nagios(3, 'Different data from 2 SNMP Walks!')
  346. return self.find_index_for_value(indexes, values, wanted)
  347. def SNMPGET(self, baseoid, idx=None, exitonerror=True):
  348. if type(baseoid) in (list, tuple):
  349. if idx not in ['', None]:
  350. idx = '.' + str(idx)
  351. else:
  352. idx = ''
  353. if self.options.snmpversion in [1, '1']:
  354. value_low = long(self.SNMPGET_wrapper(baseoid[1] + idx, exitonerror=exitonerror))
  355. if value_low < 0L:
  356. value_low += 2 ** 32
  357. value_hi = long(self.SNMPGET_wrapper(baseoid[2] + idx, exitonerror=exitonerror))
  358. if value_hi < 0L:
  359. value_hi += 2 ** 32
  360. return value_hi * 2L ** 32L + value_low
  361. elif self.options.snmpversion in [2, 3, '2', '2c', '3']:
  362. return long(self.SNMPGET_wrapper(baseoid[0] + idx, exitonerror=exitonerror))
  363. elif type(baseoid) in (str, ) and idx != None:
  364. return self.SNMPGET_wrapper(baseoid + '.' + str(idx), exitonerror=exitonerror)
  365. else:
  366. return self.SNMPGET_wrapper(baseoid, exitonerror=exitonerror)
  367. def SNMPWALK(self, baseoid, exitonerror=True):
  368. return self.SNMPWALK_wrapper(baseoid, exitonerror=exitonerror)
  369. def __SNMPGET_netsnmp(self, oid, exitonerror=True):
  370. if not self.__prepared_snmp:
  371. self.prepare_snmp()
  372. if oid in self.__SNMP_Cache:
  373. self.verbose(2, "%40s -> (CACHED) %s" % (oid, self.__SNMP_Cache[oid]))
  374. return self.__SNMP_Cache[oid]
  375. result = netsnmp.snmpget(oid, Version=int(self.options.snmpversion), DestHost=self.options.host, Community=self.options.snmpauth)[0]
  376. if not result:
  377. if exitonerror:
  378. self.back2nagios(3, 'Timeout or no answer from "%s" looking for "%s"' % (self.options.host, oid))
  379. else:
  380. return None
  381. self.__SNMP_Cache[oid] = result
  382. self.verbose(2, "%40s -> %s" % (oid, result))
  383. return result
  384. def __SNMPWALK_netsnmp(self, oid, exitonerror=True):
  385. if not self.__prepared_snmp:
  386. self.prepare_snmp()
  387. if oid in self.__SNMP_Cache:
  388. self.verbose(2, "%40s -> (CACHED) %s" % (oid, self.__SNMP_Cache[oid]))
  389. return self.__SNMP_Cache[oid]
  390. result = netsnmp.snmpwalk(oid, Version=int(self.options.snmpversion), DestHost=self.options.host, Community=self.options.snmpauth)
  391. if not result:
  392. if exitonerror:
  393. self.back2nagios(3, 'Timeout or no answer from "%s" looking for "%s"' % (self.options.host, oid))
  394. else:
  395. return None
  396. self.__SNMP_Cache[oid] = result
  397. self.verbose(2, "%40s -> %s" % (oid, result))
  398. return result
  399. def __SNMPGET_cmdline(self, oid, exitonerror=True):
  400. if not self.__prepared_snmp:
  401. self.prepare_snmp()
  402. cmdline = self.__CMDLINE_get % oid
  403. self.verbose(2, cmdline)
  404. cmd = os.popen(cmdline)
  405. out = cmd.readline().rstrip().replace('"','')
  406. retcode = cmd.close()
  407. if retcode:
  408. if not exitonerror:
  409. return None
  410. if retcode == 256:
  411. self.back2nagios(3, 'Timeout - no SNMP answer from "' + self.options.host + '"')
  412. elif retcode ==512:
  413. self.back2nagios(3, 'OID "' + oid + '" not found')
  414. else:
  415. self.back2nagios(3, 'Unknown error code "' + str(retcode) + '" from command line utils')
  416. self.verbose(1, out)
  417. return out
  418. def __SNMPWALK_cmdline(self, oid, exitonerror=True):
  419. if not self.__prepared_snmp:
  420. self.prepare_snmp()
  421. cmdline = self.__CMDLINE_walk % oid
  422. self.verbose(2, cmdline)
  423. cmd = os.popen(cmdline)
  424. out = cmd.readlines()
  425. retcode = cmd.close()
  426. if retcode:
  427. if not exitonerror:
  428. return None
  429. if retcode == 256:
  430. self.back2nagios(3, 'Timeout - no SNMP answer from "' + self.options.host + '"')
  431. elif retcode ==512:
  432. self.back2nagios(3, 'OID "' + oid + '" not found')
  433. else:
  434. self.back2nagios(3, 'Unknown error code "' + str(retcode) + '" from command line utils')
  435. for line in range(0,len(out)):
  436. out[line] = out[line].rstrip().replace('"','')
  437. self.verbose(1, out)
  438. return out
  439. ##############################################################################
  440. def main():
  441. myplugin = MonitoringPlugin(pluginname='check_testplugin', tagforstatusline='TEST')
  442. from pprint import pprint
  443. pprint(myplugin.back2nagios(0, 'Nr. 01: Simple plugin', exit=False) )
  444. pprint(myplugin.back2nagios(0, 'Nr. 02: Simple plugin with sub tag', subtag='MySubTag', exit=False) )
  445. pprint(myplugin.back2nagios(0, 'Nr. 10: Exit Code OK', exit=False) )
  446. pprint(myplugin.back2nagios(1, 'Nr. 11: Exit Code WARNING', exit=False) )
  447. pprint(myplugin.back2nagios(2, 'Nr. 12: Exit Code CRITICAL', exit=False) )
  448. pprint(myplugin.back2nagios(3, 'Nr. 13: Exit Code UNKNOWN', exit=False) )
  449. ret = myplugin.back2nagios(0, 'Nr. 20: Plugin with string-based multiline output', 'Line 2\nLine 3\nLine4', exit=False)
  450. print ret[1]
  451. print 'Returncode: ' + str(ret[0])
  452. ret = myplugin.back2nagios(0, 'Nr. 21: Plugin with list-based multiline output', ['Line 2', 'Line 3', 'Line4'], exit=False)
  453. print ret[1]
  454. print 'Returncode: ' + str(ret[0])
  455. ret = myplugin.back2nagios(0, 'Nr. 22: Plugin with tuple-based multiline output', ('Line 2', 'Line 3', 'Line4'), exit=False)
  456. print ret[1]
  457. print 'Returncode: ' + str(ret[0])
  458. myplugin.add_performancedata('Val1', 42, '')
  459. myplugin.add_performancedata('Val2', 23, 'c', warn=10, crit=20, min=0, max=100)
  460. myplugin.add_performancedata('Val 3', '2342', 'c', warn=10, crit=20, min=0, max=100)
  461. pprint(myplugin.back2nagios(0, 'Nr. 30: With perfdatas', exit=False) )
  462. myplugin.back2nagios(0, 'Nr. 99: Exit test suite with OK')
  463. if __name__ == '__main__':
  464. main()
  465. #vim: ts=4 sw=4