summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-10-24 13:06:56 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-10-24 13:06:56 +0000
commitbb7db0ed62417d62c21d55c0518304c25805af91 (patch)
tree95a082d740e944d3877d451fb6281d003860cfa4 /frontends/php/include
parent844612c2ddd19cb5e9a8d423c88f95b013ea73a4 (diff)
downloadzabbix-bb7db0ed62417d62c21d55c0518304c25805af91.tar.gz
zabbix-bb7db0ed62417d62c21d55c0518304c25805af91.tar.xz
zabbix-bb7db0ed62417d62c21d55c0518304c25805af91.zip
- [DEV-48] Support of Ping and Traceroute in Status of Triggers screen
[svn merge -r4906:4910 svn://svn.zabbix.com/branches/1.4.j] git-svn-id: svn://svn.zabbix.com/trunk@4911 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/forms.inc.php7
-rw-r--r--frontends/php/include/scripts.inc.php11
2 files changed, 16 insertions, 2 deletions
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index 4ae1db02..184cd4de 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -4872,7 +4872,12 @@ include_once 'include/discovery.inc.php';
$script_info = DBfetch(DBselect("select name from scripts where scriptid=$scriptid"));
$frmResult = new CFormTable($script_info["name"].': '.script_make_command($scriptid,$hostid));
- $frmResult->AddRow(S_RESULT,new CTextArea("message",$result["message"],100,25));
+ $message = $result["message"];
+ if($result["flag"] != 0) {
+ error($message);
+ $message = "";
+ }
+ $frmResult->AddRow(S_RESULT,new CTextArea("message",$message,100,25,'yes'));
$frmResult->AddItemToBottomRow(new CButtonCancel(null,'close_window();'));
$frmResult->Show();
diff --git a/frontends/php/include/scripts.inc.php b/frontends/php/include/scripts.inc.php
index 66639a12..33f6f1c1 100644
--- a/frontends/php/include/scripts.inc.php
+++ b/frontends/php/include/scripts.inc.php
@@ -73,7 +73,16 @@ function execute_script($scriptid,$hostid){
}
if($res)
{
- $res = socket_connect($socket, '127.0.0.1', 10051);
+ global $ZBX_LOCALNODEID;
+
+ $res = false;
+
+ $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)
{