Koozali.org: home of the SME Server

zabbix-server - not running yet

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
zabbix-server - not running yet
« on: January 15, 2014, 10:46:50 PM »
Daniel (and others),

I used to have Zabbix 1.x running... later an upgrade started to consume all my CPU (HP N40L) and getting high LA ... so I disabled it.

From time to time, as time allow I try to get it back online.
Now I updated using fws repository and when tried to start, see this on log:
Code: [Select]
32069:20140115:184240.189 using configuration file: /etc/zabbix/zabbix_server.conf
 32069:20140115:184240.200 current database version (mandatory/optional): 02010013/02010013
 32069:20140115:184240.200 required mandatory version: 02020000
 32069:20140115:184240.200 starting automatic database upgrade
 32069:20140115:184240.201 [Z3005] query failed: [1091] Can't DROP 'httptest_2'; check that column/key exists [drop index httptest_2 on httptest]
 32069:20140115:184240.201 database upgrade failed
Note: I did nothing but run "yum update --enablerepo=fw zabbix*"
and try to start it with "/etc/init.d/zabbix-server start"

...

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: zabbix-server - not running yet
« Reply #1 on: January 16, 2014, 11:18:05 AM »
try searching google with "[Z3005]+query+failed%3A+[1091]+Can%27t+DROP" key

HTH :wink:
« Last Edit: January 16, 2014, 11:23:01 AM by Stefano »

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: zabbix-server - not running yet
« Reply #2 on: January 16, 2014, 11:50:19 AM »
Looks like you was running 1.6.X or 1.8.X

The latest Zabbix in fws repo is 2.2.1, which will try to upgrade the database automatically, but only supports upgrade from 2.0.X. If you were running an older version, you should either:

- manually upgrade your database (look at the scripts in /usr/share/doc/zabbix-server-2.2.1/dbpatches/)
- drop the database and start from scratch ;-)
C'est la fin du monde !!! :lol:

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: zabbix-server - not running yet
« Reply #3 on: January 16, 2014, 01:17:11 PM »
Daniel

I´m sure I was running a 2.0 version... but I hda problems with it... it was hogging CPU cycles. It was working ... for sure!

Anyways, I can do upgrade manually... just a doubt: there are any chances to loose data on database ?

Jáder
...

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: zabbix-server - not running yet
« Reply #4 on: January 16, 2014, 01:21:17 PM »
There's no manual upgrade path for 2.0 -> 2.2. Zabbix-server daemon is responsible for this upgrade, and if if cannot make it, it means your 2.0 database wasn't consistent. Maybe you forgot to run the 1.8 -> 2.0 upgrade script (see /usr/share/doc/zabbix-server-2.2.1/dbpatches/2.0/mysql/upgrade) ?
C'est la fin du monde !!! :lol:

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: zabbix-server - not running yet
« Reply #5 on: January 16, 2014, 01:46:45 PM »
Daniel

I´ve done a backup of my zabbixdb database with
Code: [Select]
[root@leopardo mysql]# mysqlhotcopy zabbixdb> /tmp/ZabbixDB_AntesJM.sql
[root@leopardo mysql]# ls
and then:
Code: [Select]
[root@leopardo mysql]# ./upgrade zabbixdb
 WARNING: backup your database before performing upgrade

 This is an UNSUPPORTED Zabbix upgrade script from 1.8 to 2.0 for MySQL
 It does the following things:
  1. Updates indexes that might require changes;
  2. Patches the database from 1.8 schema to 2.0 schema;
  3. Adds 'Disabled' and 'Debug' usergroup if any missing;
  4. Checks for hosts not belonging to any group and adds them to one if any found.

 Usage: pass required MySQL parameters to this script (like database, user, password etc).

Continue ? (y/n) y
Patching the database
ERROR 1060 (42S21) at line 54: Duplicate column name 'listen_ip'
Failed to patch Zabbix database. Restore from backup

So I presume my DB is 2.0 already.
A test I could to do is change config to a new db (zabbix2db) and recreate it and try.

It´s possible recovery data from old DB to new ... later ... if this works ?

Jáder
...

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: zabbix-server - not running yet
« Reply #6 on: January 16, 2014, 01:56:02 PM »
Looks like your database is already messed up. Don't know what's wrong, but you'd better start from scratch. Recovering from this damaged database is probably quite hard
C'est la fin du monde !!! :lol:

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: zabbix-server - not running yet
« Reply #7 on: January 16, 2014, 02:00:15 PM »
Daniel

Can I downgrade to 2.0 (it was running) ; export some tables (pictures, maps, ...) and try start from ZERO with a new db ?

Jáder
...

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: zabbix-server - not running yet
« Reply #8 on: January 16, 2014, 02:03:29 PM »
Daniel

Can I downgrade to 2.0 (it was running) ; export some tables (pictures, maps, ...) and try start from ZERO with a new db ?
If you can find the RPM from your cache (/var/cache/yum), you can try. But:

- FWS repo do not have 2.0.X rpm anymore, only 2.2
- Your database is probably already messed up, even for 2.0.X (which is probably why you have a high CPU usage)
- You cannot export tables from MySQL, as you would be able to import it back on the new 2.2.X schema, all you could do is export a few things from Zabbix interface (XML export) and import it back
C'est la fin du monde !!! :lol:

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: zabbix-server - not running yet
« Reply #9 on: January 16, 2014, 03:50:36 PM »
Daniel

I think I´ve cleaned up yum cache just yesterday because of one problem! :$
Anyways: What I´d like to keep: Hosts configs, maps, images / pictures , sme templates I´ve cleaned up a little / changed frequency ...I have no interest in historical data from hosts and alarms.

Could I export that directly from DB and import again using phpmyadmin for example?
Otherwise I´ll have to start over on Zabbix... not THAT bad but time consuming.

Jáder
...

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: zabbix-server - not running yet
« Reply #10 on: January 16, 2014, 03:52:16 PM »
No, you cannot export and re-import directly from MySQL because of schema changes between 2.0.x and 2.2.x
C'est la fin du monde !!! :lol: