Ad Widget

Collapse

Mysql query error: saving graphs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • btriem
    Member
    • Apr 2006
    • 30

    #1

    Mysql query error: saving graphs

    I'm running into a mysql error when saving changes to my graphs. It appears it is trying to make a query for a graph with a null hostid. I've searched through the hosts and graphs tables and cannot find anything that would explain this. Thanks for your suggestions.
    # Error in query [select new.itemid from items new, items dest where dest.itemid=17356 and new.key_=dest.key_ and new.hostid=] [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 '' at line 1]
    # mysql_fetch_array(): supplied argument is not a valid MySQL result resource[/var/www/html/zabbix/include/db.inc.php:411]
    # Error in query [select * from hosts where hostid=] [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 '' at line 1]
    # mysql_fetch_array(): supplied argument is not a valid MySQL result resource[/var/www/html/zabbix/include/db.inc.php:411]
    # No host with hostid=[]
    # Missed key "system.cpu.util[,user,avg1]" for host ""
    # Can not update graph "CPU Utilization" for host ""
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Please include ZABBIX version when posting problems.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • btriem
      Member
      • Apr 2006
      • 30

      #3
      1.4.2

      Thanks and I apologize. Zabbix 1.4.2. Any other information that would be helpful?

      Comment

      • btriem
        Member
        • Apr 2006
        • 30

        #4
        Similar Error When Viewing "all" graphs in config

        I am also getting the below error related to this same thread:

        Zabbix: 1.4.2
        Mysql: 5.0.22-Debian_0ubuntu6.06.3



        Error in query [select distinct g.* from graphs g left join graphs_items gi on g.graphid=gi.graphid left join items i on gi.itemid=i.itemid while (g.graphid div 100000000000000) in (0) and ( i.hostid not in (-1) OR i.hostid is NULL ) order by g.name, g.graphid] [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 'while (g.graphid div 100000000000000) in (0) and ( i.hostid not in (-1) OR i.' at line 1]
        I wasn't getting this error after upgrading to 1.4.2. I added a bunch of graphs, approximately 30, successfully. This, as far as I can tell, just started happening out of nowhere for no obvious reason.

        Thanks again.
        Brad

        Comment

        • btriem
          Member
          • Apr 2006
          • 30

          #5
          Problem Solved

          My initial problem appears to be a separate problem from the "list all graphs" issue described here:



          I deleted the graphs and recreated them and my problem of the hostid=[] went away. Although, when I deleted the graphs, it also deleted the graphs for two hosts with no name. Going to have to chalk this up to a fluke for now but if I run into phantom hosts again I will re-address here on the forum.

          Thanks

          Comment

          Working...