How to use simplemonitor - 2 common examples

To help you get started, we’ve selected a few simplemonitor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jamesoff / simplemonitor / monitor.py View on Github external
if config.has_option("monitor", "monitors"):
        monitors_file = config.get("monitor", "monitors")
    else:
        monitors_file = "monitors.ini"

    main_logger.info("Loading monitor config from %s", monitors_file)

    try:
        allow_pickle = config.getboolean("monitor", "allow_pickle",
                                         fallback='true')
    except ValueError:
        main_logger.critical('allow_pickle should be "true" or "false".')
        sys.exit(1)

    m = SimpleMonitor(allow_pickle=allow_pickle)

    m = load_monitors(m, monitors_file)

    count = m.count_monitors()
    if count == 0:
        main_logger.critical("No monitors loaded :(")
        sys.exit(2)

    m = load_loggers(m, config)
    m = load_alerters(m, config)

    try:
        if config.get("monitor", "remote") == "1":
            if not options.no_network:
                enable_remote = True
                remote_port = int(config.get("monitor", "remote_port"))
github gleicon / restmq / contrib / system-monitor / qfeeder.py View on Github external
def post_data(host, port, queuename):
	try:
		params = urllib.urlencode({"queue":queuename, "value":json.dumps(simplemonitor.get_all_values())})

		request = urllib2.Request("http://%s:%s" % (host, str(port)), params)
		f = urllib2.urlopen(request)

		response = f.read()

		f.close()
	except urllib2.URLError, err:
		print err
	else:
		print "MQ Response: %s" % response

simplemonitor

A simple network and host monitor

BSD-3-Clause
Latest version published 5 months ago

Package Health Score

66 / 100
Full package analysis

Similar packages