summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-05-16 17:19:08 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-05-16 17:19:08 +0000
commit754c5bee55fc43c2c1b385d2db893cdd87f440f3 (patch)
tree3d0c0f5c6fd93fa8e924f7e4dc96eac091bd213d
parentb0d6efabe7fdb34edc6b102739761d899b47076f (diff)
- protection from items.delay set to 0 (Alexei)
- values provided by an agent can be less than zero (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@368 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r--ChangeLog5
-rw-r--r--frontends/php/include/config.inc11
-rw-r--r--src/zabbix_sucker/zabbix_sucker.c4
3 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5729c292..c4066589 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,11 @@ Not ready yet:
[ DOCS. All parameters should contain section "How can be used" in the Manual ]
+Changes for 1.0beta4:
+
+ - protection from items.delay set to 0 (Alexei)
+ - values provided by an agent can be less than zero (Alexei)
+
Changes for 1.0beta3:
- support for chart showing diff instead of real values (Alexei)
diff --git a/frontends/php/include/config.inc b/frontends/php/include/config.inc
index 3abce7dd..79318144 100644
--- a/frontends/php/include/config.inc
+++ b/frontends/php/include/config.inc
@@ -1157,6 +1157,11 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
$ERROR_MSG="Insufficient permissions";
return 0;
}
+ if($delay<1)
+ {
+ $ERROR_MSG="Delay cannot be less than 1 second";
+ return 0;
+ }
$sql="update items set description='$description',key_='$key',hostid=$hostid,delay=$delay,history=$history,lastdelete=0,nextcheck=0,status=$status,type=$type,snmp_community='$snmp_community',snmp_oid='$snmp_oid',value_type=$value_type where itemid=$itemid";
return DBexecute($sql);
@@ -1446,6 +1451,12 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
return 0;
}
+ if($delay<1)
+ {
+ $ERROR_MSG="Delay cannot be less than 1 second";
+ return 0;
+ }
+
$sql="insert into items (description,key_,hostid,delay,history,lastdelete,nextcheck,status,type,snmp_community,snmp_oid,value_type) values ('$description','$key',$hostid,$delay,$history,0,0,$status,$type,'$snmp_community','$snmp_oid',$value_type)";
$result=DBexecute($sql);
return DBinsert_id($result,"items","itemid");
diff --git a/src/zabbix_sucker/zabbix_sucker.c b/src/zabbix_sucker/zabbix_sucker.c
index f74638a6..636e667a 100644
--- a/src/zabbix_sucker/zabbix_sucker.c
+++ b/src/zabbix_sucker/zabbix_sucker.c
@@ -484,10 +484,6 @@ int get_value_zabbix(double *result,char *result_str,DB_ITEM *item)
zabbix_log(LOG_LEVEL_DEBUG, "NOTSUPPORTED1 [%s]", c );
return NOTSUPPORTED;
}
- else
- {
- return FAIL;
- }
}
strncpy(result_str,c,MAX_STRING_LEN);