简体   繁体   English

Zabbix LLD自定义过程监视项错误

[英]Zabbix LLD custom process monitoring item error

I want to track my custom processes through Zabbix (v2.4.8). 我想通过Zabbix(v2.4.8)跟踪我的自定义过程。 I am generating the following json object and sending it through UserParameter=service.value[*],/usr/lib/zabbix/externalscripts/custom1.bash : 我正在生成以下json对象,并通过UserParameter=service.value[*],/usr/lib/zabbix/externalscripts/custom1.bash

{
    "data":[

    {
        "{#NAME}":"ntp",
        "{#VALUE}":"1"
    },
    {
        "{#NAME}":"mysql",
        "{#VALUE}":"1"
    },
    {
        "{#NAME}":"prometheus",
        "{#VALUE}":"0"
    },
    {
        "{#NAME}":"apache2",
        "{#VALUE}":"0"
    }

    ]
}

Also, creating an item prototype and graph prototype inside a new template with a new discovery rule, having the following information: 另外,在具有新发现规则的新模板中创建项目原型和图形原型,并具有以下信息:

Discovery rule name: Service Graph
Type: Zabbix Agent
key: service.value

Item Prototype name: Service {#NAME} Graph
Type: Zabbix Agent
key: service.value[{#NAME},{#VALUE}]
Type of info: Numeric(Unsigned) & Decimal

When I apply these settings, the items keep giving the following error: 当我应用这些设置时,这些项目将继续出现以下错误:

Not supported: Received value [{ "data":[ { "{#NAME}":"ntp", "{#VALUE}":"1" }, { "{#NAME}":"mysql", "{#VALUE}":"1" }, { "{#NAME}":"prometheus", "{#VALUE}":"0" }, { "{#NAME}":"apache2", "{#VALUE}":"0" } ]}] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]

I have to create a graph prototype with these settings, so I cannot mention type as "Text" for obvious reasons. 我必须使用这些设置来创建图形原型,因此出于明显的原因,我不能将类型称为“文本”。

Another question: The graphs thus generated are not clickable at all like the other existing graphs. 另一个问题:如此生成的图根本无法像其他现有图一样单击。

Please let me know where I am going wrong. 请让我知道我要去哪里了。

If your service.value key generates JSON, that should be used with the LLD rule only. 如果您的service.value键生成JSON,则应仅将其与LLD规则一起使用。 You should not send any values in it. 您不应在其中发送任何值。 The key to be used in the prototypes should be like any normal key they only returns values it was asked for, do not use the LLD-generating key there. 原型中使用的密钥应像任何普通密钥一样,它们仅返回所要求的值,而不在此处使用LLD生成密钥。

Your current JSON looks like you might be able to use the built-in items for process monitoring, but that is hard to be sure about without additional detail. 您当前的JSON似乎可以使用内置项进行流程监视,但是如果没有其他详细信息,很难保证这一点。

Also note that [*] in the UserParameter definition is not needed if you do not pass parameters to this key. 还请注意,如果您不将参数传递给此键,则不需要UserParameter定义中的[*]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM