diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | frontends/php/include/classes/graph.inc.php | 2 | ||||
-rw-r--r-- | frontends/php/include/config.inc.php | 3 | ||||
-rw-r--r-- | frontends/php/include/locales/en_gb.inc.php | 2 | ||||
-rw-r--r-- | misc/conf/zabbix_server.conf | 2 | ||||
-rw-r--r-- | src/libs/zbxcommon/misc.c | 37 | ||||
-rw-r--r-- | src/zabbix_server/expression.c | 18 | ||||
-rw-r--r-- | src/zabbix_server/poller/checks_snmp.c | 1 |
8 files changed, 58 insertions, 11 deletions
@@ -1,5 +1,9 @@ Changes for 1.3: + - improved definition of integer and float point types (Eugene) + - fixed problem with ASN_IPADDRESS SNMP values (Eugene) + - added action email action variable '{SEVERITY}' (Eugene) + - added Brazilian Portuguese translation. Thanks to Marcelo Honorio. (Alexei) - fixed history cleaning (Eugene) - fixed Unknown when selcting trigger severity Disaster in action form (Alexei) - fixed windows agent crashing with processing of 'system.cpu.util' key (Eugene) diff --git a/frontends/php/include/classes/graph.inc.php b/frontends/php/include/classes/graph.inc.php index abd56005..53e6fb6c 100644 --- a/frontends/php/include/classes/graph.inc.php +++ b/frontends/php/include/classes/graph.inc.php @@ -272,7 +272,7 @@ if($value <= 0) $value = NULL; if(is_null($value)) $value = 900; - $this->sizeYi = $value; + $this->sizeY = $value; } function setBorder($border) diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 84105782..d85519cf 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -866,6 +866,9 @@ COpt::profiling_start("page"); if($noauth==0) { + global $TRANSLATION; + if(!isset($TRANSLATION) || !is_array($TRANSLATION)) $TRANSLATION = array(); + check_authorisation(); include_once "include/locales/".$USER_DETAILS["lang"].".inc.php"; process_locales(); diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php index 26e03bd0..82fcd6b8 100644 --- a/frontends/php/include/locales/en_gb.inc.php +++ b/frontends/php/include/locales/en_gb.inc.php @@ -779,7 +779,7 @@ "S_VERTICAL_ALIGN"=> "Vertical align", "S_TOP"=> "Top", "S_MIDDLE"=> "Middle", - "S_BOTTOM"=> "Buttom", + "S_BOTTOM"=> "Bottom", // screens.php "S_CUSTOM_SCREENS"=> "Custom screens", diff --git a/misc/conf/zabbix_server.conf b/misc/conf/zabbix_server.conf index bd4cf4a0..7158f5f3 100644 --- a/misc/conf/zabbix_server.conf +++ b/misc/conf/zabbix_server.conf @@ -28,7 +28,7 @@ ListenPort=10051 # (in hours) # Default value is 1 hour # Housekeeping is removing unnecessary information from -# tables history, laert, and alarms +# tables history, alert, and alarms # This parameter must be between 1 and 24 HousekeepingFrequency=1 diff --git a/src/libs/zbxcommon/misc.c b/src/libs/zbxcommon/misc.c index 381892f0..f2c56bda 100644 --- a/src/libs/zbxcommon/misc.c +++ b/src/libs/zbxcommon/misc.c @@ -245,8 +245,11 @@ int is_double(char *c) { int i; int dot=-1; + int len; - for(i=0;c[i]!=0;i++) + for(i=0; c[i]==' ' && c[i]!=0;i++); /* trim left spaces */ + + for(len=0; c[i]!=0; i++, len++) { if((c[i]>='0')&&(c[i]<='9')) { @@ -256,15 +259,23 @@ int is_double(char *c) if((c[i]=='.')&&(dot==-1)) { dot=i; + continue; + } - if((dot!=0)&&(dot!=(int)strlen(c)-1)) - { - continue; - } + if(c[i]==' ') /* check right spaces */ + { + for( ; c[i]==' ' && c[i]!=0;i++); /* trim right spaces */ + + if(c[i]==0) break; /* SUCCEED */ } return FAIL; } + + if(len <= 0) return FAIL; + + if(len == 1 && dot!=-1) return FAIL; + return SUCCEED; } @@ -286,17 +297,29 @@ int is_double(char *c) ******************************************************************************/ int is_uint(char *c) { - int i; + int i; + int len; - for(i=0;c[i]!=0;i++) + for(i=0; c[i]==' ' && c[i]!=0;i++); /* trim left spaces */ + + for(len=0; c[i]!=0; i++,len++) { if((c[i]>='0')&&(c[i]<='9')) { continue; } + + if(c[i]==' ') /* check right spaces */ + { + for( ; c[i]==' ' && c[i]!=0;i++); /* trim right spaces */ + + if(c[i]==0) break; /* SUCCEED */ + } return FAIL; } + if(len <= 0) return FAIL; + return SUCCEED; } diff --git a/src/zabbix_server/expression.c b/src/zabbix_server/expression.c index d477a1c9..e66b09e4 100644 --- a/src/zabbix_server/expression.c +++ b/src/zabbix_server/expression.c @@ -555,7 +555,7 @@ int evaluate(int *result,char *exp, char *error, int maxerrlen) * Author: Alexei Vladishev * * * * Comments: {DATE},{TIME},{HOSTNAME},{IPADDRESS},{STATUS}, * - * {TRIGGER.DESCRIPTION}, {TRIGGER.KEY} * + * {TRIGGER.DESCRIPTION}, {TRIGGER.KEY}, {SEVERITY} * * * ******************************************************************************/ void substitute_simple_macros(DB_TRIGGER *trigger, DB_ACTION *action, char *data) @@ -704,6 +704,22 @@ void substitute_simple_macros(DB_TRIGGER *trigger, DB_ACTION *action, char *data strncat(data, tmp, MAX_STRING_LEN); strncat(data, s+strlen("{STATUS}"), MAX_STRING_LEN); } + else if( (s = strstr(str,"{SEVERITY}")) != NULL ) + { + s[0]=0; + strcpy(data, str); + + if(trigger->priority == 0) strncat(data, "Not classified", MAX_STRING_LEN); + else if(trigger->priority == 1) strncat(data, "Information", MAX_STRING_LEN); + else if(trigger->priority == 2) strncat(data, "Warning", MAX_STRING_LEN); + else if(trigger->priority == 3) strncat(data, "Average", MAX_STRING_LEN); + else if(trigger->priority == 4) strncat(data, "High", MAX_STRING_LEN); + else if(trigger->priority == 5) strncat(data, "Disaster", MAX_STRING_LEN); + else strncat(data, "Uncnown", MAX_STRING_LEN); + + strncat(data, tmp, MAX_STRING_LEN); + strncat(data, s+strlen("{SEVERITY}"), MAX_STRING_LEN); + } else { found = FAIL; diff --git a/src/zabbix_server/poller/checks_snmp.c b/src/zabbix_server/poller/checks_snmp.c index a0b755dc..6266ec48 100644 --- a/src/zabbix_server/poller/checks_snmp.c +++ b/src/zabbix_server/poller/checks_snmp.c @@ -373,6 +373,7 @@ int get_value_snmp(DB_ITEM *item, AGENT_RESULT *value) p = malloc(16); if(p) { + ip = vars->val.string; zbx_snprintf(p,16,"%d.%d.%d.%d",ip[0],ip[1],ip[2],ip[3]); SET_STR_RESULT(value, p); |