ajout heimdall
This commit is contained in:
+48
@@ -0,0 +1,48 @@
|
||||
<?php namespace App\SupportedApps\PRTG;
|
||||
|
||||
class PRTG extends \App\SupportedApps implements \App\EnhancedApps {
|
||||
|
||||
public $config;
|
||||
|
||||
//protected $login_first = true; // Uncomment if api requests need to be authed first
|
||||
//protected $method = 'POST'; // Uncomment if requests to the API should be set by POST
|
||||
|
||||
function __construct() {
|
||||
//$this->jar = new \GuzzleHttp\Cookie\CookieJar; // Uncomment if cookies need to be set
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
$username = $this->config->username;
|
||||
$passhash = $this->config->passhash;
|
||||
$test = parent::appTest($this->url('api/getstatus.htm?id=0&username='.$username.'&passhash='.$passhash));
|
||||
echo $test->status;
|
||||
}
|
||||
|
||||
public function livestats()
|
||||
{
|
||||
$username = $this->config->username;
|
||||
$passhash = $this->config->passhash;
|
||||
$status = 'inactive';
|
||||
$res = parent::execute($this->url('api/getstatus.htm?id=0&username='.$username.'&passhash='.$passhash));
|
||||
$details = json_decode($res->getBody());
|
||||
|
||||
$data = [];
|
||||
|
||||
if($details) {
|
||||
if (empty($details->Alarms)) {$data['alarms'] = 0;} else {$data['alarms'] = number_format($details->Alarms);}
|
||||
if (empty($details->AckAlarms)) {$data['alarmsack'] = 0;} else {$data['alarmsack'] = number_format($details->AckAlarms);}
|
||||
if (empty($details->WarnSens)) {$data['warnings'] = 0;} else {$data['warnings'] = number_format($details->WarnSens);}
|
||||
if (empty($details->UnusualSens)) {$data['unusuals'] = 0;} else {$data['unusuals'] = number_format($details->UnusualSens);}
|
||||
if (empty($details->UpSens)) {$data['ups'] = 0;} else {$data['ups'] = number_format($details->UpSens);}
|
||||
}
|
||||
|
||||
return parent::getLiveStats($status, $data);
|
||||
|
||||
}
|
||||
public function url($endpoint)
|
||||
{
|
||||
$api_url = parent::normaliseurl($this->config->url).$endpoint;
|
||||
return $api_url;
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"appid": "0ea6cd5e52e84ef9afd444f5693d09d216b10ba2",
|
||||
"name": "PRTG",
|
||||
"website": "https://www.paessler.com/prtg",
|
||||
"license": "100 sensors free",
|
||||
"description": "Monitor all systems, devices, traffic and applications of your IT infrastructure.",
|
||||
"enhanced": true,
|
||||
"tile_background": "light",
|
||||
"icon": "prtg.png"
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<h2>{{ __('app.apps.config') }} ({{ __('app.optional') }}) @include('items.enable')</h2>
|
||||
<div class="items">
|
||||
<div class="input">
|
||||
<label>{{ strtoupper(__('app.url')) }}</label>
|
||||
{!! Form::text('config[override_url]', (isset($item) ? $item->getconfig()->override_url : null), array('placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control')) !!}
|
||||
</div>
|
||||
<div class="input">
|
||||
<label>{{ __('app.apps.username') }}</label>
|
||||
{!! Form::text('config[username]', (isset($item) ? $item->getconfig()->username : null), array('placeholder' => __('app.apps.username'), 'data-config' => 'username', 'class' => 'form-control config-item')) !!}
|
||||
</div>
|
||||
<div class="input">
|
||||
<label title="You need a passhash not a password, you can find this on the User Account page in PRTG.">Passhash (help?)</label>
|
||||
{!! Form::text('config[passhash]', (isset($item) ? $item->getconfig()->passhash : null), array('placeholder' => __('Passhash'), 'data-config' => 'passhash', 'class' => 'form-control config-item')) !!}
|
||||
</div>
|
||||
<div class="input">
|
||||
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
<ul class="livestats">
|
||||
<li>
|
||||
<img style="margin: 0 2px 2px; width:20px; height:20px; border:none;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAIAAAAmdTLBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeNpi/P//PwMFgBGo/7KUGnmadZ/dYmKgDFCqnwVTSKI1CMJ4Ub0Olwg+/wN9BWHAxTFFBo3/B2H4v55fQVBk0KS/oZ5+hnr4U6qfkcLyDyDAAK8eRB+e6G+qAAAAAElFTkSuQmCC">
|
||||
<p style="margin:0 auto; font-size:12px; font-weight:bold;">{!! $alarms !!}</p>
|
||||
</li>
|
||||
<li>
|
||||
<img style="margin: 0 2px 2px; width:20px; height:20px; border:none;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAIAAAAmdTLBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFFJREFUeNpi/P//PwMFgBGo/+W0UvI0i2d1MzFQBijVz4JHjtfMAcL4fOoAOfq5TLwJ6h9o/w/m8P92ZitF+vEE+2j6GSbhT6l+RgrLP4AAAwB9eCIjar5kTwAAAABJRU5ErkJggg==">
|
||||
<p style="margin:0 auto; font-size:12px; font-weight:bold;">{!! $alarmsack !!}</p>
|
||||
</li>
|
||||
<li>
|
||||
<img style="margin: 0 2px 2px; width:20px; height:20px; border:none;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAIAAAAmdTLBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAUBJREFUeNpi+k8ZYGFgYHh/npGBLCBo+J+JgTIw0PpZ4CxGJiFWDjcg4/ePXf//vQMymFkNmVnV//6++ff3eawKUOwHynGrLwciiCIg4BQtAnKBJC4FKPp/fVvB8OczyEk8NlANAk5wEiH+5zNIJVb///1yBqSOWwtEcngwsEuBRNmlQGyYOEQNdv2/3u8CeZtTHWQttz3Ca2A2RByiBrv+3193QiwEBhWbSCBcHMgGikCcA1WD3f2/z//7dhOkgSeciQtk29+3m0CKuNSBIkAGUBYSFzjj/+/n00CSQzIfxPn57NMjfyAJF4HI4tP/68NWiIUgp37YBychIhBZvPphsQgE31/3wUnMmMOZfiExBPcqPFDQYg49/cLBj5ezWL5e+/PlCFzk++MGYOJBFkGkemAZMJTzPwvEGWTrBwgwAAmf0TPW0C5TAAAAAElFTkSuQmCC">
|
||||
<p style="margin:0 auto; font-size:12px; font-weight:bold;">{!! $warnings !!}</p>
|
||||
</li>
|
||||
<li>
|
||||
<img style="margin: 0 2px 2px; width:20px; height:20px; border:none;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAIAAAAmdTLBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKtJREFUeNpi/P//PwMFgAWI389kJU+zYPpvJgbKAKX6WTCF+H33Qxhfjzf+eXMAqwg+/UxSNlAGGz8uEaq5f1Q/KeDv54ck6Gdk4wXFsIgDkv4LhNPPvzeXmUR0gQwuhwkcb5OZhHXh4kS5/+vBIoafH0Esdn5QymEHp5mfH0HixKRfYAr9tNaFUz2MWdIS6uznx7/fXIXpeOz6If78cubCSEg/jBSWfwABBgAbjD9+mVhlXQAAAABJRU5ErkJggg==">
|
||||
<p style="margin:0 auto; font-size:12px; font-weight:bold;">{!! $unusuals !!}</p>
|
||||
</li>
|
||||
<li>
|
||||
<img style="margin: 0 2px 2px; width:20px; height:20px; border: 1px solid #fff;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAIAAAAmdTLBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPNJREFUeNpi/P//PwMFgBGof+Y+OTJ0inObBZivYSLPWqBmH6P5QAYT2Zq//HhBjn64zbsuZwFJFjI0s7Dy7r9Y9P7HTdLsh2u+8XD5rbdrIIJMpGp+9e7cwbvlcHEmkjT/+f15+5VUZCkm4jUD2bsvFfz485qAfh2xRHf1aYIc6miaz9zsffRxN5pi7OGvIO0DRECvCvGqQjQ/eXng7NOJmCqx2H/l1fyjV+qBDDEhI4jmr9+f7b1ZjNUm7P6HGwEEwDDbfSkPzduEww9uxMmbPS+/nsKlDF/6Axrx+uRVPJoJxx9+zWTmv8Gkn5HC8g8gwABYVW+W51R+EAAAAABJRU5ErkJggg==">
|
||||
<p style="margin:0 auto; font-size:12px; font-weight:bold;">{!! $ups !!}</p>
|
||||
</li>
|
||||
</ul>
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
Reference in New Issue
Block a user