diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2019-05-27 13:05:06 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2019-05-27 13:05:58 +0200 |
commit | 560455a8c98e8a8ee374f50812c9915f32f7d18c (patch) | |
tree | 35725c0a0ef7f26bcdd0975eee998d1882a111f9 /admin/WebConsole/principal/sondeo.php | |
parent | b9d5756a29908aeb7c171c2be083c730383b2876 (diff) |
#915 adapt web console to use new REST API in OgAdmServer
Use new REST API in ogAdmServer.
This allows us to start removing the old SockHidra code.
Diffstat (limited to 'admin/WebConsole/principal/sondeo.php')
-rw-r--r-- | admin/WebConsole/principal/sondeo.php | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/admin/WebConsole/principal/sondeo.php b/admin/WebConsole/principal/sondeo.php index ca3e8b5e..90493d58 100644 --- a/admin/WebConsole/principal/sondeo.php +++ b/admin/WebConsole/principal/sondeo.php @@ -46,36 +46,14 @@ $cadenamac=""; RecopilaIpesMacs($cmd,$ambito,$idambito); // Ámbito de aplicación - $aplicacion="ido=".$cadenaid.chr(13)."iph=".$cadenaip.chr(13); - // Envio al servidor de la petición - //________________________________________________________________________________________________________ - $resul=false; - $trama=""; - $trama_notificacion=""; - $shidra=new SockHidra($servidorhidra,$hidraport); - if ($shidra->conectar()){ // Se ha establecido la conexión con el servidor hidra - $parametros="nfn=".$funcion.chr(13); - $parametros.=$aplicacion; - $parametros.=$atributos; - $parametros.=$acciones; - $resul=$shidra->envia_peticion($parametros); - if($resul) - $trama=$shidra->recibe_respuesta(); - $shidra->desconectar(); - } - if($resul){ - $hlonprm=hexdec(substr($trama,$LONCABECERA,$LONHEXPRM)); - $parametros=substr($trama,$LONCABECERA+$LONHEXPRM,$hlonprm); - $ValorParametros=extrae_parametros($parametros,chr(13),'='); - if (isset ($ValorParametros["tso"])) { - $trama_notificacion=$ValorParametros["tso"]; - } - } + $ips = explode (';', $cadenaip); + + $trama_notificacion = clients($sw, $ips); // Send REST requests to new OGAgent clients. $urls = array(); // Compose array of REST URLs. - foreach (explode (';', $cadenaip) as $ip) { + foreach ($ips as $ip) { $urls[$ip] = "https://$ip:8000/opengnsys/status"; } // Launch concurrent requests. |