[ZBX-17516] Cannot evaluate expression: expected numeric token Created: 2020 Mar 26  Updated: 2020 Mar 27  Resolved: 2020 Mar 27

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: 4.4.7
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Julien VINCENT Assignee: Zabbix Support Team
Resolution: Commercial support required Votes: 0
Labels: calculateditems
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 18.04


Attachments: PNG File calculated item.PNG     PNG File device_version.PNG    

 Description   

Hello everyone, 

Please find below the issue encountered.

I am using the system run key to get a docker image version.

The command i have works fine but for a specific reason, i am created a calculated item, unfortunately it does not work, i believe because it needs to be in text type and not in numeric mode.

 

Steps to reproduce:

  1. Create a zabbix-agent item using the system run key below :
    (system.run[sudo docker ps | grep "name of the container" | cut -d':' -f 2 | cut -c1-9]), output works great
  2. Create a calculated item and get the last information above with the following formula : 
    last(system.run[sudo docker ps | grep "navineo-pc-integ" | cut -d':' -f 2 | cut -c1-9])

Result:
See screenshot for more information



 Comments   
Comment by Dmitrijs Lamberts [ 2020 Mar 26 ]

Is type of information - float on both?

Comment by Julien VINCENT [ 2020 Mar 27 ]

Hello Dmitrijs, 

No, the actif agent item has text type of information while the calculated item has Numeric (unsigned)

there are only two options, Numeric (unsigned) and Numeric (float). the rest is greyed out

Comment by Dmitrijs Lamberts [ 2020 Mar 27 ]

And how does the actual received value looks like?
Is it 6a.714.56 ?

Comment by Julien VINCENT [ 2020 Mar 27 ]

Yes, this is the output from the command : sudo docker ps | grep "name of the container" | cut -d':' -f 2 | cut -c1-9.

It can return the following information :

  • 6a.714.56
  • 10.692.13

It will varie depending on the image version in docker meaning it will also evolve.

=============================================================

To give you a better idea of what i want to do, it's simple, i would like to display this information under every devices on the map.

According to the information i found on internet, i tried adding the following in the label of the device : 

{ndevice:name:system.run[sudo docker ps | grep "name of the container" | cut -d':' -f 2 | cut -c1-9].last(0)}

But it returns an "unknown" output, so i wanted to do it via the calculated formula. (see the attached image "device_version")

Comment by Dmitrijs Lamberts [ 2020 Mar 27 ]

Well, it's not an integer. And it's not a float.
That's why item is not supported.

Since it is not a bug, and there is nothing to fix here. I am closing this issue.
If you want to get some help on how to achieve your result, please use communication channels as Forum: https://www.zabbix.com/forum/

If you want to get commercial help from Zabbix, please get in touch with our Sales team at [email protected]

Comment by Julien VINCENT [ 2020 Mar 27 ]

Ok, thank you for your help.

Best regards

Generated at Mon Apr 07 19:23:26 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.