Ad Widget

Collapse

LLD issue - value is showing in key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jan.motejzik
    Junior Member
    • Nov 2022
    • 7

    #1

    LLD issue - value is showing in key

    Hello, I would like to ask about a problem that I have been struggling with for several days.

    I would like to monitor the values from the json file, specifically the number of days remaining until the end of the expiration. I think I have a problem with the LLD settings, the value that should appear for a specific item as value is displayed in the key and there is Parameter is not allowed error.


    1) python script returns me data in json:

    HTML Code:
    [
        {
            "{#ROBOT}": "Alfa",
            "{#DAYS}": "63"
        },
        {
            "{#ROBOT}": "Gamma",
            "{#DAYS}": "14"
        },
        {
            "{#ROBOT}": "Delta",
            "{#DAYS}": "19"
        }
    ]

    2)

    discovery rule:
    key: rpa.status

    item prototype:
    name: {#COMPANY}
    key: rpa.status[{#DATE}]

    3)

    zabbix agent:
    UserParameter=rpa.status,cat /opt/zabbix/test (just for test purposes)​




    what am I missing? thanks for the hints !


    Attached Files
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    UserParameter=rpa.status[*],cat.....

    Comment

    • jan.motejzik
      Junior Member
      • Nov 2022
      • 7

      #3
      thanks. now I see whole json as a value in latest data ..


      do I setup lld macros correctly?


      thanks

      Click image for larger version

Name:	image.png
Views:	223
Size:	10.0 KB
ID:	475328

      Comment

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

        #4
        You already have them in there. Just like built in block devices discovery returns json with formatted LLD macros. (https://www.zabbix.com/documentation...amples/devices).
        No need to define any others... (and what you defined there does not exist in your json.., there is no key called "robot" )

        Comment

        • jan.motejzik
          Junior Member
          • Nov 2022
          • 7

          #5

          thank you for your reply, however, despite creating several templates, I don't understand why this one still doesn't work for me ..



          I was editing the UserParameter for zabbix agent:

          UserParameter=rpa.status[*],....


          but dont get, why I didnt get the right value ....


          could you please help me with these settings ?


          thanks​

          Comment

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

            #6
            Wait... you want that this userparameter would pull correct number via that python script, which outputs that json in first post?

            Comment

            • jan.motejzik
              Junior Member
              • Nov 2022
              • 7

              #7

              I have python script which returns me json file from first post. From json I need monitor a value from {#DAYS} section, which is number of days to expire.....


              as u can see at the screenshots, like a last value there is nothing instead of number of expire days ...



              at the screenshots u can see my whole settings ...


              User Parameter is UserParameter=rpa.check[*],python3.9 /opt/script.py




              thanks for helping ..


              Click image for larger version  Name:	Screenshot_23.png Views:	0 Size:	13.9 KB ID:	475416 Click image for larger version

Name:	image.png
Views:	219
Size:	35.5 KB
ID:	475421​ ​

              Click image for larger version  Name:	image.png Views:	0 Size:	30.4 KB ID:	475420

              Attached Files
              Last edited by jan.motejzik; 05-12-2023, 17:19.

              Comment

              • jan.motejzik
                Junior Member
                • Nov 2022
                • 7

                #8
                json from script:

                Code:
                [
                {
                "{#ROBOT}": "Alfa",
                "{#DAYS}": "63"
                },
                {
                "{#ROBOT}": "Gamma",
                "{#DAYS}": "14"
                },
                {
                "{#ROBOT}": "Delta",
                "{#DAYS}": "19"
                }
                ]

                Comment

                Working...