Ad Widget

Collapse

no foreign keys in database?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cameL
    Junior Member
    • Sep 2007
    • 7

    #1

    no foreign keys in database?

    maybe my eyesight is getting worse but i cant find the foreign keys in the database. innoDB supports foreign keys in connection with MySQL and i cant believe, that the developers didnt make use of fks, cause when i take a look at the tables some fields bear the name of a foreign key =)

    maybe someone can help me, cause im trying to develop an ER Model and i dont want to (just) guess the relationships =)

    thx
    kind regards
    cameL
  • fatiha
    Member
    • Nov 2007
    • 78

    #2
    It is right

    Hi,

    I am reading php code and I found that foreign keys are simulated in the code. For example, in actions.inc.php before deleting an action :
    - delete from conditions
    - delete from operations
    - delete from alerts

    So if you want to create foreign keys in the database, you have to comment lines in php code and activate "on delete cascade" in BDD.

    I hope that zabbix developers will correct this.

    Fatiha

    Comment

    • r3dn3ck
      Member
      • Jul 2008
      • 43

      #3
      any word on if/when this sort of feature may make it into a release?

      It would make it cake to integrate with other management systems and then maybe we could have a bulk template assignment feature almost as a side effect.

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        Lack of foreign keys does not make a software worse. This is a design decision, which is absolutely correct for ZABBIX.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • r3dn3ck
          Member
          • Jul 2008
          • 43

          #5
          it's not a criticism bud... it's a feature request. Hell I'm one of the biggest fans of Z. I've installed it on over 5000 hosts in 4 different companies production environments in the last year. Trust me... I'm a fan. It's a legit feature request that would make integration with other systems significantly easier.

          While the bulk of the pain the FK thing addresses is initial setup it'd still be super neato to have the option to use really simple command line sql and have cascade update/delete take care of the complicated bits. For now I use the import tool and complicated sql scripts for bulk imports and that combined with the template assignment mod in v1.4.6 should do away with a lot of the actual meat of that issue but still... suggestion stands.

          BTW...I'm currently installing Zabbix on yet another production environment. This one has a little over 2000 hosts + associated network infrastructure. There's no limit to the ways I'll look to save time when the host lists are this long. I'd imagine many sysadmins are similarly selectively active.

          Comment

          • Niels
            Senior Member
            • May 2007
            • 239

            #6
            I agree with Alexei.

            @ r3dn3ck: You're asking for a simple SQL to do updates on the Zabbix database. That's the wrong way of solving the problem, imo. What you should be asking for is a simple Zabbix function call to do it -- we need a Zabbix API, so that Zabbix can safely abstract away the details of the database.

            Comment

            • r3dn3ck
              Member
              • Jul 2008
              • 43

              #7
              you are correct... an API would be groovy. Alexei, thoughts? Even rolling out pieces of it at a time would be cool.
              Last edited by r3dn3ck; 24-07-2008, 16:23.

              Comment

              • nelsonab
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • Sep 2006
                • 1233

                #8
                I agree with this. A SOAP or XMLRPC interface would be awesome! I also think this would greatly improve and speed the ability to create interoperability with other systems.
                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

                • lamont
                  Member
                  • Nov 2007
                  • 89

                  #9
                  Yep, I'm another 2,000-host user that would like some kind of web services API in addition to the php frontend. XML-RESTish, XML-RPC-ish or SOAP would be fine.

                  Comment

                  • hwinkel
                    Junior Member
                    • Sep 2005
                    • 7

                    #10
                    Soap

                    I defintly vote for a API as well. We just evaluate for 200 Host n*****s replacement, and a API is a major requirement for us

                    Comment

                    • nelsonab
                      Senior Member
                      Zabbix Certified SpecialistZabbix Certified Professional
                      • Sep 2006
                      • 1233

                      #11
                      Already in the works. :-)
                      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

                      • teferi
                        Member
                        • Jul 2008
                        • 93

                        #12
                        Agreed with all above, because what I'm now doing - is writing somekind tool, which alters zabbix db. And having a developer-provided API would be much more reliable =)

                        Comment

                        • Alexei
                          Founder, CEO
                          Zabbix Certified Trainer
                          Zabbix Certified SpecialistZabbix Certified Professional
                          • Sep 2004
                          • 5654

                          #13
                          I would like to understand API requirements before starting doing anything. What functions the API would provide?
                          Alexei Vladishev
                          Creator of Zabbix, Product manager
                          New York | Tokyo | Riga
                          My Twitter

                          Comment

                          • r3dn3ck
                            Member
                            • Jul 2008
                            • 43

                            #14
                            I would like to be able to add/remove/change hosts, templates, and groups from it. I don't need to administer items or triggers or most other things from the API (nor do I see a lot of sense in that, since those can be messed with pretty perfectly in the web interface)

                            add/change/remove hosts
                            add/change/remove host profile data
                            add/change/remove host group assignment
                            add/change/remove host template assignment
                            Enable/Disable monitoring on HOST(x)
                            Enable/Disable monitoring on template members (all hosts in a template affected)
                            Enable/Disable monitoring on group members (all hosts in a group affected)

                            Being able to apply templates to large numbers of hosts is the single most critical item to me. All my hosts get items assigned to them based on function, each function has a template. This would make adding a template to 500+ hosts at a time so much easier. We can't link groups since we use groups too identify which property(ies) the server is working under.

                            A faster way of creating maps would be slick too (but it's a purely nice-to-have). Perhaps if I could feed an XML with grid coordinates and boundaries to the API it load it into the DB faster than I can click and select.

                            Comment

                            • xs-
                              Senior Member
                              Zabbix Certified Specialist
                              • Dec 2007
                              • 393

                              #15
                              A nice talk about an API.

                              Pease add the following to the wishlist also
                              - User management
                              - UserGroup management (including add/remove permissions for nodes/hostgroups/hosts
                              - Action mgt (tricky i know)

                              Comment

                              Working...