English 中文(简体)
zabix 报告错误字符串 [已关闭]
原标题:zabbix reporting error string [closed]
  • 时间:2012-05-23 16:08:41
  •  标签:
  • zabbix
Closed. This question is off-topic. It is not currently accepting answers.

想要改进这个问题吗? 更新了问题 ,因此堆积溢流的回答是

Closed 11 years ago.

s让我们以 zabbix 通过代理来监视存储 。 我们希望当 zabbix 的存储失败时, 用某些脚本生成的错误描述给我们发邮件。 zabbix 能否得到字符串输出( ala nagos) 并报告它( 不只是字符串监测和报告发现/ 找不到), 或者只报告整数的工作吗?

最佳回答

您可以创建含有错误文字的文本或日志项目, 并在此项目中创建触发器, 检查“ 错误” 一词或某些值。 为该触发器创建一个动作, 并在通知中包含此项目的价值, 请使用 {ITEM. LASTvalUE} 宏 。

s 在此列出您在通知 < a href=> 中使用的宏列表, http://www.zabbix.com/documentation/2.0/manual/ appendix/macross/ support_by_place" rel=“no follow" > http://www.zabbix.com/document/2.0/manual/ appendix/macros/ support_by_place 。

问题回答

使用 Zabbix 进行字符串或文本 Regex 检查非常容易。 您可以使用简单的命令行检查来进行检查, 该检查会回溯错误或“ ok” 消息 。

例如,您想要检查日志中的“驾驶失败”并发电子邮件给它, 我会在Zabbix做一些类似“钥匙”的事情。

system.run[grep  drive failure  /var/log/message || echo  okay ]

设置检查为“ 文本 ”, 它会报告一个grepped 匹配或一个正确消息。 您可以在提醒中使用正则表达式发送邮件给任何不匹配“ OK ” 的邮件, 例如 :

{your_template:system.run[grep  drive failure  /var/log/message || echo  OK ].regexp(OK)}#1

收到除“ 好” 外的文字行后, 这将提醒 。

在 Zabbix 中处理文本时存在一些限制。 首先, Zabbix 只报告第一行。 第二, 检查必须 ways 返回文本, 要么是一条好消息, 要么是错误。 如果您检查空出Zabbix, 就会认为它已经损坏 。





相关问题
Zabbix - Macro {$MYSQL.DSN} without odbc.ini entry

Is there a way to configure {$MYSQL.DSN} without odbc.ini entry? Not necessary need to be using {$MYSQL.DSN}, but where can I only use connection string without odbc.ini in host configuration page ...

How to expose data to zabbix

Here is my goal: I would like to be able to report various metrics to zabbix so that we can display the graphs on a web page. These metrics include: latency per soap service submission various ...

Does Nagios have an API that can control targets?

In Zabbix, there is a well documented (although in Draft status) API for instantiating targets and controlling them. Does such an API exist in Nagios? The need for this is a cloud-based ...

active directory monitoring

I want to develop a monitoring tool to monitor active directory like (solar wind,op manager etc). For this purpose,I have chosen Zabbix(an open source tool) to monitor AD and provide me real time ...