diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-08-20 12:08:56 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-08-20 12:08:56 +0000 |
| commit | 5e7bd13ae6c025f5a62a8a3c18b857466979903e (patch) | |
| tree | 81ad47cfd55fcfa79adbacdf37e871f9fabbe3d2 /frontends/php/include | |
| parent | 57d4d839a4bdcc829c9a5f3ffb72579368466fee (diff) | |
| download | zabbix-5e7bd13ae6c025f5a62a8a3c18b857466979903e.tar.gz zabbix-5e7bd13ae6c025f5a62a8a3c18b857466979903e.tar.xz zabbix-5e7bd13ae6c025f5a62a8a3c18b857466979903e.zip | |
- merged rev. 4625:4626 of branches/1.4.2 (Eugene) [fixed '{HOSTNAME}' macros using for actions]
git-svn-id: svn://svn.zabbix.com/trunk@4627 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/actions.inc.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php index 4e3021d4..2da381bb 100644 --- a/frontends/php/include/actions.inc.php +++ b/frontends/php/include/actions.inc.php @@ -748,11 +748,11 @@ include_once 'include/discovery.inc.php'; foreach($cmd_list as $cmd) { $cmd = trim($cmd, "\x00..\x1F"); - if(!ereg("^([0-9a-zA-Z\_\.[.-.]]{1,})(:|#)[[:print:]]*$",$cmd,$cmd_items)){ + if(!ereg("^(({HOSTNAME})|([0-9a-zA-Z\_\.[.-.]]{1,}))(:|#)[[:print:]]*$",$cmd,$cmd_items)){ error("Incorrect command: '$cmd'"); return FALSE; } - if($cmd_items[2] == "#") + if($cmd_items[4] == "#") { // group if(!DBfetch(DBselect("select groupid from groups where name=".zbx_dbstr($cmd_items[1])))) { @@ -760,9 +760,10 @@ include_once 'include/discovery.inc.php'; return FALSE; } } - elseif($cmd_items[2] == ":") + elseif($cmd_items[4] == ":") { // host - if(!DBfetch(DBselect("select hostid from hosts where host=".zbx_dbstr($cmd_items[1])))) + if( $cmd_items[1] != '{HOSTNAME}' && + !DBfetch(DBselect("select hostid from hosts where host=".zbx_dbstr($cmd_items[1]))) ) { error("Unknown host name '".$cmd_items[1]."' in command '".$cmd."'"); return FALSE; |
