summaryrefslogtreecommitdiffstats
path: root/frontends/php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-02-07 09:27:20 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-02-07 09:27:20 +0000
commit2d76733fbfa2cdb0935210e524f373c18ef47ee9 (patch)
treed40cf2e113983d93e2c11af9bb5ad45a54235587 /frontends/php
parent4ceb822c9fdd9cb84040e4d104942c6dc565504e (diff)
downloadzabbix-2d76733fbfa2cdb0935210e524f373c18ef47ee9.tar.gz
zabbix-2d76733fbfa2cdb0935210e524f373c18ef47ee9.tar.xz
zabbix-2d76733fbfa2cdb0935210e524f373c18ef47ee9.zip
- fixed graphs in Oracle system (Eugene)
- fixed trigger expressions with ':' (Eugene) - fixed 'Server info' screen componets (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@3804 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
-rw-r--r--frontends/php/include/actions.inc.php2
-rw-r--r--frontends/php/include/classes/cserverinfo.mod.php4
-rw-r--r--frontends/php/include/classes/graph.inc.php13
-rw-r--r--frontends/php/include/config.inc.php6
-rw-r--r--frontends/php/include/hosts.inc.php2
-rw-r--r--frontends/php/include/httptest.inc.php4
-rw-r--r--frontends/php/include/triggers.inc.php2
-rw-r--r--frontends/php/include/validate.inc.php2
8 files changed, 16 insertions, 19 deletions
diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php
index 327b4e20..c8138d46 100644
--- a/frontends/php/include/actions.inc.php
+++ b/frontends/php/include/actions.inc.php
@@ -256,7 +256,7 @@
foreach($cmd_list as $cmd)
{
$cmd = trim($cmd, "\x00..\x1F");
- if(!ereg("^([0-9a-zA-Z\_\.-]{1,})(:|#)[[:print:]]*$",$cmd,$cmd_items)){
+ if(!ereg("^([0-9a-zA-Z\_\.[.-.]]{1,})(:|#)[[:print:]]*$",$cmd,$cmd_items)){
error("incorrect command: '$cmd'");
return FALSE;
}
diff --git a/frontends/php/include/classes/cserverinfo.mod.php b/frontends/php/include/classes/cserverinfo.mod.php
index 3ebe1765..d0da6951 100644
--- a/frontends/php/include/classes/cserverinfo.mod.php
+++ b/frontends/php/include/classes/cserverinfo.mod.php
@@ -48,8 +48,8 @@
$this->AddRow(S_NUMBER_OF_USERS_SHORT.": ".$status["users_count"]."(".$status["users_online"].")");
$this->AddRow(new CCol(array("Logged in as ", new CLink($USER_DETAILS["alias"],"profile.php","action"))));
$this->AddRow(new CCol(array(new CLink("ZABBIX server","http://www.zabbix.com","action")," is ",$server)),"status");
- $this->AddRow(S_VALUES_STORED.": ".$status["history_count"]);
- $this->AddRow(S_TRENDS_STORED.": ".$status["trends_count"]);
+ //$this->AddRow(S_VALUES_STORED.": ".$status["history_count"]);
+ //$this->AddRow(S_TRENDS_STORED.": ".$status["trends_count"]);
$this->AddRow(new CCol(array(S_NUMBER_OF_HOSTS_SHORT.": ".$status["hosts_count"]."(",
new CSpan($status["hosts_count_monitored"],"off"),"/",
new CSpan($status["hosts_count_not_monitored"],"on"),"/",
diff --git a/frontends/php/include/classes/graph.inc.php b/frontends/php/include/classes/graph.inc.php
index 9daa0f67..88a54a7f 100644
--- a/frontends/php/include/classes/graph.inc.php
+++ b/frontends/php/include/classes/graph.inc.php
@@ -985,32 +985,33 @@
$to_time = $this->to_time;
}
+ $calc_field = 'round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0)'; /* required for 'group by' support of Oracle */
$sql_arr = array();
if(($this->period / $this->sizeX) <= (ZBX_MAX_TREND_DIFF / ZBX_GRAPH_MAX_SKIP_CELL))
{
array_push($sql_arr,
- 'select itemid,round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0) as i,'.
+ 'select itemid,'.$calc_field.' as i,'.
' count(*) as count,avg(value) as avg,min(value) as min,'.
' max(value) as max,max(clock) as clock'.
' from history where itemid='.$this->items[$i]['itemid'].' and clock>='.$from_time.
- ' and clock<='.$to_time.' group by itemid, i' //' round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0)',
+ ' and clock<='.$to_time.' group by itemid,'.$calc_field
,
- 'select itemid,round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0) as i,'.
+ 'select itemid,'.$calc_field.' as i,'.
' count(*) as count,avg(value) as avg,min(value) as min,'.
' max(value) as max,max(clock) as clock'.
' from history_uint where itemid='.$this->items[$i]['itemid'].' and clock>='.$from_time.
- ' and clock<='.$to_time.' group by itemid, i' //' round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0)'
+ ' and clock<='.$to_time.' group by itemid,'.$calc_field
);
}
else
{
array_push($sql_arr,
- 'select itemid,round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0) as i,'.
+ 'select itemid,'.$calc_field.' as i,'.
' sum(num) as count,avg(value_avg) as avg,min(value_min) as min,'.
' max(value_max) as max,max(clock) as clock'.
' from trends where itemid='.$this->items[$i]['itemid'].' and clock>='.$from_time.
- ' and clock<='.$to_time.' group by itemid, i' //' round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0)'
+ ' and clock<='.$to_time.' group by itemid,'.$calc_field
);
}
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index a2d53239..44d40913 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -850,11 +850,7 @@ else
global $ZBX_CURNODEID;
// echo "Validating simple:$expression<br>";
-// Before str()
-// if (eregi('^\{([0-9a-zA-Z[.-.]\_\.]+)\:([]\[0-9a-zA-Z\_\/\.\,]+)\.((diff)|(min)|(max)|(last)|(prev))\(([0-9\.]+)\)\}$', $expression, $arr))
-// if (eregi('^\{([0-9a-zA-Z[.-.]\_\.]+)\:([]\[0-9a-zA-Z\_\/\.\,]+)\.((diff)|(min)|(max)|(last)|(prev)|(str))\(([0-9a-zA-Z\.\_\/\,]+)\)\}$', $expression, $arr))
-// if (eregi('^\{([0-9a-zA-Z\_\.-]+)\:([]\[0-9a-zA-Z\_\*\/\.\,\:\(\) -]+)\.([a-z]{3,11})\(([#0-9a-zA-Z\_\/\.\,]+)\)\}$', $expression, $arr))
- if (eregi('^\{([0-9a-zA-Z\_\.-\$]+)\:([]\[0-9a-zA-Z\_\*\/\.\,\:\(\)\+ -\$]+)\.([a-z]{3,11})\(([#0-9a-zA-Z\_\/\.\,[:space:]]+)\)\}$', $expression, $arr))
+ if (eregi('^\{([0-9a-zA-Z\_\.[.-.]\$]+)\:([]\[0-9a-zA-Z\_\*\/\.\,\:\(\)\+ [.-.]\$]+)\.([a-z]{3,11})\(([#0-9a-zA-Z\_\/\.\,[:space:]]+)\)\}$', $expression, $arr))
{
$host=$arr[1];
$key=$arr[2];
diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php
index 4bcd8f2a..ae1cf4db 100644
--- a/frontends/php/include/hosts.inc.php
+++ b/frontends/php/include/hosts.inc.php
@@ -139,7 +139,7 @@ require_once "include/items.inc.php";
global $ZBX_CURNODEID;
/* Character '-' must be last in the list of symbols, otherwise it won't be accepted */
- if (!eregi('^([0-9a-zA-Z\_\.\$-]+)$', $host))
+ if (!eregi('^([0-9a-zA-Z\_\.\$[.-.]]+)$', $host))
{
error("Hostname should contain '0-9a-zA-Z_.$'- characters only");
return false;
diff --git a/frontends/php/include/httptest.inc.php b/frontends/php/include/httptest.inc.php
index 1cd20aca..8e773a31 100644
--- a/frontends/php/include/httptest.inc.php
+++ b/frontends/php/include/httptest.inc.php
@@ -47,7 +47,7 @@
function db_save_step($hostid, $applicationid, $httptestid, $testname, $name, $no, $timeout, $url, $posts, $required, $delay, $history, $trends)
{
- if (!eregi('^([0-9a-zA-Z\_\.-\$ ]+)$', $name))
+ if (!eregi('^([0-9a-zA-Z\_\.[.-.]\$ ]+)$', $name))
{
error("Scenario step name should contain '0-9a-zA-Z_ .$'- characters only");
return false;
@@ -147,7 +147,7 @@
$history = 30; // TODO !!! Allow user set this parametr
$trends = 90; // TODO !!! Allow user set this parametr
- if (!eregi('^([0-9a-zA-Z\_\.-\$ ]+)$', $name))
+ if (!eregi('^([0-9a-zA-Z\_\.[.-.]\$ ]+)$', $name))
{
error("Scenario name should contain '0-9a-zA-Z_.$ '- characters only");
return false;
diff --git a/frontends/php/include/triggers.inc.php b/frontends/php/include/triggers.inc.php
index c43ef729..14ba987a 100644
--- a/frontends/php/include/triggers.inc.php
+++ b/frontends/php/include/triggers.inc.php
@@ -182,7 +182,7 @@
// echo "Expression:$expression<br>";
$arr="";
// The minus sing '-' must be the last one in the list, otherwise it won't work!
- if (eregi('^((.)*)([0-9\.]+[A-Z]{0,1})[ ]*([\&\|\>\<\=\+\*\/\#-]{1})[ ]*([0-9\.]+[A-Z]{0,1})((.)*)$', $expression, $arr))
+ if (eregi('^((.)*)([0-9\.]+[A-Z]{0,1})[ ]*([\&\|\>\<\=\+\*\/\#[.-.]]{1})[ ]*([0-9\.]+[A-Z]{0,1})((.)*)$', $expression, $arr))
{
// echo "OK<br>";
// for($i=0;$i<50;$i++)
diff --git a/frontends/php/include/validate.inc.php b/frontends/php/include/validate.inc.php
index b5a7ba3f..e2f0726a 100644
--- a/frontends/php/include/validate.inc.php
+++ b/frontends/php/include/validate.inc.php
@@ -54,7 +54,7 @@
}
function KEY_PARAM($var=NULL)
{
- return 'ereg(\'^([0-9a-zA-Z\_\.-\$ ]+)$\',{'.$var.'})&&';
+ return 'ereg(\'^([0-9a-zA-Z\_\.[.-.]\$ ]+)$\',{'.$var.'})&&';
}
define("NOT_EMPTY","({}!='')&&");