PDA

View Full Version : Bug in frontend 1.1alpha12


elkor
26-08-2005, 19:01
Update media functionality has syntax error in SQL (looks like a missing space and backquotes instead of single pops).

version still reads 1.1alpha11.

Alexei
26-08-2005, 20:24
Update media functionality has syntax error in SQL (looks like a missing space and backquotes instead of single pops).

version still reads 1.1alpha11.
Please, give me the actual error message. Thanks.

elkor
26-08-2005, 20:45
text in black appears in grey area beneath the menubar, text in blue appears in the white area below that is bordered by the dashed line.

exact message encountered while updating media for a user:

[ERROR:Cannot update media]
SQL error: Unknown column '1-7,00:00-23:59' in 'field list'
Query: update media set userid=6, mediatypeid=1, sendto='me@us.com', active=0,severity=62,period=`1-7,00:00-23:59` where mediaid=7

Here is another (this one encountered while adding acitons to a trigger with scope="all triggers of this host":

Error in query [select triggerid,expression,description,status,priority,l astchange,dep_level,comments,url,value from triggers where triggerid=] [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]Error in query [select distinct h.hostid from hosts h,functions f, items i where i.itemid=f.itemid and h.hostid=i.hostid and f.triggerid=] [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]

[Action added]
No action with actionid=[1]
No trigger with triggerid=[]

This may just be cosmetic as the action appears to have been added, I haven't been able to set it off though even though the trigger has been tripped to true, so there may be a problem there or it could just be my config, I'm investigating and will update when I find out what's going on.

James Wells
27-08-2005, 06:45
[ERROR:Cannot update media]
SQL error: Unknown column '1-7,00:00-23:59' in 'field list'
Query: update media set userid=6, mediatypeid=1, sendto='me@us.com', active=0,severity=62,period=`1-7,00:00-23:59` where mediaid=7

This is a typo on line 2010, in php/include/config.inc.php. Yes, the typo is the back ticks (`) actually need to be replaced with single quotes (').

James Wells
27-08-2005, 19:32
Here is a patch to fix the media update issue;

Index: config.inc.php
================================================== =================
RCS file: /cvsroot/zabbix/zabbix/frontends/php/include/config.inc.php,v
retrieving revision 1.261
diff -r1.261 config.inc.php
2010c2010
< $sql="update media set userid=$userid, mediatypeid=$mediatypeid, sendto='$sendto', active=$active,severity=$s,period=`$period` where mediaid=$mediaid";
---
> $sql="update media set userid=$userid, mediatypeid=$mediatypeid, sendto='$sendto', active=$active,severity=$s,period='$period' where mediaid=$mediaid";

elkor
31-08-2005, 20:21
Yeah, was on line 1998 in my file but that may be the difference between the cvs version and mine. Here's another:

[ERROR:Cannot update trigger]

SQL error: 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 's volume /prn',priority=4,status=0,comments='',url='',value= 2 where triggerid=12' at line 1
Query: update triggers set expression='{11670}<10000',description='Low free disk space on {HOSTNAME}'s volume /prn',priority=4,status=0,comments='',url='',value= 2 where triggerid=12543

this one appears to be a non-escaped single pop {HOSTNAME}'s. It occurs when updating a trigger.

EDIT: OK, didn't realize that the description was supplied in the form, easy enough to escape it and continue on adding hosts. There should either be a sanity check on this data or the single pop should not be in the default description though in order to cut down on newbie error reports (such as mine :( ). At the very least a mention in the manual (which may be there, I haven't checked. But based on the last time I flipped through it I doubt it is.)