diff options
| author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-13 13:36:05 +0000 |
|---|---|---|
| committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-13 13:36:05 +0000 |
| commit | b7e6ea8fc716f07c7ab98e08a730c3db16ab97a4 (patch) | |
| tree | 4e2357096f9b7e844f559463f9d88d8f6324be5a /frontends/php | |
| parent | b2f4127653d868e987df2140b9ad992bcdd558d3 (diff) | |
- [NTT-46] TR-060 Can not get result of command execution
[svn merge -r5000:5003 svn://svn.zabbix.com/branches/1.4.j]
git-svn-id: svn://svn.zabbix.com/trunk@5005 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
| -rw-r--r-- | frontends/php/include/classes/cformtable.inc.php | 1 | ||||
| -rw-r--r-- | frontends/php/include/classes/ctag.inc.php | 2 | ||||
| -rw-r--r-- | frontends/php/include/scripts.inc.php | 20 | ||||
| -rw-r--r-- | frontends/php/tr_status.php | 6 |
4 files changed, 17 insertions, 12 deletions
diff --git a/frontends/php/include/classes/cformtable.inc.php b/frontends/php/include/classes/cformtable.inc.php index 8c57865f..b704ab13 100644 --- a/frontends/php/include/classes/cformtable.inc.php +++ b/frontends/php/include/classes/cformtable.inc.php @@ -146,7 +146,6 @@ ), $class); } - array_push($this->center_items, $item1); } diff --git a/frontends/php/include/classes/ctag.inc.php b/frontends/php/include/classes/ctag.inc.php index c0924477..f8a93ea2 100644 --- a/frontends/php/include/classes/ctag.inc.php +++ b/frontends/php/include/classes/ctag.inc.php @@ -36,7 +36,7 @@ if(is_object($item)) { - $res = $item->ToString(); + $res = $item->ToString(false); } elseif(is_array($item)) { diff --git a/frontends/php/include/scripts.inc.php b/frontends/php/include/scripts.inc.php index 33f6f1c1..b87749cd 100644 --- a/frontends/php/include/scripts.inc.php +++ b/frontends/php/include/scripts.inc.php @@ -74,14 +74,19 @@ function execute_script($scriptid,$hostid){ if($res) { global $ZBX_LOCALNODEID; - $res = false; - - $sql = "SELECT ip,port FROM nodes WHERE nodeid=$ZBX_LOCALNODEID"; - $node = DBselect($sql); - if($row = DBfetch($node)) + if($nodeid == 0) { - $res = socket_connect($socket, $row['ip'], $row['port']); + $res = socket_connect($socket, '127.0.0.1', 10051); + } + else + { + $sql = "SELECT ip,port FROM nodes WHERE nodeid=$ZBX_LOCALNODEID"; + $node = DBselect($sql); + if($row = DBfetch($node)) + { + $res = socket_connect($socket, $row['ip'], $row['port']); + } } } if($res) @@ -101,7 +106,8 @@ function execute_script($scriptid,$hostid){ } else { - $message = socket_strerror(socket_last_error()); + $message["flag"]=-1; + $message["message"] = socket_strerror(socket_last_error()); } return $message; } diff --git a/frontends/php/tr_status.php b/frontends/php/tr_status.php index dcc8c49e..2a7f30ad 100644 --- a/frontends/php/tr_status.php +++ b/frontends/php/tr_status.php @@ -545,7 +545,7 @@ include_once "include/page_header.php"; $description = expand_trigger_description_by_data( array_merge($row, array("clock"=>$row_event["clock"])), ZBX_FLAG_EVENT); - + if($compact != 'true'){ $font = new CTag('font','yes'); $font->AddOption('color','#000'); @@ -558,10 +558,10 @@ include_once "include/page_header.php"; $font->AddOption('color','#808080'); $font->AddItem(array(' - ',$description)); $description = $font->ToString(); - + $table->AddRow(array( get_node_name_by_elid($row['triggerid']), - $_REQUEST['hostid'] > 0 ? null : $row['host'], + $host, ($row_event['acknowledged'] == 1)?(SPACE):(new CCheckBox('events['.$row_event['eventid'].']', 'no',NULL,$row_event['eventid'])), $description, $value, |
