Ad Widget

Collapse

zabbix 1.7.2 (8316) create template error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kmradke
    Member
    • Aug 2009
    • 33

    #1

    zabbix 1.7.2 (8316) create template error

    I had some problems using the upgrade script on my 1.6.6 database where it complained the SQL syntax was not understood by mysql 5.0.77. I removed some of the offending lines and now everything seems to be working except creating a new template:

    Code:
        * Added new host [App_Dns]
        * Error in query [SELECT DISTINCT h.hostid,h.host FROM hosts_templates ht LEFT JOIN hosts h ON h.hostid=ht.templateid WHERE ht.hostid=Array ORDER BY h.host] [Unknown column 'Array' in 'where clause']
        * mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/usr/lfs/v0/apps/zabbix/1.7.2/php/include/db.inc.php:544]
        * Undefined index: hosts[/usr/lfs/v0/apps/zabbix/1.7.2/php/api/classes/class.ctemplate.php:802]
        * Undefined index: templates[/usr/lfs/v0/apps/zabbix/1.7.2/php/api/classes/class.ctemplate.php:803]
        * DBcondition Error: [hostid] =
        * DBcondition Error: [templateid] =
        * Invalid argument supplied for foreach()[/usr/lfs/v0/apps/zabbix/1.7.2/php/api/classes/class.ctemplate.php:819]
        * Invalid argument supplied for foreach()[/usr/lfs/v0/apps/zabbix/1.7.2/php/api/classes/class.ctemplate.php:835]
        * Error in query [SELECT h.* FROM hosts h, hosts_templates ht WHERE h.hostid=ht.hostid AND (ht.templateid IN (10109,0,App_Dns,,0,0.0.0.0,0,3,0,,0,0,0,0,0,1,623,0,0,,,0,0,0,0,0,0,0,0,,0,0,10109)) ] [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0,0.0.0.0,0,3,0,,0,0,0,0,0,1,623,0,0,,,0,0,0,0,0,0,0,0,,0,0,10109))' at line 1]
        * mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/usr/lfs/v0/apps/zabbix/1.7.2/php/include/db.inc.php:544]
        * Error in query [SELECT host FROM hosts WHERE hostid=Array] [Unknown column 'Array' in 'where clause']
        * mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/usr/lfs/v0/apps/zabbix/1.7.2/php/include/db.inc.php:544]
    Have I messed up the database?

    One line in mysql/patch.sql it was complaining about was:

    Code:
    alter table graphs_items alter color           varchar(6)              DEFAULT '009600'        NOT NULL;
    Code:
    mysql> alter table graphs_items alter color           varchar(6)              DEFAULT '009600'        NOT NULL;
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(6)              DEFAULT '009600'        NOT NULL' at line 1
    There were a couple of other similar lines as well...
    Last edited by kmradke; 18-11-2009, 18:03.
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    reproducible in latest trunk. please, report on the tracker
    Zabbix 3.0 Network Monitoring book

    Comment

    • kmradke
      Member
      • Aug 2009
      • 33

      #3
      Created ZBX-1310

      Comment

      Working...