示例#1
0
def retrieve_munin_configuration(settings):
    """
    """
    print("Exploring Munin structure")

    try:
        settings = munin.discover_from_datafile(settings)
    except Exception as e:
        print("  {0} Could not process datafile ({1}), will read www and RRD cache instead".format(Symbol.NOK_RED, settings.paths['datafile']))

        # read /var/cache/munin/www to check what's currently displayed on the dashboard
        settings = munin.discover_from_www(settings)
        settings = rrd.discover_from_rrd(settings, insert_missing=False)
    else:
        print("  {0} Found {1}: extracted {2} measurement units".format(Symbol.OK_GREEN, settings.paths['datafile'],
                                                                        settings.nb_fields))

    # for each host, find the /var/lib/munin/<host> directory and check if node name and plugin conf match RRD files
    try:
        rrd.check_rrd_files(settings)
    except Exception as e:
        print("  {0} {1}".format(Symbol.NOK_RED, e))
    else:
        print("  {0} Found {1} RRD files".format(Symbol.OK_GREEN, settings.nb_rrd_files))

    return settings
示例#2
0
def retrieve_munin_configuration(settings):
    """
    """
    print("Exploring Munin structure")

    try:
        settings = munin.discover_from_datafile(settings)
    except Exception as e:
        print(
            "  {0} Could not process datafile ({1}), will read www and RRD cache instead"
            .format(Symbol.NOK_RED, settings.paths['datafile']))

        # read /var/cache/munin/www to check what's currently displayed on the dashboard
        settings = munin.discover_from_www(settings)
        settings = rrd.discover_from_rrd(settings, insert_missing=False)
    else:
        print("  {0} Found {1}: extracted {2} measurement units".format(
            Symbol.OK_GREEN, settings.paths['datafile'], settings.nb_fields))

    # for each host, find the /var/lib/munin/<host> directory and check if node name and plugin conf match RRD files
    try:
        rrd.check_rrd_files(settings)
    except Exception as e:
        print("  {0} {1}".format(Symbol.NOK_RED, e))
    else:
        print("  {0} Found {1} RRD files".format(Symbol.OK_GREEN,
                                                 settings.nb_rrd_files))

    return settings