Ad Widget

Collapse

PATCH: Macros in names of graphs (and elsewhere)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rledisez
    Junior Member
    • Apr 2008
    • 5

    #1

    PATCH: Macros in names of graphs (and elsewhere)

    When managing a lot of switchs, it's very difficult to remember that interface X of the switch Y is for the server of customer Z. Generally, you name the interface of the switch like the customer. So, putting the name of the interface in the name of the graph is a good idea.

    If you manage a lot of switchs with a lot of interfaces, you probably love to use templates. But with templates, you can't customize the name of graphs...

    So, here is the patch !

    Just create a template with a graph named like this :
    [22] Traffic ({:IF-MIB::ifAlias.22.last()})

    In this example, it will display the value of item that monitors the description of the interface 22.
    eg: [22] Traffic (my_customer)

    You can see that it's the normal syntax of macros {server:key.function(param)} except that when you are on a template, there isn't hostname. So, if you don't put hostname, it will use the current hostname (of the graph displayed). If you put a hostname, it will just retrieves value for the item of that host.

    It should be easy to use this code elsewhere (eg: triggers' name). I hope there isn't too much bugs...

    This patch applies on Zabbix 1.4.5. The most of the code come from evalfunc.c, of zabbix-server.
    Attached Files
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    OOHHH, very cool!

    I had a similar solution a while ago, but I like the elegance of this one.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • pdvorak75
      Junior Member
      • Jul 2008
      • 4

      #3
      patch for 1.5.3?

      This is great, however, I am using 1.5.3 beta and would like this functionality. I tried looking at the patch file and modifying the appropriate section in the 1.5.3 files but I can't get it to work. Any chance you have this patch for the beta code? Also, any chance this can get rolled into the 1.6 release?

      Comment

      • MrKen
        Senior Member
        • Oct 2008
        • 652

        #4
        Macros in names of graphs (and elsewhere)

        What a shame this didn't make it into Zabbix 1.6

        I just tried to patch 1.6 so that I could use ifAlias on my graph Templates, but unfortunately the sql code in charts.php is different and far beyond my coding abilities.

        rledisez - I hope you've upgraded to 1.6 and have made a new patch.

        Devs - This is really useful for snmp template users. Any chance of making it into 1.6.1 or .2 or .3 or .....
        Disclaimer: All of the above is pure speculation.

        Comment

        • rledisez
          Junior Member
          • Apr 2008
          • 5

          #5
          Sorry, I didn't...

          Upgrade for Zabbix is not planned for now (I'm waiting for Debian packages) and I'm currently very busy so I will not work on it in the near futur.

          But if someone want to try, I will answer all the questions asked about the code.

          Comment

          • Aly
            ZABBIX developer
            • May 2007
            • 1126

            #6
            There is such posibility, but only when I'll get some free time, due to it's not so simple with this patch. As I remember it'll require deeper developing to fully apply.
            Zabbix | ex GUI developer

            Comment

            • oneye
              Junior Member
              • May 2008
              • 27

              #7
              This patch would really make my work easyer. Takes alot of editing when you start changing interface names on equipement.



              regards

              Comment

              • oddie
                Junior Member
                • Oct 2008
                • 11

                #8
                I would just like to throw in my vote for this feature to be available in upcoming 1.6.x releases. Maybe 1.6.3?

                This would be so very very useful.

                Thanks!

                Comment

                • dan_cytexone
                  Member
                  • Dec 2008
                  • 61

                  #9
                  This would be awesome

                  Comment

                  • gugusg
                    Junior Member
                    • Jun 2008
                    • 11

                    #10
                    need this too : variables names of item / triggers would be great ! ;-)

                    see this : http://www.zabbix.org/forum/showthre...ed=1#post41049

                    Comment

                    • troffasky
                      Senior Member
                      • Jul 2008
                      • 565

                      #11
                      This one gets my vote too.

                      Comment

                      • sege
                        Member
                        • Jan 2008
                        • 40

                        #12
                        I really, really need this for Zabbix 1.6.2 right about yesterday or something. Anyone made this patch for 1.6.2 for me?

                        I'd like to have macos in graphs as well, is it possible? We always put customer/server names on ports, I would really, really like to use them in Zabbix on graphs and items.

                        Regards,
                        Johan

                        Comment

                        • sege
                          Member
                          • Jan 2008
                          • 40

                          #13
                          Any news around this one? I began remake of the patch for 1.6 but some of the things in the patch were already in 1.6 frontend. How far does this work? Does it work all the way but with different syntax or something?

                          I really really love this one.

                          Comment

                          • iwik
                            Junior Member
                            • May 2007
                            • 2

                            #14
                            Any progress?

                            Any progress about this ? Or patch for zabbix 1.6.3 ?

                            Comment

                            • tob
                              Junior Member
                              Zabbix Certified Specialist
                              • Dec 2008
                              • 25

                              #15
                              Indeed

                              Aly, any updates on this? I really agree this would be extremely useful in large environment (say, lot's of colocation customers in different datacenters ;-)

                              Tnx!

                              Comment

                              Working...