本文整理汇总了Python中Utils.LadDiagnosticUtil.getDiagnosticsMonitorConfigurationElement方法的典型用法代码示例。如果您正苦于以下问题:Python LadDiagnosticUtil.getDiagnosticsMonitorConfigurationElement方法的具体用法?Python LadDiagnosticUtil.getDiagnosticsMonitorConfigurationElement怎么用?Python LadDiagnosticUtil.getDiagnosticsMonitorConfigurationElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils.LadDiagnosticUtil
的用法示例。
在下文中一共展示了LadDiagnosticUtil.getDiagnosticsMonitorConfigurationElement方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getSyslogCfg
# 需要导入模块: from Utils import LadDiagnosticUtil [as 别名]
# 或者: from Utils.LadDiagnosticUtil import getDiagnosticsMonitorConfigurationElement [as 别名]
def getSyslogCfg():
syslogCfg = ""
ladCfg = readPublicConfig('ladCfg')
encodedSyslogCfg = LadUtil.getDiagnosticsMonitorConfigurationElement(ladCfg, 'syslogCfg')
if not encodedSyslogCfg:
encodedSyslogCfg = readPublicConfig('syslogCfg')
if encodedSyslogCfg:
syslogCfg = base64.b64decode(encodedSyslogCfg)
return syslogCfg
示例2: get_syslog_config
# 需要导入模块: from Utils import LadDiagnosticUtil [as 别名]
# 或者: from Utils.LadDiagnosticUtil import getDiagnosticsMonitorConfigurationElement [as 别名]
def get_syslog_config(self):
"""
Get syslog config from LAD extension settings.
First look up 'ladCfg' section's 'syslogCfg' and use it. If none, then use 'syslogCfg' at the top level
of public settings. Base64-encoded rsyslogd conf content is currently supported for 'syslogCfg' in either
section.
:return: rsyslogd configuration content string (base64-decoded 'syslogCfg' setting)
"""
syslog_cfg = ''
lad_cfg = self.read_public_config('ladCfg')
encoded_syslog_cfg = LadUtil.getDiagnosticsMonitorConfigurationElement(lad_cfg, 'syslogCfg')
if not encoded_syslog_cfg:
encoded_syslog_cfg = self.read_public_config('syslogCfg')
if encoded_syslog_cfg:
syslog_cfg = base64.b64decode(encoded_syslog_cfg)
return syslog_cfg
示例3: test_entry_is_present
# 需要导入模块: from Utils import LadDiagnosticUtil [as 别名]
# 或者: from Utils.LadDiagnosticUtil import getDiagnosticsMonitorConfigurationElement [as 别名]
def test_entry_is_present(self):
self.assertEqual(LadUtil.getDiagnosticsMonitorConfigurationElement(self.valid_config, "foo"), "bar")
示例4: test_entry_not_present
# 需要导入模块: from Utils import LadDiagnosticUtil [as 别名]
# 或者: from Utils.LadDiagnosticUtil import getDiagnosticsMonitorConfigurationElement [as 别名]
def test_entry_not_present(self):
self.assertIsNone(LadUtil.getDiagnosticsMonitorConfigurationElement(self.missing_from_config, "dummy"))
示例5: test_bogus_config
# 需要导入模块: from Utils import LadDiagnosticUtil [as 别名]
# 或者: from Utils.LadDiagnosticUtil import getDiagnosticsMonitorConfigurationElement [as 别名]
def test_bogus_config(self):
self.assertIsNone(LadUtil.getDiagnosticsMonitorConfigurationElement(self.bogus_config, "dummy"))
示例6: get_syslogEvents_setting
# 需要导入模块: from Utils import LadDiagnosticUtil [as 别名]
# 或者: from Utils.LadDiagnosticUtil import getDiagnosticsMonitorConfigurationElement [as 别名]
def get_syslogEvents_setting(self):
"""
Get 'ladCfg/syslogEvents' setting from LAD 3.0 public settings.
:return: A dictionary of syslog facility and minSeverity to monitor/ Refer to README.md for more details.
"""
return LadUtil.getDiagnosticsMonitorConfigurationElement(self.read_public_config('ladCfg'), 'syslogEvents')