ajout heimdall
This commit is contained in:
37
heimdall/config/www/SupportedApps/Netdata/Netdata.php
Executable file
37
heimdall/config/www/SupportedApps/Netdata/Netdata.php
Executable file
@@ -0,0 +1,37 @@
|
||||
<?php namespace App\SupportedApps\Netdata;
|
||||
|
||||
class Netdata extends \App\SupportedApps implements \App\EnhancedApps {
|
||||
private const ENDPOINT = 'api/v1/info';
|
||||
|
||||
public $config;
|
||||
|
||||
function __construct() {
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
$test = parent::appTest($this->url(self::ENDPOINT));
|
||||
echo $test->status;
|
||||
}
|
||||
|
||||
public function livestats()
|
||||
{
|
||||
$status = 'inactive';
|
||||
$res = parent::execute($this->url(self::ENDPOINT));
|
||||
$res = parent::execute($this->url(self::ENDPOINT));
|
||||
$details = json_decode($res->getBody());
|
||||
|
||||
$data = [
|
||||
'count_warning' => $details->alarms->warning,
|
||||
'count_critical' => $details->alarms->critical
|
||||
];
|
||||
|
||||
return parent::getLiveStats($status, $data);
|
||||
}
|
||||
|
||||
public function url($endpoint)
|
||||
{
|
||||
$api_url = parent::normaliseurl($this->config->url).$endpoint;
|
||||
return $api_url;
|
||||
}
|
||||
}
|
||||
10
heimdall/config/www/SupportedApps/Netdata/app.json
Executable file
10
heimdall/config/www/SupportedApps/Netdata/app.json
Executable file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"appid": "810d3926feac8c1bd3957fdac48b6c9475b932d0",
|
||||
"name": "Netdata",
|
||||
"website": "https://my-netdata.io/",
|
||||
"license": "GNU General Public License v3.0 only",
|
||||
"description": "Unparalleled insights, in real-time, of everything happening on your systems and applications, with stunning, interactive web dashboards and powerful performance and health alarms.",
|
||||
"enhanced": true,
|
||||
"tile_background": "dark",
|
||||
"icon": "netdata.png"
|
||||
}
|
||||
11
heimdall/config/www/SupportedApps/Netdata/config.blade.php
Executable file
11
heimdall/config/www/SupportedApps/Netdata/config.blade.php
Executable file
@@ -0,0 +1,11 @@
|
||||
<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]', null, array('placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control')) !!}
|
||||
</div>
|
||||
<div class="input">
|
||||
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
10
heimdall/config/www/SupportedApps/Netdata/livestats.blade.php
Executable file
10
heimdall/config/www/SupportedApps/Netdata/livestats.blade.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<ul class="livestats">
|
||||
<li>
|
||||
<span class="title">Warning</span>
|
||||
<strong>{!! $count_warning !!}</strong>
|
||||
</li>
|
||||
<li>
|
||||
<span class="title">Critical</span>
|
||||
<strong>{!! $count_critical !!}</strong>
|
||||
</li>
|
||||
</ul>
|
||||
BIN
heimdall/config/www/SupportedApps/Netdata/netdata.png
Executable file
BIN
heimdall/config/www/SupportedApps/Netdata/netdata.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Reference in New Issue
Block a user