• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python NSCP.log_error函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中NSCP.log_error函数的典型用法代码示例。如果您正苦于以下问题:Python log_error函数的具体用法?Python log_error怎么用?Python log_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了log_error函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: log

 def log(self, show_all = False, prefix = '', indent = 0):
     if self.status:
         if show_all:
             log('%s%s%s'%(prefix, ''.rjust(indent, ' '), self))
         log_debug('%s%s%s'%(prefix, ''.rjust(indent, ' '), self))
     else:
         log_error('%s%s%s'%(prefix, ''.rjust(indent, ' '), self))
开发者ID:mickem,项目名称:nscp,代码行数:7,代码来源:test_helper.py


示例2: log

 def log(self, prefix="", indent=0):
     start = "%s%s" % (prefix, "".rjust(indent, " "))
     if self.status:
         log_debug("%s%s" % (start, self))
     else:
         log_error("%s%s" % (start, self))
     for c in self.children:
         c.log(prefix, indent + 1)
开发者ID:jkells,项目名称:nscp,代码行数:8,代码来源:test_helper.py


示例3: log

	def log(self, prefix = '', indent = 0):
		start = '%s%s'%(prefix, ''.rjust(indent, ' '))
		if self.status:
			log_debug('%s%s'%(start, self))
		else:
			log_error('%s%s'%(start, self))
		for c in self.children:
			c.log(prefix, indent+1)
开发者ID:Fox-Alpha,项目名称:nscp,代码行数:8,代码来源:test_helper.py


示例4: append

 def append(self, entry):
     if not entry:
         log_error("Attempting to add invalid entry (None)")
     elif entry == self:
         log_error("Attempting to add self to self")
     else:
         if self.status and not entry.is_ok():
             self.status = False
         self.children.append(entry)
开发者ID:jkells,项目名称:nscp,代码行数:9,代码来源:test_helper.py


示例5: get_plugins

	def get_plugins(self):
		(code, data) = self.registry.query(self.build_command_request(4))
		if code == 1:
			message = plugin_pb2.RegistryResponseMessage()
			message.ParseFromString(data)
			for payload in message.payload:
				if payload.inventory:
					log_debug('Found %d plugins'%len(payload.inventory))
					return payload.inventory
		log_error('No plugins')
		return []
开发者ID:borgified,项目名称:nscp,代码行数:11,代码来源:docs.py


示例6: handler_wrapped

	def handler_wrapped(self, channel, request):
		log_error('DISCARDING message on %s'%(channel))
		
		message = plugin_pb2.SubmitRequestMessage()
		message.ParseFromString(request)
		command = message.payload[0].command
		log('Got message %s on %s'%(command, channel))
		
		msg = self.get_response(command)
		msg.got_response = True
		self.set_response(msg)
		return None
开发者ID:Fox-Alpha,项目名称:nscp,代码行数:12,代码来源:test_nrpe.py


示例7: get_query_aliases

	def get_query_aliases(self):
		log_debug('Fetching aliases...')
		(code, data) = self.registry.query(self.build_command_request(5))
		if code == 1:
			message = plugin_pb2.RegistryResponseMessage()
			message.ParseFromString(data)
			for payload in message.payload:
				if payload.inventory:
					log_debug('Found %d aliases'%len(payload.inventory))
					return payload.inventory
		log_error('No aliases found')
		return []
开发者ID:ossmon,项目名称:nscp,代码行数:12,代码来源:docs.py


示例8: inbox_handler_wrapped

	def inbox_handler_wrapped(self, channel, request):
		message = plugin_pb2.SubmitRequestMessage()
		message.ParseFromString(request)
		if len(message.payload) != 1:
			log_error("Got invalid message on channel: %s"%channel)
			return None
		command = message.payload[0].command
		log_debug('Got message %s on %s'%(command, channel))
		
		msg = NSCAMessage(command)
		msg.got_response = True
		self.set_response(msg)
		return None
开发者ID:0000-bigtree,项目名称:nscp,代码行数:13,代码来源:test_nsca.py


示例9: __main__

def __main__(args):
    global plugin_id
    # List all namespaces recursivly
    core = Core.get(plugin_id)
    (ret, ns_msgs) = core.simple_exec('CheckWMI', 'wmi', ['--list-all-ns'])
    if len(ns_msgs) == 0:
        log_error("Failed to execute WMI command is CheckWMI enabled?")
    else:
        for ns in ns_msgs[0].splitlines():
            # List all classes in each namespace
            (ret, cls_msgs) = core.simple_exec('any', 'wmi', ['--list-classes', '--simple', '--namespace', ns])
            for cls in cls_msgs[0].splitlines():
                log( '%s : %s'%(ns, cls))
开发者ID:mickem,项目名称:nscp,代码行数:13,代码来源:list_all_wmi_objects.py


示例10: extend

    def extend(self, lst):
        if isinstance(lst, list):
            if self.status:
                for c in lst:
                    if not c.is_ok():
                        self.status = False

            for c in lst:
                if c.contains(self):
                    log_error("Attempting to add a list with me in it")
                    return
            self.children.extend(lst)
        else:
            self.append(lst)
开发者ID:jkells,项目名称:nscp,代码行数:14,代码来源:test_helper.py


示例11: do_one_test

	def do_one_test(self, script, expected = status.OK, message = "Foo Bar", args=[], cleanup=True):
		result = TestResult('%s (%s)'%(script, args))
		(ret, msg, perf) = self.core.simple_query(script, args)
		if cleanup and os.name != 'nt':
			message = message.replace('"', '')
			message = message.replace('$ARG1$', '$')
			message = message.replace('$ARG2$', '$')
			message = message.replace('$ARG3$', '$')

		message = message.replace('\r', '\n')
		message = message.replace('\n\n', '\n')
		msg = msg.replace('\r', '\n')
		msg = msg.replace('\n\n', '\n')

		result.assert_equals(ret, expected, 'Validate return code for %s'%script)
		result.assert_equals(msg, message, 'Validate return message for %s'%script)
		if msg != message:
			diff = difflib.ndiff(msg.splitlines(1), message.splitlines(1))
			for l in diff:
				log_error(l)
		return result
开发者ID:mickem,项目名称:nscp,代码行数:21,代码来源:test_external_script.py


示例12: run

	def run(self, arguments = []):
		cases = []
		try:
			parser = ThrowingArgumentParser(prog='nscp')
			parser.add_argument("--script", help="The script to run (sort of ignored)", action='store')
			parser.add_argument("--case", help="Which test case to run", action='append')
			args = parser.parse_args(arguments)
			cases = args.case
		except Exception as e:
			log_error('Failed to parse command line: %s'%e)
			
		result = TestResult('Test result for %d suites'%len(self.suites))
		for suite in self.suites:
			instance = suite.getInstance()
			instance.setup(self.plugin_id, self.prefix)
			suite_result = TestResult('Running suite: %s'%instance.title())
			if cases:
				suite_result.append(instance.run_test(cases))
			else:
				suite_result.append(instance.run_test())
			result.append(suite_result)
			result.add_message(suite_result.is_ok(), 'Result from suite: %s'%instance.title())
			instance.teardown()
		return result
开发者ID:Fox-Alpha,项目名称:nscp,代码行数:24,代码来源:test_helper.py



注:本文中的NSCP.log_error函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python NSCP.Core类代码示例发布时间:2022-05-24
下一篇:
Python NSCP.log_debug函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap