summaryrefslogtreecommitdiffstats
path: root/frontends/php
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-12-03 12:58:17 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-12-03 12:58:17 +0000
commitf9fd0c3bcd9d360fce9429e634c61d1eb4cbb54a (patch)
tree24dde5e2c186333bd3defebfd33c10b5960aa31a /frontends/php
parent47d245025a7e4896f442570c6204480f288b620f (diff)
downloadzabbix-f9fd0c3bcd9d360fce9429e634c61d1eb4cbb54a.tar.gz
zabbix-f9fd0c3bcd9d360fce9429e634c61d1eb4cbb54a.tar.xz
zabbix-f9fd0c3bcd9d360fce9429e634c61d1eb4cbb54a.zip
- [DEV-48] Support of Ping and Traceroute in Status of Triggers screen
git-svn-id: svn://svn.zabbix.com/trunk@5130 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
-rw-r--r--frontends/php/include/scripts.inc.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/frontends/php/include/scripts.inc.php b/frontends/php/include/scripts.inc.php
index 417333eb..c5ab93ff 100644
--- a/frontends/php/include/scripts.inc.php
+++ b/frontends/php/include/scripts.inc.php
@@ -60,8 +60,7 @@ function script_make_command($scriptid,$hostid)
}
function execute_script($scriptid,$hostid){
- $res = array();
- $res["flag"]=1;
+ $res = 1;
$command = script_make_command($scriptid,$hostid);
$nodeid = id2nodeid($hostid);
@@ -70,7 +69,7 @@ function execute_script($scriptid,$hostid){
if(!$socket)
{
- $res["flag"] = 1;
+ $res = 0;
}
if($res)
{
@@ -92,15 +91,15 @@ function execute_script($scriptid,$hostid){
$message["flag"]=$flag;
$message["message"]=$msg;
}
- if($res)
- {
- @socket_close($socket);
- }
else
{
$message["flag"]=-1;
$message["message"] = S_CONNECT_TO_SERVER_ERROR.' ['.$ZBX_SERVER.':'.$ZBX_SERVER_PORT.'] ['.socket_strerror(socket_last_error()).']';
}
+ if($socket)
+ {
+ @socket_close($socket);
+ }
return $message;
}