Ad Widget

Collapse

Bug while exporting graph

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gwenaelle
    Junior Member
    • Feb 2008
    • 7

    #1

    Bug while exporting graph

    I've searched the forum but can't find any thread with the same error, sorry if this have already been submitted.
    I'm using Zabbix 1.4.4.
    I've tried to export the graphs I created on a host and I got the following :
    Code:
        * pg_query() [function.pg-query]: Query failed: ERREUR: La colonne "g.name" doit apparaître dans la clause GROUP BY ou doit être utilisé dans une fonction d'aggrégat[/data/inetpub/wwwroot/zabbix/include/db.inc.php:293]
        * Error in query [select g.name as info, i.hostid, count(distinct i.hostid) as cnt from graphs_items gi, items i, graphs g where g.graphid=gi.graphid and gi.itemid=i.itemid group by gi.graphid, i.hostid] [ERREUR: La colonne "g.name" doit apparaître dans la clause GROUP BY ou doit être utilisé dans une fonction d'aggrégat]
        * pg_fetch_array() expects parameter 1 to be resource, boolean given[/data/inetpub/wwwroot/zabbix/include/db.inc.php:414]
    Sorry for the message in french, means that the column "g.name" must be part of the GROUP BY.

    I find a request in exp_imp.php, line 211 :
    Code:
    S_GRAPH         => !isset($graphs[$host['hostid']]) ? null :
                                                                    'select g.name as info, i.hostid, count(distinct i.hostid) as cnt'.
                                                                    ' from graphs_items gi, items i, graphs g '.
                                                                    ' where g.graphid=gi.graphid and gi.itemid=i.itemid'.
                                                                    ' group by gi.graphid, i.hostid'
    Corrected as following and it works :
    Code:
    S_GRAPH         => !isset($graphs[$host['hostid']]) ? null :
                                                                    'select g.name as info, i.hostid, count(distinct i.hostid) as cnt'.
                                                                    ' from graphs_items gi, items i, graphs g '.
                                                                    ' where g.graphid=gi.graphid and gi.itemid=i.itemid'.
                                                                    ' group by gi.graphid, [B][COLOR="Red"][COLOR="DarkOrchid"]g.name,[/COLOR][/COLOR][/B] i.hostid'
Working...