Ad Widget

Collapse

Keeping 2 seperate Zabbix instances in sync for users, user groups, scripts, maps etc

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tiarnaigh
    Junior Member
    • Sep 2013
    • 27

    #1

    Keeping 2 seperate Zabbix instances in sync for users, user groups, scripts, maps etc

    Howdy folks.
    I have 2 standalone Zabbix instances across 2 seperate data centres (One in live data centre, and the other in our DR site). The main issue I'm having is that the instance in the live site tends to get updated on a regular basis (New administration scripts added, new host group & user groups etc.) but adding to the DR site is then an after thought until we actually need to failover to this site.

    I was just wondering if there was a simple way to keep both sites in sync, without having to manually create each script twice, create each user group twice etc. I've looked at for instance exporting the "scripts" table from the live site and importing to the DR site which works ok, but this then throws all the user group permissions on these scripts out as the userid & groupids etc. don't match.

    Any ideas?

    Thanks,
    M
  • Linwood
    Senior Member
    • Dec 2013
    • 398

    #2
    Are you trying to keep both up and running all the time?

    Another option is just to replicate the database, or just back it up periodically (if you omit the history and trend tables it's tiny), the sync the external scripts directory and maybe a few config files (though those may change).

    You could even script bringing that up live daily, though you would need to do some scripting magic (maybe some SQL) to change the server IP and maybe a few related things (e.g. anything using the server name in scripts).

    It's not live and real time all the time, but for a DR site... ?

    Comment

    • tiarnaigh
      Junior Member
      • Sep 2013
      • 27

      #3
      Yep. I need to keep both running at all times as I need to be able to fail over from prod to DR/HotStandby site at any given time. Each site has different hostnames, but all else are basically identical (HostGroups, users, user groups, scripts, maps etc.).

      I'll have a look at dumping the scripts table I guess and importing this to the 2nd site, but there are several constraints on this around the usergroup ids, user ids etc. If I go down that route, a lot of manual intervention (Other than actually copying & passting the scripts themselves) is required and this isn't ideal.

      Comment

      • Linwood
        Senior Member
        • Dec 2013
        • 398

        #4
        So just curious... why not just replace the DR site with a copy of the production once a day from backups? It can still come up and run after replacement, the DR site then misses only the amount of data you either (a) explicitly exclude to speed the backup, or (b) the time it takes to shutdown, restore the database, and come back up.

        Then you aren't fighting a battle to keep in sync (and risking missing some updates) at all?

        Comment

        • kloczek
          Senior Member
          • Jun 2006
          • 1771

          #5
          Originally posted by tiarnaigh
          I was just wondering if there was a simple way to keep both sites in sync, without having to manually create each script twice, create each user group twice etc.
          If you care about HA and have even DR env you should have slave DB backend in your primary env an yet another slave in DR one.
          http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
          https://kloczek.wordpress.com/
          zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
          My zabbix templates https://github.com/kloczek/zabbix-templates

          Comment

          Working...