[ZBXNEXT-2278] Creation of a graph from an LLD graph prototype fails if using a simple macro in the graph title Created: 2014 Apr 24  Updated: 2017 Jun 28

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: Server (S)
Affects Version/s: 2.2.3
Fix Version/s: None

Type: Change Request Priority: Minor
Reporter: Raymond Kuiper Assignee: Unassigned
Resolution: Unresolved Votes: 8
Labels: database, graphs, lld
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Since Zabbix 2.2 the use of simple macros in graph titles is supported. I'm now running into an issue with it.
I'm currently using a graph prototype that has the following title:

Int. Usg: {#SNMPVALUE} ({{HOST.HOST}:ifAlias["{#SNMPVALUE}"].last(0)})

This works perfectly fine for the case where the following values are returned:

{#SNMPVALUE}: FastEthernet0/1
{{HOST.HOST}:ifAlias["{#SNMPVALUE}"].last(0)}: printer

However, it does not work in these cases:

{#SNMPVALUE}: Adaptive Security Appliance 'HA' interface
{{HOST.HOST}:ifAlias["{#SNMPVALUE}"].last(0)}: LAN/STATE Failover Interface

{#SNMPVALUE}: Adaptive Security Appliance 'Management0/0' interface
{{HOST.HOST}:ifAlias["{#SNMPVALUE}"].last(0)}: <empty value>

What does seem to work in these problem cases is changing the graph title to just this:

Int. Usg: {#SNMPVALUE}

I suspect the LLD graph creation fails on the qoutation marks within {#SNMPVALUE} in the simple macro, but I've not found any logging or proof that confirms this.
Perhaps there is a way of escaping needed in the graph title that I'm not aware of?



 Comments   
Comment by Alexander Vladishev [ 2014 Apr 25 ]

Server can't create these graphs because length of graph titles is too long (> 128 chars).

It can be fixed only in the next major releases since requires changes in a database structure.

I move the issue into a ZBXNEXT project.

Comment by Raymond Kuiper [ 2014 Apr 25 ]

Thanks Alexander, at least now I know what the problem is!

Comment by brendon [ 2016 Oct 14 ]

Is there a workaround for this. I'm running into this exact problem as well on the exact same hardware as Raymond. I'm on v3.2.1

Comment by Mike Yurlov [ 2016 Nov 03 ]

This small feature must be fixed in new release.
Many Devices have long default iface description. For example D-Link give

IF-MIB::ifDescr.1 = STRING: D-Link DGS-3120-24SC R3.00.B02 Port 1 on Unit 1

and "Traf {#SNMPVALUE} : {ifAlias{#SNMPVALUE}.last(0)}" expand to 137 chars length:
"Traf D-Link DGS-3120-24SC R3.00.B02 Port 11 on Unit 1 : {{HOST.NAME}ifAlias[\{D-Link DGS-3120-24SC R3.00.B02 Port 11 on Unit 1\}].last(0)}"

In this case "simple macro in graph titles" supported, but not usable with ifDescr.
ifAlias also may have up to 128 chars length on some devices. Nobody use all 128 My longest alias have 47 chars length.

Another VERY bad thing - Zabbix do not show any warnings. Graphs not created silently. Only debug log have error messave about "very long name"

Comment by Mike Yurlov [ 2016 Nov 08 ]

In Apr 2014 and 2.2.3 Alexander Vladishev promised fix this in new release, but It's still not fixed. 2017 is coming and 3.2 released, but graphs.name still varchar(128)

Comment by Aleksandrs Saveljevs [ 2016 Nov 08 ]

Not sure about a promise. If you mean the first comment above, then Alexander mentioned that it can only be fixed in major releases, no promise was made.

Comment by Mike Yurlov [ 2016 Nov 08 ]

Ok, maybe not promised. I think the following:

Alter Table + some fix in code is an hours work, but add important usability in Zabbix product. As You understand, using ifAlias/ifDescr/HOST.NAME in all events/triggers/graph/names is very useful. Because any Zabbix user can get human-readeable message from interface like "4floor switch port 23 (office417) goes down", fast graph search in drop-down graph list, etc.

In production Support engeneer (with Zabbix on desk) does not need connect to switch and check "what is port 23"? Support engeneer does not need go to switch and search "where is office417 port? It's port 23. Goto Zabbix graphs and search "Traffic for port 23". It should be available in one click.
Time,time and time. Less waste time - more usability and power tool in production.
Automate everything.

That's why Zabbix team should make an effort to do human-readeable descriptions/info interface. It's very power thing.
Another thing: when use SNMP and autodiscovery in production (now we have ~1000 access switches + ~200 other hosts and we growing), put sysDescr/sysLocation into Visible name(s) is first basic thing. But this feature still exist in Zabbix from the box. We need call external script from autodiscovery and update Zabbix database outside. I don't understand why. Of cause, we can use DNS, but not in dynamic environment/local network without DNS names.

This is my vision and I see some posts in Google about all visible names in Zabbix. Probably is not the ticket information, maybe Alexander Vladishev will read this. Thanks.

Comment by Andrey Melnikov [ 2016 Nov 09 ]

DLink switches is crap. Use other method to generate keys - in item prototypes use

ifAdminStatus[Port{#SNMPINDEX}], ifAlias[Port{#SNMPINDEX}], ... etc

in graphs -

"Traf Port{#SNMPINDEX}: {ifAlias[Port{#SNMPINDEX}].last(0)}."

And, if you not changing descriptions on interfaces frequently - better fetch ifAlias

discovery[{#SNMPVALUE},IF-MIB::ifDescr,{#SNMPIFALIAS},IF-MIB::ifAlias]

while interfaces discovered and use it later directly:

"Traf Port{#SNMPINDEX}: {#SNMPIFALIAS}.".

This save numbers of sql lookups when graphs is displayed.

Comment by Mike Yurlov [ 2016 Nov 09 ]

Andrew, thanks. IF-MIB based template is good multivendor template/solution.
ifDescr are not empty (like ifAlias) and always have uniq string (not like ifAdminStatus,ifType,etc). A good choice for the index.

Even Cisco and Extreme may have long ifDescr. Extreme have
IF-MIB::ifDescr.100001 = STRING: VLAN 00001 (userdefined-long-human-readeable-vlan-name)
for logical/ip interface. So we expect Zabbix can handle this.

Comment by Andrey Melnikov [ 2016 Nov 09 ]

Use filter, Luke.

When you discovery by

{#SNMPVALUE},IF-MIB::ifDescr

- use regexp "Port \d+" and vlan entries can't pass in.

Comment by richlv [ 2016 Nov 09 ]

please note that zabbix daemons support posix extended, thus \d might not work

Comment by Mike Yurlov [ 2016 Nov 09 ]

Andrey, I know. We need monitor ip interfaces with long ifAlias/ifDescr too
Yes, it is possible to find another way. But it is better when it works "out of the box".

Comment by romale [ 2017 Jun 07 ]

I've this issue too with cisco asa
zabbix 3.0.8

upd.
Today i've also tested this on zabbix 2.2.10 with parameters:
discovery: "discovery[

{#SNMPVALUE},IF-MIB::ifDescr]"
graph name in discovery: "{#SNMPVALUE}

Traffic {{HOSTNAME}:ifAlias[

{#SNMPVALUE}

].last(0)}"
on cisco dev i've added description to port (for testing):
"sh run int fa 0/0
interface FastEthernet0/0
description 31111111111111111111111111111111111111111111111111111111111 Adaptive Security Appliance 'FastEthernet0/0' interface 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
no ip address
shutdown
duplex half
end"

and no issue with "Cannot create graph: value "Adaptive Security Appliance 'GigabitEthernet0/0' interface Traffic {{HOSTNAME}:ifAlias[Adaptive Security Appliance 'GigabitEthernet0/0' interface].last(0)}" is too long", it's worked.

snmpwalk -c public -v 2c 172.25.130.63 IF-MIB::ifAlias.1
ifAlias.1 = STRING: 31111111111111111111111111111111111111111111111111111111111 Adap

snmpwalk -c public -v 2c 172.25.130.63 IF-MIB::ifDescr.1
ifDescr.1 = STRING: FastEthernet0/0

Is it possible?

Comment by romale [ 2017 Jun 28 ]

May be, is to use discovery[

{#SNMPVALUE},IF-MIB::ifName] and not discovery[{#SNMPVALUE}

,IF-MIB::ifDescr] in LLD rule of the default "Template SNMP Interfaces" template?
It will short and working by default in most cases. Or other vendors has IF-MIB::ifName not such informative as Cisco?

snmpwalk -On -v 2c -c public cisco_asa IF-MIB::ifName
ifName.3 = STRING: GigabitEthernet0/0
ifName.4 = STRING: GigabitEthernet0/1
ifName.5 = STRING: GigabitEthernet0/2
ifName.6 = STRING: GigabitEthernet0/3
ifName.7 = STRING: GigabitEthernet0/4
ifName.8 = STRING: GigabitEthernet0/5

snmpwalk -On -v 2c -c public cisco_asa IF-MIB::ifDescr
ifDescr.3 = STRING: Adaptive Security Appliance 'GigabitEthernet0/0' interface
ifDescr.4 = STRING: Adaptive Security Appliance 'GigabitEthernet0/1' interface
ifDescr.5 = STRING: Adaptive Security Appliance 'GigabitEthernet0/2' interface
ifDescr.6 = STRING: Adaptive Security Appliance 'GigabitEthernet0/3' interface
ifDescr.7 = STRING: Adaptive Security Appliance 'GigabitEthernet0/4' interface
ifDescr.8 = STRING: Adaptive Security Appliance 'GigabitEthernet0/5' interface

snmpwalk -On -v 2c -c public cisco_asr1000 IF-MIB::ifName
ifName.1 = STRING: Gi0/0/0
ifName.2 = STRING: Gi0/0/1
ifName.3 = STRING: Gi0/0/2
ifName.4 = STRING: Gi0/0/3
ifName.5 = STRING: Gi0
ifName.6 = STRING: Vo0
ifName.7 = STRING: Nu0
ifName.8 = STRING: Po1
ifName.9 = STRING: Lo2
ifName.10 = STRING: Lo1

snmpwalk -On -v 2c -c public cisco_asr1000 IF-MIB::ifDescr
ifDescr.1 = STRING: GigabitEthernet0/0/0
ifDescr.2 = STRING: GigabitEthernet0/0/1
ifDescr.3 = STRING: GigabitEthernet0/0/2
ifDescr.4 = STRING: GigabitEthernet0/0/3
ifDescr.5 = STRING: GigabitEthernet0
ifDescr.6 = STRING: VoIP-Null0
ifDescr.7 = STRING: Null0
ifDescr.8 = STRING: Port-channel1
ifDescr.9 = STRING: Loopback2
ifDescr.10 = STRING: Loopback1

Generated at Fri Mar 29 03:23:48 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.