diff options
author | ramon <ramongomez@us.es> | 2016-03-17 12:15:10 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2016-03-17 12:15:10 +0000 |
commit | 8c9fcb2861cc222c16ab9e17b0167e125c6358fa (patch) | |
tree | 1e4743058feb48d44a892a6927a0c7b63fd0ec78 /admin/WebConsole/principal/sondeo.php | |
parent | b658596cdeebf762923d347f8bf80ab4203b28ad (diff) |
#718: Integrar sondeo de estados de antios servicios de cliente y de nuevo OGAdent.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@4835 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/principal/sondeo.php')
-rw-r--r-- | admin/WebConsole/principal/sondeo.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/admin/WebConsole/principal/sondeo.php b/admin/WebConsole/principal/sondeo.php index 137ec449..2cc30ea4 100644 --- a/admin/WebConsole/principal/sondeo.php +++ b/admin/WebConsole/principal/sondeo.php @@ -9,6 +9,7 @@ // Consulta el estado de los ordenadores // ************************************************************************************************************************************************* include_once("../includes/ctrlacc.php"); + include_once("../includes/restfunctions.php"); include_once("../clases/SockHidra.php"); include_once("../clases/AdoPhp.php"); include_once("../includes/constantes.php"); @@ -42,6 +43,8 @@ $cadenamac=""; RecopilaIpesMacs($cmd,$ambito,$idambito); // Ámbito de aplicación $aplicacion="ido=".$cadenaid.chr(13)."iph=".$cadenaip.chr(13); + // Reset status. + echo "cadenaip"; //________________________________________________________________________________________________________ // Envio al servidor de la petición //________________________________________________________________________________________________________ @@ -67,5 +70,25 @@ echo $trama_notificacion; // Devuelve respuesta } } + + // Send REST requests to new OGAgent clients. + $urls = array(); + // Compose array of REST URLs. + foreach (explode (';', $cadenaip) as $ip) { + $urls[$ip] = "https://$ip:8000/opengnsys/status"; + } + // Launch concurrent requests. + $responses = multiRequest($urls, array(CURLOPT_SSL_VERIFYHOST => false, CURLOPT_SSL_VERIFYPEER => false)); + // Process responses array (IP as array index). + foreach ($responses as $ip => $data) { + if (isset($data)) { + $status = json_decode($data); + // If user session is oppened, then append "S" to client status. + if (isset($status->status) and isset($status->loggedin)) { + // Output format: IP1/Status1;... + echo "$ip/".$status->status.($status->loggedin?"S;":";"); + } + } + } ?> |