Example #1
0
		# parse smtp options if activated
		smtpActivated = config.getboolean("smtp", "smtpActivated")
		if smtpActivated is True:
			smtpServer = config.get("smtp", "server")
			smtpPort = config.getint("smtp", "serverPort")
			smtpFromAddr = config.get("smtp", "fromAddr")
			smtpToAddr = config.get("smtp", "toAddr")

		# parse all sensors
		for section in config.sections():
			if section.find("sensor") != -1:
				sensor = PingWatchdogSensor()
				sensor.id = config.getint(section, "id")
				sensor.description = config.get(section, "description")
				sensor.alertDelay = config.getint(section, "alertDelay")
				sensor.alertLevel = config.getint(section, "alertLevel")
				sensor.triggerAlert = config.getboolean(section,
					"triggerAlert")
				sensor.triggerAlways = config.getboolean(section,
					"triggerAlways")
				sensor.triggerState = config.getint(section, "triggerState")

				# ctf watchdog specific options
				sensor.timeout = config.getint(section, "timeout")
				sensor.intervalToCheck = config.getint(section,
					"intervalToCheck")
				sensor.host = config.get(section, "host")
				sensor.execute = config.get(section, "execute")

				# check if description is empty
				if len(sensor.description) == 0: