Ad Widget

Collapse

zabbix tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • silvana
    Junior Member
    • Aug 2010
    • 4

    #1

    zabbix tables

    *Hi,
    I am migrating from Nagios to Zabbix, and I would like to migrate the data about the monitored hosts in Nagios, to the Zabbix database.
    I know there is an API but it is in draft state , so I prefer not to use this API and instead I would like to insert the data directly into the zabbix database.
    So I would like to have more information about zabbix database tables and dependencies
    In particular I'd like to know which steps are required in order to create a host in zabbix?
    The host have some associated groups and templates, but does not have asociated profiles, extended profiles nor associated macros.

    Is it enough to perform the insert operations only in the following tables?
    or do I need something else?

    1)insert a row into 'hosts' table
    2)for each group the host is associated with, insert a row into hosts_group
    3)for each template the host is associated with
    insert a row into 'hosts_templates' table
    for each template item in the 'items' table, insert into the 'items' table the
    same item for the host

    4)selects and inserts into 'ids' table, in order to get the ids

    Thank you for your help!
    Silvana
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    i would strongly advise against modifying zabbix db directly. it is possible, but can result in inconsistent data that will cause lots of trouble later. instead, i'd suggest one of the following :

    1. take a look at the api again - 'draft' should be gone from most of the documentation

    2. a more time-tested option - create one configuration entity (like host) manually, export it to xml. then script around the xml to create entries for all needed hosts and import that xml back.

    in any case, make sure to use zabbix 1.8.3
    Zabbix 3.0 Network Monitoring book

    Comment

    • silvana
      Junior Member
      • Aug 2010
      • 4

      #3
      Hi, Thank you for your replay!
      we are currently using zabbix 1.8.2 with 100 hosts, it seems to work fine.
      Now we are migrating the rest of the hosts to zabbix (aprox. 6000 hosts)

      I wonder, why do you think that upgrading to zabbix 1.8.3 is necessary?


      Best regards.
      Silvana

      Comment

      • walterheck
        Senior Member
        • Jul 2009
        • 153

        #4
        Originally posted by richlv
        1. take a look at the api again - 'draft' should be gone from most of the documentation
        It's still ultra-limited though..
        Free and Open Source Zabbix Templates Repository | Hosted Zabbix @ Tribily (http://tribily.com)

        Comment

        • richlv
          Senior Member
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Oct 2005
          • 3112

          #5
          Originally posted by silvana
          I wonder, why do you think that upgrading to zabbix 1.8.3 is necessary?
          because it has some important fixes and improvements for xml import and api

          Originally posted by walterheck
          It's still ultra-limited though..
          anything more specific ?
          Zabbix 3.0 Network Monitoring book

          Comment

          • walterheck
            Senior Member
            • Jul 2009
            • 153

            #6
            Originally posted by richlv
            anything more specific ?
            Lots of it looks like this:
            http://www.zabbix.com/documentation/...i/image/exists

            I hardly call that documentation
            Free and Open Source Zabbix Templates Repository | Hosted Zabbix @ Tribily (http://tribily.com)

            Comment

            • richlv
              Senior Member
              Zabbix Certified Trainer
              Zabbix Certified SpecialistZabbix Certified Professional
              • Oct 2005
              • 3112

              #7
              Originally posted by walterheck
              ah, that... hhehe, yeah, that is expected to improve in a very near future
              Zabbix 3.0 Network Monitoring book

              Comment

              • silvana
                Junior Member
                • Aug 2010
                • 4

                #8
                Hi,
                I am trying to use the API to create a Host

                but I get the following error:
                Error -32500: Application error., [ CHost::create ] You do not have enough rights for operation

                I perform the operation with a user which is member of the following groups: API access and zabbix administrators

                Thanks for your help!

                Silvana

                Comment

                • walterheck
                  Senior Member
                  • Jul 2009
                  • 153

                  #9
                  Originally posted by silvana
                  Hi,
                  I am trying to use the API to create a Host

                  but I get the following error:
                  Error -32500: Application error., [ CHost::create ] You do not have enough rights for operation

                  I perform the operation with a user which is member of the following groups: API access and zabbix administrators
                  I don't have the time to search for the thread, but there was someone else just yesterday or the day before that had teh exact same problem, and one of the zabbix devs responded saying it was probably a bug. The thread was about zabcon I think.
                  Free and Open Source Zabbix Templates Repository | Hosted Zabbix @ Tribily (http://tribily.com)

                  Comment

                  • silvana
                    Junior Member
                    • Aug 2010
                    • 4

                    #10
                    Originally posted by walterheck
                    I don't have the time to search for the thread, but there was someone else just yesterday or the day before that had teh exact same problem, and one of the zabbix devs responded saying it was probably a bug. The thread was about zabcon I think.
                    Thanks so much!
                    yes I found the thread with the same error, it was about zabcon.

                    Comment

                    Working...