code
stringlengths
501
5.19M
package
stringlengths
2
81
path
stringlengths
9
304
filename
stringlengths
4
145
from tornado import web, ioloop, routing from .router import router as mvc_router from .config import configuration import sys from .logger import logger class main(web.RequestHandler): def prepare(self): self.isExec = True for middlewareName in configuration.middleware_list: middleware = getattr(__import__(middlewareName), middlewareName)(self) if hasattr(middleware, "prepare"): self.isExec = getattr(middleware, "prepare")() if not self.isExec: break def on_finish(self): if self.isExec: for middlewareName in configuration.middleware_list: middleware = getattr(__import__(middlewareName), middlewareName)(self) if hasattr(middleware, "finish"): getattr(middleware, "finish")() def get(self): if self.isExec: self.router() def post(self): if self.isExec: self.router() def router(self): try: router = mvc_router(self.request.uri) controller = getattr(__import__(router.controller), router.controller)(self) getattr(controller, router.action)() except Exception as e: logger.error("An error has occurred in the main run {router.controller}/{router.action}, error:{e}".format(**locals())) self.set_status(500, e) class application(): def __init__(self, appPath, config, port=None): self.port = port configuration.init(config, appPath) self._init_router() self._init_path() self._run_plugins() def _init_router(self): self.router = [(r".*", main)] def _init_path(self): sys.path.insert(0, configuration.controller_path) sys.path.insert(0, configuration.middleware_path) sys.path.insert(0, configuration.plugin_path) sys.path.insert(0, configuration.filter_path) def _run_plugins(self): for plugin in configuration.plugin_list: plugin = getattr(__import__(plugin), plugin) self._run_plugin(plugin) def _run_plugin(self, plugin): plugin(self) def run(self): self.app = web.Application(self.router) self.app.listen(configuration.port if not self.port else self.port) ioloop.IOLoop.current().start()
zWhite
/zWhite-0.0.92-py3-none-any.whl/zero/application.py
application.py
import sys from Crypto.Cipher import AES from binascii import b2a_hex, a2b_hex from tornado import escape from .config import configuration import os, io class controller(): _401 = "<!DOCTYPE html><html lang='en'><meta name='viewport' content='width=device-width, initial-scale=1.0'><meta http-equiv='X-UA-Compatible' content='ie=edge'><head><title>401</title><style>html,body,body>div{width:100%;height:100%;margin:0;padding:0;overflow:hidden;text-align:center;color:#527bcc;font:'华文彩云'}h1{margin-top:100px;font-size:160px}.onlinefs-message-one{display:block;font:40px '华文彩云'}.onlinefs-message-two{margin-top:24px;margin-bottom:24px;display:block;font:18px '华文彩云'}a{display:inline-block;height:40px;width:130px;background:#527bcc;font-size:22px;font-family:'华文彩云';text-decoration:none;color:#fff;line-height:40px}</style></head><body><div><h1>401</h1><div class='onlinefs-message-one'>你没有权限访问这个站点,请先申请权限后再登录!</div><div class='onlinefs-message-two'>快回首页试试吧!</div><a href='/'>去首页</a></div></body></html>" def __init__(self, application): self.application = application self.application.set_header("Access-Control-Allow-Origin", configuration.cors) self.application.set_header("Access-Control-Allow-Credentials", "true") def json_encode(self, value): return escape.json_encode(value) def json_decode(self, value): return escape.json_decode(value) def json(self, value): json = self.json_encode(value) self.application.set_header("Content-Type", "application/json") self.application.write(json) def success(self, data = None): self.json({ "isSuccess": True, "data": data }) def fail(self, message): self.json({ "isSuccess": False, "message": message }) def result(self, result, data = None, message = None): if result: self.success(data) else: self.fail(message) def file(self, path, filename): self.application.set_header('Content-Type', 'application/octet-stream') self.application.set_header('Content-Disposition', 'attachment; filename=%s' % filename) with open(path, 'rb') as f: while True: data = f.read(4096) if not data: break self.application.write(data) def stream(self, filename, data): self.application.set_header('Content-Type', 'application/octet-stream') self.application.set_header('Content-Disposition', 'attachment; filename=%s' % filename) self.application.write(data) def csv(self, filename, fields, rows): content = ",".join(fields) + "\n" for row in rows: tempRow = [] for field in fields: tempRow.append(str(row[field])) content += ",".join(tempRow) + "\n" self.stream(filename, content.encode("utf-8")) def set_cookie(self, name, value): self.application.set_cookie(name, value) def get_cookie(self, name): return self.application.get_cookie(name) def __getattr__(self, name): value = self.application.get_argument(name) try: return self.json_decode(value) except: return value def set_status(self, code, message): self.application.set_status(code, message) if code >= 400: # self.application.set_header("Content-Type", "application/json") # self.json({ # "status_code": code, # "message": message # }) self.application.set_header("Content-Type", "text/html; charset=utf-8") self.application.write(controller._401) @property def user(self): try: return self.decrypt(self.get_cookie(configuration.cookie_id)) except Exception as e: return None @property def files(self): return self.application.request.files.get('file', None) def redirect(self, url): self.application.redirect(url) #加密函数,如果text不是16的倍数【加密文本text必须为16的倍数!】,那就补足为16的倍数 def encrypt(self, text): cryptor = AES.new(configuration.encrypt, AES.MODE_CBC, configuration.encrypt) #这里密钥key 长度必须为16(AES-128)、24(AES-192)、或32(AES-256)Bytes 长度.目前AES-128足够用 length = 16 count = len(text) add = length - (count % length) text = text + ('\0' * add) ciphertext = cryptor.encrypt(text) #因为AES加密时候得到的字符串不一定是ascii字符集的,输出到终端或者保存时候可能存在问题 #所以这里统一把加密后的字符串转化为16进制字符串 return b2a_hex(ciphertext) def decrypt(self, text): cryptor = AES.new(configuration.encrypt, AES.MODE_CBC, configuration.encrypt) plain_text = cryptor.decrypt(a2b_hex(text)) return plain_text.decode().rstrip('\0')
zWhite
/zWhite-0.0.92-py3-none-any.whl/zero/controller.py
controller.py
from tornado import web, ioloop, routing from .router import router as mvc_router from .config import configuration import sys from .logger import logger class main(web.RequestHandler): def prepare(self): self.isExec = True for middlewareName in configuration.middleware_list: middleware = getattr(__import__(middlewareName), middlewareName)(self) if hasattr(middleware, "prepare"): self.isExec = getattr(middleware, "prepare")() if not self.isExec: break def on_finish(self): if self.isExec: for middlewareName in configuration.middleware_list: middleware = getattr(__import__(middlewareName), middlewareName)(self) if hasattr(middleware, "finish"): getattr(middleware, "finish")() def get(self): if self.isExec: self.router() def post(self): if self.isExec: self.router() def router(self): try: router = mvc_router(self.request.uri) controller = getattr(__import__(router.controller), router.controller)(self) getattr(controller, router.action)() except Exception as e: logger.error("An error has occurred in the main run {router.controller}/{router.action}, error:{e}".format(**locals())) self.set_status(500, e) class application(): def __init__(self, appPath, config, port=None): self.port = port configuration.init(config, appPath) self._init_router() self._init_path() self._run_plugins() def _init_router(self): self.router = [(r".*", main)] def _init_path(self): sys.path.insert(0, configuration.controller_path) sys.path.insert(0, configuration.middleware_path) sys.path.insert(0, configuration.plugin_path) sys.path.insert(0, configuration.filter_path) def _run_plugins(self): for plugin in configuration.plugin_list: plugin = getattr(__import__(plugin), plugin) self._run_plugin(plugin) def _run_plugin(self, plugin): plugin(self) def run(self): self.app = web.Application(self.router) self.app.listen(configuration.port if not self.port else self.port) ioloop.IOLoop.current().start()
zWhite
/zWhite-0.0.92-py3-none-any.whl/alauda/application.py
application.py
import sys from Crypto.Cipher import AES from binascii import b2a_hex, a2b_hex from tornado import escape from .config import configuration import os, io class controller(): _401 = "<!DOCTYPE html><html lang='en'><meta name='viewport' content='width=device-width, initial-scale=1.0'><meta http-equiv='X-UA-Compatible' content='ie=edge'><head><title>401</title><style>html,body,body>div{width:100%;height:100%;margin:0;padding:0;overflow:hidden;text-align:center;color:#527bcc;font:'华文彩云'}h1{margin-top:100px;font-size:160px}.onlinefs-message-one{display:block;font:40px '华文彩云'}.onlinefs-message-two{margin-top:24px;margin-bottom:24px;display:block;font:18px '华文彩云'}a{display:inline-block;height:40px;width:130px;background:#527bcc;font-size:22px;font-family:'华文彩云';text-decoration:none;color:#fff;line-height:40px}</style></head><body><div><h1>401</h1><div class='onlinefs-message-one'>你没有权限访问这个站点,请先申请权限后再登录!</div><div class='onlinefs-message-two'>快回首页试试吧!</div><a href='/'>去首页</a></div></body></html>" def __init__(self, application): self.application = application self.application.set_header("Access-Control-Allow-Origin", configuration.cors) self.application.set_header("Access-Control-Allow-Credentials", "true") def json_encode(self, value): return escape.json_encode(value) def json_decode(self, value): return escape.json_decode(value) def json(self, value): json = self.json_encode(value) self.application.set_header("Content-Type", "application/json") self.application.write(json) def success(self, data = None): self.json({ "isSuccess": True, "data": data }) def fail(self, message): self.json({ "isSuccess": False, "message": message }) def result(self, result, data = None, message = None): if result: self.success(data) else: self.fail(message) def file(self, path, filename): self.application.set_header('Content-Type', 'application/octet-stream') self.application.set_header('Content-Disposition', 'attachment; filename=%s' % filename) with open(path, 'rb') as f: while True: data = f.read(4096) if not data: break self.application.write(data) def stream(self, filename, data): self.application.set_header('Content-Type', 'application/octet-stream') self.application.set_header('Content-Disposition', 'attachment; filename=%s' % filename) self.application.write(data) def csv(self, filename, fields, rows): content = ",".join(fields) + "\n" for row in rows: tempRow = [] for field in fields: tempRow.append(str(row[field])) content += ",".join(tempRow) + "\n" self.stream(filename, content.encode("utf-8")) def set_cookie(self, name, value): self.application.set_cookie(name, value) def get_cookie(self, name): return self.application.get_cookie(name) def __getattr__(self, name): value = self.application.get_argument(name) try: return self.json_decode(value) except: return value def set_status(self, code, message): self.application.set_status(code, message) if code >= 400: # self.application.set_header("Content-Type", "application/json") # self.json({ # "status_code": code, # "message": message # }) self.application.set_header("Content-Type", "text/html; charset=utf-8") self.application.write(controller._401) @property def user(self): try: return self.decrypt(self.get_cookie(configuration.cookie_id)) except Exception as e: return None @property def files(self): return self.application.request.files.get('file', None) def redirect(self, url): self.application.redirect(url) #加密函数,如果text不是16的倍数【加密文本text必须为16的倍数!】,那就补足为16的倍数 def encrypt(self, text): cryptor = AES.new(configuration.encrypt, AES.MODE_CBC, configuration.encrypt) #这里密钥key 长度必须为16(AES-128)、24(AES-192)、或32(AES-256)Bytes 长度.目前AES-128足够用 length = 16 count = len(text) add = length - (count % length) text = text + ('\0' * add) ciphertext = cryptor.encrypt(text) #因为AES加密时候得到的字符串不一定是ascii字符集的,输出到终端或者保存时候可能存在问题 #所以这里统一把加密后的字符串转化为16进制字符串 return b2a_hex(ciphertext) def decrypt(self, text): cryptor = AES.new(configuration.encrypt, AES.MODE_CBC, configuration.encrypt) plain_text = cryptor.decrypt(a2b_hex(text)) return plain_text.decode().rstrip('\0')
zWhite
/zWhite-0.0.92-py3-none-any.whl/alauda/controller.py
controller.py
class Names: def __init__(self, a_name, a_formula = []): self.name = a_name self.formula = a_formula def add_name(self, name_v): self.name = name_v def add_formula(self, formula_v): self.formula.extend(formula_v) def z_count(z_n): prim = 0 seg = 0 terc = 0 quar = 0 quint = 0 six = 0 z7 = 0 z8 = 0 z9 = 0 z10 = 0 z11 = 0 z12 = 0 z13 = 0 z14 = 0 z15 = 0 z16 = 0 z17 = 0 z18 = 0 z19 = 0 while z_n != 0: if z_n <= 2: prim = prim + 1 z_n -= 1 if prim > 2: z_n -= 1 elif z_n > 2 and z_n <= 4: seg += 1 z_n -= 1 if seg > 2: z_n -= 1 elif z_n > 4 and z_n <= 10: terc += 1 z_n -= 1 if terc > 6: z_n -= 1 elif z_n <= 12 and z_n > 10: quar += 1 z_n -= 1 if quar > 2: z_n -= 1 elif z_n > 12 and z_n <= 18: quint += 1 z_n -= 1 if quint > 6: z_n -=1 elif z_n > 18 and z_n <= 28: six += 1 z_n -= 1 if six > 10: z_n -=1 elif z_n > 28 and z_n <= 30: z7 += 1 z_n -= 1 if z7 > 2: z_n -= 1 elif z_n > 30 and z_n <= 36: z8 += 1 z_n -= 1 elif z_n > 36 and z_n <= 46: z9 += 1 z_n -= 1 elif z_n > 46 and z_n <= 60: z10 += 1 z_n -=1 elif z_n > 60 and z_n <= 62: z11 += 1 z_n -= 1 elif z_n > 62 and z_n <= 68: z12 += 1 z_n -= 1 elif z_n > 68 and z_n <= 78: z13 += 1 z_n -= 1 elif z_n > 78 and z_n <= 92: z14 += 1 z_n -= 1 elif z_n > 92 and z_n <= 94: z15 += 1 z_n -= 1 elif z_n > 94 and z_n <= 100: z16 += 1 z_n -= 1 elif z_n > 100 and z_n <= 110: z17 += 1 z_n -= 1 elif z_n > 110 and z_n <= 112: z18 += 1 z_n -= 1 elif z_n > 112 and z_n <= 118: z19 += 1 z_n -= 1 nome_e = input("Name: ") nome = Names(str(nome_e)) return(read_z(prim, seg, terc, quar, quint, six, z7, z8, z9, z10, z11, z12, z13, z14, z15, z16, z17, z18, z19)) """ read_z(prim, seg, terc, quar, quint, six, z7, z8, z9, z10, z11, z12, z13, z14, z15, z16, z17, z18, z19) return(prim, seg, terc, quar, quint, six, z7, z8, z9, z10, z11, z12, z13, z14, z15, z16, z17, z18, z19) """ #Other function... Shit def read_z(f1, f2 = False, f3 = False, f4 = False, f5 = False, f6 = False, f7 = False, f8 = False, f9 = False, f10 = False, f11 = False, f12 = False, f13 = False, f14 = False, f15 = False, f16 = False, f17 = False, f18 = False, f19 = False): r1 = "1s" + str(f1) r2 = "2s" + str(f2) r3 = "2p" + str(f3) r4 = str(f4) r5 = str(f5) r6 = str(f6) r7 = str(f7) r8 = str(f8) r9 = str(f9) r10 = str(f10) r11 = str(f11) r12 = str(f12) r13 = str(f13) r14 = str(f14) r15 = str(f15) r16 = str(f16) r17 = str(f17) r18 = str(f18) r19 = str(f19) print("The diagram of Linus Pauling: \n") print(r1 + "\n") print(r2 + " " + r3 + "\n") print("3s" + r4 + " 3p" + r5 + " 3d" + r6 + "\n") print("4s" + r7 + " 4p" + r8 + " 4d" + r9 + " 4f" + r10 + "\n") print("5s" + r11 + " 5p" + r12 + " 5d" + r13 + " 5f" + r14 + "\n") print("6s" + r15 + " 6p" + r16 + " 6d" + r17 + "\n") print("7s" + r18 + " 7p" + r19 + "\n") print("Eletronic distribution in geometric order: \n") print(r1 + " " + r2 + " " + r3 + " " + "3s" + r4 + " 3p" + r5 + " 3d" + r6 + " " + "4s" + r7 + " 4p" + r8 + " 4d" + r9 + " 4f" + r10 + " " + "5s" + r11 + " 5p" + r12 + " 5d" + r13 + " 5f" + r14 + " " + "6s" + r15 + " 6p" + r16 + " 6d" + r17 + " " + "7s" + r18 + " 7p" + r19 + "\n") print("Eletronic distribution in energetic order: \n") print(r1 + " " + r2 + " " + r3 + " " + "3s" + r4 + " 3p" + r5 + " 4s" + r7 + " 3d" + r6 + " " + " 4p" + r8 + " 5s" + r11 + " 4d" + r9 + " 5p" + r12 + " 6s" + r15 + " 4f" + r10 + " 5d" + r13 + " 6p" + r16 + " 7s" + r18 + " 5f" + r14 + " 6d" + r17 + " 7p" + r19 + "\n")
z_number
/z_number-1.0.0.zip/z_number-1.0.0/z_number.py
z_number.py
# za_identity_number ZA / RSA Identity Number Library to validate/check/manipulate and retrieve ID number info for South African IDs Current version: 0.0.8 Downloads total: [![Downloads](https://static.pepy.tech/personalized-badge/za-id-number?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/za-id-number) Poetry & pip compatibility Python 3.5 or greater for f-strings. Officially only support from py 3.7 >= # Installation: pip: ```bash pip install za-id-number ``` poetry: ```bash poetry add za-id-number ``` ZA ID Numbers / RSA ID numbers / South African ID numbers: ZA id numbers are validated by the luhn algorithm, with the last number validating that the entire number is correct. ZA ID number is broken up into 2 digits birth year, 2 digits birth month, 2 digits birth date, 4 digits for gender, 1 digit for citizenship (za/other), 1 digit race (phased out after 1980) 1 digit for validation. For more info: https://www.westerncape.gov.za/sites/www.westerncape.gov.za/files/sa-id-number-new.png Easiest ZA ID validation is the length. The length must be exactly 13 integers. # Example: ```python from za_id_number.za_id_number import SouthAfricanIdentityValidate if __name__ == "__main__": za_validation = SouthAfricanIdentityValidate("9202204720082") valid = za_validation.validate() za_identity = za_validation.identity() print(f"Valid: {valid}, Identity: {za_identity}") ``` # Logging As its a library logging is off by default. To get a logger for the library you can use the following example: ```python from za_id_number.za_id_number import SouthAfricanIdentityValidate logger = SouthAfricanIdentityValidate.get_logger(level=logging.DEBUG) # logger = logging.getLogger("za_id_number") # logger.removeHandler(logging.NullHandler()) # logger.addHandler(logging.StreamHandler()) za_validation = SouthAfricanIdentityValidate("9202204720082") valid = za_validation.validate() za_identity = za_validation.identity() logger.info(f"Valid: {valid}, Identity: {za_identity}") print(SouthAfricanIdentityValidate("99").identity_length()) ``` # Classes: ```python from za_id_number.za_id_number import ( SouthAfricanIdentityValidate, SouthAfricanIdentityNumber,SouthAfricanIdentityGenerate) # Validation class, inherits from SouthAfricanIdentityNumber validate_id_obj = SouthAfricanIdentityValidate("9001245289086") # SouthAfricanIdentityNumber class identity_obj = SouthAfricanIdentityNumber("9001245289086") # SouthAfricanIdentityGenerate class generated_id_obj = SouthAfricanIdentityGenerate() ``` # Class Attributes: ```python from za_id_number.za_id_number import ( SouthAfricanIdentityValidate, SouthAfricanIdentityNumber,SouthAfricanIdentityGenerate) # SouthAfricanIdentityValidate SouthAfricanIdentityValidate("9202204720082").valid # SouthAfricanIdentityNumber SouthAfricanIdentityNumber("9202204720082").id_number SouthAfricanIdentityNumber("9202204720082").birthdate SouthAfricanIdentityNumber("9202204720082").year SouthAfricanIdentityNumber("9202204720082").month SouthAfricanIdentityNumber("9202204720082").day SouthAfricanIdentityNumber("9202204720082").gender SouthAfricanIdentityNumber("9202204720082").citizenship SouthAfricanIdentityNumber("9202204720082").age ``` # Methods: ```python from za_id_number.za_id_number import ( SouthAfricanIdentityValidate, SouthAfricanIdentityNumber,SouthAfricanIdentityGenerate, generate_random_id) # SouthAfricanIdentityNumber class SouthAfricanIdentityNumber("9202204720082").get_age() SouthAfricanIdentityNumber("9202204720082").get_citizenship() SouthAfricanIdentityNumber("9202204720082").get_gender() SouthAfricanIdentityNumber("9202204720082").calculate_birthday() SouthAfricanIdentityNumber("9202204720082").get_month() SouthAfricanIdentityNumber("9202204720082").get_year() SouthAfricanIdentityNumber("9202204720082").get_day() # SouthAfricanIdentityValidate class # Inherits from SouthAfricanIdentityNumber # All attributes and methods available SouthAfricanIdentityValidate("9202204720082").valid_birth_date() SouthAfricanIdentityValidate("9202204720082").validate() SouthAfricanIdentityValidate("9202204720082").identity() SouthAfricanIdentityValidate("9202204720082").identity_length() # SouthAfricanIdentityGenerate class # Inherits from SouthAfricanIdentityValidate # All attributes and methods available # gender and citizenship can be specified for specific random # id numbers SouthAfricanIdentityGenerate() # or SouthAfricanIdentityGenerate(gender="male", citizenship='citizen') # or from za_id_number.constants import Gender, CitizenshipClass SouthAfricanIdentityGenerate(gender=Gender.FEMALE, citizenship=CitizenshipClass.CITIZEN_BORN) # generate random ID number without using class obj generate_random_id() ``` Questions/Ideas/Feedback [email protected] [email protected] ## Future features: * Ask for some please ## CI/CD Covers python: * 3.6 * 3.7 * 3.8 * 3.9 * 3.10 Check CI: https://github.com/c-goosen/za_identity_number/actions # Releases: * 0.0.7 * Upgrade packages idenitified by github security scanning * Remove loguru * Disable loggin in library by default * Fixed some exceptions * Removed luhn library for fast-luhn * fast-luhn adds generate and complete functions * Generate Random ID numbers * Generate random luhn numbers of length n * 0.0.8 * Removed fast-luhn library as pyo3 rust implementation not building for Mac or python greater than 3.8 * Simplified library. * Security issues in dependencies updated
za-id-number
/za-id-number-0.0.8.tar.gz/za-id-number-0.0.8/README.md
README.md
from datetime import date, datetime, timedelta import random import luhn from za_id_number.constants import ( Gender, CitizenshipClass, LIB_DATE_FORMAT, LIB_ID_DATE_FORMAT, ) from functools import lru_cache import logging # logger = logging.getLogger().isEnabled(level) # Since this is a library we immediately disable logging. # If logging within the library is desired, then add a handler to the logger # or call SouthAfricanIdentityValidate.get_logger(level=logging.DEBUG) logger = logging.getLogger("za_id_number") logger.addHandler(logging.NullHandler()) # from within your script. # logger = SouthAfricanIdentityValidate.get_logger(level=logging.DEBUG) # logger.debug("Hello") def check_length(f): def wrapper(*args): logger.debug(args[0].id_number) return f(*args) return wrapper class SouthAfricanIdentityNumber(object): """ Identity Number Class. Validates and sets up Identity Number class object """ def __init__(self, id_number: str): self.id_number: str = id_number self.length_valid = True if len(id_number) == 13 else False self.clean_input() self.birthdate: datetime = self.calculate_birthday() self.year = self.get_year() self.month = self.get_month() self.day = self.get_day() self.gender = self.get_gender() self.citizenship = self.get_citizenship() self.age = self.get_age() @staticmethod def get_logger(level=logging.DEBUG): """ Helper for quickly adding a StreamHandler to the logger. Useful for debugging. Logger not on by default Returns the handler after adding it. """ logger = logging.getLogger(__name__) handler = logging.StreamHandler() handler.setFormatter( logging.Formatter("[%(asctime)s] [%(module)s] [%(levelname)s]: %(message)s") ) logger.addHandler(handler) logger.setLevel(level) logger.debug(f"Added a {level} logging handler to logger: %s", __name__) return logger @lru_cache(100) def identity_length(self) -> bool: """ Test identity number is 13 characters """ if len(str(self.id_number)) != 13: return False else: return True def clean_input(self): self.id_number = self.id_number.strip() def get_day(self): return self.birthdate.day if self.birthdate else None def get_year(self): if self.birthdate: return self.birthdate.year if self.birthdate else None def get_month(self) -> int: if self.birthdate: return self.birthdate.month if self.birthdate else None @lru_cache(100) def calculate_birthday(self): try: datetime_obj = datetime.strptime( f"{self.id_number[:2]}-{self.id_number[2:4]}-{self.id_number[4:6]}", LIB_DATE_FORMAT, ) if datetime_obj > datetime.now(): return datetime_obj.replace(year=(datetime_obj.year - 100)).date() return datetime_obj.date() except ValueError as e: logger.error(e) return None def get_gender(self) -> str: try: gen_num = int(self.id_number[6:10]) logger.debug(f"gen_num {gen_num}") if gen_num < 5000: return Gender.FEMALE.value else: return Gender.MALE.value except ValueError as e: logger.error(e) return None def get_citizenship(self): """ Citizen or resident. Only these two classes of people can receive an ID number """ try: citizen_num = int(self.id_number[10]) return ( CitizenshipClass.CITIZEN_BORN.value if citizen_num == 0 else CitizenshipClass.CITIZEN_NOT_BORN.value ) except Exception as e: logger.error(e) return False @lru_cache(100) def get_age(self) -> int: try: today = date.today() age = (today.year - self.birthdate.year) - ( 1 if ( (today.month, today.day) < (self.birthdate.month, self.birthdate.day) ) else 0 ) return int(age) except Exception as e: logger.error(e) return None class SouthAfricanIdentityValidate(SouthAfricanIdentityNumber): def __init__(self, id_number: str): # super(SouthAfricanIdentityValidate, self).__init__(id_number) super().__init__(id_number) self.valid = self.validate() @lru_cache(100) def valid_birth_date(self) -> bool: """ Ensures that birthday is a valid date. A test case for this is the ID number 0000000000000 00-00-00 is not a valid date. """ try: if self.calculate_birthday(): return True else: return False except Exception as e: logger.error(e) return True def validate(self) -> bool: """ Valid ID or not? Luhn algorithm validates the ID number Additional check is where the date makes sense In Luhn 0000 """ if self.identity_length() and self.valid_birth_date(): try: return bool(luhn.verify(self.id_number)) except ValueError as e: logger.error(e) return False else: return False def identity(self) -> dict: """ Return dict of identity Class to dict """ # return self.__dict__ if self.identity_length(): return self.__dict__ else: return {} class SouthAfricanIdentityGenerate(SouthAfricanIdentityValidate): def __init__(self, gender=None, citizenship=None): # super(SouthAfricanIdentityValidate, self).__init__(id_number) id_number = self.generate(gender=gender, citizenship=citizenship) super().__init__(id_number) @staticmethod def generate_date(): time_between_dates = date.today() - date(1900, 1, 1) days_between_dates = time_between_dates.days random_number_of_days = random.randrange(days_between_dates) random_date = date.today() + timedelta(days=random_number_of_days) return random_date.strftime(LIB_ID_DATE_FORMAT) @staticmethod def generate_gender(gender=None): if gender: if gender in ["female", "f", Gender.FEMALE]: logger.debug("hit F") min = 0 max = 5000 elif gender in ["male", "m", Gender.MALE]: logger.debug("hit M") min = 5000 max = 10000 else: logger.debug("hit if") min = 0 max = 10000 rand_int = random.randrange(min, max) rand_int = f"{rand_int:04d}" logger.debug(rand_int) return rand_int @staticmethod def generate_citizenship(citizenship=None): if not citizenship: random_choice = random.choice([f"{0:01d}", f"{1:01d}"]) logger.debug(f"random_choice {random_choice}") return random_choice else: if citizenship in ["citizen", CitizenshipClass.CITIZEN_BORN]: return f"{0:01d}" elif citizenship in ["resident", CitizenshipClass.CITIZEN_NOT_BORN]: return f"{1:01d}" @classmethod def generate(cls, gender=None, citizenship=None): _date = cls.generate_date() _gender = cls.generate_gender(gender=gender) _citizenship = cls.generate_citizenship(citizenship=citizenship) _race_deprecated = 8 _luhn_nr = luhn.append(f"{_date}{_gender}{_citizenship}{_race_deprecated:01d}") logger.debug(_luhn_nr) logger.debug(f"len {len(_luhn_nr)}") return _luhn_nr def generate_random_id(gender=None, citizenship=None): return SouthAfricanIdentityGenerate.generate(gender=gender, citizenship=citizenship)
za-id-number
/za-id-number-0.0.8.tar.gz/za-id-number-0.0.8/za_id_number/za_id_number.py
za_id_number.py
za-parliament-scrapers ====================== .. image:: https://badge.fury.io/py/za-parliament-scrapers.svg :target: http://badge.fury.io/py/za-parliament-scrapers .. image:: https://travis-ci.org/Code4SA/za-parliament-scrapers.svg :target: http://travis-ci.org/Code4SA/za-parliament-scrapers This is a collection of scrapers for working with data from the `Parliament of South Africa <http://www.parliament.gov.za/>`_. It includes: 1. Scrapers for handling Questions and Replies documents Credit ------ Most of the Question and Replies scraping was taken from https://github.com/mysociety/za-hansard. Installation ------------ Install using:: pip install za-parliament-scrapers Development ----------- Clone the repo and setup for local development:: pip install -e .[dev] To run tests:: nosetest --with-doctest && flake8 za_parliament_scrapers License ------- `MIT License <LICENSE>`_
za-parliament-scrapers
/za-parliament-scrapers-0.1.0.tar.gz/za-parliament-scrapers-0.1.0/README.rst
README.rst
import os import re import datetime import mammoth import bs4 def strip_dict(d): """ Return a new dictionary, like d, but with any string value stripped >>> d = {'a': ' foo ', 'b': 3, 'c': ' bar'} >>> result = strip_dict(d) >>> type(result) <type 'dict'> >>> sorted(result.items()) [('a', 'foo'), ('b', 3), ('c', 'bar')] """ return dict((k, v.strip() if hasattr(v, 'strip') else v) for k, v in d.iteritems()) class QuestionAnswerScraper(object): """ Parses answer documents from parliament. """ DOCUMENT_NAME_REGEX = re.compile(r'^R(?P<house>[NC])(?:O(?P<president>D?P)?(?P<oral_number>\d+))?(?:W(?P<written_number>\d+))?-+(?P<date_string>\d{6})$') BAR_REGEX = re.compile(r'^_+$', re.MULTILINE) QUESTION_RE = re.compile( ur""" (?P<intro> (?:(?P<number1>\d+)\.?\s+)? # Question number (?P<askedby>[-\w\s]+?) # Name of question asker \s*\((?P<party>[-\w\s]+)\)? \s+to\s+ask\s+the\s+ (?P<questionto>[-\w\s(),:.]+)[:.] [-\u2013\w\s(),\[\]/]*? ) # Intro (?P<translated>\u2020)?\s*(</b>|\n)\s* (?P<question>.*?)\s* # The question itself. (?:(?P<identifier>(?P<house>[NC])(?P<answer_type>[WO])(?P<id_number>\d+)E)|\n|$) # Number 2 """, re.UNICODE | re.VERBOSE | re.DOTALL) REPLY_RE = re.compile(r'^reply:?', re.IGNORECASE | re.MULTILINE) def details_from_name(self, name): """ Return a map with details from the document name: * :code +str+: document code * :date +datetime+: question date * :year +int+: year portion of the date * :type +str+: 'O' for oral, or 'W' for written * :house +str+: 'N' for NA, C for NCOP * :oral_number +str+: oral number (may be null) * :written_number +str+: written number (may be null) * :president_number +str+: president question number if this is question for the president (may be null) * :deputy_president_number +str+: deputy president question number if this is question for the deputy president (may be null) """ match = self.DOCUMENT_NAME_REGEX.match(name) if not match: raise ValueError("bad document name %s" % name) document_data = match.groupdict() code = os.path.splitext(name)[0].split('-', 1)[0] # remove starting 'R' document_data['code'] = code[1:] # The President and vice Deputy President have their own # oral question sequences. president = document_data.pop('president') if president == 'P': document_data['president_number'] = document_data.pop('oral_number') if president == 'DP': document_data['deputy_president_number'] = document_data.pop('oral_number') if document_data.get('oral_number'): document_data['type'] = 'O' elif document_data.get('written_number'): document_data['type'] = 'W' else: document_data['type'] = None date = document_data.pop('date_string') try: document_data['date'] = datetime.datetime.strptime(date, '%y%m%d').date() except: raise ValueError("problem converting date %s" % date) document_data['year'] = document_data['date'].year document_data = strip_dict(document_data) return document_data def extract_content_from_document(self, filename): """ Extract content from a .docx file and return a (text, html) tuple. """ ext = os.path.splitext(filename)[1] if ext == '.docx': with open(filename, "rb") as f: html = mammoth.convert_to_html(f).value text = mammoth.extract_raw_text(f).value return (text, html) else: # TODO: handle .doc raise ValueError("Can only handle .docx files, but got %s" % ext) def extract_questions_from_text(self, text): """ Find and return a list of questions in this text. Returns a list of dicts: * :answer_type +str+: 'W' for written or 'O' for oral * :askedby +str+: initial and name of person doing the asking * :house +str+: house, N for NA, C for NCOP * :id_number +str+: the id number of this question * :identifier +str+: the identifier of this question * :intro +str+: the preamble/introduction to this question * :question +str+: the actual text of the question * :questionto +str+: who the question is being asked of, generally a Minister * :written_number +str+: the written number of the question # Checks for QUESTION_RE # Shows the need for - in the party >>> qn = u'144. Mr D B Feldman (COPE-Gauteng) to ask the Minister of Defence and Military Veterans: </b>Whether the deployment of the SA National Defence Force soldiers to the Central African Republic and the Democratic Republic of Congo is in line with our international policy with regard to (a) upholding international peace, (b) the promotion of constitutional democracy and (c) the respect for parliamentary democracy; if not, why not; if so, what are the (i) policies which underpin South African foreign policy and (ii) further relevant details? CW187E' >>> match = QuestionAnswerScraper.QUESTION_RE.match(qn) >>> match.groups() (u'144. Mr D B Feldman (COPE-Gauteng) to ask the Minister of Defence and Military Veterans:', u'144', u'Mr D B Feldman', u'COPE-Gauteng', u'Minister of Defence and Military Veterans', None, u'</b>', u'Whether the deployment of the SA National Defence Force soldiers to the Central African Republic and the Democratic Republic of Congo is in line with our international policy with regard to (a) upholding international peace, (b) the promotion of constitutional democracy and (c) the respect for parliamentary democracy; if not, why not; if so, what are the (i) policies which underpin South African foreign policy and (ii) further relevant details?', u'CW187E', u'C', u'W', u'187') # Shows the need for \u2013 (en-dash) and / (in the date) in latter part of the intro >>> qn = u'409. Mr M J R de Villiers (DA-WC) to ask the Minister of Public Works: [215] (Interdepartmental transfer \u2013 01/11) </b>(a) What were the reasons for a cut back on the allocation for the Expanded Public Works Programme to municipalities in the 2013-14 financial year and (b) what effect will this have on (i) job creation and (ii) service delivery? CW603E' >>> match = QuestionAnswerScraper.QUESTION_RE.match(qn) >>> match.groups() (u'409. Mr M J R de Villiers (DA-WC) to ask the Minister of Public Works: [215] (Interdepartmental transfer \u2013 01/11)', u'409', u'Mr M J R de Villiers', u'DA-WC', u'Minister of Public Works', None, u'</b>', u'(a) What were the reasons for a cut back on the allocation for the Expanded Public Works Programme to municipalities in the 2013-14 financial year and (b) what effect will this have on (i) job creation and (ii) service delivery?', u'CW603E', u'C', u'W', u'603') # Cope with missing close bracket >>> qn = u'1517. Mr W P Doman (DA to ask the Minister of Cooperative Governance and Traditional Affairs:</b> Which approximately 31 municipalities experienced service delivery protests as referred to in his reply to oral question 57 on 10 September 2009? NW1922E' >>> match = QuestionAnswerScraper.QUESTION_RE.match(qn) >>> match.groups() (u'1517. Mr W P Doman (DA to ask the Minister of Cooperative Governance and Traditional Affairs:', u'1517', u'Mr W P Doman', u'DA', u'Minister of Cooperative Governance and Traditional Affairs', None, u'</b>', u'Which approximately 31 municipalities experienced service delivery protests as referred to in his reply to oral question 57 on 10 September 2009?', u'NW1922E', u'N', u'W', u'1922') # Check we cope with no space before party in parentheses >>> qn = u'1569. Mr M Swart(DA) to ask the Minister of Finance: </b>Test question? NW1975E' >>> match = QuestionAnswerScraper.QUESTION_RE.match(qn) >>> match.groups() (u'1569. Mr M Swart(DA) to ask the Minister of Finance:', u'1569', u'Mr M Swart', u'DA', u'Minister of Finance', None, u'</b>', u'Test question?', u'NW1975E', u'N', u'W', u'1975') # Check we cope with a dot after the askee instead of a colon. >>> qn = u'1875. Mr G G Hill-Lewis (DA) to ask the Minister in the Presidency. National Planning </b>Test question? NW2224E' >>> match = QuestionAnswerScraper.QUESTION_RE.match(qn) >>> match.groups() (u'1875. Mr G G Hill-Lewis (DA) to ask the Minister in the Presidency. National Planning', u'1875', u'Mr G G Hill-Lewis', u'DA', u'Minister in the Presidency', None, u'</b>', u'Test question?', u'NW2224E', u'N', u'W', u'2224') # Check we cope without a question number >>> qn = u'Mr AM Matlhoko (EFF) to ask the Minister of Cooperative Governance and Traditional Affairs: </b>Whether he has an immediate plan to assist?' >>> match = QuestionAnswerScraper.QUESTION_RE.match(qn) >>> match.groups() (u'Mr AM Matlhoko (EFF) to ask the Minister of Cooperative Governance and Traditional Affairs:', None, u'Mr AM Matlhoko', u'EFF', u'Minister of Cooperative Governance and Traditional Affairs', None, u'</b>', u'Whether he has an immediate plan to assist?', None, None, None, None) """ questions = [] for match in self.QUESTION_RE.finditer(text): match_dict = match.groupdict() answer_type = match_dict[u'answer_type'] number1 = match_dict.pop('number1') if answer_type == 'O': if re.search('(?i)to ask the Deputy President', match_dict['intro']): match_dict[u'dp_number'] = number1 elif re.search('(?i)to ask the President', match_dict['intro']): match_dict[u'president_number'] = number1 else: match_dict[u'oral_number'] = number1 elif answer_type == 'W': match_dict[u'written_number'] = number1 match_dict[u'translated'] = bool(match_dict[u'translated']) match_dict[u'questionto'] = match_dict[u'questionto'].replace(':', '') match_dict['questionto'] = self.correct_minister_title(match_dict['questionto']) questions.append(match_dict) return questions def correct_minister_title(self, minister_title): corrections = { "Minister President of the Republic": "President of the Republic", "Minister in The Presidency National Planning Commission": "Minister in the Presidency: National Planning Commission", "Minister in the Presidency National Planning Commission": "Minister in the Presidency: National Planning Commission", "Questions asked to the Minister in The Presidency National Planning Commission": "Minister in the Presidency: National Planning Commission", "Minister in the Presidency. National Planning Commission": "Minister in the Presidency: National Planning Commission", "Minister in The Presidency": "Minister in the Presidency", "Minister in The Presidency Performance Monitoring and Evaluation as well as Administration in the Presidency": "Minister in the Presidency: Performance Monitoring and Evaluation as well as Administration in the in the Presidency", "Minister in the Presidency Performance , Monitoring and Evaluation as well as Administration in the Presidency": "Minister in the Presidency: Performance Monitoring and Evaluation as well as Administration in the in the Presidency", "Minister in the Presidency Performance Management and Evaluation as well as Administration in the Presidency": "Minister in the Presidency: Performance Monitoring and Evaluation as well as Administration in the in the Presidency", "Minister in the Presidency Performance Monitoring and Administration in the Presidency": "Minister in the Presidency: Performance Monitoring and Evaluation as well as Administration in the in the Presidency", "Minister in the Presidency Performance Monitoring and Evaluation as well Administration in the Presidency": "Minister in the Presidency: Performance Monitoring and Evaluation as well as Administration in the in the Presidency", "Minister in the Presidency Performance Monitoring and Evaluation as well as Administration": "Minister in the Presidency: Performance Monitoring and Evaluation as well as Administration in the in the Presidency", "Minister in the Presidency Performance Monitoring and Evaluation as well as Administration in the Presidency": "Minister in the Presidency: Performance Monitoring and Evaluation as well as Administration in the in the Presidency", "Minister in the Presidency, Performance Monitoring and Evaluation as well as Administration in the Presidency": "Minister in the Presidency: Performance Monitoring and Evaluation as well as Administration in the in the Presidency", "Minister in the PresidencyPerformance Monitoring and Evaluation as well as Administration in the Presidency": "Minister in the Presidency: Performance Monitoring and Evaluation as well as Administration in the in the Presidency", "Minister of Women in The Presidency": "Minister of Women in the Presidency", "Minister of Agriculture, Fisheries and Forestry": "Minister of Agriculture, Forestry and Fisheries", "Minister of Minister of Agriculture, Forestry and Fisheries": "Minister of Agriculture, Forestry and Fisheries", "Minister of Agriculture, Foresty and Fisheries": "Minister of Agriculture, Forestry and Fisheries", "Minister of Minister of Basic Education": "Minister of Basic Education", "Minister of Basic Transport": "Minister of Transport", "Minister of Communication": "Minister of Communications", "Minister of Cooperative Government and Traditional Affairs": "Minister of Cooperative Governance and Traditional Affairs", "Minister of Defence and MilitaryVeterans": "Minister of Defence and Military Veterans", "Minister of Heath": "Minister of Health", "Minister of Higher Education": "Minister of Higher Education and Training", "Minister of Minister of International Relations and Cooperation": "Minister of International Relations and Cooperation", "Minister of Justice and Constitutional development": "Minister of Justice and Constitutional Development", "Minister of Justice and Constitutional Developoment": "Minister of Justice and Constitutional Development", "Minister of Mining": "Minister of Mineral Resources", "Minister of Public Enterprise": "Minister of Public Enterprises", "Minister of the Public Service and Administration": "Minister of Public Service and Administration", "Minister of Public Work": "Minister of Public Works", "Minister of Rural Development and Land Affairs": "Minister of Rural Development and Land Reform", "Minister of Minister of Rural Development and Land Reform": "Minister of Rural Development and Land Reform", "Minister of Rural Development and Land Reform Question": "Minister of Rural Development and Land Reform", "Minister of Rural Development and Land Reforms": "Minister of Rural Development and Land Reform", "Minister of Rural Development and Land reform": "Minister of Rural Development and Land Reform", "Minister of Sport and Recreaton": "Minister of Sport and Recreation", "Minister of Sports and Recreation": "Minister of Sport and Recreation", "Minister of Water and Enviromental Affairs": "Minister of Water and Environmental Affairs", "Minister of Women, Children andPeople with Disabilities": "Minister of Women, Children and People with Disabilities", "Minister of Women, Children en People with Disabilities": "Minister of Women, Children and People with Disabilities", "Minister of Women, Children and Persons with Disabilities": "Minister of Women, Children and People with Disabilities", "Minister of Women, Youth, Children and People with Disabilities": "Minister of Women, Children and People with Disabilities", "Higher Education and Training": "Minister of Higher Education and Training", "Minister Basic Education": "Minister of Basic Education", "Minister Health": "Minister of Health", "Minister Labour": "Minister of Labour", "Minister Public Enterprises": "Minister of Public Enterprises", "Minister Rural Development and Land Reform": "Minister of Rural Development and Land Reform", "Minister Science and Technology": "Minister of Science and Technology", "Minister Social Development": "Minister of Social Development", "Minister Trade and Industry": "Minister of Trade and Industry", "Minister in Communications": "Minister of Communications", "Minister of Arts and Culture 102. Mr D J Stubbe (DA) to ask the Minister of Arts and Culture": "Minister of Arts and Culture", } # the most common error is the inclusion of a hyphen (presumably due to # line breaks in the original document). No ministers have a hyphen in # their title so we can do a simple replace. minister_title = minister_title.replace('-', '') # correct mispellings of 'minister' minister_title = minister_title.replace('Minster', 'Minister') # it is also common for a minister to be labelled "minister for" instead # of "minister of" minister_title = minister_title.replace('Minister for', 'Minister of') # remove any whitespace minister_title = minister_title.strip() # apply manual corrections minister_title = corrections.get(minister_title, minister_title) return minister_title def extract_answer_from_html(self, html): """ Extract the answer portion from a chunk of HTML We look for a P tag with text of 'REPLY' and return strip everything before that. """ if html.strip().startswith('<'): soup = bs4.BeautifulSoup(html, 'html.parser') for p in soup.find_all('p'): if self.REPLY_RE.match(p.text): for el in list(p.previous_elements): if isinstance(el, bs4.element.Tag): el.decompose() p.decompose() break return unicode(soup) else: # plain text match = self.REPLY_RE.search(html) if match: return html[match.end(0):] return html
za-parliament-scrapers
/za-parliament-scrapers-0.1.0.tar.gz/za-parliament-scrapers-0.1.0/za_parliament_scrapers/questions.py
questions.py
# Zaach _Zaach_ is an austrian term for exhausting/bothersome. Its a shortest way to express that you would rather do something else instead. This package includes tested helpers that I wrote once and now use in a couple of projects. They should work with Python 2 and 3. A base64 variant that is safe to be used in URLs and filesystems: - zaach.base64url.encode(unencoded) - zaach.base64url.decode(encoded) ISO 8601 compliant time formatting: - zaach.time.formatter.iso_8601_duration(seconds) Milliseconds to timecode - zaach.time.formatter.ms_to_timecode(ms, fps=None) _Easily_ getting a UNIX timestamp in UTC: - zaach.time.timestamp(utc_dt=None) Converting a UTC datetime object to CET/CEST, whatever is used at that date and time in the _bestest_ timezone - zaach.time.tzconversion.utc_to_cet_or_cest(utc_dt) A Borg object: - zaach.oop.borg.Borg A Mixin to store and retrieve (expiring) values in a class - zaach.oop.cache.CacheMixin Calculate the product of an iterable (like `sum` for multiplication) - zaach.math.prod
zaach
/zaach-1.0.10.tar.gz/zaach-1.0.10/README.md
README.md
Zabbix Agent extension to monitor CouchDB 3 =========================================== This is an extension for the Zabbix 4.x Agent to enable it to monitor CouchDB 3 servers. Requirements ------------ * Zabbix 4.0+ * Python 3.5+ * `py-zabbix <https://github.com/adubkov/py-zabbix>`_ Installation (Agent side) ------------------------- You first have to install the extension on the server that runs the Zabbix Agent. From PyPI ~~~~~~~~~ Run the following command (as root):: pip3 install zabbix-agent-extension-couchdb3 Then copy the ``zabbix-agent-extension-couchdb3.conf`` file from this repository to the ``/etc/zabbix/zabbix_agentd.conf.d/`` folder on the server. And finally, restart the Zabbix Agent (with systemd: ``systemctl restart zabbix-agent``). Installation (Zabbix side) -------------------------- 1. Import the template ~~~~~~~~~~~~~~~~~~~~~~ * Go to ``Configuration`` -> ``Templates``, * and click on the ``Import`` button. .. figure:: ./screenshots/zabbix_import_template_01.png :alt: Screenshot * Now select the template (``zabbix-agent-extension-couchdb3.template.xml``), * and click on the ``Import`` button. .. figure:: ./screenshots/zabbix_import_template_02.png :alt: Screenshot 2. Add the template to a host ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Go to the host configuration, * and link the ``Template CouchDB 3`` tempate to it. Doc: https://www.zabbix.com/documentation/4.0/manual/config/hosts/host .. figure:: ./screenshots/zabbix_add_template.png :alt: Screenshot 3. Configure connection information using macros ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Go to the host configuration page, * open the ``Macros`` tab, * configure required parameters. The following parameters are available: * ``{$COUCHDB_HOST}``: the CouchDB host (optional, default: ``localhost``) * ``{$COUCHDB_PASSWORD}``: the password to connect to CouchDB (required) * ``{$COUCHDB_PORT}``: the CouchDB port (optional, default: ``5984``) * ``{$COUCHDB_PROTO}``: the protocol to use to connect to CouchDB (``http`` or ``https``, optional, default: ``http``) * ``{$COUCHDB_USER}``: the user to connect to CouchDB (optional, default: ``admin``) **At least the** ``{$COUCHDB_PASSWORD}`` **macro must be defined!** .. figure:: ./screenshots/zabbix_config_macros.png :alt: Screenshot About polling interval ---------------------- The default polling interval of this probe in Zabbix is ``30s``. In order to have accurate stats, you must configure the "stats interval" setting of your CouchDB to twice this value (``60s``):: [stats] interval = 60 Read more `in the CouchDB documentation <https://docs.couchdb.org/en/stable/api/server/common.html#node-node-name-stats>`_. CLI Usage --------- This extension also provides a CLI to simplify debugging. :: usage: zabbix-agent-extension-couchdb3 [-h] [--host HOST] [--port PORT] [--user USER] --password PASSWORD [--proto PROTO] [--show-json] [--show-stats] [--generate-template] optional arguments: -h, --help show this help message and exit --host HOST The CouchDB server host (default: localhost) --port PORT The CouchDB server port (default: 5984) --user USER The username to use for the connexion (default: admin) --password PASSWORD The password to use for the connexion (mandatory) --proto PROTO The protocol to use (default: http) --show-json Display the raw JSON stats from CouchDB and exit (no stats will be sent to Zabbix) --show-stats Display the available stats with their values and description and exit (no stats will be sent to Zabbix) --generate-template Generates a Zabbix 4 template with all supported keys and exit (no stats will be sent to Zabbix) Example: dumping CouchDB stats as JSON:: zabbix-agent-extension-couchdb3 --password=XXXXX --show-json Example: displaying CouchDB stats in a more friendly format:: zabbix-agent-extension-couchdb3 --password=XXXXX --show-stats Example: generating the Zabbix template:: zabbix-agent-extension-couchdb3 --password=XXXXX --generate-template > zabbix-agent-extension-couchdb3.template.xml Changelog --------- * **v1.0.1:** Send credential to CouchDB at first request instead of waiting for a 401 first * **v1.0.0:** * Adds a command to generate the template from the available CouchDB stats * Adds a template for Zabbix 4.0 * Adds documentation * **v0.2.0:** Handles histogram-type values * **v0.1.1:** Fixes an issue with the entry point * **v0.1.0:** Initial release
zabbix-agent-extension-couchdb3
/zabbix-agent-extension-couchdb3-1.0.1.tar.gz/zabbix-agent-extension-couchdb3-1.0.1/README.rst
README.rst
import json import urllib.request _ZABBIX_STATS_ROUTE = "/_node/_local/_stats" def get_stats(host="localhost", port=5984, user="admin", password=None, proto="http"): # noqa: E501 if not password: raise Exception("The password parameter is mandatory") url = urllib.request.urlunparse(( proto, "%s:%i" % (host, port), _ZABBIX_STATS_ROUTE, None, None, None)) password_manager = urllib.request.HTTPPasswordMgrWithPriorAuth() password_manager.add_password( realm=None, uri=url, user=user, passwd=password, is_authenticated=True) auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) opener = urllib.request.build_opener(auth_handler) urllib.request.install_opener(opener) with urllib.request.urlopen(url) as response: return json.loads(response.read().decode("utf-8")) def flatten_stats(stats_json, prefix="couchdb3"): for key in stats_json: if "value" in stats_json[key]: value = stats_json[key]["value"] desc = stats_json[key]["desc"] if type(stats_json[key]["value"]) is dict: if "min" in value: yield ( "%s.%s.min" % (prefix, key), value["min"], desc) if "max" in value: yield ( "%s.%s.max" % (prefix, key), value["max"], desc) if "median" in value: yield ( "%s.%s.median" % (prefix, key), value["median"], desc) if "percentile" in value: for perc, count in value["percentile"]: yield ( "%s.%s.percentile[%i]" % (prefix, key, perc), count, desc) else: yield ("%s.%s" % (prefix, key), value, desc) else: for item in flatten_stats(stats_json[key], "%s.%s" % (prefix, key)): # noqa: E501 yield item
zabbix-agent-extension-couchdb3
/zabbix-agent-extension-couchdb3-1.0.1.tar.gz/zabbix-agent-extension-couchdb3-1.0.1/zabbix_agent_extension_couchdb3/couchdb.py
couchdb.py
import datetime _VALUE_TYPES = { float: 0, int: 3, } _TPL_HEAD = """<?xml version="1.0" encoding="UTF-8"?> <zabbix_export> <version>4.0</version> <date>%s</date> <groups> <group> <name>Templates</name> </group> </groups> <templates> <template> <template>Template CouchDB 3</template> <name>Template CouchDB 3</name> <description/> <groups> <group> <name>Templates</name> </group> </groups> <applications> <application> <name>CouchDB3</name> </application> </applications> <items> """ _TPL_ITEM = """ <item> <name>CouchDB 3: %s</name> <type>2</type> <snmp_community/> <snmp_oid/> <key>%s</key> <delay>0</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>%i</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description>%s</description> <inventory_link>0</inventory_link> <applications> <application> <name>CouchDB3</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <master_item/> </item> """ _TPL_TAIL = """ <item> <name>CouchDB 3 stats</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>couchdb3.stats[{$COUCHDB_HOST},{$COUCHDB_PORT},{$COUCHDB_USER},{$COUCHDB_PASSWORD},{$COUCHDB_PROTO}]</key> <delay>30s</delay> <history>90d</history> <trends>0</trends> <status>0</status> <value_type>4</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>CouchDB3</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <master_item/> </item> </items> <discovery_rules/> <httptests/> <macros> <macro> <macro>{$COUCHDB_HOST}</macro> <value>localhost</value> </macro> <macro> <macro>{$COUCHDB_PASSWORD}</macro> <value/> </macro> <macro> <macro>{$COUCHDB_PORT}</macro> <value>5984</value> </macro> <macro> <macro>{$COUCHDB_PROTO}</macro> <value>http</value> </macro> <macro> <macro>{$COUCHDB_USER}</macro> <value>admin</value> </macro> </macros> <templates/> <screens/> </template> </templates> </zabbix_export> """ def _get_current_date(): date = datetime.datetime.utcnow().isoformat() date = "%sZ" % date.split(".")[0] return date def generate_zabbix4_template(stats): date = _get_current_date() tpl = _TPL_HEAD % date for key, value, desc in stats: value_type = _VALUE_TYPES[type(value)] tpl += _TPL_ITEM % (key, key, value_type, desc) tpl += _TPL_TAIL return tpl
zabbix-agent-extension-couchdb3
/zabbix-agent-extension-couchdb3-1.0.1.tar.gz/zabbix-agent-extension-couchdb3-1.0.1/zabbix_agent_extension_couchdb3/template.py
template.py
from zabbix_api_client.client import Client SCHEMA = { 'type': 'object', 'propertes': { 'maintenanceid': { 'type': 'string' }, 'name': { 'type': 'string' }, 'active_since': { 'type': 'string' }, 'active_till': { 'type': 'string' }, 'description': { 'type': 'string' }, 'maintenance_type': { 'type': 'string' }, 'groupids': { 'type': 'array', 'items': { 'type': 'integer' } }, 'hostids': { 'type': 'array', 'items': { 'type': 'integer' } }, 'timeperiods': { 'type': 'array', 'items': { 'type': 'integer' } } }, } class Maintenance(Client): """Zabbix Maintenance API""" def __init__(self, **kwargs): super(Maintenance, self).__init__(**kwargs) def create(self, params={}): return self.request('maintenance.create', params) def delete(self, params={}): return self.request('maintenance.delete', params) def exists(self, params={}): return self.request('maintenance.exists', params) def get(self, params={}): self.validate(params, SCHEMA) params.update({ 'output': 'extend', 'selectHosts': 'extend', 'selectGroups': 'extend', 'selectTimeperiods': 'extend' }) return self.request('maintenance.get', params) def update(self, params={}): update_schema = { 'required': [ 'name', 'maintenanceid', 'active_since', 'active_till' ] } update_schema.update(SCHEMA) self.validate(params, update_schema) params['active_since'] = self.unixtime(params['active_since']) params['active_till'] = self.unixtime(params['active_till']) get_res = self.get({ 'maintenanceids': [params['maintenanceid']] })[0] for key in ('timeperiods', 'hosts', 'groups'): if key in get_res: params[key] = get_res[key] params['timeperiods'] = get_res['timeperiods'] if 'hosts' in get_res and len(get_res['hosts']) > 0: params['hostids'] = [get_res['hosts'][0]['hostid']] if 'groups' in get_res and len(get_res['groups']) > 0: params['groupids'] = [get_res['groups'][0]['groupid']] return self.request('maintenance.update', params)
zabbix-api-client
/zabbix-api-client-0.0.1.tar.gz/zabbix-api-client-0.0.1/zabbix_api_client/maintenance.py
maintenance.py
import requests import json import logging import jsonschema import dateutil.parser class Borg(object): _shared_state = {} def __init__(self): self.__dict__ = self._shared_state class Client(Borg): """Zabbix API""" def __init__(self, **kwargs): """ Client instance Constructor :param host: zabbix host name :param user: access user :param password: access user's password :param log_level: log level """ Borg.__init__(self) if not hasattr(self, 'logger') or not self.logger: self.logger = logging.getLogger(__name__) if 'log_level' not in kwargs: log_level = 'WARNING' else: log_level = kwargs['log_level'].upper() loglevel_obj = getattr(logging, log_level) self.logger.setLevel(loglevel_obj) ch = logging.StreamHandler() ch.setLevel(logging.INFO) self.logger.addHandler(ch) if not hasattr(self, 'logger') or not self.logger: self.logger = logging.getLogger(__name__) self.logger.info('Start initializing') if not hasattr(self, 'host') or not self.host: self.host = kwargs['host'] + '/zabbix/api_jsonrpc.php' self.request_id = 1 if not hasattr(self, 'auth') or not self.auth: self.auth = self.request('user.login', { 'user': kwargs['user'], 'password': kwargs['password'] }) def request(self, method, params): self.request_id += 1 headers = {"Content-Type": "application/json-rpc"} data = json.dumps({ 'jsonrpc': '2.0', 'method': method, 'params': params, 'auth': (self.auth if hasattr(self, 'auth') else None), 'id': self.request_id }) self.logger.info('URL:%s\tMETHOD:%s\tPARAM:%s', self.host, method, str(params)) r = requests.post(self.host, data=data, headers=headers) if 'error' in r.json(): error = r.json()['error'] self.logger.error('MESSAGE:%s', error) raise Exception(error) self.logger.info('STATUS_CODE:%s', r.status_code) return r.json()['result'] def validate(self, params, schema): jsonschema.validate(params, schema) def unixtime(self, datetime): return int(dateutil.parser.parse(datetime).timestamp())
zabbix-api-client
/zabbix-api-client-0.0.1.tar.gz/zabbix-api-client-0.0.1/zabbix_api_client/client.py
client.py
from logging import getLogger, DEBUG, INFO, WARNING, ERROR from collections import deque from datetime import datetime from hashlib import md5 from base64 import b64encode from time import time import re import ssl try: # noinspection PyPackageRequirements import simplejson as json except ImportError: import json try: import urllib2 except ImportError: # noinspection PyUnresolvedReferences,PyPep8Naming import urllib.request as urllib2 # python3 __all__ = ('ZabbixAPI', 'ZabbixAPIException', 'ZabbixAPIError') __version__ = '1.2.4' PARENT_LOGGER = __name__ DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S' TRIGGER_SEVERITY = ( 'not_classified', 'information', 'warning', 'average', 'high', 'disaster', ) RE_HIDE_AUTH = ( (re.compile(r'("auth": )".*?"'), r'\1"***"'), (re.compile(r'("password": )".*?"'), r'\1"***"'), ) def hide_auth(msg): """Remove sensitive information from msg.""" for pattern, repl in RE_HIDE_AUTH: msg = pattern.sub(repl, msg) return msg class ZabbixAPIException(Exception): """ Generic zabbix API exception. Used for HTTP connection/transport errors. """ def __init__(self, msg): super(ZabbixAPIException, self).__init__(hide_auth(msg)) # Remove sensitive information class ZabbixAPIError(ZabbixAPIException): """ Structured zabbix API error. Used for Zabbix API errors. The error attribute is always a dict with "code", "message" and "data" keys. Code list: -32602 - Invalid params (eg already exists) -32500 - no permissions """ _error_template = {'code': -1, 'message': '', 'data': None} def __init__(self, **error_kwargs): self.error = dict(self._error_template, **error_kwargs) msg = '%(message)s %(data)s [%(code)s]' % self.error super(ZabbixAPIError, self).__init__(msg) class ZabbixAPI(object): """ Login and access any Zabbix API method. """ __username = None __password = None __auth = None _http_handler = None _http_headers = None _api_url = None id = 0 last_login = None QUERY_EXTEND = 'extend' QUERY_COUNT = 'count' SORT_ASC = 'ASC' SORT_DESC = 'DESC' LOGIN_ERRORS = ( 'Not authorized', 'Session terminated', 're-login, please', ) def __init__(self, server='http://localhost/zabbix', user=None, passwd=None, log_level=WARNING, timeout=10, relogin_interval=30, r_query_len=10, ssl_verify=True): """ Create an API object. We're going to use proto://server/path to find the JSON-RPC api. :param str server: Server URL to connect to :param str user: Optional HTTP auth username :param str passwd: Optional HTTP auth password :param int log_level: Logging level :param int timeout: Timeout for HTTP requests to api (in seconds) :param int r_query_len: Max length of query history :param bool ssl_verify: Whether to perform HTTPS certificate verification (only for python >= 2.7.9) :param int relogin_interval: Minimum time (in seconds) after which an automatic re-login is performed; \ Can be set to None to disable automatic re-logins """ self.logger = getLogger(PARENT_LOGGER) self.set_log_level(log_level) self.server = server self.httpuser = user self.httppasswd = passwd self.timeout = timeout self.relogin_interval = relogin_interval self.r_query = deque(maxlen=r_query_len) self.ssl_verify = ssl_verify self.init() def __repr__(self): return '%s(%s)' % (self.__class__.__name__, self.server) def __getattr__(self, name): """Access any API method via dot notation [DEPRECATED -> use call()]""" if name.startswith('_'): raise AttributeError("%r object has no attribute %r" % (self.__class__, name)) api_method = ZabbixAPISubClass(self, name) setattr(self, name, api_method) return api_method def init(self): """Prepare the HTTP handler, URL, and HTTP headers for all subsequent requests""" self.debug('Initializing %r', self) proto = self.server.split('://')[0] if proto == 'https': if hasattr(ssl, 'create_default_context'): context = ssl.create_default_context() if self.ssl_verify: context.check_hostname = True context.verify_mode = ssl.CERT_REQUIRED else: context.check_hostname = False context.verify_mode = ssl.CERT_NONE self._http_handler = urllib2.HTTPSHandler(debuglevel=0, context=context) else: self._http_handler = urllib2.HTTPSHandler(debuglevel=0) elif proto == 'http': self._http_handler = urllib2.HTTPHandler(debuglevel=0) else: raise ValueError('Invalid protocol %s' % proto) self._api_url = self.server + '/api_jsonrpc.php' self._http_headers = { 'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api', } if self.httpuser: self.debug('HTTP authentication enabled') auth = self.httpuser + ':' + self.httppasswd self._http_headers['Authorization'] = 'Basic ' + b64encode(auth.encode('utf-8')).decode('ascii') @staticmethod def get_severity(prio): """Return severity string from severity id""" try: return TRIGGER_SEVERITY[int(prio)] except IndexError: return 'unknown' @classmethod def get_datetime(cls, timestamp): """Return python datetime object from unix timestamp""" return datetime.fromtimestamp(int(timestamp)) @staticmethod def convert_datetime(dt, dt_format=DATETIME_FORMAT): """Convert python datetime to human readable date and time string""" return dt.strftime(dt_format) @classmethod def timestamp_to_datetime(cls, dt, dt_format=DATETIME_FORMAT): """Convert unix timestamp to human readable date/time string""" return cls.convert_datetime(cls.get_datetime(dt), dt_format=dt_format) @staticmethod def get_age(dt): """Calculate delta between current time and datetime and return a human readable form of the delta object""" delta = datetime.now() - dt days = delta.days hours, rem = divmod(delta.seconds, 3600) minutes, seconds = divmod(rem, 60) if days: return '%dd %dh %dm' % (days, hours, minutes) else: return '%dh %dm %ds' % (hours, minutes, seconds) def recent_query(self): """Return recent API query object""" return list(self.r_query) def set_log_level(self, level): self.debug('Set logging level to %d', level) self.logger.setLevel(level) def log(self, level, msg, *args): return self.logger.log(level, msg, *args) def debug(self, msg, *args): return self.log(DEBUG, msg, *args) def json_obj(self, method, params=None, auth=True): """Return JSON object expected by the Zabbix API""" if params is None: params = {} obj = { 'jsonrpc': '2.0', 'method': method, 'params': params, 'auth': self.__auth if auth else None, 'id': self.id, } return json.dumps(obj) def do_request(self, json_obj): """Perform one HTTP request to Zabbix API""" self.debug('Request: url="%s" headers=%s', self._api_url, self._http_headers) self.debug('Request: body=%s', json_obj) self.r_query.append(json_obj) request = urllib2.Request(url=self._api_url, data=json_obj.encode('utf-8'), headers=self._http_headers) opener = urllib2.build_opener(self._http_handler) urllib2.install_opener(opener) try: response = opener.open(request, timeout=self.timeout) except Exception as e: raise ZabbixAPIException('HTTP connection problem: %s' % e) self.debug('Response: code=%s', response.code) # NOTE: Getting a 412 response code means the headers are not in the list of allowed headers. if response.code != 200: raise ZabbixAPIException('HTTP error %s: %s' % (response.status, response.reason)) reads = response.read() if len(reads) == 0: raise ZabbixAPIException('Received zero answer') try: jobj = json.loads(reads.decode('utf-8')) except ValueError as e: self.log(ERROR, 'Unable to decode. returned string: %s', reads) raise ZabbixAPIException('Unable to decode response: %s' % e) self.debug('Response: body=%s', jobj) self.id += 1 if 'error' in jobj: # zabbix API error error = jobj['error'] if isinstance(error, dict): raise ZabbixAPIError(**error) try: return jobj['result'] except KeyError: raise ZabbixAPIException('Missing result in API response') def login(self, user=None, password=None, save=True): """Perform a user.login API request""" if user and password: if save: self.__username = user self.__password = password elif self.__username and self.__password: user = self.__username password = self.__password else: raise ZabbixAPIException('No authentication information available.') self.last_login = time() # Don't print the raw password hashed_pw_string = 'md5(%s)' % md5(password.encode('utf-8')).hexdigest() self.debug('Trying to login with %r:%r', user, hashed_pw_string) obj = self.json_obj('user.login', params={'user': user, 'password': password}, auth=False) self.__auth = self.do_request(obj) def relogin(self): """Perform a re-login""" try: self.__auth = None # reset auth before relogin self.login() except ZabbixAPIException as e: self.log(ERROR, 'Zabbix API relogin error (%s)', e) self.__auth = None # logged_in() will always return False raise # Re-raise the exception @property def logged_in(self): return bool(self.__auth) def check_auth(self): """Perform a re-login if not signed in or raise an exception""" if not self.logged_in: if self.relogin_interval and self.last_login and (time() - self.last_login) > self.relogin_interval: self.log(WARNING, 'Zabbix API not logged in. Performing Zabbix API relogin after %d seconds', self.relogin_interval) self.relogin() # Will raise exception in case of login error else: raise ZabbixAPIException('Not logged in.') def api_version(self): """Call apiinfo.version API method""" return self.do_request(self.json_obj('apiinfo.version', auth=False)) def call(self, method, params=None): """Check authentication and perform actual API request and relogin if needed""" start_time = time() self.check_auth() self.log(INFO, '[%s-%05d] Calling Zabbix API method "%s"', start_time, self.id, method) self.log(DEBUG, '\twith parameters: %s', params) try: return self.do_request(self.json_obj(method, params=params)) except ZabbixAPIError as ex: if self.relogin_interval and any(i in ex.error['data'] for i in self.LOGIN_ERRORS): self.log(WARNING, 'Zabbix API not logged in (%s). Performing Zabbix API relogin', ex) self.relogin() # Will raise exception in case of login error return self.do_request(self.json_obj(method, params=params)) raise # Re-raise the exception finally: self.log(INFO, '[%s-%05d] Zabbix API method "%s" finished in %g seconds', start_time, self.id, method, (time() - start_time)) class ZabbixAPISubClass(object): """ Wrapper class to ensure all calls go through the parent object. """ def __init__(self, parent, prefix): self.prefix = prefix self.parent = parent self.parent.debug('Creating %r', self) def __repr__(self): return '%s(%s)' % (self.__class__.__name__, self.prefix) def __getattr__(self, name): if name.startswith('_'): raise AttributeError("%r object has no attribute %r" % (self.__class__, name)) if self.prefix == 'configuration' and name == 'import_': # workaround for "import" method name = 'import' def method(params=None): return self.parent.call('%s.%s' % (self.prefix, name), params=params) return method
zabbix-api-erigones
/zabbix-api-erigones-1.2.4.tar.gz/zabbix-api-erigones-1.2.4/zabbix_api.py
zabbix_api.py
zabbix-api-erigones ################### `Zabbix API <https://www.zabbix.com/documentation/2.4/manual/api>`_ Python Library. Used by the `Ludolph Monitoring Jabber Bot <https://github.com/erigones/Ludolph>`_. * Supported Python versions: >= 2.6 and >= 3.2 * Supported Zabbix versions: 1.8, 2.0, 2.2, 2.4, 3.0 .. image:: https://badge.fury.io/py/zabbix-api-erigones.png :target: http://badge.fury.io/py/zabbix-api-erigones Installation ------------ .. code:: bash pip install zabbix-api-erigones Usage ----- .. code:: python from zabbix_api import ZabbixAPI zx = ZabbixAPI(server='http://127.0.0.1') zx.login('username', 'password') # Example: list zabbix users zx.call('user.get', {'output': zx.QUERY_EXTEND}) # Or use the old dot notation method zx.user.get({'output': zx.QUERY_EXTEND}) Links ----- - Bug Tracker: https://github.com/erigones/zabbix-api/issues - Twitter: https://twitter.com/erigones
zabbix-api-erigones
/zabbix-api-erigones-1.2.4.tar.gz/zabbix-api-erigones-1.2.4/README.rst
README.rst
# NOTES: # The API requires zabbix 1.8 or later. # Currently, not all of the API is implemented, and some functionality is # broken. This is a work in progress. import base64 import hashlib import logging import string import sys import ssl import socket try: import urllib2 except ImportError: import urllib.request as urllib2 # python3 import re from collections import deque try: from ssl import _create_unverified_context HAS_SSLCONTEXT = True except ImportError: HAS_SSLCONTEXT = False default_log_handler = logging.StreamHandler(sys.stdout) __logger = logging.getLogger("zabbix_api") __logger.addHandler(default_log_handler) __logger.log(10, "Starting logging") try: # Separate module or Python <2.6 import simplejson as json __logger.log(15, "Using simplejson library") except ImportError: # Python >=2.6 import json __logger.log(15, "Using native json library") def checkauth(fn): """ Decorator to check authentication of the decorated method """ def ret(self, *args): self.__checkauth__() return fn(self, args) return ret def dojson(fn): def wrapper(self, method, opts): self.logger.log(logging.DEBUG, "Going to do_request for %s with opts %s" % (repr(fn), repr(opts))) return self.do_request(self.json_obj(method, opts))['result'] return wrapper def version_compare(v1, v2): """ The result is 0 if v1 == v2, -1 if v1 < v2, and +1 if v1 > v2 """ for v1_part, v2_part in zip(v1.split("."), v2.split(".")): if v1_part.isdecimal() and v2_part.isdecimal(): if int(v1_part) > int(v2_part): return 1 elif int(v1_part) < int(v2_part): return -1 else: if v1 > v2: return 1 elif v1 < v2: return -1 return 0 class ZabbixAPIException(Exception): """ generic zabbix api exception code list: -32602 - Invalid params (eg already exists) -32500 - no permissions """ pass class Already_Exists(ZabbixAPIException): pass class InvalidProtoError(ZabbixAPIException): """ Recived an invalid proto """ pass class APITimeout(ZabbixAPIException): pass class ZabbixAPI(object): __username__ = '' __password__ = '' __tokenauth__ = False auth = '' url = '/api_jsonrpc.php' params = None method = None # HTTP or HTTPS proto = 'http' # HTTP authentication httpuser = None httppasswd = None timeout = 10 validate_certs = None # sub-class instances. # Constructor Params: # server: Server to connect to # path: Path leading to the zabbix install # proto: Protocol to use. http or https # We're going to use proto://server/path to find the JSON-RPC api. # # user: HTTP auth username # passwd: HTTP auth password # log_level: logging level # r_query_len: max len query history # **kwargs: Data to pass to each api module def __init__(self, server='http://localhost/zabbix', user=httpuser, passwd=httppasswd, log_level=logging.WARNING, timeout=10, r_query_len=10, validate_certs=True, **kwargs): """ Create an API object. """ self._setuplogging() self.set_log_level(log_level) self.server = server self.url = server + '/api_jsonrpc.php' self.proto = self.server.split("://")[0] # self.proto=proto self.httpuser = user self.httppasswd = passwd self.timeout = timeout self.kwargs = kwargs self.id = 0 self.r_query = deque([], maxlen=r_query_len) self.validate_certs = validate_certs self.debug(logging.INFO, "url: " + self.url) def _setuplogging(self): self.logger = logging.getLogger("zabbix_api.%s" % self.__class__.__name__) def set_log_level(self, level): self.debug(logging.INFO, "Set logging level to %d" % level) self.logger.setLevel(level) def recent_query(self): """ return recent query """ return list(self.r_query) def debug(self, level, var="", msg=None): strval = str(level) + ": " if msg: strval = strval + str(msg) if var != "": strval = strval + str(var) self.logger.log(level, strval) def json_obj(self, method, params={}, auth=True): obj = {'jsonrpc': '2.0', 'method': method, 'params': params, 'auth': self.auth, 'id': self.id} if not auth: del obj['auth'] self.debug(logging.DEBUG, "json_obj: " + str(obj)) return json.dumps(obj) def login(self, user='', password='', save=True, api_token=None): if api_token is not None: # due to ZBX-21688 we are unable to check if the token is valid # obj = self.json_obj('user.checkAuthentication', {'sessionid': api_token}, auth=False) # result = self.do_request(obj) self.debug(logging.DEBUG, "Using API Token for auth") self.auth=api_token self.__tokenauth__ = True return if user != '': l_user = user l_password = password if save: self.__username__ = user self.__password__ = password elif self.__username__ != '': l_user = self.__username__ l_password = self.__password__ else: raise ZabbixAPIException("No authentication information available.") # don't print the raw password. hashed_pw_string = "md5(" + hashlib.md5(l_password.encode('utf-8')).hexdigest() + ")" self.debug(logging.DEBUG, "Trying to login with %s:%s" % (repr(l_user), repr(hashed_pw_string))) if version_compare(self.api_version(), '5.4') >= 0: login_arg = {'username': l_user, 'password': l_password} else: login_arg = {'user': l_user, 'password': l_password} obj = self.json_obj('user.login', login_arg, auth=False) result = self.do_request(obj) self.auth = result['result'] def logout(self): if self.__tokenauth__: # Do nothing for logout for API tokens. self.debug(logging.DEBUG, "Clearing auth information due to use of API Token") self.auth = '' self.__username__ = '' self.__password__ = '' self.__tokenauth__ = False return if self.auth == '': raise ZabbixAPIException("No authentication information available.") self.debug(logging.DEBUG, "Trying to logout user: %s." % self.__username__) obj = self.json_obj('user.logout', auth=True) result = self.do_request(obj) if result['result']: self.auth = '' self.__username__ = '' self.__password__ = '' def test_login(self): if self.auth != '': obj = self.json_obj('user.checkAuthentication', {'sessionid': self.auth}) result = self.do_request(obj) if not result['result']: self.auth = '' return False # auth hash bad return True # auth hash good else: return False def do_request(self, json_obj): headers = {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'} if self.httpuser: self.debug(logging.INFO, "HTTP Auth enabled") credentials = (self.httpuser + ':' + self.httppasswd).encode('ascii') auth = 'Basic ' + base64.b64encode(credentials).decode("ascii") headers['Authorization'] = auth self.r_query.append(str(json_obj)) self.debug(logging.INFO, "Sending: " + str(json_obj)) self.debug(logging.DEBUG, "Sending headers: " + str(headers)) request = urllib2.Request(url=self.url, data=json_obj.encode('utf-8'), headers=headers) if self.proto == "https": if HAS_SSLCONTEXT and not self.validate_certs: https_handler = urllib2.HTTPSHandler(debuglevel=0, context=_create_unverified_context()) else: https_handler = urllib2.HTTPSHandler(debuglevel=0) opener = urllib2.build_opener(https_handler) elif self.proto == "http": http_handler = urllib2.HTTPHandler(debuglevel=0) opener = urllib2.build_opener(http_handler) else: raise ZabbixAPIException("Unknow protocol %s" % self.proto) urllib2.install_opener(opener) try: response = opener.open(request, timeout=self.timeout) except ssl.SSLError as e: if hasattr(e, 'message'): e = e.message raise ZabbixAPIException("ssl.SSLError - %s" % e) except socket.timeout as e: raise APITimeout("HTTP read timeout",) except urllib2.URLError as e: if hasattr(e, 'message') and e.message: e = e.message elif hasattr(e, 'reason'): e = e.reason raise ZabbixAPIException("urllib2.URLError - %s" % e) self.debug(logging.INFO, "Response Code: " + str(response.code)) # NOTE: Getting a 412 response code means the headers are not in the # list of allowed headers. if response.code != 200: raise ZabbixAPIException("HTTP ERROR %s: %s" % (response.status, response.reason)) reads = response.read() if len(reads) == 0: raise ZabbixAPIException("Received zero answer") try: jobj = json.loads(reads.decode('utf-8')) except ValueError as msg: print ("unable to decode. returned string: %s" % reads) sys.exit(-1) self.debug(logging.DEBUG, "Response Body: " + str(jobj)) self.id += 1 if 'error' in jobj: # some exception msg = "Error %s: %s, %s while sending %s" % (jobj['error']['code'], jobj['error']['message'], jobj['error']['data'], str(json_obj)) if re.search(".*already\sexists.*", jobj["error"]["data"], re.I): # already exists raise Already_Exists(msg, jobj['error']['code']) else: raise ZabbixAPIException(msg, jobj['error']['code']) return jobj def logged_in(self): if self.auth != '': return True return False def api_version(self, **options): obj = self.do_request(self.json_obj('apiinfo.version', options, auth=False)) return obj['result'] def __checkauth__(self): if not self.logged_in(): raise ZabbixAPIException("Not logged in.") def __getattr__(self, name): return ZabbixAPISubClass(self, dict({"prefix": name}, **self.kwargs)) class ZabbixAPISubClass(ZabbixAPI): """ wrapper class to ensure all calls go through the parent object """ parent = None data = None def __init__(self, parent, data, **kwargs): self._setuplogging() self.debug(logging.INFO, "Creating %s" % self.__class__.__name__) self.data = data self.parent = parent # Save any extra info passed in for key, val in kwargs.items(): setattr(self, key, val) self.debug(logging.WARNING, "Set %s:%s" % (repr(key), repr(val))) def __getattr__(self, name): if self.data["prefix"] == "configuration" and name == "import_": # workaround for "import" method name = "import" def method(*opts): return self.universal("%s.%s" % (self.data["prefix"], name), opts[0]) return method def __checkauth__(self): self.parent.__checkauth__() def do_request(self, req): return self.parent.do_request(req) def json_obj(self, method, param): return self.parent.json_obj(method, param) @dojson @checkauth def universal(self, **opts): return opts
zabbix-api
/zabbix-api-0.5.6.tar.gz/zabbix-api-0.5.6/zabbix_api.py
zabbix_api.py
This is an implementation of the Zabbix API in Python. Please note that the Zabbix API is still in a draft state, and subject to change. Implementations of the Zabbix API in other languages may be found on the wiki. Zabbix 1.8, 2.0, 2.2, 2.4, 3.0 and 3.2 are supported. Python 2 and 3 are supported. Future versions must be supported too, if there is no deep changes. Installation: ```sh # pip install zabbix-api ``` Short example: ```python >>> from zabbix_api import ZabbixAPI >>> zapi = ZabbixAPI(server="https://server/") >>> zapi.login("login", "password") >>> zapi.trigger.get({"expandExpression": "extend", "triggerids": range(0, 100)}) ``` See also: * http://www.zabbix.com/wiki/doc/api * https://www.zabbix.com/documentation/2.4/manual/api * http://www.zabbix.com/forum/showthread.php?t=15218
zabbix-api
/zabbix-api-0.5.6.tar.gz/zabbix-api-0.5.6/README.md
README.md
import psutil import json import socket import sys name = "app listen ports" class GetListenPorts(object): """ """ def __init__(self, exe=True, cmdline=False): """ Do you want add exe and the first cmdline item in APPNAME? :param exe: exe :param cmdline: cmdline """ self.exe = exe self.cmdline = cmdline def process(self): data = {} all_listen_app = [] for proc in psutil.process_iter(): for pcon in proc.connections(): if pcon.status == psutil.CONN_LISTEN and pcon.family == socket.AF_INET: macros_key_pairs = {} # add exe or cmdline or both in macros {#APPNAME}, default only add exe. app_name_list = [proc.name()] if self.exe: app_name_list.append(proc.exe()) if self.cmdline: app_name_list.append(proc.cmdline()) app_name = "__".join(app_name_list) macros_key_pairs["{#APPNAME}"] = app_name # python2.x if sys.version_info.major < 3: try: listen_port = pcon.laddr.port except AttributeError: listen_port = pcon.laddr[1] # python3.x else: try: listen_port = pcon.laddr.port except AttributeError: listen_port = pcon.laddr[1] macros_key_pairs["{#APPPORT}"] = str(listen_port) if macros_key_pairs not in all_listen_app: all_listen_app.append(macros_key_pairs) data["data"] = all_listen_app jsonData = json.dumps(data, sort_keys=True, indent=4) return jsonData if __name__ == "__main__": getlistport = GetListenPorts() items = getlistport.process() print(items)
zabbix-app-ports-discovery
/zabbix_app_ports_discovery-2019.2.22.2-py3-none-any.whl/applistenports/__init__.py
__init__.py
============= zabbix-client ============= **zabbix-client** is a Zabbix API wrapper written in Python. It works on Python 2.6+ and 3.2+. Zabbix API ---------- Zabbix API was introduced in Zabbix 1.8 and allows you to create, update and fetch Zabbix objects (like hosts, items, graphs and others) through the JSON-RPC 2.0 protocol. Zabbix API documentation: * `Getting started with Zabbix API`_ * `Zabbix API description`_ * `Zabbix API method reference`_ JSON-RPC documentation: * `JSON-RPC 2.0 specification`_ **zabbix-client** supports all Zabbix versions including the JSON-RPC API, starting with Zabbix 1.8. Usage ----- Calling a method that does not require authentication:: >>> from zabbix_client import ZabbixServerProxy >>> s = ZabbixServerProxy('http://localhost/zabbix') >>> s.apiinfo.version() '2.0.12' Calling a method that requires previous authentication:: >>> from zabbix_client import ZabbixServerProxy >>> s = ZabbixServerProxy('http://localhost/zabbix') >>> s.user.login(user='Admin', password='zabbix') '44cfb35933e3e75ef51988845ab15e8b' >>> s.host.get(output=['hostid', 'host']) [{'host': 'Zabbix server', 'hostid': '10084'}, {'host': 'Test', 'hostid': '10085'}] >>> s.user.logout() True License ------- Licensed under the Apache License. .. _Getting started with Zabbix API: https://www.zabbix.com/documentation/1.8/api/getting_started .. _Zabbix API description: https://www.zabbix.com/documentation/2.2/manual/api .. _Zabbix API method reference: https://www.zabbix.com/documentation/2.2/manual/api/reference .. _JSON-RPC 2.0 specification: http://www.jsonrpc.org/specification
zabbix-client
/zabbix-client-0.1.2.tar.gz/zabbix-client-0.1.2/README.rst
README.rst
import logging import json import string import socket try: from urllib.request import Request, build_opener except ImportError: # Python 2 from urllib2 import Request, build_opener try: from urllib.error import URLError, HTTPError as _HTTPError except ImportError: # Python 2 from urllib2 import URLError, HTTPError as _HTTPError try: from io import BytesIO except ImportError: # Python 2 try: # C implementation from cStringIO import StringIO as BytesIO except ImportError: # Python implementation from StringIO import StringIO as BytesIO try: import gzip except ImportError: # Python can be built without zlib/gzip support gzip = None try: import requests except ImportError: requests = None from . import __version__ from .exceptions import ( ZabbixClientError, TransportError, TimeoutError, HTTPError, ResponseError, ContentDecodingError, InvalidJSONError, JSONRPCError ) # Default network timeout (in seconds) DEFAULT_TIMEOUT = 30 logger = logging.getLogger(__name__) def dumps(id_, method, params=None, auth=None): rpc_request = { 'jsonrpc': '2.0', 'id': id_, 'method': method } if params is not None: rpc_request['params'] = params else: # Zabbix 3 and later versions fail if 'params' is omitted rpc_request['params'] = {} if auth is not None: rpc_request['auth'] = auth dump = json.dumps(rpc_request, separators=(',', ':')).encode('utf-8') if logger.isEnabledFor(logging.INFO): json_str = json.dumps(rpc_request, sort_keys=True) logger.info("JSON-RPC request: {0}".format(json_str)) return dump def loads(response): try: rpc_response = json.loads(response.decode('utf-8')) except ValueError as e: raise InvalidJSONError(e) if not isinstance(rpc_response, dict): raise ResponseError('Response is not a dict') if 'jsonrpc' not in rpc_response or rpc_response['jsonrpc'] != '2.0': raise ResponseError('JSON-RPC version not supported') if 'error' in rpc_response: error = rpc_response['error'] if 'code' not in error or 'message' not in error: raise ResponseError('Invalid JSON-RPC error object') code = error['code'] message = error['message'] # 'data' may be omitted data = error.get('data', None) if data is None: exception_message = 'Code: {0}, Message: {1}'.format(code, message) else: exception_message = ('Code: {0}, Message: {1}, ' + 'Data: {2}').format(code, message, data) raise JSONRPCError(exception_message, code=code, message=message, data=data) if 'result' not in rpc_response: raise ResponseError('Response does not contain a result object') if logger.isEnabledFor(logging.INFO): json_str = json.dumps(rpc_response, sort_keys=True) logger.info("JSON-RPC response: {0}".format(json_str)) return rpc_response class ZabbixServerProxy(object): def __init__(self, url, transport=None): self.url = url if not url.endswith('/') else url[:-1] self.url += '/api_jsonrpc.php' logger.debug("Zabbix server URL: {0}".format(self.url)) if transport is not None: self.transport = transport else: if requests: logger.debug("Using requests as transport layer") self.transport = RequestsTransport() else: logger.debug("Using urllib libraries as transport layer") self.transport = UrllibTransport() self._request_id = 0 self._auth_token = None self._method_hooks = { 'apiinfo.version': self._no_auth_method, 'user.login': self._login, 'user.authenticate': self._login, # deprecated alias of user.login 'user.logout': self._logout } def __getattr__(self, name): return ZabbixObject(name, self) def call(self, method, params=None): method_lower = method.lower() if method_lower in self._method_hooks: return self._method_hooks[method_lower](method, params=params) return self._call(method, params=params, auth=self._auth_token) def _call(self, method, params=None, auth=None): self._request_id += 1 rpc_request = dumps(self._request_id, method, params=params, auth=auth) content = self.transport.request(self.url, rpc_request) rpc_response = loads(content) return rpc_response['result'] def _no_auth_method(self, method, params=None): return self._call(method, params=params) def _login(self, method, params=None): self._auth_token = None # Save the new token if the request is successful self._auth_token = self._call(method, params=params) return self._auth_token def _logout(self, method, params=None): try: result = self._call(method, params=params, auth=self._auth_token) except ZabbixClientError: raise finally: self._auth_token = None return result class ZabbixObject(object): def __init__(self, name, server_proxy): self.name = name self.server_proxy = server_proxy def __getattr__(self, name): def call_wrapper(*args, **kwargs): if args and kwargs: raise ValueError('JSON-RPC 2.0 does not allow both ' + 'positional and keyword arguments') method = '{0}.{1}'.format(self.name, name) params = args or kwargs or None return self.server_proxy.call(method, params=params) # Little hack to avoid clashes with reserved keywords. # Example: use configuration.import_() to call configuration.import() if name.endswith('_'): name = name[:-1] return call_wrapper class Transport(object): def __init__(self, timeout=DEFAULT_TIMEOUT): self.timeout = timeout def request(self, url, rpc_request): raise NotImplementedError @staticmethod def _add_headers(headers): # Set the JSON-RPC headers json_rpc_headers = { 'Content-Type': 'application/json', 'Accept': 'application/json' } headers.update(json_rpc_headers) # If no custom header exists, set the default user-agent if 'User-Agent' not in headers: headers['User-Agent'] = 'zabbix-client/{0}'.format(__version__) class RequestsTransport(Transport): def __init__(self, *args, **kwargs): if not requests: raise ValueError('requests is not available') self.session = kwargs.pop('session', None) super(RequestsTransport, self).__init__(*args, **kwargs) if self.session is None: self.session = requests.Session() # Delete default requests' user-agent self.session.headers.pop('User-Agent', None) self._add_headers(self.session.headers) def request(self, url, rpc_request): try: response = self.session.post(url, data=rpc_request, timeout=self.timeout) response.raise_for_status() content = response.content except requests.Timeout as e: raise TimeoutError(e) except requests.exceptions.ContentDecodingError as e: raise ContentDecodingError(e) except requests.HTTPError as e: raise HTTPError(e) except requests.RequestException as e: raise TransportError(e) return content class UrllibTransport(Transport): def __init__(self, *args, **kwargs): self.accept_gzip_encoding = kwargs.pop('accept_gzip_encoding', True) headers = kwargs.pop('headers', None) super(UrllibTransport, self).__init__(*args, **kwargs) self.headers = {} if headers: for key, value in headers.items(): self.headers[string.capwords(key, '-')] = value self._add_headers(self.headers) if self.accept_gzip_encoding and gzip: self.headers['Accept-Encoding'] = 'gzip' self._opener = build_opener() def request(self, url, rpc_request): request = Request(url, data=rpc_request, headers=self.headers) try: response = self._opener.open(request, timeout=self.timeout) content = response.read() except _HTTPError as e: raise HTTPError(e) except URLError as e: if isinstance(e.reason, socket.timeout): raise TimeoutError(e) else: raise TransportError(e) except socket.timeout as e: raise TimeoutError(e) encoding = response.info().get('Content-Encoding', '').lower() if encoding in ('gzip', 'x-gzip'): if not gzip: raise ValueError('gzip is not available') b = BytesIO(content) try: content = gzip.GzipFile(mode='rb', fileobj=b).read() except IOError as e: raise ContentDecodingError(e) return content
zabbix-client
/zabbix-client-0.1.2.tar.gz/zabbix-client-0.1.2/zabbix_client/api_wrapper.py
api_wrapper.py
# 1. Zabbix CLI ## 1.1 Example ### 1.1.1 Valid Command ```bash zabbix_controller -u username -p password hosts list zabbix_controller -u username -p password hosts -m name:^server$ list ``` ### 1.1.2 Invalid Command ```bash zabbix_controller hosts -u username -p password list zabbix_controller -u username -p password hosts list -m name:^server$ ``` ## 1.2 zabbixctl [options] command ... ### 1.2.1 Options These options are only set at `zabbixctl [options] command ...`. `zabbixctl command [options] ...` is not accepted. #### 1.2.1.1 --help ```bash zabbixctl --help ``` #### 1.2.1.2 --apiserver-address, -aa ```bash zabbixctl -aa http://localhost:8081 ``` #### 1.2.1.3 --username, -u, --password, -p Used for zabbix login ```bash zabbixctl --username Admin --password zabbix_password ``` #### 1.2.1.4 --basicauth_username, -bu, --basicauth_password, -bp Used for basic authentication ```bash zabbixctl -bu alis -bp alis_password ``` #### 1.2.1.5 --dry-run If you set `--dry-run`, only get API is executed, then ZabbixCTL state is printed. Create, update, delete like API is not executed. ```bash zabbixctl --dry-run ``` ## 1.3 zabbixctl host `Options` `Command` ... ### 1.3.1 Options #### 1.3.1.1 `-m, --match` Search host using json like object. Search key, then apply value. In the example below, hosts which name key is including `some_name` are listed. ```bash zabbixctl hosts -m '{"name": "some_name"}' list zabbixctl hosts -m '[{"name": "some_name"}]' list ``` Each key, value pairs are chained by `and operator`. Each dicts are chained by `or operator`. This command mean `("name": "some_name" and "hostid": "^1") or "name": "other_name"`. ```bash zabbixctl hosts -m '[{"name": "some_name", "hostid": "^1"}, {"name": "other_name"}]' list ``` #### 1.3.1.2 `-tr, --time-range` This option is able to specify time range. If you use --match at the same time, used by "and operator". ``` key:[from]-[to] ``` `from` and `to` must be unixtime and can be omitted. These commands are same and print host which disable property is included from 0 to now. ```bash zabbixctl hosts -tr disable:0- list zabbixctl hosts -tr disable:- list ``` This command mean `(("name": "some_name" and "hostid": "^1") or "name": "other_name") and (0 <= disable_until <= now)`. ```bash zabbixctl hosts -m '[{"name": "some_name", "hostid": "^1"}, {"name": "other_name"}]' -tr 'disable_until:-' list ``` ### 1.3.2 Commands #### 1.3.2.1 `list` list up host #### 1.3.2.2 `delete` delete host - options - `-y, --yes` ```bash zabbixctl hosts -m '{"name": "some_name"}' delete -y ``` #### 1.3.2.3 `disable` disable host - options - `-y, --yes` ```bash zabbixctl hosts -m '{"name": "some_name"}' disable -y ``` #### 1.3.2.4 `update` update host - options - `-d, --data` - `-y, --yes` These are same command. ```bash zabbixctl hosts -m '{"name": "some_name"}' update -d '{"state": 1}' -y zabbixctl hosts -m '{"name": "some_name"}' update -d '{"state": "1"}' -y zabbixctl hosts -m '{"name": "some_name"}' disable -y ``` ## 1.4 zabbixctl host graphs `Options` `Command` ### 1.4.1 Command #### 1.4.2 `list` #### 1.4.3 `delete` - options - `-y, --yes` ### 1.4.2 Options #### 1.4.2.1 `-m, --match` This command delete graphs which is in hosts which is matched regex. ```bash zabbixctl hosts -m '{"name": "some_name"}' graphs delete -y ``` ## 1.5 zabbixctl host interfaces `Options` `Command` ### 1.5.1 Command #### 1.5.1.1 `list` #### 1.5.1.2 `usedns` Use dns, not ipaddress - options - `-y, --yes` #### 1.5.1.3 `update` These are same command. - options - `-y, --yes` ```bash zabbixctl hosts interfaces update -d '{"useip": 0}' -y zabbixctl hosts interfaces update -d '{"useip": "0"}' -y zabbixctl hosts interfaces usedns -y ``` # LICENSE
zabbix-controller
/zabbix_controller-0.1.19.tar.gz/zabbix_controller-0.1.19/README.md
README.md
import sys import time import json from functools import wraps from pyzabbix import ZabbixAPI from bullet import Check import click from .zabbix_ctl import ZabbixCTL def zabbix_auth(host, username, password, basicauth_username=None, basicauth_password=None): """ Authentication zabbix. Parameters ---------- host: str api server address username: str login username password: str login password basicauth_username: str basic auth username basicauth_password: str basic auth password Returns ------- ZabbixAPI zabbixAPI object """ zapi = ZabbixAPI(host) if basicauth_username is not None and basicauth_password is not None: # Basic 認証 zapi.session.auth = (basicauth_username, basicauth_password) # SLL/TLSの検証をするかどうかFalseの場合は警告メッセージが出力 zapi.session.verify = False # TODO: Trueにすべきかもしれない zapi.timeout = 5.1 # (秒) zapi.login(username, password) return zapi def validate_match(ctx, param, values): """ Parameters ---------- ctx: click.Context click Context object param: click.param I don't know. Not using. values: str Json string. One dict must be changed [dict]. When filtering, use this, thinking this is list. Returns ------- values: [dict] """ if values is None: return None values = validate_json(ctx, param, values) for k, v in values.items(): if isinstance(v, int): values[k] = str(v) if isinstance(values, dict): values = [values] if not isinstance(values, list): raise TypeError('logic error, must be list or dict') return values def validate_time_range(ctx, param, values): """ key:[unixtime]-[unixtime] errors_from:174134341-1841471834 return {'key': 'errors_from', from: 174134341, to: 1841471834} errors_from:- return {'key': errors_from', from: 0, to: [now unixtime]} """ if values is None: return None if ':' not in values: raise click.BadParameter('Please include ":" in --host-pattern. Run --help') k, v = values.split(':', 1) # ignore second ':' f, t = v.split('-') # -1047 is 0-1047 f = 0 if f == '' else int(f) # 71414 is 71414-[now unixtime] t = int(time.time()) if t == '' else int(t) values = {'key': k, 'from': f, 'to': t} return values def validate_json(ctx, param, values): """ Parameters ---------- ctx: click.Context click Context object param: click.param I don't know. Not using. values: str Json string. Returns ------- values: dict """ if values is None: return None try: values = json.loads(values) except json.JSONDecodeError: raise click.BadParameter(f'You pass {values}. Please pass json format.') return values def ask_hosts(hosts): """ host を選択する return selected_hosts: [dict] """ click.echo('\n') # ターミナルをリフレッシュ select_hostnames_cli = Check( prompt="Choose instance: input <space> to choose, then input <enter> to finish", choices=[host['name'] for host in hosts], align=4, margin=1, ) hostnames = select_hostnames_cli.launch() selected_hosts = list(filter(lambda host: host['name'] in hostnames, hosts)) return selected_hosts def ask_graphs(graphs): """ 1つのホストに対して行う return graphs: [dicts] """ click.echo('\n') # terminal new line choices = ['all'] choices.extend([f'{graph["host"]}: {graph["name"]}' for graph in graphs]) # 入力のバリデーションするのでwhile回す while True: select_graphs_cli = Check( prompt=f"Choose graph: input <space> to choose, then input <enter> to finish", choices=choices, align=4, margin=1, ) selected_graphs = select_graphs_cli.launch() if 'all' in selected_graphs: if len(selected_graphs) != 1: # When select all, be able to select only all. click.echo('Select only all.') continue else: return graphs selected_graphs = list( filter( lambda graph: f'{graph["host"]}: {graph["name"]}' in selected_graphs, graphs, ) ) return selected_graphs def check_dry_run(func): @wraps(func) def wrapped(obj: ZabbixCTL, *args, **kwargs): if obj.main_options['dry_run']: click.echo(f'{obj}') # TODO: 関数のテストの仕方を考えている...zapiが呼ばれた回数をテストすれば良さそう sys.exit(0) result = func(obj, *args, **kwargs) return result return wrapped
zabbix-controller
/zabbix_controller-0.1.19.tar.gz/zabbix_controller-0.1.19/zabbix_controller/utils.py
utils.py
from click import Context from .utils import * @click.group(help=('Entry point.\n' 'Initialize ZabbixAPI.'), invoke_without_command=True, ) @click.option('-aa', '--apiserver-address', default='http://localhost:8081', help=('Zabbix api server address.\n' 'ex) http://localhost:8081') ) @click.option('-u', '--username', default='Admin', help='Zabbix username') @click.option('-p', '--password', default='zabbix', help='Zabbix password') @click.option('-bu', '--basicauth-username', default=None, help='Basic authentication username') @click.option('-bp', '--basicauth-password', default=None, help='Basic authentication password') @click.option('--dry-run', default=False, is_flag=True, help=('Activate debug mode.\n' 'Create, Update, Delete API are not executed.\n' 'Only Get API is executed.')) @click.option('-i', '--interactive', default=False, is_flag=True, help=('Turn on interactive mode.\n' 'Confirmation is still available.')) @click.option('--called', default='cli', help='This option is for flask.') @click.option('-v', '--version', default=False, is_flag=True) @click.pass_context def main( ctx, apiserver_address, username, password, basicauth_username, basicauth_password, dry_run, interactive, called, version, ): """ Initialize ZabbixCTL Parameters ---------- ctx: Context click context apiserver_address: str api server address username: str login username password: str login password basicauth_username: str basic auth username basicauth_password: str basic auth password dry_run: bool dry run option is on or off This is only available in cli. interactive: bool interactive option is on or off. This is only available in cli. called: str cli or http version: bool flag for --version Returns ------- """ if version or ctx.invoked_subcommand is None: from . import VERSION click.echo(f'zabbixctl {VERSION}') sys.exit() else: zapi = zabbix_auth(apiserver_address, username, password, basicauth_username, basicauth_password) ctx.obj = ZabbixCTL(zapi, dry_run=dry_run, interactive=interactive, called=called)
zabbix-controller
/zabbix_controller-0.1.19.tar.gz/zabbix_controller-0.1.19/zabbix_controller/cli.py
cli.py
import re import pprint import json import copy import sys import click from pyzabbix import ZabbixAPI from .command import hosts from ..utils import validate_match, check_dry_run, ask_graphs from . import ZabbixCTL def get_graphs(zapi, _filter=None, match=None): """ Get graphs. Add hostid, host property in graph dict. Parameters ---------- zapi: ZabbixAPI ZabbixAPI object _filter: dict Must include host key that is hostname. {'name': 'some-name'}. Not regex. Used for API requests. match: [dict] Regex. Using re package. These conditions are chained by `and` operator. Not Used for API requests. Used after API requests. All items in the dict are chained "and" operator. All dict are chained "or" operator. (name match some_name and hostid match ^1234) or name match other_name Returns ------- _graphs: [dict] graph objects including host """ if _filter is not None and 'host' not in _filter: raise ValueError('filter must include host key.') _graphs = zapi.graph.get(filter=_filter) if _filter is not None: for g in _graphs: g['host'] = _filter['host'] if match is not None: match_graphs = [] for m in match: graphs_copy = copy.deepcopy(_graphs) for k, v in m.items(): graphs_copy = list( filter( lambda _graph: re.search(v, _graph[k]) is not None, graphs_copy, ) ) match_graphs.extend(graphs_copy) match_graphs = list({v['graphid']: v for v in match_graphs}.values()) # unique else: match_graphs = copy.deepcopy(_graphs) return match_graphs @hosts.group(help='host graph') @click.option('-m', '--match', callback=validate_match, help=('For search host by regex. Using re.search() in python. \n' 'You can use json.\n' 'ex1) \'{"name": "^some$"}\' -> This matches some\n' 'ex2) \'{"graphid": 41}\' -> This matches 4123232, 111141, ...' 'ex3) \'{"name": "^$"}\' -> This matches empty string') ) @click.pass_obj def graphs(obj: ZabbixCTL, match): """ Entry point graphs command. Add graphs to ZabbixCTL. graphs = [{hostname: 'host_name', graphs: [graph]}] """ _graphs = [] for host in obj.hosts: h_graphs = get_graphs(obj.zapi, {'host': host['host']}, match=match) if len(h_graphs) == 0: continue _graphs.extend(h_graphs) obj.graphs = _graphs @graphs.command(name='list', help='list graph') @click.pass_obj def _list(obj): click.echo(f'{json.dumps({"graphs": obj.graphs})}') @graphs.command(help='delete graph') @click.option('-y', '--yes', default=False, is_flag=True, help=('Turn on yes mode.\n' 'No confirmation update or delete.')) @click.pass_obj @check_dry_run def delete(obj, yes): """ Parameters ---------- obj: ZabbixCTL yes: bool If yes is true, no confirmation update or delete. Returns ------- """ if obj.main_options['interactive']: selected_graphs = ask_graphs(obj.graphs) else: selected_graphs = obj.graphs if len(selected_graphs) == 0: click.echo(f'{json.dumps({"message": "There is no graph."})}') sys.exit(0) if yes or click.confirm( f'delete:\n{pprint.pformat([(graph["host"], graph["name"]) for graph in selected_graphs])}', default=False, abort=True, show_default=True): obj.zapi.graph.delete(*[graph['graphid'] for graph in selected_graphs])
zabbix-controller
/zabbix_controller-0.1.19.tar.gz/zabbix_controller-0.1.19/zabbix_controller/hosts/graphs.py
graphs.py
import sys import re import copy import pprint import json import click from pyzabbix import ZabbixAPI from bullet import Check from .command import hosts from ..zabbix_ctl import ZabbixCTL from ..utils import validate_match, validate_json, check_dry_run def get_interfaces(zapi, _filter=None, match=None): """ Parameters ---------- zapi: ZabbixAPI ZabbixAPI object _filter: dict Must include hostid and host key. match: [dict] All items in the dict are chained "and" operator. All dict are chained "or" operator. Returns ------- match_itf """ if _filter is not None and ('hostid' not in _filter or 'host' not in _filter): raise ValueError('filter must include hostid and host key.') _interfaces = zapi.hostinterface.get(filter=_filter) if _filter is not None: for itf in _interfaces: # hostid is already included. No need hostid. itf['host'] = _filter['host'] if match is None: return _interfaces ret = [] for m in match: match_itf = copy.deepcopy(_interfaces) for k, v in m.items(): match_itf = list( filter( lambda _itf: re.search(v, _itf[k]) is not None, match_itf, ) ) ret.extend(match_itf) return ret def update_interfaces(zapi, _interfaces, data): """ Parameters ---------- zapi: ZabbixAPI _interfaces: list data: dict Returns ------- interfaceids: list list of ids """ interfaceids = [] for itf in _interfaces: interfaceid = zapi.hostinterface.update(interfaceid=itf['interfaceid'], **data) interfaceids.append(interfaceid) return interfaceids def ask_interfaces(_interfaces): """ Parameters ---------- _interfaces Returns ------- """ click.echo('\n') # terminal new line choices = [f'dns[{itf["dns"]}], ip[{itf["ip"]}]' for itf in _interfaces] select_interfaces_cli = Check( prompt=f"Choose interfaces: input <space> to choose, then input <enter> to finish", choices=choices, align=4, margin=1, ) selected_interfaces = select_interfaces_cli.launch() selected_interfaces = list( filter( lambda itf: f'dns[{itf["dns"]}], ip[{itf["ip"]}]' in selected_interfaces, _interfaces, ), ) return selected_interfaces @hosts.group() @click.option('-m', '--match', callback=validate_match, help=('For search host by regex. Using re.search() in python. \n' 'You can use json.\n' 'ex1) \'{"hostid": "^111$"}\' -> This matches 111\n' 'ex2) \'{"interfaceid": 41}\' -> This matches 4123232, 111141, ...' 'ex3) \'{"dns": "^$"}\' -> This matches empty string') ) @click.pass_obj def interfaces(obj, match): """ Entry point interfaces command. Get host interfaces. Parameters ---------- obj: ZabbixCTL ZabbixCTL object match: list pattern matches """ _interfaces = [] for host in obj.hosts: _filter = {'host': host['host'], 'hostid': host['hostid']} _interfaces.extend(get_interfaces(obj.zapi, _filter=_filter, match=match)) obj.interfaces = _interfaces @interfaces.command(name='list', help='list interfaces') @click.pass_obj def _list(obj): """ Parameters ---------- obj: ZabbixCTL """ click.echo(f'{json.dumps({"interfaces": obj.interfaces})}') @interfaces.command(help='update interfaces') @click.option('-d', '--data', callback=validate_json) @click.option('-y', '--yes', default=False, is_flag=True, help=('Turn on yes mode.\n' 'No confirmation update or delete.')) @click.pass_obj @check_dry_run def update(obj, data, yes): """ Parameters ---------- obj: ZabbixCTL data: dict new data. json like object. yes: bool If yes is true, no confirmation update or delete. """ if obj.main_options['interactive']: selected_interfaces = ask_interfaces(obj.interfaces) else: selected_interfaces = obj.interfaces if len(selected_interfaces) == 0: click.echo(f'{json.dumps({"message": "There is not host."})}') sys.exit() if yes or click.confirm( (f'update interfaceids: {pprint.pformat([itf["interfaceid"] for itf in selected_interfaces])}\n' f'data: {pprint.pformat(data)}'), default=False, abort=True, show_default=True): result = update_interfaces(obj.zapi, selected_interfaces, data) click.echo(f'{json.dumps(result)}') @interfaces.command(help='change from use ip -> use dns') @click.option('-y', '--yes', default=False, is_flag=True, help=('Turn on yes mode.\n' 'No confirmation update or delete.')) @click.pass_obj @check_dry_run def usedns(obj, yes): """ Update host interfaces from use ip -> use dns. Parameters ---------- obj: ZabbixCTL ZabbixCTL object yes: bool If yes is true, no confirmation update or delete. """ # ignore interface which dns is empty string formatted_interfaces = list(filter(lambda itf: len(itf['dns']) > 0, obj.interfaces)) if obj.main_options['interactive']: selected_interfaces = ask_interfaces(formatted_interfaces) else: selected_interfaces = formatted_interfaces if len(selected_interfaces) == 0: click.echo(f'{json.dumps({"message": "There is no interface."})}') sys.exit(0) if yes or click.confirm( f'usedns: interfaceids{pprint.pformat([itf["interfaceid"] for itf in selected_interfaces])}\n', default=False, abort=True, show_default=True): result = update_interfaces(obj.zapi, selected_interfaces, {'useip': 0}) click.echo(f'{json.dumps(result)}')
zabbix-controller
/zabbix_controller-0.1.19.tar.gz/zabbix_controller-0.1.19/zabbix_controller/hosts/interfaces.py
interfaces.py
import pprint import json import sys import click from . import main, ZabbixCTL from ..utils import validate_match, validate_time_range, validate_json, check_dry_run, ask_hosts from .apis import get_hosts, update_hosts @main.group(help='host command entry point') @click.option('-m', '--match', callback=validate_match, help=('For search host by regex. Using re.search() in python. \n' 'You can use json.\n' 'ex1) \'{"name": "^some$"}\' -> This matches some\n' 'ex2) \'{"hostid": "41"}\' -> This matches 4123232, 111141, ...\n' 'ex3) \'{"name": "^$"}\' -> This matches empty string\n' 'ex4) \'[{"name": "^some"}, {"hostid": "11"}]\' \n' '-> name starts with "some" and hostid is including "11"') ) @click.option('-tr', '--time-range', callback=validate_time_range, help=('For search by time range. Using unixtime\n' 'key:[from]-[to].\n' 'If you use --match at the same time, used by "and operator".\n' '"from" must be less than "to".\n' 'ex1) errors_from:48120471-140834017 -> 48120471~140834017\n' 'ex2) errors_from:- -> 0~[now unixtime]\n' 'ex3) disable_until:-7184 -> 0~7184\n') ) @click.pass_obj def hosts(obj, match, time_range): """ Parameters ---------- obj: ZabbixCTL Including command state. match: dict Key is host property in zabbix api. Value is regular expresion used by re. Each items is chained && operator, not ||. time_range: dict Keys are 'key', 'from', 'to'. Values are str, int, int. 'from' <= host['key'] <= 'to' """ _hosts = get_hosts(obj.zapi, match=match, time_range=time_range) obj.hosts = _hosts if len(_hosts) == 0: click.echo(f'{json.dumps({"message": "There is not host."})}') sys.exit(0) obj.hosts = _hosts @hosts.command(name='list', help='list hosts') @click.pass_obj def _list(obj): """ List hosts. Parameters ---------- obj: ZabbixCTL Including command state. """ click.echo(f'{json.dumps({"hosts": obj.hosts})}') @hosts.command(help='delete hosts') @click.option('-y', '--yes', default=False, is_flag=True, help=('Turn on yes mode.\n' 'No confirmation update or delete.')) @click.pass_obj @check_dry_run def delete(obj, yes): """ Checking dry-run. Delete hosts. Parameters ---------- obj: ZabbixCTL Including command state. yes: bool If yes is true, no confirmation update or delete. """ if obj.main_options['interactive']: selected_hosts = ask_hosts(obj.hosts) else: selected_hosts = obj.hosts if len(selected_hosts) == 0: click.echo(f'{json.dumps({"message": "There is not host."})}') sys.exit(0) if yes or click.confirm(f'delete: {[host["name"] for host in selected_hosts]}', default=False, abort=True, show_default=True): obj.zapi.host.delete(*[host['hostid'] for host in selected_hosts]) @hosts.command(help='disable hosts') @click.option('-y', '--yes', default=False, is_flag=True, help=('Turn on yes mode.\n' 'No confirmation update or delete.')) @click.pass_obj @check_dry_run def disable(obj, yes): """ Checking dry-run. Disable hosts. It is deprecated. Parameters ---------- obj: ZabbixCTL yes: bool If yes is true, no confirmation update or delete. """ if obj.main_options['interactive']: selected_hosts = ask_hosts(obj.hosts) else: selected_hosts = obj.hosts if len(selected_hosts) == 0: click.echo(f'{json.dumps({"message": "There is not host."})}') sys.exit(0) if yes or click.confirm(f'disable: {pprint.pformat([host["name"] for host in selected_hosts])}', default=False, abort=True, show_default=True): data = {'status': 1} result = update_hosts(obj.zapi, selected_hosts, data) click.echo(f'{json.dumps(result)}') @hosts.command(help='update hosts') @click.option('-d', '--data', callback=validate_json, help='data for update', required=True) @click.option('-y', '--yes', default=False, is_flag=True, help=('Turn on yes mode.\n' 'No confirmation update or delete.')) @click.pass_obj @check_dry_run def update(obj, data, yes): """ Checking dry-run. Update hosts. Parameters ---------- obj: ZabbixCTL Including command state. data: dict New data yes: bool If yes is true, no confirmation update or delete. """ if obj.main_options['interactive']: selected_hosts = ask_hosts(obj.hosts) else: selected_hosts = obj.hosts if len(selected_hosts) == 0: click.echo(f'{json.dumps({"message": "There is not host."})}') sys.exit(0) if yes or click.confirm((f'update: {pprint.pformat([host["name"] for host in selected_hosts])}\n' f'data: {pprint.pformat(data)}'), default=False, abort=True, show_default=True): result = update_hosts(obj.zapi, selected_hosts, data) click.echo(f'{json.dumps(result)}')
zabbix-controller
/zabbix_controller-0.1.19.tar.gz/zabbix_controller-0.1.19/zabbix_controller/hosts/command.py
command.py
import copy import re from pyzabbix import ZabbixAPI def get_hosts(zapi, match=None, time_range=None): """ Get hosts matching 'match' and 'time_range' Parameters ---------- zapi: ZabbixAPI match: [dict] Regex. Using re package. These conditions are chained by `and` operator. Not Used for API requests. Used after API requests. [{'name': 'some_name', 'hostid': '^1234'}, {'name': 'other_name'}] All items in the dict are chained "and" operator. All dict are chained "or" operator. (name match some_name and hostid match ^1234) or name match other_name time_range: dict {'key': 'error_from', 'from': 0, 'to': int(time.time())} Returns ------- hosts: [dict] list of host object. """ hosts = zapi.host.get() if match is not None: match_hosts = [] for m in match: hosts_copy = copy.deepcopy(hosts) for k, v in m.items(): hosts_copy = list( filter( lambda _host: re.search(v, _host[k]) is not None, hosts_copy, ) ) match_hosts.extend(hosts_copy) match_hosts = list({v['hostid']: v for v in match_hosts}.values()) # unique else: match_hosts = copy.deepcopy(hosts) if time_range is not None: ret = list(filter( lambda host: time_range['from'] <= int(host[time_range['key']]) <= time_range['to'], match_hosts, )) else: ret = match_hosts return ret def update_hosts(zapi, hosts, data): """ update host Parameters ---------- zapi: ZabbixAPI ZabbixAPI object hosts: [dict] list of host object data: dict new data Returns ------- results: list """ results = [] for host in hosts: result = zapi.host.update(hostid=host['hostid'], **data) results.append(result) return results
zabbix-controller
/zabbix_controller-0.1.19.tar.gz/zabbix_controller-0.1.19/zabbix_controller/hosts/apis.py
apis.py
import os import docker from .toolbox import AppError from dockermetrics import containerMetrics class Container(object): def __init__(self, container): self.raw = container self.info = {} self.__process() def __getName(self): try: return (self.raw['Name'].strip('/'), 0) except KeyError: return ('Unknown key', 1) except Exception as e: return (repr(e), 1) def __getShortId(self): try: return (self.raw['Id'][0:12], 0) except KeyError: return ('Unknown key', 1) except Exception as e: return (repr(e), 1) def __get(self, key1, key2=None): try: if key2 is None: return (self.raw[key1], 0) else: return (self.raw[key1][key2], 0) except KeyError: return ('Unknown key ' + key1 + ' ' + key2, 1) except Exception as e: return (repr(e), 1) def getLabel(self, labelName, ret=''): try: return self.info['labels'][0][labelName] except Exception: return ret def get(self, key, ret=''): if key in self.info and self.info[key][1] == 0: return self.info[key][0] else: return ret def __process(self): self.info = { 'name': self.__getName(), 'id': self.__get('Id'), 'short_id': self.__getShortId(), 'status': self.__get('State', 'Status'), 'labels': self.__get('Config', 'Labels'), 'image': self.__get('Config', 'Image'), 'restartCount': self.__get('RestartCount'), 'cpuShares': self.__get('HostConfig', 'CpuShares'), 'memory': self.__get('HostConfig', 'Memory'), 'memoryReservation': self.__get('HostConfig', 'MemoryReservation'), 'memorySwap': self.__get('HostConfig', 'MemorySwap') } class Containers(object): def __init__(self): self.docker = docker.APIClient(base_url='unix://var/run/docker.sock') def __iter__(self): for c in self.docker.containers(): inspectData = self.docker.inspect_container(c['Id']) container = Container(inspectData) yield container class dockerData(object): def __init__(self): labels = os.getenv('LABELS','') self.labels = [l.strip() for l in labels.split(',')] self.containers = {} self.instancesData = {} def discover_containers(self): for container in Containers(): self.containers[container.get('id')] = container.info self.instancesData[container.get('id')] = { 'short_id': container.get('short_id'), 'name': container.get('name'), 'groups': list( set( ['Containers'] + [ container.getLabel(l, 'Containers') for l in self.labels ] ) ) } def metrics(self, containerId): try: metrics = containerMetrics( containerId=containerId, sysfs=os.getenv('CGROUPS_DIR', '/cgroupfs') ) ret = metrics.stats ret['info'] = self.containers[containerId] return ret except Exception as e: raise AppError(str(e))
zabbix-docker-agent
/zabbix-docker-agent-0.2.3.tar.gz/zabbix-docker-agent-0.2.3/ZabbixDockerAgent/dockerdata.py
dockerdata.py
import sys import time import logging from pyzabbix import ZabbixAPI class Zabbix(object): def __init__(self, payload, Config, default_group='ECS'): self.payload = payload self.Config = Config self.cluster2proxy = Config['cluster2proxy'] self.cluster2proxyId = {} self.default_group = default_group self.data = {'groups': None, 'hosts': None, 'proxies': None, 'templates': None} self.runningInstances = [] self.instanceGroups = {} self.instanceTemplates = [] self.log = logging.getLogger(__name__) self.log.setLevel(logging.DEBUG) ch = logging.StreamHandler() self.log.addHandler(ch) self.stats = { 'created_hosts': 0, 'deleted_hosts': 0, 'created_groups': 0, 'clusters': 0, 'running_instances': 0 } self.zapi = self.api_connect() def api_connect(self): while True: try: zapi = ZabbixAPI(self.Config['Zabbix']['url']) zapi.session.verify = True zapi.timeout = 5 zapi.login(self.Config['Zabbix']['user'], self.Config['Zabbix']['pass']) self.log.debug("Connected to Zabbix API Version %s" % zapi.api_version()) return zapi except Exception as e: self.log.warning("ERROR connecting to Zabbix API: {0}". format(e)) time.sleep(300) pass def get_state(self): self.data['groups'] = self.zapi.hostgroup.get(output='extend') self.data['hosts'] = self.zapi.host.get( output='extend', selectGroups='extend', selectParentTemplates='extend' ) self.data['proxies'] = self.zapi.proxy.get(output='extend') proxies = {p['host']: p['proxyid'] for p in self.data['proxies']} for clusterName, proxyName in self.cluster2proxy.items(): self.cluster2proxyId[clusterName] = proxies[proxyName] self.data['templates'] = self.zapi.template.get(output='extend') self.instanceTemplates = [ {'templateid': t['templateid']} for t in self.data['templates'] if t['host'] in self.Config['Zabbix']['instanceTemplates'] ] def housekeeping(self): self.get_state() if 'hosts' in self.data: for host in self.data['hosts']: memberOfGroups = [g['name'] for g in host['groups']] if self.default_group not in memberOfGroups: continue if host['host'] not in self.runningInstances: self.log.debug("Deleting host {}".format(host['host'])) try: self.zapi.host.delete(host['hostid']) self.stats['deleted_hosts'] += 1 except Exception as e: self.log.warning("ERROR deleting host: {} {}". format(host['host'], e)) def group_exists(self, groupName): ret = [g['groupid'] for g in self.data['groups'] if g['name'] == groupName] if len(ret) == 0: return False else: return ret[0] def create_group(self, groupName): groupid = self.group_exists(groupName) if not groupid: self.log.debug("Creating group {}".format(groupName)) try: resp = self.zapi.hostgroup.create(name=groupName) except Exception as e: self.log.warning("ERROR creating proxied host: {} {}". format(groupName, e)) return {} else: self.log.debug("Created group {}".format(groupName)) self.data['groups'].append({ "groupid": resp['groupids'][0], "name": groupName, "internal": "0", "flags": "0" }) self.stats['created_groups'] += 1 return {'groupid': resp['groupids'][0]} else: return {'groupid': groupid} def create_groups(self, groupNames): groupNames.append(self.default_group) groupNames = list(set(groupNames)) groupIds = [] for groupName in groupNames: groupid = self.create_group(groupName) groupIds.append(groupid) return groupIds def host_exists(self, ec2InstanceId): matching_hosts = [h['hostid'] for h in self.data['hosts'] if h['host'] == ec2InstanceId] return matching_hosts[0] if len(matching_hosts) > 0 else None def create_proxied_instance(self, ec2InstanceId, instance, proxyId): hostID = self.host_exists(ec2InstanceId) if hostID is None: try: self.zapi.host.create( host=ec2InstanceId, interfaces=[{ 'type': 1, 'main': 1, 'useip': 1, 'ip': instance['PrivateIpAddress'], 'dns': '', 'port': 10050 }], groups=self.instanceGroups[ec2InstanceId], proxy_hostid=proxyId, templates=self.instanceTemplates ) except Exception as e: self.log.warning("ERROR creating proxied host: {} {}". format(ec2InstanceId, e)) else: groups = [g['groupid'] for g in self.instanceGroups[ec2InstanceId]] self.log.debug("Created proxied host {}" " groups: {}" " proxyid: {}" " ip: {}".format( ec2InstanceId, ','.join(groups), proxyId, instance['PrivateIpAddress'] )) self.stats['created_hosts'] += 1 else: try: self.zapi.host.update( hostid=hostID, groups=self.instanceGroups[ec2InstanceId], templates=self.instanceTemplates ) except Exception as e: self.log.warning("ERROR updating host: {} {}". format(ec2InstanceId, e)) else: groups = [g['groupid'] for g in self.instanceGroups[ec2InstanceId]] self.log.debug("Updated host {}" " groups: {}" " ip: {}".format( ec2InstanceId, ','.join(groups), instance['PrivateIpAddress'] )) def create_instance(self, ec2InstanceId, instance): hostID = self.host_exists(ec2InstanceId) if hostID is None: try: self.zapi.host.create( host=ec2InstanceId, interfaces=[{ 'type': 1, 'main': 1, 'useip': 1, 'ip': instance['PrivateIpAddress'], 'dns': '', 'port': 10050 }], groups=self.instanceGroups[ec2InstanceId], templates=self.instanceTemplates ) except Exception as e: self.log.warning("ERROR creating host: {} {}". format(ec2InstanceId, e)) else: groups = [g['groupid'] for g in self.instanceGroups[ec2InstanceId]] self.log.debug("Created host {}" " groups: {}" " ip: {}".format( ec2InstanceId, ','.join(groups), instance['PrivateIpAddress'] )) self.stats['created_hosts'] += 1 else: try: self.zapi.host.update( hostid=hostID, groups=self.instanceGroups[ec2InstanceId], templates=self.instanceTemplates ) except Exception as e: self.log.warning("ERROR updating host: {} {}". format(ec2InstanceId, e)) else: groups = [g['groupid'] for g in self.instanceGroups[ec2InstanceId]] self.log.debug("Updated host {}" " groups: {}" " ip: {}".format( ec2InstanceId, ','.join(groups), instance['PrivateIpAddress'] )) def run(self): self.get_state() for accountName, account in self.payload.items(): for clusterArn, cluster in account.items(): self.stats['clusters'] += 1 for ec2InstanceId, instance in cluster['instances'].items(): self.stats['running_instances'] += 1 self.runningInstances.append(ec2InstanceId) self.instanceGroups[ec2InstanceId] = self.create_groups( instance['Groups']) if cluster['name'] in self.cluster2proxyId: self.create_proxied_instance( ec2InstanceId, instance, self.cluster2proxyId[cluster['name']]) else: self.create_instance(ec2InstanceId, instance) self.log.info("{}".format(self.stats)) self.housekeeping()
zabbix-ecs-connector
/zabbix-ecs-connector-0.0.3.tar.gz/zabbix-ecs-connector-0.0.3/ZabbixECSConnector/zabbix.py
zabbix.py
import boto3 class AWSECS(object): def __init__(self, Config): self.AWSAccounts = Config['AWSAccounts'] self.ecs = {} self.ec2 = {} self.clusters = {} self.groupTags = Config['groupTags'] for awsAccountName in self.AWSAccounts: ref = self.AWSAccounts[awsAccountName] self.ecs[awsAccountName] = boto3.client( 'ecs', aws_access_key_id=ref['key'], aws_secret_access_key=ref['secret'] ) self.ec2[awsAccountName] = boto3.client( 'ec2', aws_access_key_id=ref['key'], aws_secret_access_key=ref['secret'] ) def discover_instances(self): for account in self.AWSAccounts: self.clusters[account] = {} ref = self.clusters[account] clusterArns = self.ecs[account].list_clusters()['clusterArns'] for c in self.ecs[account].describe_clusters( clusters=clusterArns)['clusters']: ref[c['clusterArn']] = { 'name': c['clusterName'], 'instances': {} } instArns = self.ecs[account].list_container_instances( cluster=c['clusterArn'] )['containerInstanceArns'] instDetails = self.ecs[account].describe_container_instances( cluster=c['clusterArn'], containerInstances=instArns ) instances = {} for i in instDetails['containerInstances']: instances[i['ec2InstanceId']] = { 'ec2InstanceId': i['ec2InstanceId'], 'containerInstanceArn': i['containerInstanceArn'] } ec2InstDetails = self.ec2[account].describe_instances( InstanceIds=list(instances.keys()) ) for r in ec2InstDetails['Reservations']: for i in r['Instances']: groups = [t['Value'] for t in i['Tags'] if t['Key'] in self.groupTags] groups.append(c['clusterName']) ref[c['clusterArn']]['instances'][i['InstanceId']] = { 'PrivateDnsName': i['PrivateDnsName'], 'PrivateIpAddress': i['PrivateIpAddress'], 'PublicDnsName': i['PublicDnsName'], 'PublicIpAddress': i['PublicIpAddress'], 'Groups': groups } return self.clusters
zabbix-ecs-connector
/zabbix-ecs-connector-0.0.3.tar.gz/zabbix-ecs-connector-0.0.3/ZabbixECSConnector/awsecs.py
awsecs.py
# Zabbix Elasticsearch ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/zabbix_elasticsearch) ![PyPI](https://img.shields.io/pypi/v/zabbix_elasticsearch) [![Build Status](https://travis-ci.org/steve-simpson/zabbix_elasticsearch.svg?branch=master)](https://travis-ci.org/steve-simpson/zabbix_elasticsearch) ![PyPI - License](https://img.shields.io/pypi/l/zabbix_elasticsearch) Simple Python wrappr around the Elasticsearch python module to provide metrics for consumption by Zabbix Agent. In time, this project may be expanded to provide monitoring for the whole Elastic Stack (Elasticsearch, Kibana, Logstash, Beats etc.) ## Getting Started These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. ### Prerequisites Despite the project name, you don't actually need Zabbix Server/Agent setup to run this project. You can "mock" Zabbix Agent using the CLI to see the metric required. See deployment for more info. You will however need a connection to Elasticsearch in order to collect metrics. For development purposes you may wish to use the elasticsearch docker image here: `https://hub.docker.com/_/elasticsearch` or you can checkout `https://app.vagrantup.com/stevesimpson/boxes/elasticsearch` for my Vagrant setup. Either way, the Elasticsearch cluster needs to be online and reachable. ``` # Note: Pulling an images requires using a specific version number tag. The latest tag is not supported. docker pull elasticsearch:7.3.2 docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.3.2 # Ensure Elasticsearch is up and reachable curl -X GET "http://localhost:9200/_cluster/health?pretty" { "cluster_name" : "docker-cluster", "status" : "green", "timed_out" : false, "number_of_nodes" : 1, "number_of_data_nodes" : 1, "active_primary_shards" : 0, "active_shards" : 0, "relocating_shards" : 0, "initializing_shards" : 0, "unassigned_shards" : 0, "delayed_unassigned_shards" : 0, "number_of_pending_tasks" : 0, "number_of_in_flight_fetch" : 0, "task_max_waiting_in_queue_millis" : 0, "active_shards_percent_as_number" : 100.0 } ``` ### Installing Install the package using `pip`. Virtualenv is recommended. ``` pip install zabbix-elasticsearch ``` Copy the default configuration file to a destination of your choosing.The default options will work with an Elasticsearch "Cluster" running on "localhost". ``` cp <install_dir>/docs/default.conf <dest> # Example using virtualenv, 'zabbix-elasticsearch' mkdir -p /etc/zabbix-elasticsearch # Make new config directory cp ~/.virtualenvs/zabbix-elasticsearch-test/docs/default.conf /etc/zabbix-elasticsearch/zabbix-elasticsearch.conf ``` That's it! Here's a usage example to grab the cluster status. The `--api`, `--endpoint` and `--metric` options will be fully documented in time. ``` zabbix_elasticsearch -c /etc/zabbix-elasticsearch/zabbix-elasticsearch.conf --api cluster --endpoint stats --metric status [19/11/2019 12:03:03] INFO GET http://localhost:9200/_nodes/_all/http [status:200 request:0.004s] [19/11/2019 12:03:03] INFO GET http://172.17.0.2:9200/_cluster/stats [status:200 request:0.005s] green [19/11/2019 12:03:03] INFO 'status': green. CLOSING ``` As you can see we are logging to stdout, this can be changed to log to a file in the config. The important output here for Zabbix integration is the printed output "green". This will be used in a later Zabbix template. ## Running the tests Test coverage is almost non exsitant. I'm hoping to change that soon! You can run `pytest` in the project root to run the pointless test if you like. Testing contributions most welcome :heavy_check_mark: ## Deployment Coming Soon :construction: ## Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. ## Versioning We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags). ## Authors * **Steve Simpson** - *Project Owner* ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details ## Acknowledgments * CI and Build with Travis CI * Package hosted on PyPI * Thanks to the teams at both Elastic and Zabbix for providing excellent open source tools
zabbix-elasticsearch
/zabbix_elasticsearch-0.5.8.tar.gz/zabbix_elasticsearch-0.5.8/README.md
README.md
import json import sys import logging import argparse from distutils.util import strtobool import configparser from collections import MutableMapping from elasticsearch import Elasticsearch, exceptions import urllib3 def parse_conf(argv=None): """Read configuration parameters from config file and configure argparse""" # Do argv default this way, as doing it in the functional # declaration sets it at compile time. if argv is None: argv = sys.argv # Parse any conf_file specification # We make this parser with add_help=False so that # it doesn't parse -h and print help. conf_parser = argparse.ArgumentParser( description=__doc__, # printed with -h/--help # Don't mess with format of description formatter_class=argparse.RawDescriptionHelpFormatter, # Turn off help, so we print all options in response to -h add_help=False ) conf_parser.add_argument( "-c", "--conf_file", help="Specify path to config file", metavar="FILE" ) args, remaining_argv = conf_parser.parse_known_args() defaults = {} if args.conf_file: try: with open(args.conf_file): config = configparser.ConfigParser() config.read([args.conf_file]) except IOError as err: print(err) sys.exit(1) # Not the cleanest solution. # Flattens the config into a single argparse namespace try: defaults.update(dict(config.items("GLOBAL"))) defaults.update(dict(config.items("ELASTICSEARCH"))) except configparser.NoSectionError as err: print(f"Configuration Error: {err}") sys.exit(1) # Parse rest of arguments # Don't suppress add_help here so it will handle -h parser = argparse.ArgumentParser( # Inherit options from config_parser parents=[conf_parser], description='Elasticsearch Monitoring for Zabbix Server' ) parser.set_defaults(**defaults) parser.add_argument( "--api", help="specify API", choices=[ 'cluster', 'indices', 'nodes', 'cat', 'ilm' ] ) parser.add_argument( "--endpoint", help="specify API", choices=[ 'stats', 'health', 'shards', 'explain_lifecycle' ] ) parser.add_argument( "--metric", help="specifiy metric" ) # The below options will be used as parameters in the API call. parser.add_argument( "--parameters", help="Seprated parmaters to be used with the API call. ';' seperator. " "Example format=json;bytes=kb;index=index_name;nodes=nodes_1,node_2" ) parser.add_argument( "--nodes", help="comma seperated list of nodes. Limit the returned data to given nodes" ) # These options are specified in the config file but can be overridden on the CLI parser.add_argument( "--logstdout", help="Enable logging to stdout", ) parser.add_argument( "--logdir", help="Specifiy log directory", ) parser.add_argument( "--logfilename", help="Specify logfile name" ) parser.add_argument( "--loglevel", help="set log level", choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], ) parser.add_argument( "--hosts", help="comma seperated list of hosts", ) args = parser.parse_args(remaining_argv) return args def configure_logging(level, logstdout, logdir, logfilename): """Configure Logging""" try: log_level = getattr(logging, level.upper()) except AttributeError as err: logging.basicConfig( stream=sys.stdout, format='[%(asctime)s] %(levelname)s %(message)s', datefmt='%d/%m/%Y %H:%M:%S', level='INFO' ) logging.error(err) sys.exit(1) if logstdout.lower() == 'true': # Log to stdout logging.basicConfig( stream=sys.stdout, format='[%(asctime)s] %(levelname)s %(message)s', datefmt='%d/%m/%Y %I:%M:%S', level=log_level ) elif logstdout.lower() == 'false': # Attempt to write to logfile. # If file does not exist, write to stdout and exit logfile = f"{logdir}{logfilename}" try: with open(logfile, 'a') as file: pass file.close() logging.basicConfig( filename=logfile, format='[%(asctime)s] %(levelname)s %(message)s', datefmt='%d/%m/%Y %I:%M:%S', level=log_level ) except PermissionError: logging.basicConfig( stream=sys.stdout, format='[%(asctime)s] %(levelname)s %(message)s', datefmt='%d/%m/%Y %I:%M:%S', level=log_level ) logging.error("Log file: %s can not be written, permission denied. \ Ensure log directory and log file are writable. Closing", logfile) sys.exit(1) return logging def validate_args(args): """Validate the CLI arguments""" choices_matrix = { 'cluster': [ 'stats', 'health' ], 'indices': [ 'stats' ], 'nodes': [ 'stats' ], 'cat': [ 'shards' ], 'ilm': [ 'explain_lifecycle' ] } # Lookup the args endpoint to ensure it is valid for the requested api if args.endpoint not in choices_matrix.get(args.api, args.endpoint): logging.error("'%s' is not a valid endpoint for the '%s' api. " "Terminating", args.endpoint, args.api) sys.exit(1) class ESWrapper: """Functions to call Elasticsearch API""" def __init__(self, args): # Disable warning about SSL certs if args.disable_ssl_warning.lower() == 'true': urllib3.disable_warnings() self.es_configuration = {} # Convert hosts to python list self.es_hosts = args.hosts.split(",") self.es_configuration["hosts"] = self.es_hosts self.es_configuration["scheme"] = args.httpscheme self.es_configuration["port"] = int(args.port) self.es_configuration["sniff_on_start"] = args.sniffonstart.lower() self.es_configuration["sniff_on_connection_fail"] = args.sniffonconnectionfail.lower() self.es_configuration["sniffer_timeout"] = int(args.sniffertimeout) # Build SSL options if SSL_enabled if strtobool(args.use_ssl): try: self.es_configuration["use_ssl"] = True self.es_configuration["verify_certs"] = strtobool(args.verify_ssl_certs) self.es_configuration["ssl_show_warn"] = strtobool(args.ssl_show_warn) except ValueError as err: logging.error("%s. Terminating", err) sys.exit(1) else: self.es_configuration["es_use_ssl"] = False # Build authentication options if using authenticated url try: if strtobool(args.httpauth): self.es_configuration["http_auth"] = (args.authuser, args.authpassword) except ValueError as err: logging.error("%s. Terminating", err) sys.exit(1) try: self.es_config = Elasticsearch(**self.es_configuration) except exceptions.TransportError as err: logging.error(err) sys.exit(1) def node_discovery(self, response): """Discover nodes""" returned_data = {'data': []} for key, value in response['nodes'].items(): returned_data['data'].append({ '{#NODE_ID}': key, '{#NODE_NAME}': value['name'], '{#NODE_IP}': value['ip'] }) return json.dumps(returned_data) def index_discovery(self, response): """Discover Indices""" returned_data = {'data': []} for key, value in response['indices'].items(): returned_data['data'].append({ '{#INDEX_NAME}': key, '{#INDEX_UUID}': value['uuid'], }) return json.dumps(returned_data) def convert_flatten(self, dictionary, parent_key='', sep='.'): """ Code to convert dict to flattened dictionary. Default seperater '.' """ items = [] for key, value in dictionary.items(): new_key = parent_key + sep + key if parent_key else key if isinstance(value, MutableMapping): items.extend(self.convert_flatten(value, new_key, sep=sep).items()) else: items.append((new_key, value)) return dict(items) def shards_per_node(self, api_response, nodes): """Get count of all shards that match the given node""" count = 0 for item in api_response: if item['node'] in nodes: count += 1 return count def ilm_explain(self, api_response): """Loop through the index response and look for ERROR steps. Return 1 is any ERRORS found""" for index in api_response["indices"].keys(): if api_response["indices"][index]["managed"] == True: if api_response["indices"][index]["step"] == "ERROR": res = 1 return res else: pass return 0 def send_requests(self, args): """GET METRICS""" api_call = getattr(self.es_config, args.api) if args.parameters: api_parameters = dict( param.split("=") for param in args.parameters.split(";") ) if not api_parameters['format']: api_parameters['format'] = "json" else: api_parameters = dict({"format": "json"}) try: api_response = getattr(api_call, args.endpoint)(**api_parameters) # Elasticsearch serialization error except exceptions.SerializationError: logging.error("SerializationError. " "Check that %s is a valid format for this API.", api_parameters['format'] ) sys.exit(1) except: logging.error("Problem calling API. Check CLI arguments and parameters then try again") sys.exit(1) try: # Handle "null" metrics if args.metric is None: logging.error("'--metric' has not been specified. Terminating") sys.exit(1) # Discovery elif args.metric == "node_discovery" or args.metric == "index_discovery": logging.info("Running discovery...") response = getattr(self, args.metric)(api_response) return response # Get Metric elif args.metric == "shards_per_node": try: response = self.shards_per_node(api_response, args.nodes) return response except TypeError: logging.error("Cannot iterate through response. " "Likley cause: '--nodes' has not been specified. Terminating") sys.exit(1) elif args.metric == "ilm_explain": try: response = self.ilm_explain(api_response) return response except: logging.error("ILM Explain Error") sys.exit(1) else: response = self.convert_flatten(api_response) logging.info("'%s': %s", args.metric, response[args.metric]) return response[args.metric] except KeyError: logging.error("KeyError: '%s' is not a valid metric for the '%s' endpoint. " "Terminating", args.metric, args.endpoint) sys.exit(1) def main(argv=None): """Main Execution path""" if argv is None: argv = sys.argv args = parse_conf() configure_logging(args.loglevel, args.logstdout, args.logdir, args.logfilename) validate_args(args) es_wrapper = ESWrapper(args) try: result = es_wrapper.send_requests(args) print(result) sys.exit(0) except AttributeError as err: logging.error(err) sys.exit(1) if __name__ == "__main__": main()
zabbix-elasticsearch
/zabbix_elasticsearch-0.5.8.tar.gz/zabbix_elasticsearch-0.5.8/zabbix_elasticsearch/zabbix_elasticsearch.py
zabbix_elasticsearch.py
# zabbix-enums Zabbix enumerations for API scripting. This package aims to provide enumerations for Zabbix object parameters. So instead of using bare numbers and constantly browsing the docs, you can just use a nice enum. Example 1: Use nice enums in API calls ```python from zabbix_enums.z60 import TriggerState from pyzabbix import ZabbixAPI zapi = ZabbixAPI('http://localhost') zapi.login('Admin', 'zabbix') # this unknown_triggers = zapi.trigger.get(filter={'state': 1}) # becomes this unknown_triggers = zapi.trigger.get(filter={'state': TriggerState.UNKNOWN}) zapi.user.logout() ``` Example 2: Filter entities offline, based on their status ```python from zabbix_enums.z60 import HostStatus from pyzabbix import ZabbixAPI zapi = ZabbixAPI('http://localhost') zapi.login('Admin', 'zabbix') hosts = zapi.host.get() monitored = [h for h in hosts if HostStatus(h['status']) == HostStatus.MONITORED] zapi.user.logout() ``` Example 3: Filter problems with severities above a certain level ```python from zabbix_enums.z60 import ProblemSeverity from pyzabbix import ZabbixAPI zapi = ZabbixAPI('http://localhost') zapi.login('Admin', 'zabbix') problems = zapi.problem.get() important = [p for p in problems if ProblemSeverity(p['severity']) > ProblemSeverity.AVERAGE] zapi.user.logout() ``` # Limitations Please bare in mind that not all enumerations are present at this time. For comparing Enums do not use `is` keyword - see second example At this moment, only Zabbix 5.0 and above is supported. # Versioning The following version schema is used: X.Y.Z X - major version. If this changes, your code might break - update with caution. Y - latest supported Zabbix version. I.E 1.60.0 supports Zabbix 6.0 and below but not 6.2. Z - minor version. For bugfixes.
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/README.md
README.md
from zabbix_enums import _ZabbixEnum class MapExpandMacro(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Whether to expand macros in labels when configuring the map. """ NO = 0 YES = 1 class MapExpandProblem(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Whether the problem trigger will be displayed for elements with a single problem. """ NO = 0 YES = 1 class MapGridAlign(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Whether to enable grid aligning. """ NO = 0 YES = 1 class MapGridShow(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Whether to show the grid on the map. """ NO = 0 YES = 1 class MapHighlight(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Whether icon highlighting is enabled. """ NO = 0 YES = 1 class MapLabelFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Whether to enable advanced labels. """ DISABLE_ADVANCED_LABELS = 0 ENABLE_ADVANCED_LABELS = 1 class MapLabelLocation(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Location of the map element label. """ BOTTOM = 0 LEFT = 1 RIGHT = 2 TOP = 3 class MapLabelType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Map element label type. """ LABEL = 0 IP_ADDRESS = 1 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 class MapLabelTypeHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Label type for host elements. """ LABEL = 0 IP_ADDRESS = 1 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapLabelTypeHostGroup(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Label type for host group elements. """ LABEL = 0 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapLabelTypeImage(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Label type for host group elements. """ LABEL = 0 ELEMENT_NAME = 2 NOTHING = 4 CUSTOM = 5 class MapLabelTypeMap(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Label type for map elements. """ LABEL = 0 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapLabelTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Label type for trigger elements. """ LABEL = 0 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapMarkElements(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Whether to highlight map elements that have recently changed their status. """ NO = 0 YES = 1 class MapShowUnack(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map How problems should be displayed. """ COUNT_ALL_PROBLEMS = 0 COUNT_UNACK_PROBLEMS = 1 COUNT_ALL_PROBLEMS_SEPARATELY = 2 class MapPrivate(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Type of map sharing. """ NO = 0 YES = 1 class MapShowSuppressed(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/map/object#map Whether suppressed problems are shown. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/map.py
map.py
from zabbix_enums import _ZabbixEnum class EventSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/event/object#event Type of the event. """ TRIGGER = 0 DISCOVERY = 1 AUTOREGISTRATION = 2 INTERNAL = 3 class EventObjectTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/event/object#event Type of object that is related to the event. Possible values for trigger events. """ TRIGGER = 0 class EventObjectDiscovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/event/object#event Type of object that is related to the event. Possible values for discovery events. """ HOST = 1 SERVICE = 2 class EventObjectAutoregistration(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/event/object#event Type of object that is related to the event. Possible values for autoregistration events. """ HOST = 3 class EventObjectInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/event/object#event Possible values for internal events. """ TRIGGER = 0 ITEM = 4 LLD = 5 class EventValueTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/event/object#event State of the related object. Possible values for trigger events. """ OK = 0 PROBLEM = 1 class EventValueDiscovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/event/object#event State of the related object. Possible values for discovery events. """ UP = 0 DOWN = 1 DISCOVERED = 2 LOST = 3 class EventValueInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/event/object#event State of the related object. Possible values for internal events. """ NORMAL = 0 UNKNOWN = 1 NOT_SUPPORTED = 1 class EventSeverity(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/event/object#event Event current severity. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class EventSuppressed(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/event/object#event Whether the event is suppressed. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/event.py
event.py
from zabbix_enums import _ZabbixEnum class HostAvailable(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host [Readonly] Availability of Zabbix agent. """ UNKNOWN = 0 AVAILABLE = 1 UNAVAILABLE = 2 class HostFlag(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host [Readonly] Origin of the host. """ PLAIN = 0 DISCOVERED = 4 class HostInventoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host Host inventory population mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1 class HostIPMIAuthType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host IPMI authentication algorithm. """ DEFAULT = -1 NONE = 0 MD2 = 1 MD = 2 STRAIGHT = 4 OEM = 5 RMCP = 6 class HostIPMIAvailable(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host [Readonly] Availability of IPMI agent. """ UNKNOWN = 0 AVAILABLE = 1 UNAVAILABLE = 2 class HostIPMIPrivilege(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host IPMI privilege level. """ CALLBACK = 1 USER = 2 OPERATOR = 3 ADMIN = 4 OEM = 5 class HostJMXAvailable(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host [Readonly] Availability of JMX agent. """ UNKNOWN = 0 AVAILABLE = 1 UNAVAILABLE = 2 class HostMaintenanceStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host [Readonly] Effective maintenance type. """ NO_MAINTENANCE = 0 IN_MAINTENANCE = 1 class HostMaintenanceType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host [Readonly] Effective maintenance type. """ WITH_DATA_COLLECTION = 0 WITHOUT_DATA_COLLECTION = 1 class HostSNMPAvailable(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host [Readonly] Availability of SNMP agent. """ UNKNOWN = 0 AVAILABLE = 1 UNAVAILABLE = 2 class HostStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host Status and function of the host. """ MONITORED = 0 UNMONITORED = 1 class HostTLSConnect(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host Connections to host. """ NO_ENCRYPTION = 1 PSK = 2 CERTIFICATE = 4 class HostTLSAccept(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host Connections from host. Possible bitmap values. """ NO_ENCRYPTION = 1 PSK = 2 CERTIFICATE = 4 class HostInventoryProperty(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/host/object#host-inventory Each property has it's own unique ID number, which is used to associate host inventory fields with items. """ ALIAS = 4 ASSET_TAG = 11 CHASSIS = 28 CONTACT = 23 CONTRACT_NUMBER = 32 DATE_HW_DECOMM = 47 DATE_HW_EXPIRY = 46 DATE_HW_INSTALL = 45 DATE_HW_PURCHASE = 44 DEPLOYMENT_STATUS = 34 HARDWARE = 14 HARDWARE_FULL = 15 HOST_NETMASK = 39 HOST_NETWORKS = 38 HOST_ROUTER = 40 HW_ARCH = 30 INSTALLER_NAME = 33 LOCATION = 24 LOCATION_LAT = 25 LOCATION_LON = 26 MACADDRESS_A = 12 MACADDRESS_B = 13 MODEL = 29 NAME = 3 NOTES = 27 OOB_IP = 41 OOB_NETMASK = 42 OOB_ROUTER = 43 OS = 5 OS_FULL = 6 OS_SHORT = 7 POC_1_CELL = 61 POC_1_EMAIL = 58 POC_1_NAME = 57 POC_1_NOTES = 63 POC_1_PHONE_A = 59 POC_1_PHONE_B = 60 POC_1_SCREEN = 62 POC_2_CELL = 68 POC_2_EMAIL = 65 POC_2_NAME = 64 POC_2_NOTES = 70 POC_2_PHONE_A = 66 POC_2_PHONE_B = 67 POC_2_SCREEN = 69 SERIALNO_A = 8 SERIALNO_B = 9 SITE_ADDRESS_A = 48 SITE_ADDRESS_B = 49 SITE_ADDRESS_C = 50 SITE_CITY = 51 SITE_COUNTRY = 53 SITE_NOTES = 56 SITE_RACK = 55 SITE_STATE = 52 SITE_ZIP = 54 SOFTWARE = 16 SOFTWARE_APP_A = 18 SOFTWARE_APP_B = 19 SOFTWARE_APP_C = 20 SOFTWARE_APP_D = 21 SOFTWARE_APP_E = 22 SOFTWARE_FULL = 17 TAG = 10 TYPE = 1 TYPE_FULL = 2 URL_A = 35 URL_B = 36 URL_C = 37 VENDOR = 31
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/host.py
host.py
from enum import Enum from unittest.mock import DEFAULT from zabbix_enums import _ZabbixEnum class DashboardPrivate(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dashboard/object#dashboard Type of dashboard sharing. """ NO = 0 YES = 1 PUBLIC = 0 PRIVATE = 1 class DashboardWidgetType(str, Enum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dashboard/object#dashboard-widget Type of the dashboard widget. """ ACTION_LOG = "actionlog" CLOCK = "clock" DATA_OVERVIEW = "dataover" DISCOVERY_STATUS = "discovery" FAVORITE_GRAPHS = "favgraphs" FAVORITE_MAPS = "favmaps" FAVORITE_SCREENS = "favscreens" GRAPH_CLASSIC = "graph" GRAPH_PROTOTYPE = "graphprototype" HOST_AVAILABILITY = "hostavail" MAP = "map" MAP_NAVIGATION_TREE = "navtree" PLAIN_TEXT = "plaintext" PROBLEM_HOSTS = "problemhosts" PROBLEMS = "problems" PROBLEMS_BY_SEVERITY = "problemsbysv" GRAPH = "svggraph" SYSTEM_INFORMATION = "systeminfo" TRIGGER_OVERVIEW = "trigover" URL = "url" WEB_MONITORING = "web" class DashboardWidgetViewMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dashboard/object#dashboard-widget The widget view mode. """ DEFAULT = 0 HIDDEN_HEADER = 1 class DashboardWidgetFieldType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dashboard/object#dashboard-widget-field Type of the widget field. """ INTEGER = 0 STRING = 1 HOST_GROUP = 2 HOST = 3 ITEM = 4 GRAPH = 6 MAP = 8 class DashboardUserGroupPermission(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dashboard/object#dashboard-user-group Type of permission level. """ READ_ONLY = 2 READ_WRITE = 3 class DashboardUserPermission(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dashboard/object#dashboard-user Type of permission level. """ READ_ONLY = 2 READ_WRITE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/dashboard.py
dashboard.py
from zabbix_enums import _ZabbixEnum class ItemPrototypeType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype Type of the item prototype. """ ZABBIX_AGENT = 0 ZABBIX_TRAPPER = 2 SIMPLE_CHECK = 3 ZABBIX_INTERNAL = 5 ZABBIX_AGENT_ACTIVE = 7 ZABBIX_AGGREGATE = 8 EXTERNAL_CHECK = 10 DATABASE_MONITOR = 11 IPMI_AGENT = 12 SSH_AGENT = 13 TELNET_AGENT = 14 CALCULATED = 15 JMX_AGENT = 16 SNMP_TRAP = 17 DEPENDENT_ITEM = 18 HTTP_AGENT = 19 SNMP_AGENT = 20 class ItemPrototypeValueType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype Type of information of the item prototype. """ NUMERIC_FLOAT = 0 CHARACTER = 1 LOG = 2 NUMERIC_UNSIGNED = 3 TEXT = 4 class ItemPrototypeAllowTraps(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Allow to populate value as in trapper item type also. """ NO = 0 YES = 1 class ItemPrototypeAuthTypeSSH(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype Used only by SSH agent item prototypes or HTTP agent item prototypes. SSH agent authentication method possible values. """ PASSWORD = 0 PUBLIC_KEY = 1 class ItemPrototypeAuthTypeHTTP(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype Used only by SSH agent item prototypes or HTTP agent item prototypes. HTTP agent authentication method possible values. """ NONE = 0 BASIC = 1 NTLM = 2 KERBEROS = 3 class ItemPrototypeFollowRedirects(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Follow response redirects while pooling data. """ NO = 0 YES = 1 class ItemPrototypeOutputFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Should response be converted to JSON. """ RAW = 0 JSON = 1 class ItemPrototypePostType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Type of post data body stored in posts property. """ RAW = 0 JSON = 2 XML = 3 class ItemPrototypeRequestMethod(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Type of request method. """ GET = 0 POST = 1 PUT = 2 HEAD = 3 class ItemPrototypeRetrieveMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. What part of response should be stored. """ BODY = 0 HEADERS = 1 BODY_AND_HEADERS = 2 BOTH = 2 class ItemPrototypeStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype Status of the item prototype. """ ENABLED = 0 DISABLED = 1 UNSUPPORTED = 3 class ItemPrototypeVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. """ NO = 0 YES = 1 class ItemPrototypeVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Validate is host certificate authentic. """ NO = 0 YES = 1 class ItemPrototypePrototypeDiscover(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype-prototype Item prototype discovery status. """ DISCOVER = 0 DONT_DISCOVER = 1 class ItemPrototypePreprocessingType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype-preprocessing The preprocessing option type. """ CUSTOM_MULTIPLIER = 1 RIGHT_TRIM = 2 LEFT_TRIM = 3 TRIM = 4 REGULAR_EXPRESSION = 5 BOOLEAN_TO_DECIMAL = 6 OCTAL_TO_DECIMAL = 7 HEXADECIMAL_TO_DECIMAL = 8 SIMPLE_CHANGE = 9 CHANGE_PER_SECOND = 10 XML_XPATH = 11 JSONPATH = 12 IN_RANGE = 13 MATCHES_REGULAR_EXPRESSION = 14 DOES_NOT_MATCH_REGULAR_EXPRESSION = 15 CHECK_FOR_ERROR_IN_JSON = 16 CHECK_FOR_ERROR_IN_XML = 17 CHECK_FOR_ERROR_USING_REGULAR_EXPRESSION = 18 DISCARD_UNCHANGED = 19 DISCARD_UNCHANGED_WITH_HEARTBEAT = 20 JAVASCRIPT = 21 PROMETHEUS_PATTERN = 22 PROMETHEUS_TO_JSON = 23 CSV_TO_JSON = 24 REPLACE = 25 class ItemPrototypePreprocessingErrorHandler(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/itemprototype/object#item-prototype-preprocessing Action type used in case of preprocessing step failure. """ ERROR_MESSAGE = 0 DISCARD_VALUE = 1 CUSTOM_VALUE = 2 CUSTOM_ERROR_MESSAGE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/itemprototype.py
itemprototype.py
from zabbix_enums import _ZabbixEnum class LLDRuleType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule Type of the LLD rule. """ ZABBIX_AGENT = 0 ZABBIX_TRAPPER = 2 SIMPLE_CHECK = 3 ZABBIX_INTERNAL = 5 ZABBIX_AGENT_ACTIVE = 7 EXTERNAL_CHECK = 10 DATABASE_MONITOR = 11 IPMI_AGENT = 12 SSH_AGENT = 13 TELNET_AGENT = 14 CALCULATED = 15 JMX_AGENT = 16 DEPENDENT_ITEM = 18 HTTP_AGENT = 19 SNMP_AGENT = 20 class LLDRuleAllowTraps(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Allow to populate value as in trapper item type also. """ NO = 0 YES = 1 class LLDRuleAuthTypeSSH(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule Used only by SSH agent or HTTP agent LLD rules. SSH agent authentication method possible values. """ PASSWORD = 0 PUBLIC_KEY = 1 class LLDRuleAuthTypeHTTP(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule Used only by SSH agent or HTTP agent LLD rules. HTTP agent authentication method possible values. """ NONE = 0 BASIC = 1 NTLM = 2 class LLDRuleFollowRedirects(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Follow response redirects while pooling data. """ NO = 0 YES = 1 class LLDRuleOutputFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Should response be converted to JSON. """ RAW = 0 JSON = 1 class LLDRulePostType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Type of post data body stored in posts property. """ RAW = 0 JSON = 2 XML = 3 class LLDRuleRequestMethod(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Type of request method. """ GET = 0 POST = 1 PUT = 2 HEAD = 3 class LLDRuleRetrieveMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. What part of response should be stored. """ BODY = 0 HEADERS = 1 BODY_AND_HEADERS = 2 BOTH = 2 class LLDRuleState(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule [Readonly] State of the LLD rule. """ NORMAL = 0 NOT_SUPPORTED = 1 class LLDRuleStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule Status of the LLD rule. """ ENABLED = 0 DISABLED = 1 class LLDRuleVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. """ NO = 0 YES = 1 class LLDRuleVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Validate is host certificate authentic. """ NO = 0 YES = 1 class LLDRuleEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-filter Filter condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 CUSTOM = 3 class LLDRuleFilterConditionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-filter-condition Condition operator. """ MATCHES_REGEX = 8 DOES_NOT_MATCH_REGEX = 9 class LLDRulePreprocessing(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-preprocessing The preprocessing option type. """ REGULAR_EXPRESSION = 5 XML_XPATH = 11 JSONPATH = 12 DOES_NOT_MATCH_REGULAR_EXPRESSION = 15 CHECK_FOR_ERROR_IN_JSON = 16 CHECK_FOR_ERROR_IN_XML = 17 DISCARD_UNCHANGED_WITH_HEARTBEAT = 20 PROMETHEUS_PATTERN = 22 PROMETHEUS_TO_JSON = 23 CSV_TO_JSON = 24 REPLACE = 25 class LLDRulePreprocessingErrorHandler(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-preprocessing Action type used in case of preprocessing step failure. """ ERROR_MESSAGE = 0 DISCARD_VALUE = 1 CUSTOM_VALUE = 2 CUSTOM_ERROR_MESSAGE = 3 class LLDRuleOverridesStop(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-overrides Stop processing next overrides if matches. """ NO = 0 YES = 1 class LLDRuleOverrideFilterEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-filter Override filter condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 CUSTOM = 3 class LLDRuleOverrideFilterConditionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-filter-condition Condition operator. """ MATCHES_REGEX = 8 DOES_NOT_MATCH_REGEX = 9 class LLDRuleOverrideOperationObject(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation Type of discovered object to perform the action. """ ITEM = 0 TRIGGER = 1 GRAPH = 2 HOST = 3 class LLDRuleOverrideOperationOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation Override condition operator. """ EQUALS = 0 DOES_NOT_EQUAL = 1 CONTAINS = 2 DOESN_NOT_CONTAIN = 3 MATCHES = 8 DOES_NOT_MATCH = 9 class LLDRuleOverrideOperationStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-status Override the status for selected object. """ CREATE_ENABLED = 0 CREATE_DISABLED = 1 class LLDRuleOverrideOperationDiscover(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-discover Override the discover status for selected object. """ YES = 0 NO = 1 class LLDRuleOverrideOperationSeverity(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-severity Override the severity of trigger prototype. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class LLDRuleOverrideOperationInventory(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-inventory Override the host prototype inventory mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/discoveryrule.py
discoveryrule.py
from zabbix_enums import _ZabbixEnum class ScreenItemResourceType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/screenitem/object#screen-item Type of screen item. """ GRAPH = 0 SIMPLE_GRAPH = 1 MAP = 2 PLAIN_TEXT = 3 HOSTS_INFO = 4 TRIGGERS_INFO = 5 SYSTEM_INFORMATION = 6 CLOCK = 7 TRIGGERS_OVERVIEW = 9 DATA_OVERVIEW = 10 URL = 11 HISTORY_OF_ACTIONS = 12 HISTORY_OF_EVENTS = 13 LATEST_HOST_GROUP_ISSUES = 14 PROBLEMS_BY_SEVERITY = 15 LATEST_HOST_ISSUES = 16 SIMPLE_GRAPH_PROTOTYPE = 19 GRAPH_PROTOTYPE = 20 class ScreenItemDynamic(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/screenitem/object#screen-item Whether the screen item is dynamic. """ NO = 0 YES = 1 class ScreenItemHalign(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/screenitem/object#screen-item Specifies how the screen item must be aligned horizontally in the cell. """ CENTER = 0 LEFT = 1 RIGHT = 2 class ScreenItemSortTriggersActions(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/screenitem/object#screen-item Order in which actions or triggers must be sorted. Possible values for history of actions screen elements. """ TIME_ASCENDING = 3 TIME_DESCENDING = 4 TYPE_ASCENDING = 5 TYPE_DESCENDING = 6 STATUS_ASCENDING = 7 STATUS_DESCENDING = 8 RETRIES_LEFT_ASCENDING = 9 RETRIES_LEFT_DESCENDING = 10 RECIPIENT_ASCENDING = 11 RECIPIENT_DESCENDING = 12 class ScreenItemSortTriggersIssues(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/screenitem/object#screen-item Possible values for latest host group issues and latest host issues screen items: """ LAST_CHANGE_DESCENDING = 0 SEVERITY_DESCENDING = 1 HOST_ASCENDING = 2 class ScreenItemStyleOverview(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/screenitem/object#screen-item Screen item display option. Possible values for data overview and triggers overview screen items: """ HOSTS_ON_LEFT = 0 HOSTS_ON_TOP = 1 class ScreenItemStyleInfo(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/screenitem/object#screen-item Screen item display option. Possible values for hosts info and triggers info screen elements. """ HORIZONTAL_LAYOUT = 0 VERTICAL_LAYOUT = 1 class ScreenItemStyleClock(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/screenitem/object#screen-item Screen item display option. Possible values for clock screen items. """ LOCAL_TIME = 0 SERVER_TIME = 1 HOST_TIME = 2 class ScreenItemStylePlaintext(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/screenitem/object#screen-item Screen item display option. Possible values for plain text screen items. """ PLAIN = 0 HTML = 1 class ScreenItemValign(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/screenitem/object#screen-item Specifies how the screen item must be aligned vertically in the cell. """ MIDDLE = 0 TOP = 1 BOTTOM = 2
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/screenitem.py
screenitem.py
from zabbix_enums import _ZabbixEnum class ActionStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action Whether the action is enabled or disabled. """ ENABLED = 0 DISABLED = 1 class ActionPauseSupressed(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action Whether to pause escalation during maintenance periods or not. """ NO = 0 YES = 1 class ActionOperationType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-operation Type of operation. """ SEND_MESSAGE = 0 REMOTE_COMMAND = 1 ADD_HOST = 2 REMOVE_HOST = 3 ADD_TO_HOST_GROUP = 4 REMOVE_FROM_HOST_GROUP = 5 LINK_TO_TEMPLATE = 6 UNLINK_FROM_TEMPLATE = 7 ENABLE_HOST = 8 DISABLE_HOST = 9 SET_HOST_INVENTORY_MODE = 10 class ActionOperationEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-operation Operation condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 class ActionOperationCommandType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-operation-command Type of operation command. """ CUSTOM_SCRIPT = 0 IPMI = 1 SSH = 2 TELNET = 3 GLOBAL_SCRIPT = 4 class ActionOperationCommandAuthType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-operation-command Authentication method used for SSH commands. """ PASSWORD = 0 PUBLIC_KEY = 1 class ActionOperationCommandExecuteOn(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-operation-command Target on which the custom script operation command will be executed. Required for custom script commands. """ ZABBIX_AGENT = 0 ZABBIX_SERVER = 1 ZABBIX_SERVER_PROXY = 2 class ActionOperationMessageDefault(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-operation-message Whether to use the default action message text and subject. """ NO = 0 YES = 1 class ActionOperationConditionType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-operation-condition Type of condition. """ EVENT_ACKNOWLEDGED = 14 class ActionOperationConditionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-operation-condition Condition operator. """ EQUALS = 0 class ActionOperationConditionEventAcknowledged(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-operation-condition Whether the event is acknowledged. """ NO = 0 YES = 1 class ActionRecoveryOperationTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-recovery-operation Type of operation. Possible values for trigger actions. """ SEND_MESSAGE = 0 REMOTE_COMMAND = 1 NOTIFY_ALL_INVOLVED = 11 class ActionRecoveryOperationTypeInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-recovery-operation Type of operation. Possible values for internal actions. """ SEND_MESSAGE = 0 NOTIFY_ALL_INVOLVED = 11 class ActionUpdateOperationTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-update-operation Type of operation. Possible values for trigger actions. """ SEND_MESSAGE = 0 REMOTE_COMMAND = 1 NOTIFY_ALL_INVOLVED = 12 class ActionFilterEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-filter Filter condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 CUSTOM = 3 class ActionFilterCondidtionTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for trigger actions. """ HOST_GROUP = 0 HOST = 1 TRIGGER = 2 TRIGGER_NAME = 3 TRIGGER_SEVERITY = 4 TIME_PERIOD = 6 HOST_TEMPLATE = 13 APPLICATION = 15 PROBLEM_IS_SUPPRESSED = 16 EVENT_TAG = 25 EVENT_TAG_VALUE = 26 class ActionFilterCondidtionTypeDiscovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for discovery actions. """ HOST_IP = 7 DISCOVERED_SERVICE_TYPE = 8 DISCOVERED_SERVICE_PORT = 9 DISCOVERY_STATUS = 10 UPTIME_OR_DOWNTIME_DURATION = 11 RECEIVED_VALUE = 12 DISCOVERY_RULE = 18 DISCOVERY_CHECK = 19 PROXY = 20 DISCOVERY_OBJECT = 21 class ActionFilterCondidtionTypeAutoregistration(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for autoregistration actions. """ PROXY = 20 HOST_NAME = 22 HOST_METADATA = 24 class ActionFilterCondidtionTypeInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for internal actions. """ HOST_GROUP = 0 HOST = 1 HOST_TEMPLATE = 13 APPLICATION = 15 EVENT_TYPE = 23 class ActionFilterCondidtionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/action/object#action-filter-condition Condition operator. """ EQUALS = 0 DOES_NOT_EQUAL = 1 CONTAINS = 2 DOES_NOT_CONTAIN = 3 IN = 4 GREATER_OR_EQUAL = 5 LESS_OR_EQUAL = 6 NOT_IN = 7 MATCHES = 8 DOES_NOT_MATCH = 9 YES = 10 NO = 11
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/action.py
action.py
from zabbix_enums import _ZabbixEnum class ItemType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item Type of the item. """ ZABBIX_AGENT = 0 ZABBIX_TRAPPER = 2 SIMPLE_CHECK = 3 ZABBIX_INTERNAL = 5 ZABBIX_AGENT_ACTIVE = 7 ZABBIX_AGGREGATE = 8 WEB_ITEM = 9 EXTERNAL_CHECK = 10 DATABASE_MONITOR = 11 IPMI_AGENT = 12 SSH_AGENT = 13 TELNET_AGENT = 14 CALCULATED = 15 JMX_AGENT = 16 SNMP_TRAP = 17 DEPENDENT_ITEM = 18 HTTP_AGENT = 19 SNMP_AGENT = 20 class ItemValueType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item Type of information of the item. """ NUMERIC_FLOAT = 0 CHARACTER = 1 LOG = 2 NUMERIC_UNSIGNED = 3 TEXT = 4 class ItemAllowTraps(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item HTTP agent item field. Allow to populate value as in trapper item type also. """ NO = 0 YES = 1 class ItemAuthTypeSSH(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item Used only by SSH agent items or HTTP agent items. SSH agent authentication method possible values. """ PASSWORD = 0 PUBLIC_KEY = 1 class ItemAuthTypeHTTP(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item Used only by SSH agent items or HTTP agent items. HTTP agent authentication method possible values. """ NONE = 0 BASIC = 1 NTLM = 2 KERBEROS = 3 class ItemFlag(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item [Readonly] Origin of the item. """ PLAIN = 0 DISCOVERED = 4 class ItemFollowRedirects(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item HTTP agent item field. Follow response redirects while pooling data. """ NO = 0 YES = 1 class ItemOutputFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item HTTP agent item field. Should response be converted to JSON. """ RAW = 0 JSON = 1 class ItemPostType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item HTTP agent item field. Type of post data body stored in posts property. """ RAW = 0 JSON = 2 XML = 3 class ItemRequestMethod(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item HTTP agent item field. Type of request method. """ GET = 0 POST = 1 PUT = 2 HEAD = 3 class ItemRetrieveMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item HTTP agent item field. What part of response should be stored. """ BODY = 0 HEADERS = 1 BODY_AND_HEADERS = 2 BOTH = 2 class ItemState(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item [Readonly] State of the item. """ NORMAL = 0 NOT_SUPPORTED = 1 class ItemStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item Status of the item. """ ENABLED = 0 DISABLED = 1 class ItemVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item HTTP agent item field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. """ NO = 0 YES = 1 class ItemVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item HTTP agent item field. Validate is host certificate authentic. """ NO = 0 YES = 1 class ItemPreprocessingType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item-preprocessing The preprocessing option type. """ CUSTOM_MULTIPLIER = 1 RIGHT_TRIM = 2 LEFT_TRIM = 3 TRIM = 4 REGULAR_EXPRESSION = 5 BOOLEAN_TO_DECIMAL = 6 OCTAL_TO_DECIMAL = 7 HEXADECIMAL_TO_DECIMAL = 8 SIMPLE_CHANGE = 9 CHANGE_PER_SECOND = 10 XML_XPATH = 11 JSONPATH = 12 IN_RANGE = 13 MATCHES_REGULAR_EXPRESSION = 14 DOES_NOT_MATCH_REGULAR_EXPRESSION = 15 CHECK_FOR_ERROR_IN_JSON = 16 CHECK_FOR_ERROR_IN_XML = 17 CHECK_FOR_ERROR_USING_REGULAR_EXPRESSION = 18 DISCARD_UNCHANGED = 19 DISCARD_UNCHANGED_WITH_HEARTBEAT = 20 JAVASCRIPT = 21 PROMETHEUS_PATTERN = 22 PROMETHEUS_TO_JSON = 23 CSV_TO_JSON = 24 REPLACE = 25 class ItemPreprocessingErrorHandler(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/item/object#item-preprocessing Action type used in case of preprocessing step failure. """ ERROR_MESSAGE = 0 DISCARD_VALUE = 1 CUSTOM_VALUE = 2 CUSTOM_ERROR_MESSAGE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/item.py
item.py
from zabbix_enums import _ZabbixEnum class MediaTypeType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/mediatype/object#media-type Transport used by the media type. """ EMAIL = 0 SCRIPT = 1 SMS = 2 WEBHOOK = 4 class MediaTypeSMTPSecurity(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/mediatype/object#media-type SMTP connection security level to use. """ NONE = 0 STARTTLS = 1 SSL_TLS = 2 class MediaTypeSMTPSVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/mediatype/object#media-type SSL verify host for SMTP. """ NO = 0 YES = 1 class MediaTypeSMTPSVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/mediatype/object#media-type SSL verify peer for SMTP. """ NO = 0 YES = 1 class MediaTypeSMTPAuthentication(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/mediatype/object#media-type SMTP authentication method to use. """ NONE = 0 PASSWORD = 1 class MediaTypeStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/mediatype/object#media-type Whether the media type is enabled. """ ENABLED = 0 DISABLED = 1 class MediaTypeContentType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/mediatype/object#media-type Message format. """ PLAIN_TEXT = 0 HTML = 1 class MediaTypeProcessTags(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/mediatype/object#media-type Defines should the webhook script response to be interpreted as tags and these tags should be added to associated event. """ NO = 0 YES = 1 class MediaTypeShowEventMenu(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/mediatype/object#media-type Show media type entry in problem.get and event.get property urls. """ NO = 0 YES = 1 class MessageTemplateEventSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/mediatype/object#message-template Event source. """ TRIGGER = 0 DISCOVERY = 1 AUTOREGISTRATION = 2 INTERNAL = 3 class MessageTemplateRecovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/mediatype/object#message-template Operation mode. """ OPERATIONS = 0 RECOVERY = 1 RECOVERY_OPERATIONS = 1 UPDATE = 2 UPDATE_OPERATIONS = 2
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/mediatype.py
mediatype.py
from zabbix_enums import _ZabbixEnum class TriggerFlag(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/trigger/object#trigger [Readonly] Origin of the trigger. """ PLAIN = 0 DISCOVERED = 4 class TriggerPriority(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/trigger/object#trigger Severity of the trigger. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class TriggerState(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/trigger/object#trigger [Readonly] State of the trigger. """ NORMAL = 0 UNKNOWN = 1 class TriggerStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/trigger/object#trigger Whether the trigger is enabled or disabled. """ ENABLED = 0 DISABLED = 1 class TriggerType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/trigger/object#trigger Whether the trigger can generate multiple problem events. """ GENERATE_SINGLE_EVENT = 0 DO_NOT_GENERATE_MULTIPLE_EVENTS = 0 GENERATE_MULTIPLE_EVENTS = 1 class TriggerValue(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/trigger/object#trigger [Readonly] Whether the trigger is in OK or problem state. """ OK = 0 PROBLEM = 1 class TriggerRecoveryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/trigger/object#trigger OK event generation mode. """ EXPRESSION = 0 RECOVERY_EXPRESSION = 1 NONE = 2 class TriggerCorrelationMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/trigger/object#trigger OK event closes. """ ALL_PROBLEMS = 0 TAG_VALUES_MATCH = 1 class TriggerManualClose(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/trigger/object#trigger Allow manual close. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/trigger.py
trigger.py
from zabbix_enums import _ZabbixEnum class DiscoveryCheckSNMPv3AuthProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dcheck/object#discovery-check Authentication protocol used for SNMPv3 agent checks with security level set to authNoPriv or authPriv. """ MD5 = 0 SHA = 1 class DiscoveryCheckSNMPv3PrivProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dcheck/object#discovery-check Privacy protocol used for SNMPv3 agent checks with security level set to authPriv. """ DES = 0 AES = 1 class DiscoveryCheckSNMPv3SecurityLevel(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dcheck/object#discovery-check Security level used for SNMPv3 agent checks. """ NOAUTHNOPRIV = 0 AUTHNOPRIV = 1 AUTHPRIV = 2 class DiscoveryCheckType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dcheck/object#discovery-check Type of check. """ SSH = 0 LDAP = 1 SMTP = 2 FTP = 3 HTTP = 4 POP = 5 NNTP = 6 IMAP = 7 TCP = 8 ZABBIX_AGENT = 9 SNMPV1 = 10 SNMPV2 = 11 ICMP = 12 SNMPV3 = 13 HTTPS = 14 TELNET = 15 class DiscoveryCheckUniq(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dcheck/object#discovery-check Whether to use this check as a device uniqueness criteria. Only a single unique check can be configured for a discovery rule. Used for Zabbix agent, SNMPv1, SNMPv2 and SNMPv3 agent checks. """ NO = 0 YES = 1 class DiscoveryCheckHostSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dcheck/object#discovery-check Source for host name. """ DNS = 1 IP = 2 CHECK_VALUE = 3 class DiscoveryCheckNameSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/dcheck/object#discovery-check Source for visible name. """ NOT_SCPECIFIED = 0 DNS = 1 IP = 2 CHECK_VALUE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/dcheck.py
dcheck.py
from zabbix_enums import _ZabbixEnum class HostInterfaceMain(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/hostinterface/object#host-interface Whether the interface is used as default on the host. Only one interface of some type can be set as default on a host. """ NO = 0 YES = 1 class HostInterfaceType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/hostinterface/object#host-interface Interface type. """ AGENT = 1 SNMP = 2 IPMI = 3 JMX = 4 class HostIntrefaceUseIP(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/hostinterface/object#host-interface Whether the connection should be made via IP. """ NO = 0 YES = 1 class DetailsTagVersion(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/hostinterface/object#details-tag SNMP interface version. """ SNMP1 = 1 SNMP2 = 2 SNMP3 = 3 class DetailsTagBulk(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/hostinterface/object#details-tag Whether to use bulk SNMP requests. """ NO = 0 YES = 1 class DetailsTagSecurityLevel(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/hostinterface/object#details-tag SNMPv3 security level. Used only by SNMPv3 interfaces. """ NOAUTHNOPRIV = 0 AUTHNOPRIV = 1 AUTHPRIV = 2 class DetailsTagAuthProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/hostinterface/object#details-tag SNMPv3 authentication protocol. Used only by SNMPv3 interfaces. """ MD5 = 0 SHA = 1 class DetailsTagPrivProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.0/en/manual/api/reference/hostinterface/object#details-tag SNMPv3 privacy protocol. Used only by SNMPv3 interfaces. """ DES = 0 AES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z50/hostinterface.py
hostinterface.py
from zabbix_enums import _ZabbixEnum class MapExpandMacro(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Whether to expand macros in labels when configuring the map. """ NO = 0 YES = 1 class MapExpandProblem(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Whether the problem trigger will be displayed for elements with a single problem. """ NO = 0 YES = 1 class MapGridAlign(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Whether to enable grid aligning. """ NO = 0 YES = 1 class MapGridShow(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Whether to show the grid on the map. """ NO = 0 YES = 1 class MapHighlight(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Whether icon highlighting is enabled. """ NO = 0 YES = 1 class MapLabelFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Whether to enable advanced labels. """ DISABLE_ADVANCED_LABELS = 0 ENABLE_ADVANCED_LABELS = 1 class MapLabelLocation(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Location of the map element label. """ BOTTOM = 0 LEFT = 1 RIGHT = 2 TOP = 3 class MapLabelType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Map element label type. """ LABEL = 0 IP_ADDRESS = 1 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 class MapLabelTypeHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Label type for host elements. """ LABEL = 0 IP_ADDRESS = 1 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapLabelTypeHostGroup(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Label type for host group elements. """ LABEL = 0 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapLabelTypeImage(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Label type for host group elements. """ LABEL = 0 ELEMENT_NAME = 2 NOTHING = 4 CUSTOM = 5 class MapLabelTypeMap(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Label type for map elements. """ LABEL = 0 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapLabelTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Label type for trigger elements. """ LABEL = 0 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapMarkElements(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Whether to highlight map elements that have recently changed their status. """ NO = 0 YES = 1 class MapShowUnack(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map How problems should be displayed. """ COUNT_ALL_PROBLEMS = 0 COUNT_UNACK_PROBLEMS = 1 COUNT_ALL_PROBLEMS_SEPARATELY = 2 class MapPrivate(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Type of map sharing. """ NO = 0 YES = 1 class MapShowSuppressed(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/map/object#map Whether suppressed problems are shown. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/map.py
map.py
from zabbix_enums import _ZabbixEnum class ServiceAlgorithm(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/service/object#service Status calculation rule. Only applicable if child services exist. """ SET_STATUS_TO_OK = 0 MOST_CRITICAL_IF_ALL_CHILDREN_HAVE_PROBLEMS = 1 MOST_CRITICAL_OF_CHILD_SERVICES = 2 class ServicePropagationRule(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/service/object#service Status propagation rule. Must be set together with propagation_value. PROPAGATE_SERVICE_STATUS_AS_IS - propagate service status as is - without any changes INCREASE_THE_STATUS - increase the propagated status by a given propagation_value (by 1 to 5 severities) DECREASE_THE_STATUS - decrease the propagated status by a given propagation_value (by 1 to 5 severities) IGNORE_THIS_SERVICE - ignore this service - the status is not propagated to the parent service at all SET_FIXED_SERVICE_STATUS - set fixed service status using a given propagation_value. """ PROPAGATE_SERVICE_STATUS_AS_IS = 0 INCREASE_THE_STATUS = 1 DECREASE_THE_STATUS = 2 IGNORE_THIS_SERVICE = 3 SET_FIXED_SERVICE_STATUS = 4 class ServicePropagationValue(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/service/object#service Status propagation value. Must be set together with propagation_rule. """ OK = -1 NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class ServiceStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/service/object#service [Readonly] Whether the service is in OK or problem state. """ OK = -1 NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class ServiceReadOnly(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/service/object#service [Readonly] Access to the service. """ READ_WRITE = 0 READ_ONLY = 1 class StatusRuleType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/service/object#status-rule Condition for setting (New status) status. AT_LEAST_N_CHILD_SERVICES_WITH_STATUS_OR_ABOVE - if at least (N) child services have (Status) status or above AT_LEAST_NP_CHILD_SERVICES_WITH_STATUS_OR_ABOVE - if at least (N%) of child services have (Status) status or above LESS_THAN_N_CHILD_SERVICES_WITH_STATUS_OR_BELOW - if less than (N) child services have (Status) status or below LESS_THAN_NP_CHILD_SERVICES_WITH_STATUS_OR_BELOW - if less than (N%) of child services have (Status) status or below CHILD_SERVICE_WEIGHT_WITH_STATUS_OR_ABOVE_AT_LEAST_W - if weight of child services with (Status) status or above is at least (W) CHILD_SERVICE_WEIGHT_WITH_STATUS_OR_ABOVE_AT_LEAST_NP - if weight of child services with (Status) status or above is at least (N%) CHILD_SERVICE_WEIGHT_WITH_STATUS_OR_BELOW_AT_MOST_W - if weight of child services with (Status) status or below is less than (W) CHILD_SERVICE_WEIGHT_WITH_STATUS_OR_BELOW_AT_MOST_NP - if weight of child services with (Status) status or below is less than (N%) Where: - N (W) is limit_value - (Status) is limit_status - (New status) is new_status """ AT_LEAST_N_CHILD_SERVICES_WITH_STATUS_OR_ABOVE = 0 AT_LEAST_NP_CHILD_SERVICES_WITH_STATUS_OR_ABOVE = 1 LESS_THAN_N_CHILD_SERVICES_WITH_STATUS_OR_BELOW = 2 LESS_THAN_NP_CHILD_SERVICES_WITH_STATUS_OR_BELOW = 3 CHILD_SERVICE_WEIGHT_WITH_STATUS_OR_ABOVE_AT_LEAST_W = 4 CHILD_SERVICE_WEIGHT_WITH_STATUS_OR_ABOVE_AT_LEAST_NP = 5 CHILD_SERVICE_WEIGHT_WITH_STATUS_OR_BELOW_AT_MOST_W = 6 CHILD_SERVICE_WEIGHT_WITH_STATUS_OR_BELOW_AT_MOST_NP = 7 class StatusRuleLimitStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/service/object#status-rule Limit status. """ OK = -1 NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class StatusRuleLimitStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/service/object#status-rule New status value. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class ProblemTagOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/service/object#problem-tag Mapping condition operator. """ EQUALS = 0 LIKE = 2
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/service.py
service.py
from zabbix_enums import _ZabbixEnum class EventSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/event/object#event Type of the event. """ TRIGGER = 0 DISCOVERY = 1 AUTOREGISTRATION = 2 INTERNAL = 3 SERVICE = 4 class EventObjectTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/event/object#event Type of object that is related to the event. Possible values for trigger events. """ TRIGGER = 0 class EventObjectDiscovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/event/object#event Type of object that is related to the event. Possible values for discovery events. """ HOST = 1 SERVICE = 2 class EventObjectAutoregistration(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/event/object#event Type of object that is related to the event. Possible values for autoregistration events. """ HOST = 3 class EventObjectInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/event/object#event Possible values for internal events. """ TRIGGER = 0 ITEM = 4 LLD = 5 class EventObjectInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/event/object#event Possible values for service events. """ SERVICE = 6 class EventValueTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/event/object#event State of the related object. Possible values for trigger events. """ OK = 0 PROBLEM = 1 class EventValueService(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/event/object#event State of the related object. Possible values for service events. """ OK = 0 PROBLEM = 1 class EventValueDiscovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/event/object#event State of the related object. Possible values for discovery events. """ UP = 0 DOWN = 1 DISCOVERED = 2 LOST = 3 class EventValueInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/event/object#event State of the related object. Possible values for internal events. """ NORMAL = 0 UNKNOWN = 1 NOT_SUPPORTED = 1 class EventSeverity(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/event/object#event Event current severity. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class EventSuppressed(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/event/object#event Whether the event is suppressed. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/event.py
event.py
from zabbix_enums import _ZabbixEnum class HostFlag(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/host/object#host [Readonly] Origin of the host. """ PLAIN = 0 DISCOVERED = 4 class HostInventoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/host/object#host Host inventory population mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1 class HostIPMIAuthType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/host/object#host IPMI authentication algorithm. """ DEFAULT = -1 NONE = 0 MD2 = 1 MD = 2 STRAIGHT = 4 OEM = 5 RMCP = 6 class HostIPMIPrivilege(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/host/object#host IPMI privilege level. """ CALLBACK = 1 USER = 2 OPERATOR = 3 ADMIN = 4 OEM = 5 class HostMaintenanceStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/host/object#host [Readonly] Effective maintenance type. """ NO_MAINTENANCE = 0 IN_MAINTENANCE = 1 class HostMaintenanceType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/host/object#host [Readonly] Effective maintenance type. """ WITH_DATA_COLLECTION = 0 WITHOUT_DATA_COLLECTION = 1 class HostStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/host/object#host Status and function of the host. """ MONITORED = 0 UNMONITORED = 1 class HostTLSConnect(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/host/object#host Connections to host. """ NO_ENCRYPTION = 1 PSK = 2 CERTIFICATE = 4 class HostTLSAccept(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/host/object#host Connections from host. Possible bitmap values. """ NO_ENCRYPTION = 1 PSK = 2 CERTIFICATE = 4 class HostInventoryProperty(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/host/object#host-inventory Each property has it's own unique ID number, which is used to associate host inventory fields with items. """ ALIAS = 4 ASSET_TAG = 11 CHASSIS = 28 CONTACT = 23 CONTRACT_NUMBER = 32 DATE_HW_DECOMM = 47 DATE_HW_EXPIRY = 46 DATE_HW_INSTALL = 45 DATE_HW_PURCHASE = 44 DEPLOYMENT_STATUS = 34 HARDWARE = 14 HARDWARE_FULL = 15 HOST_NETMASK = 39 HOST_NETWORKS = 38 HOST_ROUTER = 40 HW_ARCH = 30 INSTALLER_NAME = 33 LOCATION = 24 LOCATION_LAT = 25 LOCATION_LON = 26 MACADDRESS_A = 12 MACADDRESS_B = 13 MODEL = 29 NAME = 3 NOTES = 27 OOB_IP = 41 OOB_NETMASK = 42 OOB_ROUTER = 43 OS = 5 OS_FULL = 6 OS_SHORT = 7 POC_1_CELL = 61 POC_1_EMAIL = 58 POC_1_NAME = 57 POC_1_NOTES = 63 POC_1_PHONE_A = 59 POC_1_PHONE_B = 60 POC_1_SCREEN = 62 POC_2_CELL = 68 POC_2_EMAIL = 65 POC_2_NAME = 64 POC_2_NOTES = 70 POC_2_PHONE_A = 66 POC_2_PHONE_B = 67 POC_2_SCREEN = 69 SERIALNO_A = 8 SERIALNO_B = 9 SITE_ADDRESS_A = 48 SITE_ADDRESS_B = 49 SITE_ADDRESS_C = 50 SITE_CITY = 51 SITE_COUNTRY = 53 SITE_NOTES = 56 SITE_RACK = 55 SITE_STATE = 52 SITE_ZIP = 54 SOFTWARE = 16 SOFTWARE_APP_A = 18 SOFTWARE_APP_B = 19 SOFTWARE_APP_C = 20 SOFTWARE_APP_D = 21 SOFTWARE_APP_E = 22 SOFTWARE_FULL = 17 TAG = 10 TYPE = 1 TYPE_FULL = 2 URL_A = 35 URL_B = 36 URL_C = 37 VENDOR = 31
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/host.py
host.py
from enum import Enum from unittest.mock import DEFAULT from zabbix_enums import _ZabbixEnum class DashboardPrivate(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dashboard/object#dashboard Type of dashboard sharing. """ NO = 0 YES = 1 PUBLIC = 0 PRIVATE = 1 class DashboardAutoStart(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dashboard/object#dashboard Auto start slideshow. """ NO = 0 YES = 1 DashboardStartSlideshow = DashboardAutoStart class DashboardWidgetType(str, Enum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dashboard/object#dashboard-widget Type of the dashboard widget. """ ACTION_LOG = "actionlog" CLOCK = "clock" DATA_OVERVIEW = "dataover" DISCOVERY_STATUS = "discovery" FAVORITE_GRAPHS = "favgraphs" FAVORITE_MAPS = "favmaps" GRAPH_CLASSIC = "graph" GRAPH_PROTOTYPE = "graphprototype" HOST_AVAILABILITY = "hostavail" ITEM = "item" MAP = "map" MAP_NAVIGATION_TREE = "navtree" PLAIN_TEXT = "plaintext" PROBLEM_HOSTS = "problemhosts" PROBLEMS = "problems" PROBLEMS_BY_SEVERITY = "problemsbysv" SLA_REPORT = "slareport" GRAPH = "svggraph" SYSTEM_INFORMATION = "systeminfo" TOP_HOSTS = "tophosts" TRIGGER_OVERVIEW = "trigover" URL = "url" WEB_MONITORING = "web" class DashboardWidgetViewMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dashboard/object#dashboard-widget The widget view mode. """ DEFAULT = 0 HIDDEN_HEADER = 1 class DashboardWidgetFieldType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dashboard/object#dashboard-widget-field Type of the widget field. """ INTEGER = 0 STRING = 1 HOST_GROUP = 2 HOST = 3 ITEM = 4 GRAPH = 6 MAP = 8 SERVICE = 9 SLA = 10 class DashboardUserGroupPermission(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dashboard/object#dashboard-user-group Type of permission level. """ READ_ONLY = 2 READ_WRITE = 3 class DashboardUserPermission(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dashboard/object#dashboard-user Type of permission level. """ READ_ONLY = 2 READ_WRITE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/dashboard.py
dashboard.py
from zabbix_enums import _ZabbixEnum class ItemPrototypeType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype Type of the item prototype. """ ZABBIX_AGENT = 0 ZABBIX_TRAPPER = 2 SIMPLE_CHECK = 3 ZABBIX_INTERNAL = 5 ZABBIX_AGENT_ACTIVE = 7 EXTERNAL_CHECK = 10 DATABASE_MONITOR = 11 IPMI_AGENT = 12 SSH_AGENT = 13 TELNET_AGENT = 14 CALCULATED = 15 JMX_AGENT = 16 SNMP_TRAP = 17 DEPENDENT_ITEM = 18 HTTP_AGENT = 19 SNMP_AGENT = 20 SCRIPT = 21 class ItemPrototypeValueType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype Type of information of the item prototype. """ NUMERIC_FLOAT = 0 CHARACTER = 1 LOG = 2 NUMERIC_UNSIGNED = 3 TEXT = 4 class ItemPrototypeAllowTraps(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Allow to populate value as in trapper item type also. """ NO = 0 YES = 1 class ItemPrototypeAuthTypeSSH(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype Used only by SSH agent item prototypes or HTTP agent item prototypes. SSH agent authentication method possible values. """ PASSWORD = 0 PUBLIC_KEY = 1 class ItemPrototypeAuthTypeHTTP(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype Used only by SSH agent item prototypes or HTTP agent item prototypes. HTTP agent authentication method possible values. """ NONE = 0 BASIC = 1 NTLM = 2 KERBEROS = 3 class ItemPrototypeFollowRedirects(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Follow response redirects while pooling data. """ NO = 0 YES = 1 class ItemPrototypeOutputFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Should response be converted to JSON. """ RAW = 0 JSON = 1 class ItemPrototypePostType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Type of post data body stored in posts property. """ RAW = 0 JSON = 2 XML = 3 class ItemPrototypeRequestMethod(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Type of request method. """ GET = 0 POST = 1 PUT = 2 HEAD = 3 class ItemPrototypeRetrieveMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. What part of response should be stored. """ BODY = 0 HEADERS = 1 BODY_AND_HEADERS = 2 BOTH = 2 class ItemPrototypeStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype Status of the item prototype. """ ENABLED = 0 DISABLED = 1 UNSUPPORTED = 3 class ItemPrototypeVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. """ NO = 0 YES = 1 class ItemPrototypeVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Validate is host certificate authentic. """ NO = 0 YES = 1 class ItemPrototypePrototypeDiscover(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype-prototype Item prototype discovery status. """ DISCOVER = 0 DONT_DISCOVER = 1 class ItemPrototypePreprocessingType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype-preprocessing The preprocessing option type. """ CUSTOM_MULTIPLIER = 1 RIGHT_TRIM = 2 LEFT_TRIM = 3 TRIM = 4 REGULAR_EXPRESSION = 5 BOOLEAN_TO_DECIMAL = 6 OCTAL_TO_DECIMAL = 7 HEXADECIMAL_TO_DECIMAL = 8 SIMPLE_CHANGE = 9 CHANGE_PER_SECOND = 10 XML_XPATH = 11 JSONPATH = 12 IN_RANGE = 13 MATCHES_REGULAR_EXPRESSION = 14 DOES_NOT_MATCH_REGULAR_EXPRESSION = 15 CHECK_FOR_ERROR_IN_JSON = 16 CHECK_FOR_ERROR_IN_XML = 17 CHECK_FOR_ERROR_USING_REGULAR_EXPRESSION = 18 DISCARD_UNCHANGED = 19 DISCARD_UNCHANGED_WITH_HEARTBEAT = 20 JAVASCRIPT = 21 PROMETHEUS_PATTERN = 22 PROMETHEUS_TO_JSON = 23 CSV_TO_JSON = 24 REPLACE = 25 CHECK_UNSUPPORTED = 26 XML_TO_JSON = 27 class ItemPrototypePreprocessingErrorHandler(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/itemprototype/object#item-prototype-preprocessing Action type used in case of preprocessing step failure. """ ERROR_MESSAGE = 0 DISCARD_VALUE = 1 CUSTOM_VALUE = 2 CUSTOM_ERROR_MESSAGE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/itemprototype.py
itemprototype.py
from zabbix_enums import _ZabbixEnum class LLDRuleType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule Type of the LLD rule. """ ZABBIX_AGENT = 0 ZABBIX_TRAPPER = 2 SIMPLE_CHECK = 3 ZABBIX_INTERNAL = 5 ZABBIX_AGENT_ACTIVE = 7 EXTERNAL_CHECK = 10 DATABASE_MONITOR = 11 IPMI_AGENT = 12 SSH_AGENT = 13 TELNET_AGENT = 14 CALCULATED = 15 JMX_AGENT = 16 DEPENDENT_ITEM = 18 HTTP_AGENT = 19 SNMP_AGENT = 20 SCRIPT = 21 class LLDRuleAllowTraps(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Allow to populate value as in trapper item type also. """ NO = 0 YES = 1 class LLDRuleAuthTypeSSH(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule Used only by SSH agent or HTTP agent LLD rules. SSH agent authentication method possible values. """ PASSWORD = 0 PUBLIC_KEY = 1 class LLDRuleAuthTypeHTTP(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule Used only by SSH agent or HTTP agent LLD rules. HTTP agent authentication method possible values. """ NONE = 0 BASIC = 1 NTLM = 2 class LLDRuleFollowRedirects(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Follow response redirects while pooling data. """ NO = 0 YES = 1 class LLDRuleOutputFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Should response be converted to JSON. """ RAW = 0 JSON = 1 class LLDRulePostType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Type of post data body stored in posts property. """ RAW = 0 JSON = 2 XML = 3 class LLDRuleRequestMethod(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Type of request method. """ GET = 0 POST = 1 PUT = 2 HEAD = 3 class LLDRuleRetrieveMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. What part of response should be stored. """ BODY = 0 HEADERS = 1 BODY_AND_HEADERS = 2 BOTH = 2 class LLDRuleState(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule [Readonly] State of the LLD rule. """ NORMAL = 0 NOT_SUPPORTED = 1 class LLDRuleStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule Status of the LLD rule. """ ENABLED = 0 DISABLED = 1 class LLDRuleVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. """ NO = 0 YES = 1 class LLDRuleVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Validate is host certificate authentic. """ NO = 0 YES = 1 class LLDRuleEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-filter Filter condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 CUSTOM = 3 class LLDRuleFilterConditionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-filter-condition Condition operator. """ MATCHES_REGEX = 8 DOES_NOT_MATCH_REGEX = 9 EXISTS = 12 DOES_NOT_EXIST = 13 class LLDRulePreprocessing(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-preprocessing The preprocessing option type. """ REGULAR_EXPRESSION = 5 XML_XPATH = 11 JSONPATH = 12 DOES_NOT_MATCH_REGULAR_EXPRESSION = 15 CHECK_FOR_ERROR_IN_JSON = 16 CHECK_FOR_ERROR_IN_XML = 17 DISCARD_UNCHANGED_WITH_HEARTBEAT = 20 PROMETHEUS_PATTERN = 22 PROMETHEUS_TO_JSON = 23 CSV_TO_JSON = 24 REPLACE = 25 XML_TO_JSON = 27 class LLDRulePreprocessingErrorHandler(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-preprocessing Action type used in case of preprocessing step failure. """ ERROR_MESSAGE = 0 DISCARD_VALUE = 1 CUSTOM_VALUE = 2 CUSTOM_ERROR_MESSAGE = 3 class LLDRuleOverridesStop(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-overrides Stop processing next overrides if matches. """ NO = 0 YES = 1 class LLDRuleOverrideFilterEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-filter Override filter condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 CUSTOM = 3 class LLDRuleOverrideFilterConditionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-filter-condition Condition operator. """ MATCHES_REGEX = 8 DOES_NOT_MATCH_REGEX = 9 EXISTS = 12 DOES_NOT_EXIST = 13 class LLDRuleOverrideOperationObject(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation Type of discovered object to perform the action. """ ITEM = 0 TRIGGER = 1 GRAPH = 2 HOST = 3 class LLDRuleOverrideOperationOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation Override condition operator. """ EQUALS = 0 DOES_NOT_EQUAL = 1 CONTAINS = 2 DOESN_NOT_CONTAIN = 3 MATCHES = 8 DOES_NOT_MATCH = 9 class LLDRuleOverrideOperationStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-status Override the status for selected object. """ CREATE_ENABLED = 0 CREATE_DISABLED = 1 class LLDRuleOverrideOperationDiscover(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-discover Override the discover status for selected object. """ YES = 0 NO = 1 class LLDRuleOverrideOperationSeverity(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-severity Override the severity of trigger prototype. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class LLDRuleOverrideOperationInventory(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-inventory Override the host prototype inventory mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/discoveryrule.py
discoveryrule.py
from zabbix_enums import _ZabbixEnum class SettingsServerCheckInterval(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/settings/object#settings Show warning if Zabbix server is down. """ DONT_SHOW_WARNING = 0 SHOW_WARNING = 10 class SettingsShowTechnicalErrors(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/settings/object#settings Show technical errors (PHP/SQL) to non-Super admin users and to users that are not part of user groups with debug mode enabled. """ NO = 0 YES = 1 class SettingsCustomColor(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/settings/object#settings Use custom event status colors. """ NO = 0 YES = 1 class SettingsProblemUnackStyle(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/settings/object#settings Blinking for unacknowledged PROBLEM events. """ DONT_BLINK = 0 BLINK = 1 class SettingsProblemAckStyle(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/settings/object#settings Blinking for acknowledged PROBLEM events. """ DONT_BLINK = 0 BLINK = 1 class SettingsOKUnackStyle(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/settings/object#settings Blinking for unacknowledged RESOLVED events. """ DONT_BLINK = 0 BLINK = 1 class SettingsOKAckStyle(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/settings/object#settings Blinking for acknowledged RESOLVED events. """ DONT_BLINK = 0 BLINK = 1 class SettingsDefaultInventoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/settings/object#settings Default host inventory mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1 class SettingsSnmptrapLogging(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/settings/object#settings Log unmatched SNMP traps. """ NO = 0 YES = 1 class SettingsValidateUriSchemes(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/settings/object#settings Validate URI schemes. """ NO = 0 YES = 1 class SettingsIframeSandboxingEnabled(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/settings/object#settings Use iframe sandboxing. """ NO = 0 YES = 1 class SettingsAuditlogEnabled(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/settings/object#settings Enable audit logging. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/settings.py
settings.py
from zabbix_enums import _ZabbixEnum class ActionStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action Whether the action is enabled or disabled. """ ENABLED = 0 DISABLED = 1 class ActionPauseSupressed(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action Whether to pause escalation during maintenance periods or not. """ NO = 0 YES = 1 class ActionNotifyIfCanceled(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action Whether to notify when escalation is canceled. """ NO = 0 YES = 1 class ActionOperationType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-operation Type of operation. """ SEND_MESSAGE = 0 GLOBAL_SCRIPT = 1 ADD_HOST = 2 REMOVE_HOST = 3 ADD_TO_HOST_GROUP = 4 REMOVE_FROM_HOST_GROUP = 5 LINK_TO_TEMPLATE = 6 UNLINK_FROM_TEMPLATE = 7 ENABLE_HOST = 8 DISABLE_HOST = 9 SET_HOST_INVENTORY_MODE = 10 class ActionOperationEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-operation Operation condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 class ActionOperationMessageDefault(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-operation-message Whether to use the default action message text and subject. """ NO = 0 YES = 1 class ActionOperationConditionType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-operation-condition Type of condition. """ EVENT_ACKNOWLEDGED = 14 class ActionOperationConditionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-operation-condition Condition operator. """ EQUALS = 0 class ActionOperationConditionEventAcknowledged(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-operation-condition Whether the event is acknowledged. """ NO = 0 YES = 1 class ActionRecoveryOperationTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-recovery-operation Type of operation. Possible values for trigger actions. """ SEND_MESSAGE = 0 GLOBAL_SCRIPT = 1 NOTIFY_ALL_INVOLVED = 11 class ActionRecoveryOperationTypeInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-recovery-operation Type of operation. Possible values for internal actions. """ SEND_MESSAGE = 0 NOTIFY_ALL_INVOLVED = 11 class ActionUpdateOperationTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-update-operation Type of operation. Possible values for trigger actions. """ SEND_MESSAGE = 0 GLOBAL_SCRIPT = 1 NOTIFY_ALL_INVOLVED = 12 class ActionFilterEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-filter Filter condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 CUSTOM = 3 class ActionFilterCondidtionTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for trigger actions. """ HOST_GROUP = 0 HOST = 1 TRIGGER = 2 TRIGGER_NAME = 3 TRIGGER_SEVERITY = 4 TIME_PERIOD = 6 HOST_TEMPLATE = 13 PROBLEM_IS_SUPPRESSED = 16 EVENT_TAG = 25 EVENT_TAG_VALUE = 26 class ActionFilterCondidtionTypeDiscovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for discovery actions. """ HOST_IP = 7 DISCOVERED_SERVICE_TYPE = 8 DISCOVERED_SERVICE_PORT = 9 DISCOVERY_STATUS = 10 UPTIME_OR_DOWNTIME_DURATION = 11 RECEIVED_VALUE = 12 DISCOVERY_RULE = 18 DISCOVERY_CHECK = 19 PROXY = 20 DISCOVERY_OBJECT = 21 class ActionFilterCondidtionTypeAutoregistration(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for autoregistration actions. """ PROXY = 20 HOST_NAME = 22 HOST_METADATA = 24 class ActionFilterCondidtionTypeInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for internal actions. """ HOST_GROUP = 0 HOST = 1 HOST_TEMPLATE = 13 EVENT_TYPE = 23 EVENT_TAG = 25 EVENT_TAG_VALUE = 26 class ActionFilterCondidtionTypeService(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for service actions. """ EVENT_TAG = 25 EVENT_TAG_VALUE = 26 SERVICE = 27 SERVICE_NAME = 28 class ActionFilterCondidtionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/action/object#action-filter-condition Condition operator. """ EQUALS = 0 DOES_NOT_EQUAL = 1 CONTAINS = 2 DOES_NOT_CONTAIN = 3 IN = 4 GREATER_OR_EQUAL = 5 LESS_OR_EQUAL = 6 NOT_IN = 7 MATCHES = 8 DOES_NOT_MATCH = 9 YES = 10 NO = 11
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/action.py
action.py
from zabbix_enums import _ZabbixEnum class HostPrototypeStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostprototype/object#host-prototype Status of the host prototype. """ MONITORED = 0 UNMONITORED = 1 class HostPrototypeInventoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostprototype/object#host-prototype Host inventory population mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1 class HostPrototypeDiscover(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostprototype/object#host-prototype Host prototype discovery status. """ DISCOVER = 0 DONT_DISCOVER = 1 class HostPrototypeCustomInterfaces(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostprototype/object#host-prototype Source of interfaces for hosts created by the host prototype. """ PARENT_HOST = 0 CUSTOM_INTERFACE = 1 class CustomInterfaceMain(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostprototype/object#custom-interface Whether the interface is used as default on the host. Only one interface of some type can be set as default on a host. """ class CustomInterfaceType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostprototype/object#custom-interface Interface type. """ AGENT = 1 SNMP = 2 IPMI = 3 JMX = 4 class CustomInterfaceUseIp(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostprototype/object#custom-interface Whether the connection should be made via IP. """ NO = 0 YES = 1 class CustomInterfaceDetailsVersion(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostprototype/object#custom-interface-details SNMP interface version. """ SNMP1 = 1 SNMP2 = 2 SNMP3 = 3 class CustomInterfaceDetailsBulk(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostprototype/object#custom-interface-details Whether to use bulk SNMP requests. """ NO = 0 YES = 1 class CustomInterfaceDetailsSecurityLevel(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostprototype/object#custom-interface-details SNMPv3 security level. Used only by SNMPv3 interfaces. """ NOAUTHNOPRIV = 0 AUTHNOPRIV = 1 AUTHPRIV = 2 class CustomInterfaceDetailsAuthProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostprototype/object#custom-interface-details SNMPv3 authentication protocol. Used only by SNMPv3 interfaces. """ MD5 = 0 SHA = 1 SHA1 = 1 SHA224 = 2 SHA256 = 3 SHA384 = 4 SHA512 = 5 class CustomInterfaceDetailsPrivProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostprototype/object#custom-interface-details SNMPv3 privacy protocol. Used only by SNMPv3 interfaces. """ DES = 0 AES = 1 AES128 = 1 AES192 = 2 AES256 = 3 AES192C = 4 AES256C = 5
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/hostprototype.py
hostprototype.py
from zabbix_enums import _ZabbixEnum class ItemType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item Type of the item. """ ZABBIX_AGENT = 0 ZABBIX_TRAPPER = 2 SIMPLE_CHECK = 3 ZABBIX_INTERNAL = 5 ZABBIX_AGENT_ACTIVE = 7 WEB_ITEM = 9 EXTERNAL_CHECK = 10 DATABASE_MONITOR = 11 IPMI_AGENT = 12 SSH_AGENT = 13 TELNET_AGENT = 14 CALCULATED = 15 JMX_AGENT = 16 SNMP_TRAP = 17 DEPENDENT_ITEM = 18 HTTP_AGENT = 19 SNMP_AGENT = 20 SCRIPT = 21 class ItemValueType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item Type of information of the item. """ NUMERIC_FLOAT = 0 CHARACTER = 1 LOG = 2 NUMERIC_UNSIGNED = 3 TEXT = 4 class ItemAllowTraps(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item HTTP agent item field. Allow to populate value as in trapper item type also. """ NO = 0 YES = 1 class ItemAuthTypeSSH(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item Used only by SSH agent items or HTTP agent items. SSH agent authentication method possible values. """ PASSWORD = 0 PUBLIC_KEY = 1 class ItemAuthTypeHTTP(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item Used only by SSH agent items or HTTP agent items. HTTP agent authentication method possible values. """ NONE = 0 BASIC = 1 NTLM = 2 KERBEROS = 3 class ItemFlag(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item [Readonly] Origin of the item. """ PLAIN = 0 DISCOVERED = 4 class ItemFollowRedirects(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item HTTP agent item field. Follow response redirects while pooling data. """ NO = 0 YES = 1 class ItemOutputFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item HTTP agent item field. Should response be converted to JSON. """ RAW = 0 JSON = 1 class ItemPostType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item HTTP agent item field. Type of post data body stored in posts property. """ RAW = 0 JSON = 2 XML = 3 class ItemRequestMethod(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item HTTP agent item field. Type of request method. """ GET = 0 POST = 1 PUT = 2 HEAD = 3 class ItemRetrieveMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item HTTP agent item field. What part of response should be stored. """ BODY = 0 HEADERS = 1 BODY_AND_HEADERS = 2 BOTH = 2 class ItemState(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item [Readonly] State of the item. """ NORMAL = 0 NOT_SUPPORTED = 1 class ItemStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item Status of the item. """ ENABLED = 0 DISABLED = 1 class ItemVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item HTTP agent item field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. """ NO = 0 YES = 1 class ItemVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item HTTP agent item field. Validate is host certificate authentic. """ NO = 0 YES = 1 class ItemPreprocessingType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item-preprocessing The preprocessing option type. """ CUSTOM_MULTIPLIER = 1 RIGHT_TRIM = 2 LEFT_TRIM = 3 TRIM = 4 REGULAR_EXPRESSION = 5 BOOLEAN_TO_DECIMAL = 6 OCTAL_TO_DECIMAL = 7 HEXADECIMAL_TO_DECIMAL = 8 SIMPLE_CHANGE = 9 CHANGE_PER_SECOND = 10 XML_XPATH = 11 JSONPATH = 12 IN_RANGE = 13 MATCHES_REGULAR_EXPRESSION = 14 DOES_NOT_MATCH_REGULAR_EXPRESSION = 15 CHECK_FOR_ERROR_IN_JSON = 16 CHECK_FOR_ERROR_IN_XML = 17 CHECK_FOR_ERROR_USING_REGULAR_EXPRESSION = 18 DISCARD_UNCHANGED = 19 DISCARD_UNCHANGED_WITH_HEARTBEAT = 20 JAVASCRIPT = 21 PROMETHEUS_PATTERN = 22 PROMETHEUS_TO_JSON = 23 CSV_TO_JSON = 24 REPLACE = 25 CHECK_UNSUPPORTED = 26 XML_TO_JSON = 27 class ItemPreprocessingErrorHandler(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/item/object#item-preprocessing Action type used in case of preprocessing step failure. """ ERROR_MESSAGE = 0 DISCARD_VALUE = 1 CUSTOM_VALUE = 2 CUSTOM_ERROR_MESSAGE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/item.py
item.py
from zabbix_enums import _ZabbixEnum class RoleType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/role/object#role User type. """ USER = 1 ADMIN = 2 SUPERADMIN = 3 class RoleReadOnly(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/role/object#role [Readonly] Whether the role is readonly. """ NO = 0 YES = 1 class RoleRulesUIDefaultAccess(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/role/object#role-rules Whether access to new UI elements is enabled. """ DISABLED = 0 ENABLED = 1 class RoleRulesModulesDefaultAccess(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/role/object#role-rules Whether access to new modules is enabled. """ DISABLED = 0 ENABLED = 1 class RoleRulesAPIAccess(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/role/object#role-rules Whether access to API is enabled. """ DISABLED = 0 ENABLED = 1 class RoleRulesAPIMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/role/object#role-rules Mode for treating API methods listed in the api property. """ DENY_LIST = 0 ALLOW_LIST = 1 class RoleRulesActionsDefaultAccess(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/role/object#role-rules Whether access to new actions is enabled. """ DISABLED = 0 ENABLED = 1 class UIElementStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/role/object#ui-element Whether access to the UI element is enabled. """ DISABLED = 0 ENABLED = 1 class ModuleStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/role/object#module Whether access to the module is enabled. """ DISABLED = 0 ENABLED = 1 class ActionStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/role/object#action Whether access to perform the action is enabled. """ DISABLED = 0 ENABLED = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/role.py
role.py
from zabbix_enums import _ZabbixEnum class MediaTypeType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/mediatype/object#media-type Transport used by the media type. """ EMAIL = 0 SCRIPT = 1 SMS = 2 WEBHOOK = 4 class MediaTypeSMTPSecurity(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/mediatype/object#media-type SMTP connection security level to use. """ NONE = 0 STARTTLS = 1 SSL_TLS = 2 class MediaTypeSMTPSVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/mediatype/object#media-type SSL verify host for SMTP. """ NO = 0 YES = 1 class MediaTypeSMTPSVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/mediatype/object#media-type SSL verify peer for SMTP. """ NO = 0 YES = 1 class MediaTypeSMTPAuthentication(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/mediatype/object#media-type SMTP authentication method to use. """ NONE = 0 PASSWORD = 1 class MediaTypeStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/mediatype/object#media-type Whether the media type is enabled. """ ENABLED = 0 DISABLED = 1 class MediaTypeContentType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/mediatype/object#media-type Message format. """ PLAIN_TEXT = 0 HTML = 1 class MediaTypeProcessTags(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/mediatype/object#media-type Defines should the webhook script response to be interpreted as tags and these tags should be added to associated event. """ NO = 0 YES = 1 class MediaTypeShowEventMenu(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/mediatype/object#media-type Show media type entry in problem.get and event.get property urls. """ NO = 0 YES = 1 class MessageTemplateEventSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/mediatype/object#message-template Event source. """ TRIGGER = 0 DISCOVERY = 1 AUTOREGISTRATION = 2 INTERNAL = 3 SERVICES = 4 class MessageTemplateRecovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/mediatype/object#message-template Operation mode. """ OPERATIONS = 0 RECOVERY = 1 RECOVERY_OPERATIONS = 1 UPDATE = 2 UPDATE_OPERATIONS = 2
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/mediatype.py
mediatype.py
from zabbix_enums import _ZabbixEnum class AuthenticationType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication Default authentication. """ INTERNAL = 0 LDAP = 1 class AuthenticationHTTPAuthEnabled(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication Enable HTTP authentication. """ DISABLED = 0 ENABLED = 1 class AuthenticationHTTPLoginForm(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication Default login form. """ ZABBIX_FORM = 0 HTTP_FORM = 1 class AuthenticationHTTPCaseSensitive(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication HTTP case sensitive login. """ OFF = 0 ON = 1 NO = 0 YES = 1 class AuthenticationLDAPConfigured(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication Enable LDAP authentication """ DISABLED = 0 ENABLED = 1 class AuthenticationLDAPCaseSensitive(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication LDAP case sensitive login. """ OFF = 0 ON = 1 NO = 0 YES = 1 class AuthenticationSAMLAuthEnabled(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication Enable SAML authentication """ DISABLED = 0 ENABLED = 1 class AuthenticationSAMLSignMessages(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication SAML sign messages. """ NO = 0 YES = 1 class AuthenticationSAMLSignAssertions(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication SAML sign assertions. """ NO = 0 YES = 1 class AuthenticationSAMLSignAuthnrequests(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication SAML sign AuthN requests. """ NO = 0 YES = 1 class AuthenticationSAMLSignLogoutRequests(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication SAML sign logout requests. """ NO = 0 YES = 1 class AuthenticationSAMLSignLogoutResponses(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication SAML sign logout responses. """ NO = 0 YES = 1 class AuthenticationSAMLEncryptNameId(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication SAML encrypt name ID. """ NO = 0 YES = 1 class AuthenticationSAMLEncryptAssertions(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication SAML encrypt assertions. """ NO = 0 YES = 1 class AuthenticationSAMLCaseSensitive(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/authentication/object#authentication SAML case sensitive login. """ OFF = 0 ON = 1 NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/authentication.py
authentication.py
from zabbix_enums import _ZabbixEnum class TriggerFlag(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/trigger/object#trigger [Readonly] Origin of the trigger. """ PLAIN = 0 DISCOVERED = 4 class TriggerPriority(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/trigger/object#trigger Severity of the trigger. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class TriggerState(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/trigger/object#trigger [Readonly] State of the trigger. """ NORMAL = 0 UNKNOWN = 1 class TriggerStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/trigger/object#trigger Whether the trigger is enabled or disabled. """ ENABLED = 0 DISABLED = 1 class TriggerType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/trigger/object#trigger Whether the trigger can generate multiple problem events. """ GENERATE_SINGLE_EVENT = 0 DO_NOT_GENERATE_MULTIPLE_EVENTS = 0 GENERATE_MULTIPLE_EVENTS = 1 class TriggerValue(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/trigger/object#trigger [Readonly] Whether the trigger is in OK or problem state. """ OK = 0 PROBLEM = 1 class TriggerRecoveryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/trigger/object#trigger OK event generation mode. """ EXPRESSION = 0 RECOVERY_EXPRESSION = 1 NONE = 2 class TriggerCorrelationMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/trigger/object#trigger OK event closes. """ ALL_PROBLEMS = 0 TAG_VALUES_MATCH = 1 class TriggerManualClose(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/trigger/object#trigger Allow manual close. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/trigger.py
trigger.py
from zabbix_enums import _ZabbixEnum class DiscoveryCheckSNMPv3AuthProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dcheck/object#discovery-check Authentication protocol used for SNMPv3 agent checks with security level set to authNoPriv or authPriv. """ MD5 = 0 SHA = 1 SHA1 = 1 SHA224 = 2 SHA256 = 3 SHA384 = 4 SHA512 = 5 class DiscoveryCheckSNMPv3PrivProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dcheck/object#discovery-check Privacy protocol used for SNMPv3 agent checks with security level set to authPriv. """ DES = 0 AES = 1 AES128 = 1 AES192 = 2 AES256 = 3 AES192C = 4 AES256C = 5 class DiscoveryCheckSNMPv3SecurityLevel(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dcheck/object#discovery-check Security level used for SNMPv3 agent checks. """ NOAUTHNOPRIV = 0 AUTHNOPRIV = 1 AUTHPRIV = 2 class DiscoveryCheckType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dcheck/object#discovery-check Type of check. """ SSH = 0 LDAP = 1 SMTP = 2 FTP = 3 HTTP = 4 POP = 5 NNTP = 6 IMAP = 7 TCP = 8 ZABBIX_AGENT = 9 SNMPV1 = 10 SNMPV2 = 11 ICMP = 12 SNMPV3 = 13 HTTPS = 14 TELNET = 15 class DiscoveryCheckUniq(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dcheck/object#discovery-check Whether to use this check as a device uniqueness criteria. Only a single unique check can be configured for a discovery rule. Used for Zabbix agent, SNMPv1, SNMPv2 and SNMPv3 agent checks. """ NO = 0 YES = 1 class DiscoveryCheckHostSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dcheck/object#discovery-check Source for host name. """ DNS = 1 IP = 2 CHECK_VALUE = 3 class DiscoveryCheckNameSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/dcheck/object#discovery-check Source for visible name. """ NOT_SCPECIFIED = 0 DNS = 1 IP = 2 CHECK_VALUE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/dcheck.py
dcheck.py
from zabbix_enums import _ZabbixEnum class HousekeepingHKEventsMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for events and alerts. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKServiceMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for services. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKAuditMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for audit. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKSessionsMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for sessions. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKHistoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for history. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKHistoryGlobal(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/housekeeping/object#housekeeping Override item history period. """ NO = 0 YES = 1 class HousekeepingHKTrendsMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for trends. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKTrendsGlobal(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/housekeeping/object#housekeeping Override item trends period. """ NO = 0 YES = 1 class HousekeepingCompressionStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/housekeeping/object#housekeeping Enable TimescaleDB compression for history and trends. """ OFF = 0 ON = 1 class HousekeepingCompressionAvailability(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/housekeeping/object#housekeeping [Readonly] Compression availability. """ UNAVAILABLE = 0 AVAILABLE = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/housekeeping.py
housekeeping.py
from zabbix_enums import _ZabbixEnum class HostInterfaceAvailable(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostinterface/object#host-interface [Readonly] Availability of host interface. """ UNKNOWN = 0 AVAILABLE = 1 UNAVAILABLE = 2 class HostInterfaceMain(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostinterface/object#host-interface Whether the interface is used as default on the host. Only one interface of some type can be set as default on a host. """ NO = 0 YES = 1 class HostInterfaceType(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostinterface/object#host-interface Interface type. """ AGENT = 1 SNMP = 2 IPMI = 3 JMX = 4 class HostIntrefaceUseIP(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostinterface/object#host-interface Whether the connection should be made via IP. """ NO = 0 YES = 1 class DetailsTagVersion(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostinterface/object#details-tag SNMP interface version. """ SNMP1 = 1 SNMP2 = 2 SNMP3 = 3 class DetailsTagBulk(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostinterface/object#details-tag Whether to use bulk SNMP requests. """ NO = 0 YES = 1 class DetailsTagSecurityLevel(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostinterface/object#details-tag SNMPv3 security level. Used only by SNMPv3 interfaces. """ NOAUTHNOPRIV = 0 AUTHNOPRIV = 1 AUTHPRIV = 2 class DetailsTagAuthProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostinterface/object#details-tag SNMPv3 authentication protocol. Used only by SNMPv3 interfaces. """ MD5 = 0 SHA = 1 class DetailsTagPrivProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostinterface/object#details-tag SNMPv3 privacy protocol. Used only by SNMPv3 interfaces. """ DES = 0 AES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z60/hostinterface.py
hostinterface.py
from zabbix_enums import _ZabbixEnum class MapExpandMacro(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Whether to expand macros in labels when configuring the map. """ NO = 0 YES = 1 class MapExpandProblem(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Whether the problem trigger will be displayed for elements with a single problem. """ NO = 0 YES = 1 class MapGridAlign(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Whether to enable grid aligning. """ NO = 0 YES = 1 class MapGridShow(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Whether to show the grid on the map. """ NO = 0 YES = 1 class MapHighlight(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Whether icon highlighting is enabled. """ NO = 0 YES = 1 class MapLabelFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Whether to enable advanced labels. """ DISABLE_ADVANCED_LABELS = 0 ENABLE_ADVANCED_LABELS = 1 class MapLabelLocation(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Location of the map element label. """ BOTTOM = 0 LEFT = 1 RIGHT = 2 TOP = 3 class MapLabelType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Map element label type. """ LABEL = 0 IP_ADDRESS = 1 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 class MapLabelTypeHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Label type for host elements. """ LABEL = 0 IP_ADDRESS = 1 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapLabelTypeHostGroup(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Label type for host group elements. """ LABEL = 0 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapLabelTypeImage(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Label type for host group elements. """ LABEL = 0 ELEMENT_NAME = 2 NOTHING = 4 CUSTOM = 5 class MapLabelTypeMap(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Label type for map elements. """ LABEL = 0 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapLabelTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Label type for trigger elements. """ LABEL = 0 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapMarkElements(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Whether to highlight map elements that have recently changed their status. """ NO = 0 YES = 1 class MapShowUnack(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map How problems should be displayed. """ COUNT_ALL_PROBLEMS = 0 COUNT_UNACK_PROBLEMS = 1 COUNT_ALL_PROBLEMS_SEPARATELY = 2 class MapPrivate(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Type of map sharing. """ NO = 0 YES = 1 class MapShowSuppressed(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/map/object#map Whether suppressed problems are shown. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/map.py
map.py
from zabbix_enums import _ZabbixEnum class EventSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/event/object#event Type of the event. """ TRIGGER = 0 DISCOVERY = 1 AUTOREGISTRATION = 2 INTERNAL = 3 class EventObjectTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/event/object#event Type of object that is related to the event. Possible values for trigger events. """ TRIGGER = 0 class EventObjectDiscovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/event/object#event Type of object that is related to the event. Possible values for discovery events. """ HOST = 1 SERVICE = 2 class EventObjectAutoregistration(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/event/object#event Type of object that is related to the event. Possible values for autoregistration events. """ HOST = 3 class EventObjectInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/event/object#event Possible values for internal events. """ TRIGGER = 0 ITEM = 4 LLD = 5 class EventValueTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/event/object#event State of the related object. Possible values for trigger events. """ OK = 0 PROBLEM = 1 class EventValueDiscovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/event/object#event State of the related object. Possible values for discovery events. """ UP = 0 DOWN = 1 DISCOVERED = 2 LOST = 3 class EventValueInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/event/object#event State of the related object. Possible values for internal events. """ NORMAL = 0 UNKNOWN = 1 NOT_SUPPORTED = 1 class EventSeverity(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/event/object#event Event current severity. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class EventSuppressed(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/event/object#event Whether the event is suppressed. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/event.py
event.py
from zabbix_enums import _ZabbixEnum class HostFlag(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/host/object#host [Readonly] Origin of the host. """ PLAIN = 0 DISCOVERED = 4 class HostInventoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/host/object#host Host inventory population mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1 class HostIPMIAuthType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/host/object#host IPMI authentication algorithm. """ DEFAULT = -1 NONE = 0 MD2 = 1 MD = 2 STRAIGHT = 4 OEM = 5 RMCP = 6 class HostIPMIPrivilege(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/host/object#host IPMI privilege level. """ CALLBACK = 1 USER = 2 OPERATOR = 3 ADMIN = 4 OEM = 5 class HostMaintenanceStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/host/object#host [Readonly] Effective maintenance type. """ NO_MAINTENANCE = 0 IN_MAINTENANCE = 1 class HostMaintenanceType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/host/object#host [Readonly] Effective maintenance type. """ WITH_DATA_COLLECTION = 0 WITHOUT_DATA_COLLECTION = 1 class HostStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/host/object#host Status and function of the host. """ MONITORED = 0 UNMONITORED = 1 class HostTLSConnect(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/host/object#host Connections to host. """ NO_ENCRYPTION = 1 PSK = 2 CERTIFICATE = 4 class HostTLSAccept(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/host/object#host Connections from host. Possible bitmap values. """ NO_ENCRYPTION = 1 PSK = 2 CERTIFICATE = 4 class HostInventoryProperty(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/host/object#host-inventory Each property has it's own unique ID number, which is used to associate host inventory fields with items. """ ALIAS = 4 ASSET_TAG = 11 CHASSIS = 28 CONTACT = 23 CONTRACT_NUMBER = 32 DATE_HW_DECOMM = 47 DATE_HW_EXPIRY = 46 DATE_HW_INSTALL = 45 DATE_HW_PURCHASE = 44 DEPLOYMENT_STATUS = 34 HARDWARE = 14 HARDWARE_FULL = 15 HOST_NETMASK = 39 HOST_NETWORKS = 38 HOST_ROUTER = 40 HW_ARCH = 30 INSTALLER_NAME = 33 LOCATION = 24 LOCATION_LAT = 25 LOCATION_LON = 26 MACADDRESS_A = 12 MACADDRESS_B = 13 MODEL = 29 NAME = 3 NOTES = 27 OOB_IP = 41 OOB_NETMASK = 42 OOB_ROUTER = 43 OS = 5 OS_FULL = 6 OS_SHORT = 7 POC_1_CELL = 61 POC_1_EMAIL = 58 POC_1_NAME = 57 POC_1_NOTES = 63 POC_1_PHONE_A = 59 POC_1_PHONE_B = 60 POC_1_SCREEN = 62 POC_2_CELL = 68 POC_2_EMAIL = 65 POC_2_NAME = 64 POC_2_NOTES = 70 POC_2_PHONE_A = 66 POC_2_PHONE_B = 67 POC_2_SCREEN = 69 SERIALNO_A = 8 SERIALNO_B = 9 SITE_ADDRESS_A = 48 SITE_ADDRESS_B = 49 SITE_ADDRESS_C = 50 SITE_CITY = 51 SITE_COUNTRY = 53 SITE_NOTES = 56 SITE_RACK = 55 SITE_STATE = 52 SITE_ZIP = 54 SOFTWARE = 16 SOFTWARE_APP_A = 18 SOFTWARE_APP_B = 19 SOFTWARE_APP_C = 20 SOFTWARE_APP_D = 21 SOFTWARE_APP_E = 22 SOFTWARE_FULL = 17 TAG = 10 TYPE = 1 TYPE_FULL = 2 URL_A = 35 URL_B = 36 URL_C = 37 VENDOR = 31
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/host.py
host.py
from enum import Enum from unittest.mock import DEFAULT from zabbix_enums import _ZabbixEnum class DashboardPrivate(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dashboard/object#dashboard Type of dashboard sharing. """ NO = 0 YES = 1 PUBLIC = 0 PRIVATE = 1 class DashboardAutoStart(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dashboard/object#dashboard Auto start slideshow. """ NO = 0 YES = 1 DashboardStartSlideshow = DashboardAutoStart class DashboardWidgetType(str, Enum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dashboard/object#dashboard-widget Type of the dashboard widget. """ ACTION_LOG = "actionlog" CLOCK = "clock" DATA_OVERVIEW = "dataover" DISCOVERY_STATUS = "discovery" FAVORITE_GRAPHS = "favgraphs" FAVORITE_MAPS = "favmaps" GRAPH_CLASSIC = "graph" GRAPH_PROTOTYPE = "graphprototype" HOST_AVAILABILITY = "hostavail" MAP = "map" MAP_NAVIGATION_TREE = "navtree" PLAIN_TEXT = "plaintext" PROBLEM_HOSTS = "problemhosts" PROBLEMS = "problems" PROBLEMS_BY_SEVERITY = "problemsbysv" GRAPH = "svggraph" SYSTEM_INFORMATION = "systeminfo" TRIGGER_OVERVIEW = "trigover" URL = "url" WEB_MONITORING = "web" class DashboardWidgetViewMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dashboard/object#dashboard-widget The widget view mode. """ DEFAULT = 0 HIDDEN_HEADER = 1 class DashboardWidgetFieldType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dashboard/object#dashboard-widget-field Type of the widget field. """ INTEGER = 0 STRING = 1 HOST_GROUP = 2 HOST = 3 ITEM = 4 GRAPH = 6 MAP = 8 class DashboardUserGroupPermission(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dashboard/object#dashboard-user-group Type of permission level. """ READ_ONLY = 2 READ_WRITE = 3 class DashboardUserPermission(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dashboard/object#dashboard-user Type of permission level. """ READ_ONLY = 2 READ_WRITE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/dashboard.py
dashboard.py
from zabbix_enums import _ZabbixEnum class ItemPrototypeType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype Type of the item prototype. """ ZABBIX_AGENT = 0 ZABBIX_TRAPPER = 2 SIMPLE_CHECK = 3 ZABBIX_INTERNAL = 5 ZABBIX_AGENT_ACTIVE = 7 EXTERNAL_CHECK = 10 DATABASE_MONITOR = 11 IPMI_AGENT = 12 SSH_AGENT = 13 TELNET_AGENT = 14 CALCULATED = 15 JMX_AGENT = 16 SNMP_TRAP = 17 DEPENDENT_ITEM = 18 HTTP_AGENT = 19 SNMP_AGENT = 20 SCRIPT = 21 class ItemPrototypeValueType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype Type of information of the item prototype. """ NUMERIC_FLOAT = 0 CHARACTER = 1 LOG = 2 NUMERIC_UNSIGNED = 3 TEXT = 4 class ItemPrototypeAllowTraps(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Allow to populate value as in trapper item type also. """ NO = 0 YES = 1 class ItemPrototypeAuthTypeSSH(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype Used only by SSH agent item prototypes or HTTP agent item prototypes. SSH agent authentication method possible values. """ PASSWORD = 0 PUBLIC_KEY = 1 class ItemPrototypeAuthTypeHTTP(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype Used only by SSH agent item prototypes or HTTP agent item prototypes. HTTP agent authentication method possible values. """ NONE = 0 BASIC = 1 NTLM = 2 KERBEROS = 3 class ItemPrototypeFollowRedirects(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Follow response redirects while pooling data. """ NO = 0 YES = 1 class ItemPrototypeOutputFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Should response be converted to JSON. """ RAW = 0 JSON = 1 class ItemPrototypePostType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Type of post data body stored in posts property. """ RAW = 0 JSON = 2 XML = 3 class ItemPrototypeRequestMethod(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Type of request method. """ GET = 0 POST = 1 PUT = 2 HEAD = 3 class ItemPrototypeRetrieveMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. What part of response should be stored. """ BODY = 0 HEADERS = 1 BODY_AND_HEADERS = 2 BOTH = 2 class ItemPrototypeStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype Status of the item prototype. """ ENABLED = 0 DISABLED = 1 UNSUPPORTED = 3 class ItemPrototypeVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. """ NO = 0 YES = 1 class ItemPrototypeVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Validate is host certificate authentic. """ NO = 0 YES = 1 class ItemPrototypePrototypeDiscover(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype-prototype Item prototype discovery status. """ DISCOVER = 0 DONT_DISCOVER = 1 class ItemPrototypePreprocessingType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype-preprocessing The preprocessing option type. """ CUSTOM_MULTIPLIER = 1 RIGHT_TRIM = 2 LEFT_TRIM = 3 TRIM = 4 REGULAR_EXPRESSION = 5 BOOLEAN_TO_DECIMAL = 6 OCTAL_TO_DECIMAL = 7 HEXADECIMAL_TO_DECIMAL = 8 SIMPLE_CHANGE = 9 CHANGE_PER_SECOND = 10 XML_XPATH = 11 JSONPATH = 12 IN_RANGE = 13 MATCHES_REGULAR_EXPRESSION = 14 DOES_NOT_MATCH_REGULAR_EXPRESSION = 15 CHECK_FOR_ERROR_IN_JSON = 16 CHECK_FOR_ERROR_IN_XML = 17 CHECK_FOR_ERROR_USING_REGULAR_EXPRESSION = 18 DISCARD_UNCHANGED = 19 DISCARD_UNCHANGED_WITH_HEARTBEAT = 20 JAVASCRIPT = 21 PROMETHEUS_PATTERN = 22 PROMETHEUS_TO_JSON = 23 CSV_TO_JSON = 24 REPLACE = 25 CHECK_UNSUPPORTED = 26 XML_TO_JSON = 27 class ItemPrototypePreprocessingErrorHandler(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/itemprototype/object#item-prototype-preprocessing Action type used in case of preprocessing step failure. """ ERROR_MESSAGE = 0 DISCARD_VALUE = 1 CUSTOM_VALUE = 2 CUSTOM_ERROR_MESSAGE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/itemprototype.py
itemprototype.py
from zabbix_enums import _ZabbixEnum class LLDRuleType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule Type of the LLD rule. """ ZABBIX_AGENT = 0 ZABBIX_TRAPPER = 2 SIMPLE_CHECK = 3 ZABBIX_INTERNAL = 5 ZABBIX_AGENT_ACTIVE = 7 EXTERNAL_CHECK = 10 DATABASE_MONITOR = 11 IPMI_AGENT = 12 SSH_AGENT = 13 TELNET_AGENT = 14 CALCULATED = 15 JMX_AGENT = 16 DEPENDENT_ITEM = 18 HTTP_AGENT = 19 SNMP_AGENT = 20 SCRIPT = 21 class LLDRuleAllowTraps(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Allow to populate value as in trapper item type also. """ NO = 0 YES = 1 class LLDRuleAuthTypeSSH(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule Used only by SSH agent or HTTP agent LLD rules. SSH agent authentication method possible values. """ PASSWORD = 0 PUBLIC_KEY = 1 class LLDRuleAuthTypeHTTP(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule Used only by SSH agent or HTTP agent LLD rules. HTTP agent authentication method possible values. """ NONE = 0 BASIC = 1 NTLM = 2 class LLDRuleFollowRedirects(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Follow response redirects while pooling data. """ NO = 0 YES = 1 class LLDRuleOutputFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Should response be converted to JSON. """ RAW = 0 JSON = 1 class LLDRulePostType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Type of post data body stored in posts property. """ RAW = 0 JSON = 2 XML = 3 class LLDRuleRequestMethod(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Type of request method. """ GET = 0 POST = 1 PUT = 2 HEAD = 3 class LLDRuleRetrieveMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. What part of response should be stored. """ BODY = 0 HEADERS = 1 BODY_AND_HEADERS = 2 BOTH = 2 class LLDRuleState(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule [Readonly] State of the LLD rule. """ NORMAL = 0 NOT_SUPPORTED = 1 class LLDRuleStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule Status of the LLD rule. """ ENABLED = 0 DISABLED = 1 class LLDRuleVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. """ NO = 0 YES = 1 class LLDRuleVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Validate is host certificate authentic. """ NO = 0 YES = 1 class LLDRuleEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-filter Filter condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 CUSTOM = 3 class LLDRuleFilterConditionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-filter-condition Condition operator. """ MATCHES_REGEX = 8 DOES_NOT_MATCH_REGEX = 9 EXISTS = 12 DOES_NOT_EXIST = 13 class LLDRulePreprocessing(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-preprocessing The preprocessing option type. """ REGULAR_EXPRESSION = 5 XML_XPATH = 11 JSONPATH = 12 DOES_NOT_MATCH_REGULAR_EXPRESSION = 15 CHECK_FOR_ERROR_IN_JSON = 16 CHECK_FOR_ERROR_IN_XML = 17 DISCARD_UNCHANGED_WITH_HEARTBEAT = 20 PROMETHEUS_PATTERN = 22 PROMETHEUS_TO_JSON = 23 CSV_TO_JSON = 24 REPLACE = 25 XML_TO_JSON = 27 class LLDRulePreprocessingErrorHandler(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-preprocessing Action type used in case of preprocessing step failure. """ ERROR_MESSAGE = 0 DISCARD_VALUE = 1 CUSTOM_VALUE = 2 CUSTOM_ERROR_MESSAGE = 3 class LLDRuleOverridesStop(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-overrides Stop processing next overrides if matches. """ NO = 0 YES = 1 class LLDRuleOverrideFilterEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-override-filter Override filter condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 CUSTOM = 3 class LLDRuleOverrideFilterConditionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-override-filter-condition Condition operator. """ MATCHES_REGEX = 8 DOES_NOT_MATCH_REGEX = 9 EXISTS = 12 DOES_NOT_EXIST = 13 class LLDRuleOverrideOperationObject(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation Type of discovered object to perform the action. """ ITEM = 0 TRIGGER = 1 GRAPH = 2 HOST = 3 class LLDRuleOverrideOperationOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation Override condition operator. """ EQUALS = 0 DOES_NOT_EQUAL = 1 CONTAINS = 2 DOESN_NOT_CONTAIN = 3 MATCHES = 8 DOES_NOT_MATCH = 9 class LLDRuleOverrideOperationStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-status Override the status for selected object. """ CREATE_ENABLED = 0 CREATE_DISABLED = 1 class LLDRuleOverrideOperationDiscover(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-discover Override the discover status for selected object. """ YES = 0 NO = 1 class LLDRuleOverrideOperationSeverity(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-severity Override the severity of trigger prototype. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class LLDRuleOverrideOperationInventory(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-inventory Override the host prototype inventory mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/discoveryrule.py
discoveryrule.py
from zabbix_enums import _ZabbixEnum class SettingsServerCheckInterval(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/settings/object#settings Show warning if Zabbix server is down. """ DONT_SHOW_WARNING = 0 SHOW_WARNING = 10 class SettingsShowTechnicalErrors(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/settings/object#settings Show technical errors (PHP/SQL) to non-Super admin users and to users that are not part of user groups with debug mode enabled. """ NO = 0 YES = 1 class SettingsCustomColor(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/settings/object#settings Use custom event status colors. """ NO = 0 YES = 1 class SettingsProblemUnackStyle(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/settings/object#settings Blinking for unacknowledged PROBLEM events. """ DONT_BLINK = 0 BLINK = 1 class SettingsProblemAckStyle(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/settings/object#settings Blinking for acknowledged PROBLEM events. """ DONT_BLINK = 0 BLINK = 1 class SettingsOKUnackStyle(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/settings/object#settings Blinking for unacknowledged RESOLVED events. """ DONT_BLINK = 0 BLINK = 1 class SettingsOKAckStyle(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/settings/object#settings Blinking for acknowledged RESOLVED events. """ DONT_BLINK = 0 BLINK = 1 class SettingsDefaultInventoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/settings/object#settings Default host inventory mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1 class SettingsSnmptrapLogging(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/settings/object#settings Log unmatched SNMP traps. """ NO = 0 YES = 1 class SettingsValidateUriSchemes(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/settings/object#settings Validate URI schemes. """ NO = 0 YES = 1 class SettingsIframeSandboxingEnabled(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/settings/object#settings Use iframe sandboxing. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/settings.py
settings.py
from zabbix_enums import _ZabbixEnum class ActionStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action Whether the action is enabled or disabled. """ ENABLED = 0 DISABLED = 1 class ActionPauseSupressed(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action Whether to pause escalation during maintenance periods or not. """ NO = 0 YES = 1 class ActionOperationType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-operation Type of operation. """ SEND_MESSAGE = 0 GLOBAL_SCRIPT = 1 ADD_HOST = 2 REMOVE_HOST = 3 ADD_TO_HOST_GROUP = 4 REMOVE_FROM_HOST_GROUP = 5 LINK_TO_TEMPLATE = 6 UNLINK_FROM_TEMPLATE = 7 ENABLE_HOST = 8 DISABLE_HOST = 9 SET_HOST_INVENTORY_MODE = 10 class ActionOperationEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-operation Operation condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 class ActionOperationMessageDefault(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-operation-message Whether to use the default action message text and subject. """ NO = 0 YES = 1 class ActionOperationConditionType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-operation-condition Type of condition. """ EVENT_ACKNOWLEDGED = 14 class ActionOperationConditionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-operation-condition Condition operator. """ EQUALS = 0 class ActionOperationConditionEventAcknowledged(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-operation-condition Whether the event is acknowledged. """ NO = 0 YES = 1 class ActionRecoveryOperationTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-recovery-operation Type of operation. Possible values for trigger actions. """ SEND_MESSAGE = 0 GLOBAL_SCRIPT = 1 NOTIFY_ALL_INVOLVED = 11 class ActionRecoveryOperationTypeInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-recovery-operation Type of operation. Possible values for internal actions. """ SEND_MESSAGE = 0 NOTIFY_ALL_INVOLVED = 11 class ActionUpdateOperationTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-update-operation Type of operation. Possible values for trigger actions. """ SEND_MESSAGE = 0 GLOBAL_SCRIPT = 1 NOTIFY_ALL_INVOLVED = 12 class ActionFilterEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-filter Filter condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 CUSTOM = 3 class ActionFilterCondidtionTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for trigger actions. """ HOST_GROUP = 0 HOST = 1 TRIGGER = 2 TRIGGER_NAME = 3 TRIGGER_SEVERITY = 4 TIME_PERIOD = 6 HOST_TEMPLATE = 13 PROBLEM_IS_SUPPRESSED = 16 EVENT_TAG = 25 EVENT_TAG_VALUE = 26 class ActionFilterCondidtionTypeDiscovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for discovery actions. """ HOST_IP = 7 DISCOVERED_SERVICE_TYPE = 8 DISCOVERED_SERVICE_PORT = 9 DISCOVERY_STATUS = 10 UPTIME_OR_DOWNTIME_DURATION = 11 RECEIVED_VALUE = 12 DISCOVERY_RULE = 18 DISCOVERY_CHECK = 19 PROXY = 20 DISCOVERY_OBJECT = 21 class ActionFilterCondidtionTypeAutoregistration(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for autoregistration actions. """ PROXY = 20 HOST_NAME = 22 HOST_METADATA = 24 class ActionFilterCondidtionTypeInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for internal actions. """ HOST_GROUP = 0 HOST = 1 HOST_TEMPLATE = 13 EVENT_TYPE = 23 EVENT_TAG = 25 EVENT_TAG_VALUE = 26 class ActionFilterCondidtionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/action/object#action-filter-condition Condition operator. """ EQUALS = 0 DOES_NOT_EQUAL = 1 CONTAINS = 2 DOES_NOT_CONTAIN = 3 IN = 4 GREATER_OR_EQUAL = 5 LESS_OR_EQUAL = 6 NOT_IN = 7 MATCHES = 8 DOES_NOT_MATCH = 9 YES = 10 NO = 11
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/action.py
action.py
from zabbix_enums import _ZabbixEnum class HostPrototypeStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostprototype/object#host-prototype Status of the host prototype. """ MONITORED = 0 UNMONITORED = 1 class HostPrototypeInventoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostprototype/object#host-prototype Host inventory population mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1 class HostPrototypeDiscover(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostprototype/object#host-prototype Host prototype discovery status. """ DISCOVER = 0 DONT_DISCOVER = 1 class HostPrototypeCustomInterfaces(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostprototype/object#host-prototype Source of interfaces for hosts created by the host prototype. """ PARENT_HOST = 0 CUSTOM_INTERFACE = 1 class CustomInterfaceMain(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostprototype/object#custom-interface Whether the interface is used as default on the host. Only one interface of some type can be set as default on a host. """ class CustomInterfaceType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostprototype/object#custom-interface Interface type. """ AGENT = 1 SNMP = 2 IPMI = 3 JMX = 4 class CustomInterfaceUseIp(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostprototype/object#custom-interface Whether the connection should be made via IP. """ NO = 0 YES = 1 class CustomInterfaceDetailsVersion(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostprototype/object#custom-interface-details SNMP interface version. """ SNMP1 = 1 SNMP2 = 2 SNMP3 = 3 class CustomInterfaceDetailsBulk(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostprototype/object#custom-interface-details Whether to use bulk SNMP requests. """ NO = 0 YES = 1 class CustomInterfaceDetailsSecurityLevel(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostprototype/object#custom-interface-details SNMPv3 security level. Used only by SNMPv3 interfaces. """ NOAUTHNOPRIV = 0 AUTHNOPRIV = 1 AUTHPRIV = 2 class CustomInterfaceDetailsAuthProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostprototype/object#custom-interface-details SNMPv3 authentication protocol. Used only by SNMPv3 interfaces. """ MD5 = 0 SHA = 1 SHA1 = 1 SHA224 = 2 SHA256 = 3 SHA384 = 4 SHA512 = 5 class CustomInterfaceDetailsPrivProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostprototype/object#custom-interface-details SNMPv3 privacy protocol. Used only by SNMPv3 interfaces. """ DES = 0 AES = 1 AES128 = 1 AES192 = 2 AES256 = 3 AES192C = 4 AES256C = 5
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/hostprototype.py
hostprototype.py
from zabbix_enums import _ZabbixEnum class ItemType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item Type of the item. """ ZABBIX_AGENT = 0 ZABBIX_TRAPPER = 2 SIMPLE_CHECK = 3 ZABBIX_INTERNAL = 5 ZABBIX_AGENT_ACTIVE = 7 WEB_ITEM = 9 EXTERNAL_CHECK = 10 DATABASE_MONITOR = 11 IPMI_AGENT = 12 SSH_AGENT = 13 TELNET_AGENT = 14 CALCULATED = 15 JMX_AGENT = 16 SNMP_TRAP = 17 DEPENDENT_ITEM = 18 HTTP_AGENT = 19 SNMP_AGENT = 20 SCRIPT = 21 class ItemValueType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item Type of information of the item. """ NUMERIC_FLOAT = 0 CHARACTER = 1 LOG = 2 NUMERIC_UNSIGNED = 3 TEXT = 4 class ItemAllowTraps(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item HTTP agent item field. Allow to populate value as in trapper item type also. """ NO = 0 YES = 1 class ItemAuthTypeSSH(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item Used only by SSH agent items or HTTP agent items. SSH agent authentication method possible values. """ PASSWORD = 0 PUBLIC_KEY = 1 class ItemAuthTypeHTTP(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item Used only by SSH agent items or HTTP agent items. HTTP agent authentication method possible values. """ NONE = 0 BASIC = 1 NTLM = 2 KERBEROS = 3 class ItemFlag(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item [Readonly] Origin of the item. """ PLAIN = 0 DISCOVERED = 4 class ItemFollowRedirects(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item HTTP agent item field. Follow response redirects while pooling data. """ NO = 0 YES = 1 class ItemOutputFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item HTTP agent item field. Should response be converted to JSON. """ RAW = 0 JSON = 1 class ItemPostType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item HTTP agent item field. Type of post data body stored in posts property. """ RAW = 0 JSON = 2 XML = 3 class ItemRequestMethod(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item HTTP agent item field. Type of request method. """ GET = 0 POST = 1 PUT = 2 HEAD = 3 class ItemRetrieveMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item HTTP agent item field. What part of response should be stored. """ BODY = 0 HEADERS = 1 BODY_AND_HEADERS = 2 BOTH = 2 class ItemState(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item [Readonly] State of the item. """ NORMAL = 0 NOT_SUPPORTED = 1 class ItemStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item Status of the item. """ ENABLED = 0 DISABLED = 1 class ItemVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item HTTP agent item field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. """ NO = 0 YES = 1 class ItemVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item HTTP agent item field. Validate is host certificate authentic. """ NO = 0 YES = 1 class ItemPreprocessingType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item-preprocessing The preprocessing option type. """ CUSTOM_MULTIPLIER = 1 RIGHT_TRIM = 2 LEFT_TRIM = 3 TRIM = 4 REGULAR_EXPRESSION = 5 BOOLEAN_TO_DECIMAL = 6 OCTAL_TO_DECIMAL = 7 HEXADECIMAL_TO_DECIMAL = 8 SIMPLE_CHANGE = 9 CHANGE_PER_SECOND = 10 XML_XPATH = 11 JSONPATH = 12 IN_RANGE = 13 MATCHES_REGULAR_EXPRESSION = 14 DOES_NOT_MATCH_REGULAR_EXPRESSION = 15 CHECK_FOR_ERROR_IN_JSON = 16 CHECK_FOR_ERROR_IN_XML = 17 CHECK_FOR_ERROR_USING_REGULAR_EXPRESSION = 18 DISCARD_UNCHANGED = 19 DISCARD_UNCHANGED_WITH_HEARTBEAT = 20 JAVASCRIPT = 21 PROMETHEUS_PATTERN = 22 PROMETHEUS_TO_JSON = 23 CSV_TO_JSON = 24 REPLACE = 25 CHECK_UNSUPPORTED = 26 XML_TO_JSON = 27 class ItemPreprocessingErrorHandler(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/item/object#item-preprocessing Action type used in case of preprocessing step failure. """ ERROR_MESSAGE = 0 DISCARD_VALUE = 1 CUSTOM_VALUE = 2 CUSTOM_ERROR_MESSAGE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/item.py
item.py
from zabbix_enums import _ZabbixEnum class RoleType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/role/object#role User type. """ USER = 1 ADMIN = 2 SUPERADMIN = 3 class RoleReadOnly(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/role/object#role [Readonly] Whether the role is readonly. """ NO = 0 YES = 1 class RoleRulesUIDefaultAccess(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/role/object#role-rules Whether access to new UI elements is enabled. """ DISABLED = 0 ENABLED = 1 class RoleRulesModulesDefaultAccess(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/role/object#role-rules Whether access to new modules is enabled. """ DISABLED = 0 ENABLED = 1 class RoleRulesAPIAccess(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/role/object#role-rules Whether access to API is enabled. """ DISABLED = 0 ENABLED = 1 class RoleRulesAPIMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/role/object#role-rules Mode for treating API methods listed in the api property. """ DENY_LIST = 0 ALLOW_LIST = 1 class RoleRulesActionsDefaultAccess(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/role/object#role-rules Whether access to new actions is enabled. """ DISABLED = 0 ENABLED = 1 class UIElementStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/role/object#ui-element Whether access to the UI element is enabled. """ DISABLED = 0 ENABLED = 1 class ModuleStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/role/object#module Whether access to the module is enabled. """ DISABLED = 0 ENABLED = 1 class ActionStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/role/object#action Whether access to perform the action is enabled. """ DISABLED = 0 ENABLED = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/role.py
role.py
from zabbix_enums import _ZabbixEnum class MediaTypeType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/mediatype/object#media-type Transport used by the media type. """ EMAIL = 0 SCRIPT = 1 SMS = 2 WEBHOOK = 4 class MediaTypeSMTPSecurity(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/mediatype/object#media-type SMTP connection security level to use. """ NONE = 0 STARTTLS = 1 SSL_TLS = 2 class MediaTypeSMTPSVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/mediatype/object#media-type SSL verify host for SMTP. """ NO = 0 YES = 1 class MediaTypeSMTPSVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/mediatype/object#media-type SSL verify peer for SMTP. """ NO = 0 YES = 1 class MediaTypeSMTPAuthentication(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/mediatype/object#media-type SMTP authentication method to use. """ NONE = 0 PASSWORD = 1 class MediaTypeStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/mediatype/object#media-type Whether the media type is enabled. """ ENABLED = 0 DISABLED = 1 class MediaTypeContentType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/mediatype/object#media-type Message format. """ PLAIN_TEXT = 0 HTML = 1 class MediaTypeProcessTags(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/mediatype/object#media-type Defines should the webhook script response to be interpreted as tags and these tags should be added to associated event. """ NO = 0 YES = 1 class MediaTypeShowEventMenu(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/mediatype/object#media-type Show media type entry in problem.get and event.get property urls. """ NO = 0 YES = 1 class MessageTemplateEventSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/mediatype/object#message-template Event source. """ TRIGGER = 0 DISCOVERY = 1 AUTOREGISTRATION = 2 INTERNAL = 3 class MessageTemplateRecovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/mediatype/object#message-template Operation mode. """ OPERATIONS = 0 RECOVERY = 1 RECOVERY_OPERATIONS = 1 UPDATE = 2 UPDATE_OPERATIONS = 2
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/mediatype.py
mediatype.py
from zabbix_enums import _ZabbixEnum class AuthenticationType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication Default authentication. """ INTERNAL = 0 LDAP = 1 class AuthenticationHTTPAuthEnabled(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication Enable HTTP authentication. """ DISABLED = 0 ENABLED = 1 class AuthenticationHTTPLoginForm(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication Default login form. """ ZABBIX_FORM = 0 HTTP_FORM = 1 class AuthenticationHTTPCaseSensitive(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication HTTP case sensitive login. """ OFF = 0 ON = 1 NO = 0 YES = 1 class AuthenticationLDAPConfigured(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication Enable LDAP authentication """ DISABLED = 0 ENABLED = 1 class AuthenticationLDAPCaseSensitive(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication LDAP case sensitive login. """ OFF = 0 ON = 1 NO = 0 YES = 1 class AuthenticationSAMLAuthEnabled(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication Enable SAML authentication """ DISABLED = 0 ENABLED = 1 class AuthenticationSAMLSignMessages(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication SAML sign messages. """ NO = 0 YES = 1 class AuthenticationSAMLSignAssertions(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication SAML sign assertions. """ NO = 0 YES = 1 class AuthenticationSAMLSignAuthnrequests(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication SAML sign AuthN requests. """ NO = 0 YES = 1 class AuthenticationSAMLSignLogoutRequests(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication SAML sign logout requests. """ NO = 0 YES = 1 class AuthenticationSAMLSignLogoutResponses(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication SAML sign logout responses. """ NO = 0 YES = 1 class AuthenticationSAMLEncryptNameId(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication SAML encrypt name ID. """ NO = 0 YES = 1 class AuthenticationSAMLEncryptAssertions(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication SAML encrypt assertions. """ NO = 0 YES = 1 class AuthenticationSAMLCaseSensitive(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/authentication/object#authentication SAML case sensitive login. """ OFF = 0 ON = 1 NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/authentication.py
authentication.py
from zabbix_enums import _ZabbixEnum class TriggerFlag(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/trigger/object#trigger [Readonly] Origin of the trigger. """ PLAIN = 0 DISCOVERED = 4 class TriggerPriority(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/trigger/object#trigger Severity of the trigger. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class TriggerState(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/trigger/object#trigger [Readonly] State of the trigger. """ NORMAL = 0 UNKNOWN = 1 class TriggerStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/trigger/object#trigger Whether the trigger is enabled or disabled. """ ENABLED = 0 DISABLED = 1 class TriggerType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/trigger/object#trigger Whether the trigger can generate multiple problem events. """ GENERATE_SINGLE_EVENT = 0 DO_NOT_GENERATE_MULTIPLE_EVENTS = 0 GENERATE_MULTIPLE_EVENTS = 1 class TriggerValue(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/trigger/object#trigger [Readonly] Whether the trigger is in OK or problem state. """ OK = 0 PROBLEM = 1 class TriggerRecoveryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/trigger/object#trigger OK event generation mode. """ EXPRESSION = 0 RECOVERY_EXPRESSION = 1 NONE = 2 class TriggerCorrelationMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/trigger/object#trigger OK event closes. """ ALL_PROBLEMS = 0 TAG_VALUES_MATCH = 1 class TriggerManualClose(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/trigger/object#trigger Allow manual close. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/trigger.py
trigger.py
from zabbix_enums import _ZabbixEnum class DiscoveryCheckSNMPv3AuthProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dcheck/object#discovery-check Authentication protocol used for SNMPv3 agent checks with security level set to authNoPriv or authPriv. """ MD5 = 0 SHA = 1 SHA1 = 1 SHA224 = 2 SHA256 = 3 SHA384 = 4 SHA512 = 5 class DiscoveryCheckSNMPv3PrivProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dcheck/object#discovery-check Privacy protocol used for SNMPv3 agent checks with security level set to authPriv. """ DES = 0 AES = 1 AES128 = 1 AES192 = 2 AES256 = 3 AES192C = 4 AES256C = 5 class DiscoveryCheckSNMPv3SecurityLevel(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dcheck/object#discovery-check Security level used for SNMPv3 agent checks. """ NOAUTHNOPRIV = 0 AUTHNOPRIV = 1 AUTHPRIV = 2 class DiscoveryCheckType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dcheck/object#discovery-check Type of check. """ SSH = 0 LDAP = 1 SMTP = 2 FTP = 3 HTTP = 4 POP = 5 NNTP = 6 IMAP = 7 TCP = 8 ZABBIX_AGENT = 9 SNMPV1 = 10 SNMPV2 = 11 ICMP = 12 SNMPV3 = 13 HTTPS = 14 TELNET = 15 class DiscoveryCheckUniq(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dcheck/object#discovery-check Whether to use this check as a device uniqueness criteria. Only a single unique check can be configured for a discovery rule. Used for Zabbix agent, SNMPv1, SNMPv2 and SNMPv3 agent checks. """ NO = 0 YES = 1 class DiscoveryCheckHostSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dcheck/object#discovery-check Source for host name. """ DNS = 1 IP = 2 CHECK_VALUE = 3 class DiscoveryCheckNameSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/dcheck/object#discovery-check Source for visible name. """ NOT_SCPECIFIED = 0 DNS = 1 IP = 2 CHECK_VALUE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/dcheck.py
dcheck.py
from zabbix_enums import _ZabbixEnum class HousekeepingHKEventsMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for events and alerts. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKServiceMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for services. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKAuditMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for audit. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKSessionsMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for sessions. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKHistoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for history. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKHistoryGlobal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/housekeeping/object#housekeeping Override item history period. """ NO = 0 YES = 1 class HousekeepingHKTrendsMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for trends. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKTrendsGlobal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/housekeeping/object#housekeeping Override item trends period. """ NO = 0 YES = 1 class HousekeepingCompressionStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/housekeeping/object#housekeeping Enable TimescaleDB compression for history and trends. """ OFF = 0 ON = 1 class HousekeepingCompressionAvailability(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/housekeeping/object#housekeeping [Readonly] Compression availability. """ UNAVAILABLE = 0 AVAILABLE = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/housekeeping.py
housekeeping.py
from zabbix_enums import _ZabbixEnum class HostInterfaceAvailable(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostinterface/object#host-interface [Readonly] Availability of host interface. """ UNKNOWN = 0 AVAILABLE = 1 UNAVAILABLE = 2 class HostInterfaceMain(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostinterface/object#host-interface Whether the interface is used as default on the host. Only one interface of some type can be set as default on a host. """ NO = 0 YES = 1 class HostInterfaceType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostinterface/object#host-interface Interface type. """ AGENT = 1 SNMP = 2 IPMI = 3 JMX = 4 class HostIntrefaceUseIP(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostinterface/object#host-interface Whether the connection should be made via IP. """ NO = 0 YES = 1 class DetailsTagVersion(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostinterface/object#details-tag SNMP interface version. """ SNMP1 = 1 SNMP2 = 2 SNMP3 = 3 class DetailsTagBulk(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostinterface/object#details-tag Whether to use bulk SNMP requests. """ NO = 0 YES = 1 class DetailsTagSecurityLevel(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostinterface/object#details-tag SNMPv3 security level. Used only by SNMPv3 interfaces. """ NOAUTHNOPRIV = 0 AUTHNOPRIV = 1 AUTHPRIV = 2 class DetailsTagAuthProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostinterface/object#details-tag SNMPv3 authentication protocol. Used only by SNMPv3 interfaces. """ MD5 = 0 SHA = 1 class DetailsTagPrivProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.4/en/manual/api/reference/hostinterface/object#details-tag SNMPv3 privacy protocol. Used only by SNMPv3 interfaces. """ DES = 0 AES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z54/hostinterface.py
hostinterface.py
from zabbix_enums import _ZabbixEnum class MapExpandMacro(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Whether to expand macros in labels when configuring the map. """ NO = 0 YES = 1 class MapExpandProblem(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Whether the problem trigger will be displayed for elements with a single problem. """ NO = 0 YES = 1 class MapGridAlign(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Whether to enable grid aligning. """ NO = 0 YES = 1 class MapGridShow(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Whether to show the grid on the map. """ NO = 0 YES = 1 class MapHighlight(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Whether icon highlighting is enabled. """ NO = 0 YES = 1 class MapLabelFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Whether to enable advanced labels. """ DISABLE_ADVANCED_LABELS = 0 ENABLE_ADVANCED_LABELS = 1 class MapLabelLocation(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Location of the map element label. """ BOTTOM = 0 LEFT = 1 RIGHT = 2 TOP = 3 class MapLabelType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Map element label type. """ LABEL = 0 IP_ADDRESS = 1 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 class MapLabelTypeHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Label type for host elements. """ LABEL = 0 IP_ADDRESS = 1 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapLabelTypeHostGroup(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Label type for host group elements. """ LABEL = 0 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapLabelTypeImage(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Label type for host group elements. """ LABEL = 0 ELEMENT_NAME = 2 NOTHING = 4 CUSTOM = 5 class MapLabelTypeMap(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Label type for map elements. """ LABEL = 0 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapLabelTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Label type for trigger elements. """ LABEL = 0 ELEMENT_NAME = 2 STATUS = 3 NOTHING = 4 CUSTOM = 5 class MapMarkElements(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Whether to highlight map elements that have recently changed their status. """ NO = 0 YES = 1 class MapShowUnack(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map How problems should be displayed. """ COUNT_ALL_PROBLEMS = 0 COUNT_UNACK_PROBLEMS = 1 COUNT_ALL_PROBLEMS_SEPARATELY = 2 class MapPrivate(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Type of map sharing. """ NO = 0 YES = 1 class MapShowSuppressed(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/map/object#map Whether suppressed problems are shown. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/map.py
map.py
from zabbix_enums import _ZabbixEnum class EventSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/event/object#event Type of the event. """ TRIGGER = 0 DISCOVERY = 1 AUTOREGISTRATION = 2 INTERNAL = 3 class EventObjectTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/event/object#event Type of object that is related to the event. Possible values for trigger events. """ TRIGGER = 0 class EventObjectDiscovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/event/object#event Type of object that is related to the event. Possible values for discovery events. """ HOST = 1 SERVICE = 2 class EventObjectAutoregistration(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/event/object#event Type of object that is related to the event. Possible values for autoregistration events. """ HOST = 3 class EventObjectInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/event/object#event Possible values for internal events. """ TRIGGER = 0 ITEM = 4 LLD = 5 class EventValueTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/event/object#event State of the related object. Possible values for trigger events. """ OK = 0 PROBLEM = 1 class EventValueDiscovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/event/object#event State of the related object. Possible values for discovery events. """ UP = 0 DOWN = 1 DISCOVERED = 2 LOST = 3 class EventValueInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/event/object#event State of the related object. Possible values for internal events. """ NORMAL = 0 UNKNOWN = 1 NOT_SUPPORTED = 1 class EventSeverity(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/event/object#event Event current severity. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class EventSuppressed(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/event/object#event Whether the event is suppressed. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/event.py
event.py
from zabbix_enums import _ZabbixEnum class HostAvailable(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host [Readonly] Availability of Zabbix agent. """ UNKNOWN = 0 AVAILABLE = 1 UNAVAILABLE = 2 class HostFlag(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host [Readonly] Origin of the host. """ PLAIN = 0 DISCOVERED = 4 class HostInventoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host Host inventory population mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1 class HostIPMIAuthType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host IPMI authentication algorithm. """ DEFAULT = -1 NONE = 0 MD2 = 1 MD = 2 STRAIGHT = 4 OEM = 5 RMCP = 6 class HostIPMIAvailable(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host [Readonly] Availability of IPMI agent. """ UNKNOWN = 0 AVAILABLE = 1 UNAVAILABLE = 2 class HostIPMIPrivilege(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host IPMI privilege level. """ CALLBACK = 1 USER = 2 OPERATOR = 3 ADMIN = 4 OEM = 5 class HostJMXAvailable(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host [Readonly] Availability of JMX agent. """ UNKNOWN = 0 AVAILABLE = 1 UNAVAILABLE = 2 class HostMaintenanceStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host [Readonly] Effective maintenance type. """ NO_MAINTENANCE = 0 IN_MAINTENANCE = 1 class HostMaintenanceType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host [Readonly] Effective maintenance type. """ WITH_DATA_COLLECTION = 0 WITHOUT_DATA_COLLECTION = 1 class HostSNMPAvailable(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host [Readonly] Availability of SNMP agent. """ UNKNOWN = 0 AVAILABLE = 1 UNAVAILABLE = 2 class HostStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host Status and function of the host. """ MONITORED = 0 UNMONITORED = 1 class HostTLSConnect(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host Connections to host. """ NO_ENCRYPTION = 1 PSK = 2 CERTIFICATE = 4 class HostTLSAccept(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host Connections from host. Possible bitmap values. """ NO_ENCRYPTION = 1 PSK = 2 CERTIFICATE = 4 class HostInventoryProperty(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/host/object#host-inventory Each property has it's own unique ID number, which is used to associate host inventory fields with items. """ ALIAS = 4 ASSET_TAG = 11 CHASSIS = 28 CONTACT = 23 CONTRACT_NUMBER = 32 DATE_HW_DECOMM = 47 DATE_HW_EXPIRY = 46 DATE_HW_INSTALL = 45 DATE_HW_PURCHASE = 44 DEPLOYMENT_STATUS = 34 HARDWARE = 14 HARDWARE_FULL = 15 HOST_NETMASK = 39 HOST_NETWORKS = 38 HOST_ROUTER = 40 HW_ARCH = 30 INSTALLER_NAME = 33 LOCATION = 24 LOCATION_LAT = 25 LOCATION_LON = 26 MACADDRESS_A = 12 MACADDRESS_B = 13 MODEL = 29 NAME = 3 NOTES = 27 OOB_IP = 41 OOB_NETMASK = 42 OOB_ROUTER = 43 OS = 5 OS_FULL = 6 OS_SHORT = 7 POC_1_CELL = 61 POC_1_EMAIL = 58 POC_1_NAME = 57 POC_1_NOTES = 63 POC_1_PHONE_A = 59 POC_1_PHONE_B = 60 POC_1_SCREEN = 62 POC_2_CELL = 68 POC_2_EMAIL = 65 POC_2_NAME = 64 POC_2_NOTES = 70 POC_2_PHONE_A = 66 POC_2_PHONE_B = 67 POC_2_SCREEN = 69 SERIALNO_A = 8 SERIALNO_B = 9 SITE_ADDRESS_A = 48 SITE_ADDRESS_B = 49 SITE_ADDRESS_C = 50 SITE_CITY = 51 SITE_COUNTRY = 53 SITE_NOTES = 56 SITE_RACK = 55 SITE_STATE = 52 SITE_ZIP = 54 SOFTWARE = 16 SOFTWARE_APP_A = 18 SOFTWARE_APP_B = 19 SOFTWARE_APP_C = 20 SOFTWARE_APP_D = 21 SOFTWARE_APP_E = 22 SOFTWARE_FULL = 17 TAG = 10 TYPE = 1 TYPE_FULL = 2 URL_A = 35 URL_B = 36 URL_C = 37 VENDOR = 31
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/host.py
host.py
from enum import Enum from unittest.mock import DEFAULT from zabbix_enums import _ZabbixEnum class DashboardPrivate(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dashboard/object#dashboard Type of dashboard sharing. """ NO = 0 YES = 1 PUBLIC = 0 PRIVATE = 1 class DashboardWidgetType(str, Enum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dashboard/object#dashboard-widget Type of the dashboard widget. """ ACTION_LOG = "actionlog" CLOCK = "clock" DATA_OVERVIEW = "dataover" DISCOVERY_STATUS = "discovery" FAVORITE_GRAPHS = "favgraphs" FAVORITE_MAPS = "favmaps" FAVORITE_SCREENS = "favscreens" GRAPH_CLASSIC = "graph" GRAPH_PROTOTYPE = "graphprototype" HOST_AVAILABILITY = "hostavail" MAP = "map" MAP_NAVIGATION_TREE = "navtree" PLAIN_TEXT = "plaintext" PROBLEM_HOSTS = "problemhosts" PROBLEMS = "problems" PROBLEMS_BY_SEVERITY = "problemsbysv" GRAPH = "svggraph" SYSTEM_INFORMATION = "systeminfo" TRIGGER_OVERVIEW = "trigover" URL = "url" WEB_MONITORING = "web" class DashboardWidgetViewMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dashboard/object#dashboard-widget The widget view mode. """ DEFAULT = 0 HIDDEN_HEADER = 1 class DashboardWidgetFieldType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dashboard/object#dashboard-widget-field Type of the widget field. """ INTEGER = 0 STRING = 1 HOST_GROUP = 2 HOST = 3 ITEM = 4 GRAPH = 6 MAP = 8 class DashboardUserGroupPermission(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dashboard/object#dashboard-user-group Type of permission level. """ READ_ONLY = 2 READ_WRITE = 3 class DashboardUserPermission(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dashboard/object#dashboard-user Type of permission level. """ READ_ONLY = 2 READ_WRITE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/dashboard.py
dashboard.py
from zabbix_enums import _ZabbixEnum class ItemPrototypeType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype Type of the item prototype. """ ZABBIX_AGENT = 0 ZABBIX_TRAPPER = 2 SIMPLE_CHECK = 3 ZABBIX_INTERNAL = 5 ZABBIX_AGENT_ACTIVE = 7 ZABBIX_AGGREGATE = 8 EXTERNAL_CHECK = 10 DATABASE_MONITOR = 11 IPMI_AGENT = 12 SSH_AGENT = 13 TELNET_AGENT = 14 CALCULATED = 15 JMX_AGENT = 16 SNMP_TRAP = 17 DEPENDENT_ITEM = 18 HTTP_AGENT = 19 SNMP_AGENT = 20 SCRIPT = 21 class ItemPrototypeValueType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype Type of information of the item prototype. """ NUMERIC_FLOAT = 0 CHARACTER = 1 LOG = 2 NUMERIC_UNSIGNED = 3 TEXT = 4 class ItemPrototypeAllowTraps(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Allow to populate value as in trapper item type also. """ NO = 0 YES = 1 class ItemPrototypeAuthTypeSSH(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype Used only by SSH agent item prototypes or HTTP agent item prototypes. SSH agent authentication method possible values. """ PASSWORD = 0 PUBLIC_KEY = 1 class ItemPrototypeAuthTypeHTTP(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype Used only by SSH agent item prototypes or HTTP agent item prototypes. HTTP agent authentication method possible values. """ NONE = 0 BASIC = 1 NTLM = 2 KERBEROS = 3 class ItemPrototypeFollowRedirects(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Follow response redirects while pooling data. """ NO = 0 YES = 1 class ItemPrototypeOutputFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Should response be converted to JSON. """ RAW = 0 JSON = 1 class ItemPrototypePostType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Type of post data body stored in posts property. """ RAW = 0 JSON = 2 XML = 3 class ItemPrototypeRequestMethod(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Type of request method. """ GET = 0 POST = 1 PUT = 2 HEAD = 3 class ItemPrototypeRetrieveMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. What part of response should be stored. """ BODY = 0 HEADERS = 1 BODY_AND_HEADERS = 2 BOTH = 2 class ItemPrototypeStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype Status of the item prototype. """ ENABLED = 0 DISABLED = 1 UNSUPPORTED = 3 class ItemPrototypeVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. """ NO = 0 YES = 1 class ItemPrototypeVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype HTTP agent item prototype field. Validate is host certificate authentic. """ NO = 0 YES = 1 class ItemPrototypePrototypeDiscover(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype-prototype Item prototype discovery status. """ DISCOVER = 0 DONT_DISCOVER = 1 class ItemPrototypePreprocessingType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype-preprocessing The preprocessing option type. """ CUSTOM_MULTIPLIER = 1 RIGHT_TRIM = 2 LEFT_TRIM = 3 TRIM = 4 REGULAR_EXPRESSION = 5 BOOLEAN_TO_DECIMAL = 6 OCTAL_TO_DECIMAL = 7 HEXADECIMAL_TO_DECIMAL = 8 SIMPLE_CHANGE = 9 CHANGE_PER_SECOND = 10 XML_XPATH = 11 JSONPATH = 12 IN_RANGE = 13 MATCHES_REGULAR_EXPRESSION = 14 DOES_NOT_MATCH_REGULAR_EXPRESSION = 15 CHECK_FOR_ERROR_IN_JSON = 16 CHECK_FOR_ERROR_IN_XML = 17 CHECK_FOR_ERROR_USING_REGULAR_EXPRESSION = 18 DISCARD_UNCHANGED = 19 DISCARD_UNCHANGED_WITH_HEARTBEAT = 20 JAVASCRIPT = 21 PROMETHEUS_PATTERN = 22 PROMETHEUS_TO_JSON = 23 CSV_TO_JSON = 24 REPLACE = 25 CHECK_UNSUPPORTED = 26 class ItemPrototypePreprocessingErrorHandler(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/itemprototype/object#item-prototype-preprocessing Action type used in case of preprocessing step failure. """ ERROR_MESSAGE = 0 DISCARD_VALUE = 1 CUSTOM_VALUE = 2 CUSTOM_ERROR_MESSAGE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/itemprototype.py
itemprototype.py
from zabbix_enums import _ZabbixEnum class LLDRuleType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule Type of the LLD rule. """ ZABBIX_AGENT = 0 ZABBIX_TRAPPER = 2 SIMPLE_CHECK = 3 ZABBIX_INTERNAL = 5 ZABBIX_AGENT_ACTIVE = 7 EXTERNAL_CHECK = 10 DATABASE_MONITOR = 11 IPMI_AGENT = 12 SSH_AGENT = 13 TELNET_AGENT = 14 CALCULATED = 15 JMX_AGENT = 16 DEPENDENT_ITEM = 18 HTTP_AGENT = 19 SNMP_AGENT = 20 SCRIPT = 21 class LLDRuleAllowTraps(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Allow to populate value as in trapper item type also. """ NO = 0 YES = 1 class LLDRuleAuthTypeSSH(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule Used only by SSH agent or HTTP agent LLD rules. SSH agent authentication method possible values. """ PASSWORD = 0 PUBLIC_KEY = 1 class LLDRuleAuthTypeHTTP(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule Used only by SSH agent or HTTP agent LLD rules. HTTP agent authentication method possible values. """ NONE = 0 BASIC = 1 NTLM = 2 class LLDRuleFollowRedirects(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Follow response redirects while pooling data. """ NO = 0 YES = 1 class LLDRuleOutputFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Should response be converted to JSON. """ RAW = 0 JSON = 1 class LLDRulePostType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Type of post data body stored in posts property. """ RAW = 0 JSON = 2 XML = 3 class LLDRuleRequestMethod(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Type of request method. """ GET = 0 POST = 1 PUT = 2 HEAD = 3 class LLDRuleRetrieveMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. What part of response should be stored. """ BODY = 0 HEADERS = 1 BODY_AND_HEADERS = 2 BOTH = 2 class LLDRuleState(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule [Readonly] State of the LLD rule. """ NORMAL = 0 NOT_SUPPORTED = 1 class LLDRuleStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule Status of the LLD rule. """ ENABLED = 0 DISABLED = 1 class LLDRuleVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. """ NO = 0 YES = 1 class LLDRuleVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule HTTP agent LLD rule field. Validate is host certificate authentic. """ NO = 0 YES = 1 class LLDRuleEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-filter Filter condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 CUSTOM = 3 class LLDRuleFilterConditionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-filter-condition Condition operator. """ MATCHES_REGEX = 8 DOES_NOT_MATCH_REGEX = 9 class LLDRulePreprocessing(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-preprocessing The preprocessing option type. """ REGULAR_EXPRESSION = 5 XML_XPATH = 11 JSONPATH = 12 DOES_NOT_MATCH_REGULAR_EXPRESSION = 15 CHECK_FOR_ERROR_IN_JSON = 16 CHECK_FOR_ERROR_IN_XML = 17 DISCARD_UNCHANGED_WITH_HEARTBEAT = 20 PROMETHEUS_PATTERN = 22 PROMETHEUS_TO_JSON = 23 CSV_TO_JSON = 24 REPLACE = 25 class LLDRulePreprocessingErrorHandler(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-preprocessing Action type used in case of preprocessing step failure. """ ERROR_MESSAGE = 0 DISCARD_VALUE = 1 CUSTOM_VALUE = 2 CUSTOM_ERROR_MESSAGE = 3 class LLDRuleOverridesStop(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-overrides Stop processing next overrides if matches. """ NO = 0 YES = 1 class LLDRuleOverrideFilterEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-override-filter Override filter condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 CUSTOM = 3 class LLDRuleOverrideFilterConditionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-override-filter-condition Condition operator. """ MATCHES_REGEX = 8 DOES_NOT_MATCH_REGEX = 9 class LLDRuleOverrideOperationObject(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation Type of discovered object to perform the action. """ ITEM = 0 TRIGGER = 1 GRAPH = 2 HOST = 3 class LLDRuleOverrideOperationOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation Override condition operator. """ EQUALS = 0 DOES_NOT_EQUAL = 1 CONTAINS = 2 DOESN_NOT_CONTAIN = 3 MATCHES = 8 DOES_NOT_MATCH = 9 class LLDRuleOverrideOperationStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-status Override the status for selected object. """ CREATE_ENABLED = 0 CREATE_DISABLED = 1 class LLDRuleOverrideOperationDiscover(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-discover Override the discover status for selected object. """ YES = 0 NO = 1 class LLDRuleOverrideOperationSeverity(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-severity Override the severity of trigger prototype. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class LLDRuleOverrideOperationInventory(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/discoveryrule/object#lld-rule-override-operation-inventory Override the host prototype inventory mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/discoveryrule.py
discoveryrule.py
from zabbix_enums import _ZabbixEnum class ScreenItemResourceType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/screenitem/object#screen-item Type of screen item. """ GRAPH = 0 SIMPLE_GRAPH = 1 MAP = 2 PLAIN_TEXT = 3 HOSTS_INFO = 4 TRIGGERS_INFO = 5 SYSTEM_INFORMATION = 6 CLOCK = 7 TRIGGERS_OVERVIEW = 9 DATA_OVERVIEW = 10 URL = 11 HISTORY_OF_ACTIONS = 12 HISTORY_OF_EVENTS = 13 LATEST_HOST_GROUP_ISSUES = 14 PROBLEMS_BY_SEVERITY = 15 LATEST_HOST_ISSUES = 16 SIMPLE_GRAPH_PROTOTYPE = 19 GRAPH_PROTOTYPE = 20 class ScreenItemDynamic(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/screenitem/object#screen-item Whether the screen item is dynamic. """ NO = 0 YES = 1 class ScreenItemHalign(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/screenitem/object#screen-item Specifies how the screen item must be aligned horizontally in the cell. """ CENTER = 0 LEFT = 1 RIGHT = 2 class ScreenItemSortTriggersActions(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/screenitem/object#screen-item Order in which actions or triggers must be sorted. Possible values for history of actions screen elements. """ TIME_ASCENDING = 3 TIME_DESCENDING = 4 TYPE_ASCENDING = 5 TYPE_DESCENDING = 6 STATUS_ASCENDING = 7 STATUS_DESCENDING = 8 RETRIES_LEFT_ASCENDING = 9 RETRIES_LEFT_DESCENDING = 10 RECIPIENT_ASCENDING = 11 RECIPIENT_DESCENDING = 12 class ScreenItemSortTriggersIssues(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/screenitem/object#screen-item Possible values for latest host group issues and latest host issues screen items: """ LAST_CHANGE_DESCENDING = 0 SEVERITY_DESCENDING = 1 HOST_ASCENDING = 2 class ScreenItemStyleOverview(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/screenitem/object#screen-item Screen item display option. Possible values for data overview and triggers overview screen items: """ HOSTS_ON_LEFT = 0 HOSTS_ON_TOP = 1 class ScreenItemStyleInfo(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/screenitem/object#screen-item Screen item display option. Possible values for hosts info and triggers info screen elements. """ HORIZONTAL_LAYOUT = 0 VERTICAL_LAYOUT = 1 class ScreenItemStyleClock(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/screenitem/object#screen-item Screen item display option. Possible values for clock screen items. """ LOCAL_TIME = 0 SERVER_TIME = 1 HOST_TIME = 2 class ScreenItemStylePlaintext(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/screenitem/object#screen-item Screen item display option. Possible values for plain text screen items. """ PLAIN = 0 HTML = 1 class ScreenItemValign(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/screenitem/object#screen-item Specifies how the screen item must be aligned vertically in the cell. """ MIDDLE = 0 TOP = 1 BOTTOM = 2
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/screenitem.py
screenitem.py
from zabbix_enums import _ZabbixEnum class SettingsServerCheckInterval(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/settings/object#settings Show warning if Zabbix server is down. """ DONT_SHOW_WARNING = 0 SHOW_WARNING = 10 class SettingsShowTechnicalErrors(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/settings/object#settings Show technical errors (PHP/SQL) to non-Super admin users and to users that are not part of user groups with debug mode enabled. """ NO = 0 YES = 1 class SettingsCustomColor(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/settings/object#settings Use custom event status colors. """ NO = 0 YES = 1 class SettingsProblemUnackStyle(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/settings/object#settings Blinking for unacknowledged PROBLEM events. """ DONT_BLINK = 0 BLINK = 1 class SettingsProblemAckStyle(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/settings/object#settings Blinking for acknowledged PROBLEM events. """ DONT_BLINK = 0 BLINK = 1 class SettingsOKUnackStyle(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/settings/object#settings Blinking for unacknowledged RESOLVED events. """ DONT_BLINK = 0 BLINK = 1 class SettingsOKAckStyle(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/settings/object#settings Blinking for acknowledged RESOLVED events. """ DONT_BLINK = 0 BLINK = 1 class SettingsDefaultInventoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/settings/object#settings Default host inventory mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1 class SettingsSnmptrapLogging(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/settings/object#settings Log unmatched SNMP traps. """ NO = 0 YES = 1 class SettingsValidateUriSchemes(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/settings/object#settings Validate URI schemes. """ NO = 0 YES = 1 class SettingsIframeSandboxingEnabled(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/settings/object#settings Use iframe sandboxing. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/settings.py
settings.py
from zabbix_enums import _ZabbixEnum class ActionStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action Whether the action is enabled or disabled. """ ENABLED = 0 DISABLED = 1 class ActionPauseSupressed(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action Whether to pause escalation during maintenance periods or not. """ NO = 0 YES = 1 class ActionOperationType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-operation Type of operation. """ SEND_MESSAGE = 0 REMOTE_COMMAND = 1 ADD_HOST = 2 REMOVE_HOST = 3 ADD_TO_HOST_GROUP = 4 REMOVE_FROM_HOST_GROUP = 5 LINK_TO_TEMPLATE = 6 UNLINK_FROM_TEMPLATE = 7 ENABLE_HOST = 8 DISABLE_HOST = 9 SET_HOST_INVENTORY_MODE = 10 class ActionOperationEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-operation Operation condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 class ActionOperationCommandType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-operation-command Type of operation command. """ CUSTOM_SCRIPT = 0 IPMI = 1 SSH = 2 TELNET = 3 GLOBAL_SCRIPT = 4 class ActionOperationCommandAuthType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-operation-command Authentication method used for SSH commands. """ PASSWORD = 0 PUBLIC_KEY = 1 class ActionOperationCommandExecuteOn(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-operation-command Target on which the custom script operation command will be executed. Required for custom script commands. """ ZABBIX_AGENT = 0 ZABBIX_SERVER = 1 ZABBIX_SERVER_PROXY = 2 class ActionOperationMessageDefault(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-operation-message Whether to use the default action message text and subject. """ NO = 0 YES = 1 class ActionOperationConditionType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-operation-condition Type of condition. """ EVENT_ACKNOWLEDGED = 14 class ActionOperationConditionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-operation-condition Condition operator. """ EQUALS = 0 class ActionOperationConditionEventAcknowledged(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-operation-condition Whether the event is acknowledged. """ NO = 0 YES = 1 class ActionRecoveryOperationTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-recovery-operation Type of operation. Possible values for trigger actions. """ SEND_MESSAGE = 0 REMOTE_COMMAND = 1 NOTIFY_ALL_INVOLVED = 11 class ActionRecoveryOperationTypeInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-recovery-operation Type of operation. Possible values for internal actions. """ SEND_MESSAGE = 0 NOTIFY_ALL_INVOLVED = 11 class ActionUpdateOperationTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-update-operation Type of operation. Possible values for trigger actions. """ SEND_MESSAGE = 0 REMOTE_COMMAND = 1 NOTIFY_ALL_INVOLVED = 12 class ActionFilterEvalType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-filter Filter condition evaluation method. """ AND_OR = 0 AND = 1 OR = 2 CUSTOM = 3 class ActionFilterCondidtionTypeTrigger(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for trigger actions. """ HOST_GROUP = 0 HOST = 1 TRIGGER = 2 TRIGGER_NAME = 3 TRIGGER_SEVERITY = 4 TIME_PERIOD = 6 HOST_TEMPLATE = 13 APPLICATION = 15 PROBLEM_IS_SUPPRESSED = 16 EVENT_TAG = 25 EVENT_TAG_VALUE = 26 class ActionFilterCondidtionTypeDiscovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for discovery actions. """ HOST_IP = 7 DISCOVERED_SERVICE_TYPE = 8 DISCOVERED_SERVICE_PORT = 9 DISCOVERY_STATUS = 10 UPTIME_OR_DOWNTIME_DURATION = 11 RECEIVED_VALUE = 12 DISCOVERY_RULE = 18 DISCOVERY_CHECK = 19 PROXY = 20 DISCOVERY_OBJECT = 21 class ActionFilterCondidtionTypeAutoregistration(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for autoregistration actions. """ PROXY = 20 HOST_NAME = 22 HOST_METADATA = 24 class ActionFilterCondidtionTypeInternal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-filter-condition Type of condition. Possible values for internal actions. """ HOST_GROUP = 0 HOST = 1 HOST_TEMPLATE = 13 APPLICATION = 15 EVENT_TYPE = 23 class ActionFilterCondidtionOperator(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/action/object#action-filter-condition Condition operator. """ EQUALS = 0 DOES_NOT_EQUAL = 1 CONTAINS = 2 DOES_NOT_CONTAIN = 3 IN = 4 GREATER_OR_EQUAL = 5 LESS_OR_EQUAL = 6 NOT_IN = 7 MATCHES = 8 DOES_NOT_MATCH = 9 YES = 10 NO = 11
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/action.py
action.py
from zabbix_enums import _ZabbixEnum class HostPrototypeStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/hostprototype/object#host-prototype Status of the host prototype. """ MONITORED = 0 UNMONITORED = 1 class HostPrototypeInventoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/hostprototype/object#host-prototype Host inventory population mode. """ DISABLED = -1 MANUAL = 0 AUTOMATIC = 1 class HostPrototypeDiscover(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/hostprototype/object#host-prototype Host prototype discovery status. """ DISCOVER = 0 DONT_DISCOVER = 1 class HostPrototypeCustomInterfaces(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/hostprototype/object#host-prototype Source of interfaces for hosts created by the host prototype. """ PARENT_HOST = 0 CUSTOM_INTERFACE = 1 class CustomInterfaceMain(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/hostprototype/object#custom-interface Whether the interface is used as default on the host. Only one interface of some type can be set as default on a host. """ class CustomInterfaceType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/hostprototype/object#custom-interface Interface type. """ AGENT = 1 SNMP = 2 IPMI = 3 JMX = 4 class CustomInterfaceUseIp(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/hostprototype/object#custom-interface Whether the connection should be made via IP. """ NO = 0 YES = 1 class CustomInterfaceDetailsVersion(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/hostprototype/object#custom-interface-details SNMP interface version. """ SNMP1 = 1 SNMP2 = 2 SNMP3 = 3 class CustomInterfaceDetailsBulk(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/hostprototype/object#custom-interface-details Whether to use bulk SNMP requests. """ NO = 0 YES = 1 class CustomInterfaceDetailsSecurityLevel(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/hostprototype/object#custom-interface-details SNMPv3 security level. Used only by SNMPv3 interfaces. """ NOAUTHNOPRIV = 0 AUTHNOPRIV = 1 AUTHPRIV = 2 class CustomInterfaceDetailsAuthProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/hostprototype/object#custom-interface-details SNMPv3 authentication protocol. Used only by SNMPv3 interfaces. """ MD5 = 0 SHA = 1 class CustomInterfaceDetailsPrivProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/hostprototype/object#custom-interface-details SNMPv3 privacy protocol. Used only by SNMPv3 interfaces. """ DES = 0 AES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/hostprototype.py
hostprototype.py
from zabbix_enums import _ZabbixEnum class ItemType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item Type of the item. """ ZABBIX_AGENT = 0 ZABBIX_TRAPPER = 2 SIMPLE_CHECK = 3 ZABBIX_INTERNAL = 5 ZABBIX_AGENT_ACTIVE = 7 ZABBIX_AGGREGATE = 8 WEB_ITEM = 9 EXTERNAL_CHECK = 10 DATABASE_MONITOR = 11 IPMI_AGENT = 12 SSH_AGENT = 13 TELNET_AGENT = 14 CALCULATED = 15 JMX_AGENT = 16 SNMP_TRAP = 17 DEPENDENT_ITEM = 18 HTTP_AGENT = 19 SNMP_AGENT = 20 SCRIPT = 21 class ItemValueType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item Type of information of the item. """ NUMERIC_FLOAT = 0 CHARACTER = 1 LOG = 2 NUMERIC_UNSIGNED = 3 TEXT = 4 class ItemAllowTraps(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item HTTP agent item field. Allow to populate value as in trapper item type also. """ NO = 0 YES = 1 class ItemAuthTypeSSH(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item Used only by SSH agent items or HTTP agent items. SSH agent authentication method possible values. """ PASSWORD = 0 PUBLIC_KEY = 1 class ItemAuthTypeHTTP(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item Used only by SSH agent items or HTTP agent items. HTTP agent authentication method possible values. """ NONE = 0 BASIC = 1 NTLM = 2 KERBEROS = 3 class ItemFlag(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item [Readonly] Origin of the item. """ PLAIN = 0 DISCOVERED = 4 class ItemFollowRedirects(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item HTTP agent item field. Follow response redirects while pooling data. """ NO = 0 YES = 1 class ItemOutputFormat(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item HTTP agent item field. Should response be converted to JSON. """ RAW = 0 JSON = 1 class ItemPostType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item HTTP agent item field. Type of post data body stored in posts property. """ RAW = 0 JSON = 2 XML = 3 class ItemRequestMethod(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item HTTP agent item field. Type of request method. """ GET = 0 POST = 1 PUT = 2 HEAD = 3 class ItemRetrieveMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item HTTP agent item field. What part of response should be stored. """ BODY = 0 HEADERS = 1 BODY_AND_HEADERS = 2 BOTH = 2 class ItemState(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item [Readonly] State of the item. """ NORMAL = 0 NOT_SUPPORTED = 1 class ItemStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item Status of the item. """ ENABLED = 0 DISABLED = 1 class ItemVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item HTTP agent item field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. """ NO = 0 YES = 1 class ItemVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item HTTP agent item field. Validate is host certificate authentic. """ NO = 0 YES = 1 class ItemPreprocessingType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item-preprocessing The preprocessing option type. """ CUSTOM_MULTIPLIER = 1 RIGHT_TRIM = 2 LEFT_TRIM = 3 TRIM = 4 REGULAR_EXPRESSION = 5 BOOLEAN_TO_DECIMAL = 6 OCTAL_TO_DECIMAL = 7 HEXADECIMAL_TO_DECIMAL = 8 SIMPLE_CHANGE = 9 CHANGE_PER_SECOND = 10 XML_XPATH = 11 JSONPATH = 12 IN_RANGE = 13 MATCHES_REGULAR_EXPRESSION = 14 DOES_NOT_MATCH_REGULAR_EXPRESSION = 15 CHECK_FOR_ERROR_IN_JSON = 16 CHECK_FOR_ERROR_IN_XML = 17 CHECK_FOR_ERROR_USING_REGULAR_EXPRESSION = 18 DISCARD_UNCHANGED = 19 DISCARD_UNCHANGED_WITH_HEARTBEAT = 20 JAVASCRIPT = 21 PROMETHEUS_PATTERN = 22 PROMETHEUS_TO_JSON = 23 CSV_TO_JSON = 24 REPLACE = 25 CHECK_UNSUPPORTED = 26 class ItemPreprocessingErrorHandler(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/item/object#item-preprocessing Action type used in case of preprocessing step failure. """ ERROR_MESSAGE = 0 DISCARD_VALUE = 1 CUSTOM_VALUE = 2 CUSTOM_ERROR_MESSAGE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/item.py
item.py
from zabbix_enums import _ZabbixEnum class RoleType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/role/object#role User type. """ USER = 1 ADMIN = 2 SUPERADMIN = 3 class RoleReadOnly(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/role/object#role [Readonly] Whether the role is readonly. """ NO = 0 YES = 1 class RoleRulesUIDefaultAccess(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/role/object#role-rules Whether access to new UI elements is enabled. """ DISABLED = 0 ENABLED = 1 class RoleRulesModulesDefaultAccess(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/role/object#role-rules Whether access to new modules is enabled. """ DISABLED = 0 ENABLED = 1 class RoleRulesAPIAccess(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/role/object#role-rules Whether access to API is enabled. """ DISABLED = 0 ENABLED = 1 class RoleRulesAPIMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/role/object#role-rules Mode for treating API methods listed in the api property. """ DENY_LIST = 0 ALLOW_LIST = 1 class RoleRulesActionsDefaultAccess(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/role/object#role-rules Whether access to new actions is enabled. """ DISABLED = 0 ENABLED = 1 class UIElementStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/role/object#ui-element Whether access to the UI element is enabled. """ DISABLED = 0 ENABLED = 1 class ModuleStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/role/object#module Whether access to the module is enabled. """ DISABLED = 0 ENABLED = 1 class ActionStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/role/object#action Whether access to perform the action is enabled. """ DISABLED = 0 ENABLED = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/role.py
role.py
from zabbix_enums import _ZabbixEnum class MediaTypeType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/mediatype/object#media-type Transport used by the media type. """ EMAIL = 0 SCRIPT = 1 SMS = 2 WEBHOOK = 4 class MediaTypeSMTPSecurity(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/mediatype/object#media-type SMTP connection security level to use. """ NONE = 0 STARTTLS = 1 SSL_TLS = 2 class MediaTypeSMTPSVerifyHost(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/mediatype/object#media-type SSL verify host for SMTP. """ NO = 0 YES = 1 class MediaTypeSMTPSVerifyPeer(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/mediatype/object#media-type SSL verify peer for SMTP. """ NO = 0 YES = 1 class MediaTypeSMTPAuthentication(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/mediatype/object#media-type SMTP authentication method to use. """ NONE = 0 PASSWORD = 1 class MediaTypeStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/mediatype/object#media-type Whether the media type is enabled. """ ENABLED = 0 DISABLED = 1 class MediaTypeContentType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/mediatype/object#media-type Message format. """ PLAIN_TEXT = 0 HTML = 1 class MediaTypeProcessTags(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/mediatype/object#media-type Defines should the webhook script response to be interpreted as tags and these tags should be added to associated event. """ NO = 0 YES = 1 class MediaTypeShowEventMenu(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/mediatype/object#media-type Show media type entry in problem.get and event.get property urls. """ NO = 0 YES = 1 class MessageTemplateEventSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/mediatype/object#message-template Event source. """ TRIGGER = 0 DISCOVERY = 1 AUTOREGISTRATION = 2 INTERNAL = 3 class MessageTemplateRecovery(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/mediatype/object#message-template Operation mode. """ OPERATIONS = 0 RECOVERY = 1 RECOVERY_OPERATIONS = 1 UPDATE = 2 UPDATE_OPERATIONS = 2
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/mediatype.py
mediatype.py
from zabbix_enums import _ZabbixEnum class AuthenticationType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication Default authentication. """ INTERNAL = 0 LDAP = 1 class AuthenticationHTTPAuthEnabled(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication Enable HTTP authentication. """ DISABLED = 0 ENABLED = 1 class AuthenticationHTTPLoginForm(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication Default login form. """ ZABBIX_FORM = 0 HTTP_FORM = 1 class AuthenticationHTTPCaseSensitive(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication HTTP case sensitive login. """ OFF = 0 ON = 1 NO = 0 YES = 1 class AuthenticationLDAPConfigured(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication Enable LDAP authentication """ DISABLED = 0 ENABLED = 1 class AuthenticationLDAPCaseSensitive(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication LDAP case sensitive login. """ OFF = 0 ON = 1 NO = 0 YES = 1 class AuthenticationSAMLAuthEnabled(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication Enable SAML authentication """ DISABLED = 0 ENABLED = 1 class AuthenticationSAMLSignMessages(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication SAML sign messages. """ NO = 0 YES = 1 class AuthenticationSAMLSignAssertions(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication SAML sign assertions. """ NO = 0 YES = 1 class AuthenticationSAMLSignAuthnrequests(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication SAML sign AuthN requests. """ NO = 0 YES = 1 class AuthenticationSAMLSignLogoutRequests(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication SAML sign logout requests. """ NO = 0 YES = 1 class AuthenticationSAMLSignLogoutResponses(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication SAML sign logout responses. """ NO = 0 YES = 1 class AuthenticationSAMLEncryptNameId(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication SAML encrypt name ID. """ NO = 0 YES = 1 class AuthenticationSAMLEncryptAssertions(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication SAML encrypt assertions. """ NO = 0 YES = 1 class AuthenticationSAMLCaseSensitive(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/authentication/object#authentication SAML case sensitive login. """ OFF = 0 ON = 1 NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/authentication.py
authentication.py
from zabbix_enums import _ZabbixEnum class TriggerFlag(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/trigger/object#trigger [Readonly] Origin of the trigger. """ PLAIN = 0 DISCOVERED = 4 class TriggerPriority(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/trigger/object#trigger Severity of the trigger. """ NOT_CLASSIFIED = 0 INFORMATION = 1 WARNING = 2 AVERAGE = 3 HIGH = 4 DISASTER = 5 class TriggerState(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/trigger/object#trigger [Readonly] State of the trigger. """ NORMAL = 0 UNKNOWN = 1 class TriggerStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/trigger/object#trigger Whether the trigger is enabled or disabled. """ ENABLED = 0 DISABLED = 1 class TriggerType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/trigger/object#trigger Whether the trigger can generate multiple problem events. """ GENERATE_SINGLE_EVENT = 0 DO_NOT_GENERATE_MULTIPLE_EVENTS = 0 GENERATE_MULTIPLE_EVENTS = 1 class TriggerValue(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/trigger/object#trigger [Readonly] Whether the trigger is in OK or problem state. """ OK = 0 PROBLEM = 1 class TriggerRecoveryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/trigger/object#trigger OK event generation mode. """ EXPRESSION = 0 RECOVERY_EXPRESSION = 1 NONE = 2 class TriggerCorrelationMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/trigger/object#trigger OK event closes. """ ALL_PROBLEMS = 0 TAG_VALUES_MATCH = 1 class TriggerManualClose(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/trigger/object#trigger Allow manual close. """ NO = 0 YES = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/trigger.py
trigger.py
from zabbix_enums import _ZabbixEnum class DiscoveryCheckSNMPv3AuthProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dcheck/object#discovery-check Authentication protocol used for SNMPv3 agent checks with security level set to authNoPriv or authPriv. """ MD5 = 0 SHA = 1 SHA1 = 1 class DiscoveryCheckSNMPv3PrivProtocol(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dcheck/object#discovery-check Privacy protocol used for SNMPv3 agent checks with security level set to authPriv. """ DES = 0 AES = 1 class DiscoveryCheckSNMPv3SecurityLevel(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dcheck/object#discovery-check Security level used for SNMPv3 agent checks. """ NOAUTHNOPRIV = 0 AUTHNOPRIV = 1 AUTHPRIV = 2 class DiscoveryCheckType(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dcheck/object#discovery-check Type of check. """ SSH = 0 LDAP = 1 SMTP = 2 FTP = 3 HTTP = 4 POP = 5 NNTP = 6 IMAP = 7 TCP = 8 ZABBIX_AGENT = 9 SNMPV1 = 10 SNMPV2 = 11 ICMP = 12 SNMPV3 = 13 HTTPS = 14 TELNET = 15 class DiscoveryCheckUniq(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dcheck/object#discovery-check Whether to use this check as a device uniqueness criteria. Only a single unique check can be configured for a discovery rule. Used for Zabbix agent, SNMPv1, SNMPv2 and SNMPv3 agent checks. """ NO = 0 YES = 1 class DiscoveryCheckHostSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dcheck/object#discovery-check Source for host name. """ DNS = 1 IP = 2 CHECK_VALUE = 3 class DiscoveryCheckNameSource(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/dcheck/object#discovery-check Source for visible name. """ NOT_SCPECIFIED = 0 DNS = 1 IP = 2 CHECK_VALUE = 3
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/dcheck.py
dcheck.py
from zabbix_enums import _ZabbixEnum class HousekeepingHKEventsMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for events and alerts. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKServiceMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for services. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKAuditMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for audit. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKSessionsMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for sessions. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKHistoryMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for history. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKHistoryGlobal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/housekeeping/object#housekeeping Override item history period. """ NO = 0 YES = 1 class HousekeepingHKTrendsMode(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/housekeeping/object#housekeeping Enable internal housekeeping for trends. """ DISABLED = 0 ENABLED = 1 class HousekeepingHKTrendsGlobal(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/housekeeping/object#housekeeping Override item trends period. """ NO = 0 YES = 1 class HousekeepingCompressionStatus(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/housekeeping/object#housekeeping Enable TimescaleDB compression for history and trends. """ OFF = 0 ON = 1 class HousekeepingCompressionAvailability(_ZabbixEnum): """ https://www.zabbix.com/documentation/5.2/en/manual/api/reference/housekeeping/object#housekeeping [Readonly] Compression availability. """ UNAVAILABLE = 0 AVAILABLE = 1
zabbix-enums
/zabbix-enums-1.60.1.tar.gz/zabbix-enums-1.60.1/src/zabbix_enums/z52/housekeeping.py
housekeeping.py