Ad Widget

Collapse

{INVENTORY.NAME} macro not translating in trigger name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mgrzegorski
    Junior Member
    • Jan 2023
    • 14

    #1

    {INVENTORY.NAME} macro not translating in trigger name

    I'm on zabbix 6.2 version and according to this page https://www.zabbix.com/documentation...ed_by_location {INVENTORY.NAME} is supported in Trigger-based notifications and commands.

    My setup:
    using built in template for hikvision cameras i added discover rule to find all cameras, then set up action to add them to hosts and set their inventory mode to automatic. When i go to inventory page for any camera then name field is populated by template item key hikvision_cam.device_name so thats work.
    Now i want to setup basic trigger.
    Click image for larger version

Name:	image.png
Views:	895
Size:	30.6 KB
ID:	458237

    The {HOST.HOST} part translate correctly to camera ip, but inventory.name does not while it has Name in inventory
    Click image for larger version

Name:	image.png
Views:	787
Size:	11.7 KB
ID:	458239​​​
    Attached Files
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    It says "Trigger based notifications and commands"... not " Trigger names".

    Comment

    • mgrzegorski
      Junior Member
      • Jan 2023
      • 14

      #3
      w/e, got it working without this great community help

      Comment

      • TheBonaZabbix
        Member
        • Feb 2023
        • 67

        #4
        Dear Mgrzegorski,
        May I ask how did you do it please?

        Many thanks
        Ciao

        Comment

        • mgrzegorski
          Junior Member
          • Jan 2023
          • 14

          #5
          you have to mention item key somewhere in the expression field, doesn’t matter what is it, simply check for some random string then you can mention this by using ITME.LASTVALUEX where x is expression number in my case 2. absolutely retarted but at least it is free software


          Click image for larger version

Name:	image.png
Views:	673
Size:	43.9 KB
ID:	460972

          Comment

          • TheBonaZabbix
            Member
            • Feb 2023
            • 67

            #6
            Many thanks for your reply !
            You have been very kind.

            For my experience unfortunately this forum does not help new users like me.
            I asked a few questions but never received a complete answer.

            Have a nice day !​

            Comment

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

              #7
              Question still remains, why your camera hostname is set to IP, and no name so you could use {HOST.NAME} or {HOST.HOST} macros as everyone else... You are not using that inventory macro right now also... you refer directly to item, that feeds inventory....You could switch off inventory, it would still work.. Your solution has been defacto solution since early days of Zabbix to display values of of other items in triggers.

              You say, you set up a discovery rule and everything works... seems it does not work properly, if you have to use workarounds... Maybe adding camera IP-s do DNS and use DNS name as hostname in discovery would give you needed results?

              Blaming software to be retarded just because you try to use things in places, where they are not supported, is not software issue, but yours...



              Originally posted by TheBonaZabbix
              For my experience unfortunately this forum does not help new users like me.
              I asked a few questions but never received a complete answer.​
              Goes already offtopic but ...
              Generally about those n00b questions.... It is very hard to answer the questions, if the person who asks, does not understand the answers... does not understand terms used in documentation and has not even read the docs in most of cases... Usually expecting full step-by-step guides for each question... With pictures... Sorry, but this is community forum, people answer questions out of their free time, expecting someone to do couple of hours work for an answer, is very selfish...
              I would say majority(80+%) of "first questions" would be resolved by reading docs...

              Comment

              • TheBonaZabbix
                Member
                • Feb 2023
                • 67

                #8
                Hi #Cyber,
                I didn't mean to be rude to the forum.
                I understand that when things are free you can't expect anything but only thank!
                I add that in my previous posts maybe you were the only one to answer me... so thank you.

                I add that I don't expect answers with step-by-step guides.
                I would just like an answer, even a generic one that puts me on the right track.

                Unfortunately Zabbix has particular logics therefore, especially at the beginning, a new user like me is in trouble.

                You say that often the manuals are not read..... I've been searching the Internet for more than a week, doing tests, breaking keyboards.... nevertheless I can't do one thing and I can't find anything
                that can help me (I'm referring to my post asking for help with a host with multiple interfaces)



                Thanks for your help.
                A greeting
                Andrea

                PS. Sorry for my english.​

                Comment

                • mgrzegorski
                  Junior Member
                  • Jan 2023
                  • 14

                  #9
                  simply because those names are not hostnames or whatever, instead they are channels names, which only you can get by querying camera api which hikvision template does, and then feeds it to inventory. Im not going to manually set hostnames for 1000+ cameras for dns resolve just so zabbix can use host.name, so this was only solution i could think of. Also i like how you thrashed my answer but weren’t bothered to post proper one before. just nuke this thread and move one. im surprised im still not banned lol.

                  Comment

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

                    #10
                    Originally posted by mgrzegorski
                    simply because those names are not hostnames or whatever, instead they are channels names, which only you can get by querying camera api which hikvision template does, and then feeds it to inventory. Im not going to manually set hostnames for 1000+ cameras for dns resolve just so zabbix can use host.name, so this was only solution i could think of. Also i like how you thrashed my answer but weren’t bothered to post proper one before. just nuke this thread and move one. im surprised im still not banned lol.
                    All in all, you get the answers based on info you provide... No info, low quality answer...

                    Your initial question was about macro usage.. First sentence already declared wrong assumptions... So, clearing up conceptual errors can later lead to other questions... which you did not really ask... Just "thanks for nothing"...
                    I do not know camera systems, so I cannot really give suggestions without your side explanations... how should I know, how you obtain that name? I can only suggest based on common zabbix knowledge about network discovery.

                    If that info is available over API, you could run a script item to pull that name and run update command over API to fill up "visible name" and then use {HOST.NAME} macro without any additional clauses in expression.​

                    Comment

                    Working...