noc.core.profile.checker

Module Contents

noc.core.profile.checker.rules_lock
class noc.core.profile.checker.ProfileChecker(address=None, pool=None, logger=None, snmp_community=None, calling_service='profilechecker', snmp_version=None)

Bases: object

base_logger
_rules_cache
_re_cache
find_profile(self, method, param, result)

Find profile by method :param method: Fingerprint getting method :param param: Method params :param result: Getting params result :return:

get_profile(self)

Returns profile for object, or None when not known

get_error(self)

Get error message :return:

classmethod get_profile_check_rules(cls)
get_rules(self)

Load ProfileCheckRules and return a list, grouped by preferences [{

(method, param) -> [(
match_method, value, action, profile, rule_name

), …]

}]

iter_rules(self)
classmethod get_re(cls, regexp)
do_check(self, method, param)

Perform check

check_snmp_v2c_get(self, param)

Perform SNMP v2c GET. Param is OID or symbolic name

check_http_get(self, param)

Perform HTTP GET check. Param can be URL path or :<port>/<path>

check_https_get(self, param)

Perform HTTPS GET check. Param can be URL path or :<port>/<path>

is_match(self, result, method, value)

Returns True when result matches value

snmp_v1_get(self, param)

Perform SNMP v1 request. May be overridden for testing :param param: :return:

snmp_v2c_get(self, param)

Perform SNMP v2c request. May be overridden for testing :param param: :return:

http_get(self, url)

Perform HTTP request. May be overridden for testing :param url: Request URL :return:

https_get(self, url)

Perform HTTP request. May be overridden for testing :param url: Request URL :return: