Ad Widget

Collapse

Send float number with zabbix_sender

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skiny13
    Junior Member
    • May 2013
    • 2

    #1

    Send float number with zabbix_sender

    Hi,

    i'm trying to send a custom data to my Zabbix server using "zabbix_sender".
    The data is the result of "iostat -c" (a package that gives cpu load), and this data is a float (0.59 for instance).
    I've added an item "CPU", with the keys "user" and as "Type of information" I've selected "Numeric (float)".

    My zabbix_sender command line is:
    zabbix_sender -z 192.168.1.250 -p 10051 -s "Zabbix server" -k "user" -o $user
    This gives me
    Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.000101"
    I think this is because I send a float, but I don't understand why Zabbix can't receive such value.

    Thanks for your help.
  • NAR
    Junior Member
    • Nov 2017
    • 3

    #2
    Similar problem

    I have the similar problem (on Zabbix 3.4 on Debian 9.2 strech). I created the float item, sent the value:

    Code:
    > zabbix_sender -vv -z localhost -p 10051 -s api_test -k 'blockchain.float' -o 342.45
    zabbix_sender [11183]: DEBUG: answer [{"response":"success","info":"processed: 0; failed: 1; total: 1; seconds spent: 0.000018"}]
    info from server: "processed: 0; failed: 1; total: 1; seconds spent: 0.000018"
    sent: 1; skipped: 0; total: 1
    Then I changed the type of the item to integer, it worked:
    Code:
    > zabbix_sender -vv -z localhost -p 10051 -s api_test -k 'blockchain.float' -o 342
    zabbix_sender [20122]: DEBUG: answer [{"response":"success","info":"processed: 1; failed: 0; total: 1; seconds spent: 0.000052"}]
    info from server: "processed: 1; failed: 0; total: 1; seconds spent: 0.000052"
    sent: 1; skipped: 0; total: 1
    I changed the type back to float and now it works even for floats:
    Code:
    zabbix_sender -vv -z localhost -p 10051 -s api_test -k 'blockchain.float' -o 342.47
    zabbix_sender [25568]: DEBUG: answer [{"response":"success","info":"processed: 1; failed: 0; total: 1; seconds spent: 0.000073"}]
    info from server: "processed: 1; failed: 0; total: 1; seconds spent: 0.000073"
    sent: 1; skipped: 0; total: 1
    Why didn't it work for the first time?

    Comment

    Working...