Browse Source

Removed some data source options

Options weren't universal to all netdata installs, so should users can replicate the removed functions with a custom data definition
Henry Whitaker 6 years ago
parent
commit
b9e0160dd5
2 changed files with 0 additions and 75 deletions
  1. 0 59
      api/functions/netdata-functions.php
  2. 0 16
      api/functions/option-functions.php

+ 0 - 59
api/functions/netdata-functions.php

@@ -334,32 +334,6 @@ function swap($url)
     return $data;
 }
 
-function ipmiTemp($url, $unit)
-{
-    $data = [];
-    $dataUrl = $url . '/api/v1/data?chart=ipmi.temperatures_c&format=array&points=540&group=average&gtime=0&options=absolute|jsonwrap|nonzero&after=-540';
-    try {
-        $response = Requests::get($dataUrl);
-        if ($response->success) {
-            $json = json_decode($response->body, true);
-            $data['value'] = $json['result'][0];
-            if($unit == 'c') {
-                $data['percent'] = ($data['value'] / 50) * 100;
-                $data['max'] = 50;
-            } else if($unit == 'f') {
-                $data['value'] = ($data['value'] * 9/5) + 32;
-                $data['percent'] = ($data['value'] / 122) * 100;
-                $data['max'] = 122;
-            }
-            $data['units'] = '°'.strtoupper($unit);
-        }
-    } catch (Requests_Exception $e) {
-        writeLog('error', 'Netdata Connect Function - Error: ' . $e->getMessage(), 'SYSTEM');
-    };
-
-    return $data;
-}
-
 function getPercent($val, $max)
 {
     if($max == 0) {
@@ -369,39 +343,6 @@ function getPercent($val, $max)
     }
 }
 
-function cpuTemp($url, $unit)
-{
-    $data = [];
-    $dataUrl = $url . '/api/v1/data?chart=sensors.coretemp-isa-0000_temperature&format=json&points=509&group=average&gtime=0&options=ms|flip|jsonwrap|nonzero&after=-540';
-    try {
-        $response = Requests::get($dataUrl);
-        if ($response->success) {
-            $json = json_decode($response->body, true);
-            $vals = $json['latest_values'];
-            $vals = array_filter($vals);
-            if(count($vals) > 0) {
-                $data['value'] = array_sum($vals) / count($vals);
-            } else {
-                $data['value'] = 0;
-            }
-            
-            if($unit == 'c') {
-                $data['percent'] = ($data['value'] / 50) * 100;
-                $data['max'] = 50;
-            } else if($unit == 'f') {
-                $data['value'] = ($data['value'] * 9/5) + 32;
-                $data['percent'] = ($data['value'] / 122) * 100;
-                $data['max'] = 122;
-            }
-            $data['units'] = '°'.strtoupper($unit);
-        }
-    } catch (Requests_Exception $e) {
-        writeLog('error', 'Netdata Connect Function - Error: ' . $e->getMessage(), 'SYSTEM');
-    };
-
-    return $data;
-}
-
 function customNetdata($url, $id)
 {
     try {

+ 0 - 16
api/functions/option-functions.php

@@ -187,22 +187,6 @@ function netdataOptions()
 			'name' => 'Disk space available',
 			'value' => 'disk-avail',
 		],
-		[
-			'name' => 'IPMI Temperature C',
-			'value' => 'ipmi-temp-c'
-		],
-		[
-			'name' => 'IPMI Temperature F',
-			'value' => 'ipmi-temp-f'
-		],
-		[
-			'name' => 'CPU Temperature C',
-			'value' => 'cpu-temp-c'
-		],
-		[
-			'name' => 'CPU Temperature F',
-			'value' => 'cpu-temp-f'
-		],
 		[
 			'name' => 'Custom',
 			'value' => 'custom',