Ad Widget

Collapse

Low-Level Discovery and PHP script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Inixi
    Junior Member
    • Jan 2015
    • 2

    #1

    Low-Level Discovery and PHP script

    Hello,
    In my company we are using Zabbix server and agent version 2.4 and I have a problem with implementing LLD with PHP script which outputs json as it should in documentation here https://www.zabbix.com/documentation...evel_discovery

    In user paramter I have put this line:
    Code:
    UserParameter=php.test.discovery,php -e /opt/somescript.php
    When I use zabbix-get to see the output then it looks fine:
    Code:
    # zabbix_get -s 127.0.0.1 -k "php.test.discovery"
    {"data":[{"{#RGID}":"0_0_0","{#STATE}":"Unbound"},{"{#RGID}":"0_0_1","{#STATE}":"Unbound"},{"{#RGID}":"0_0_2","{#STATE}":"Unbound"},{"{#RGID}":"0_0_3","{#STATE}":"Unbound"},{"{#RGID}":"0_0_4","{#STATE}":"Empty"},{"{#RGID}":"0_0_5","{#STATE}":"Empty"},{"{#RGID}":"0_0_6","{#STATE}":"Empty"},{"{#RGID}":"0_0_7","{#STATE}":"Empty"},{"{#RGID}":"0_0_8","{#STATE}":"Empty"},{"{#RGID}":"0_0_9","{#STATE}":"Empty"},{"{#RGID}":"0_0_10","{#STATE}":"Empty"},{"{#RGID}":"0_0_11","{#STATE}":"Empty"},{"{#RGID}":"0_0_12","{#STATE}":"Empty"},{"{#RGID}":"0_0_13","{#STATE}":"Empty"},{"{#RGID}":"0_0_14","{#STATE}":"Empty"},{"{#RGID}":"0_0_15","{#STATE}":"Empty"},{"{#RGID}":"0_0_16","{#STATE}":"Empty"},{"{#RGID}":"0_0_17","{#STATE}":"Empty"},{"{#RGID}":"0_0_18","{#STATE}":"Empty"},{"{#RGID}":"0_0_19","{#STATE}":"Empty"},{"{#RGID}":"0_0_20","{#STATE}":"Empty"},{"{#RGID}":"0_0_21","{#STATE}":"Empty"},{"{#RGID}":"0_0_22","{#STATE}":"Empty"}]}
    But when I use zabbix_agentd with "-t" switch it just freezes and prints nothing:
    Code:
    # zabbix_agentd -t "php.test.discovery"
    php.test.discovery
    Forcing me to use CTRL-C to exit.

    this only occurs when I use php scripting only, when using perl or bash it works fine, but rewriting scripts from php to one of then is out of question. Is it a common problem with the PHP scripting in LLD?
  • clevelas
    Junior Member
    • Mar 2015
    • 22

    #2
    Low-Level Discovery and PHP script

    I've been struggling with this for days. A simple PHP script that for now just echos out raw JSON. zabbix_agentd -t just hangs. I just converted the script to simple perl and that command works just great.

    What's the deal with PHP LLD?

    Comment

    • maplesyrupghost
      Member
      • Jul 2012
      • 37

      #3
      Originally posted by clevelas
      I've been struggling with this for days. A simple PHP script that for now just echos out raw JSON. zabbix_agentd -t just hangs. I just converted the script to simple perl and that command works just great.

      What's the deal with PHP LLD?
      did you ever get a PHP script LLD working?

      Comment

      • clevelas
        Junior Member
        • Mar 2015
        • 22

        #4
        It appears in my current version (2.4.7), it is working now. Not sure what changed. The format had to be exact, I do remember that. And I'm running php 5.6. That was a change from before as well.

        Comment

        Working...