Ad Widget

Collapse

Getting Error on Discovery Rule from Zabbix Agent that "Value Should Be JSON Object"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff West
    Junior Member
    • Jul 2020
    • 4

    #1

    Getting Error on Discovery Rule from Zabbix Agent that "Value Should Be JSON Object"

    When I run the zabbix_get command I get the following:

    [root@zabbix jeff.west.sa]# zabbix_get -s 10.21.1.43 -k nutdev1_battery
    100

    Any ideas how to correct this?
  • Jeff West
    Junior Member
    • Jul 2020
    • 4

    #2
    So, I updated my script called status_ups1.sh

    #!/bin/bash
    status=$(/usr/bin/upsc nutdev1@localhost ups.status 2>&1 | grep -v '^Init SSL')
    json_status='{"nutdev1_status": "'$status'" }'
    echo $json_status

    I created a UserParameter in the zabbix_agentd.conf

    UserParameter=nutdev1_status,/scripts/status_ups1.sh

    From the server now, when I run the following:

    [root@zabbix jeff.west.sa]# zabbix_get -s 10.21.1.43 -k nutdev1_status
    {"nutdev1_status": "OL" }
    [root@zabbix jeff.west.sa]#

    The output, which is validated as proper JSON, but Zabbix Discovery Rule still tells me "Value Should Be JSON Object"

    Any ideas?

    Comment

    Working...