Ad Widget

Collapse

backing up Zabbix Server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Crazy Marty
    Member
    • Sep 2007
    • 75

    #1

    backing up Zabbix Server

    In the event that my Zabbix Server catches fire and the hard drives all melt, what exactly do I need to put on a new machine to restore monitoring?

    (Assuming I have machines with capacity, the same OS, the same MySQL, the same httpd, the same php, and a copy of the Zabbix tarball with the source as I installed it on the server.)

    Is it completely sufficient to save /etc/my.cnf and either a mysqlhotcopy or mysqldump of the zabbix database? Is it necessary to generate a zabbix_server.xml (and how would I do that from a cron job?)?

    How does the requirement change in the face of a distributed setup (instructions for the creation of which are still unwritten, alas)?
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    Yes all you will need is a dump or backup of your DB, your my.cnf and the conf file from the conf directory in Zabbix. You can actually get away with only having the DB backup and recreate the rest with relative ease if you really must. I would however strongly recomend you backup your zabbix_server.conf and zabbix_agentd.conf (or zabbix_agent.conf) files. If you are using any custom scripts it can sometimes be a pain to figure out what they were when you rebuild.

    Performing a xml dump of your system isn't necisary as all settings for your system are stored in the database.

    As for restoring, I'm assuming you're restoring to the same distro and version, you may also be able to use this method to upgrade distros.
    1) Install OS and components (apache, mysql, php, snmp, etc)
    2) Get / compile / install Zabbix (preferably the same version you had before. Upgrading can be done, but it's outside the scope of this post) Create Zabbix system user.
    3) Restore old config files (z\Zabbix too), shutdown mysql if it is running. If you are tweaking innodb in the conf file, you may need to delete the innodb log file for mysql to start correctly.
    4) start mysql. Create the Zabbix database. Import old database ie "mysql zabbix < zabbix_dump.sql"
    5) Check Zabbix config file and settings.
    6) Ensure everything is set to run at startup: zabbix_server, zabbix_agent(d), apache, mysql etc
    7) Check Zabbix to ensure everything is working
    8) Grab favorite beverage and snack
    9) Enjoy!
    Last edited by nelsonab; 08-10-2007, 19:16.
    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

    Working...