Ad Widget

Collapse

Invalid discovery rule value: cannot close top level object

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zxlin
    Junior Member
    • May 2024
    • 4

    #1

    Invalid discovery rule value: cannot close top level object

    Hello,
    I have migrated an old Zabbix 3.2.4 to 6.4.
    In order to monitor only certain services, I have a discovery rule that uses a Powershell script to determine the services to be monitored on a server and create the corresponding items using an item prototype. I have adapted the script to the new notation.
    In the list of discovery rules for a given host, I get the following message: "Invalid discovery rule value: cannot close top level object"
    Unfortunately, I cannot find an explanation of what this message refers to. Is the error to be found in the return array of the script or in the configuration?

    Return array:
    Code:
    [
        {
            "{#SERVICESTATE}": "Running",
            "{#SERVICEDISPLAY}": "Apache Tomcat 9.0 FAV2",
            "{#SERVICENAME}": "FAV2",
            "{#SERVICEDESC}": "Apache Tomcat 9.0.27 Server - https://tomcat.apache.org/",
            "{#SERVICEDIR}": "D:/apache-tomcat-9/bin/"
        },
        {
            "{#SERVICESTATE}": "Running",
            "{#SERVICEDISPLAY}": "Apache Tomcat 9.0 DA",
            "{#SERVICENAME}": "DA",
            "{#SERVICEDESC}": "Apache Tomcat 9.0.27 Server - https://tomcat.apache.org/",
            "{#SERVICEDIR}": "D:/apache-tomcat-9/bin/"
        },
        {
            "{#SERVICESTATE}": "Running",
            "{#SERVICEDISPLAY}": "Apache Tomcat 9.0 WS",
            "{#SERVICENAME}": "WS",
            "{#SERVICEDESC}": "Apache Tomcat 9.0.27 Server - https://tomcat.apache.org/",
            "{#SERVICEDIR}": "D:/apache-tomcat-9/bin/"
        }
    ]
    My LLD configuration
    Click image for larger version

Name:	grafik.png
Views:	295
Size:	41.5 KB
ID:	484501

    Click image for larger version

Name:	grafik.png
Views:	144
Size:	19.9 KB
ID:	484502

    What is incorrectly configured or missing in my configuration?
  • zxlin
    Junior Member
    • May 2024
    • 4

    #2
    Bin ich hier allein oder gibt es hier keine Unterstützung?

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4806

      #3
      Looks ok to me... Tried to replicate a discovery here... works OK (at least feeding your data to disco results in no errors) ..

      It might be from the script ? if you call it with zabbix_get, what do you get as answer? or run locally with zabbix_agent -t ?

      Comment

      Working...