Ad Widget

Collapse

Smartontool - Value should be a JSON object

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • proseti
    Junior Member
    • Feb 2018
    • 2

    #1

    Smartontool - Value should be a JSON object

    Hi,
    I have problem with monitoring of my hdd WD. On this bare metal server I have installed Xen. On Xen Server I have zabbix agent and installed this
    https://github.com/v-zhuravlev/zbx-smartctl , step by step.
    Unfortunately it doesn't work properly. I get error in zabbix server - Value should be a JSON object. You can see it on the screenshot:


    Added in sudoers /usr/bin/perl didn't resolve the issue :/.
    On server with agent:

    sudo perl smartctl-disks-discovery.pl
    {
    "data":[

    {
    "{#DISKNAME}":"/dev/sda -d sat",
    "{#SMART_ENABLED}":"1"
    }
    ]
    }



    sudo zabbix_agentd -t uHDD.discovery

    uHDD.discovery [t|{
    "data":[

    {
    "{#DISKNAME}":"/dev/sda -d sat",
    "{#SMART_ENABLED}":"1"
    }
    ]
    }]

    Anybody can help with this issue?
  • kaspars.mednis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2017
    • 349

    #2
    All scripts on server are executed from zabbix user with zabbix user permissions.

    Added in sudoers /usr/bin/perl didn't resolve the issue :/.
    I think zabbix user should be in the sudoers file.....

    its better to do sudo zabbix command to test your zabbix scripts from zabbix user

    Regards,
    Kaspars

    Comment

    • proseti
      Junior Member
      • Feb 2018
      • 2

      #3
      From /etc/passwd
      zabbix:x:995:990:Zabbix Monitoring System:/var/lib/zabbix:/sbin/nologin

      From /etc/sudoers
      zabbix ALL= (ALL) NOPASSWD: /usr/bin/perl,/usr/sbin/smartctl,/etc/zabbix/scripts/smartctl-disks-discovery.pl

      Comment

      • Pepe94
        Junior Member
        • Jan 2018
        • 4

        #4
        Originally posted by proseti
        from /etc/passwd
        zabbix:x:995:990:zabbix monitoring system:/var/lib/zabbix:/sbin/nologin

        from /etc/sudoers
        zabbix all= (all) nopasswd: /usr/bin/perl,/usr/sbin/smartctl,/etc/zabbix/scripts/smartctl-disks-discovery.pl
        Hi, did you solved this problem? Because I have it same. I did it all step by step but still get "Value should be a JSON object"

        Comment

        Working...