Skip to content
Snippets Groups Projects
Commit c23fd7ba authored by Tibo's avatar Tibo
Browse files

download client from cylab artifact repository

parent cc7a8b92
No related branches found
No related tags found
No related merge requests found
Pipeline #1869 failed
......@@ -13,10 +13,10 @@ class ClientVersion extends \App\AbstractSensor
{
const MANIFEST = "https://download.cylab.be/monitor-php-client/manifest.json";
public function latestVersion()
public function manifest()
{
$client = new Client([
$client = new Client([
'timeout' => 5.0,
]);
......@@ -26,8 +26,19 @@ class ClientVersion extends \App\AbstractSensor
return "";
}
return json_decode($json)[0]->version;
return json_decode($json)[0];
}
public function latestVersion()
{
return $this->manifest()->version;
}
public function latestUrl()
{
return $this->manifest()->url;
}
//put your code here
public function report()
......
......@@ -91,6 +91,12 @@ class Server extends Model
return $last_record->version;
}
public function lastClientUrl()
{
$client_sensor = new \App\Sensor\ClientVersion($this);
return $client_sensor->latestUrl();
}
/**
* Get integer status of server.
......
......@@ -120,11 +120,11 @@ window.monitorServerToken = "{{ $server->read_token }}";
</div>
<div class="card-body">
<p>Download client application:</p>
<pre style="font-size: 75%; overflow: hidden"><code>wget https://gitlab.cylab.be/cylab/monitoring/raw/master/php-client/bin/monitor.phar
chmod +x monitor.phar
<pre style="font-size: 75%; overflow: hidden"><code>wget {{ $server->lastClientUrl() }}
unzip monitor-*.zip
</code></pre>
<p>Move it to /usr/bin:</p>
<pre style="font-size: 75%; overflow: hidden"><code>sudo mv monitor.phar /usr/bin/monitor
<pre style="font-size: 75%; overflow: hidden"><code>sudo mv monitor /usr/bin/monitor
</code></pre>
<p>Test it:</p>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment