Skip to content

Commit 85d84d3

Browse files
authored
Remove duplicate rrdtool version code (librenms#19841)
1 parent bd5437f commit 85d84d3

2 files changed

Lines changed: 1 addition & 24 deletions

File tree

LibreNMS/Data/Store/Rrd.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -585,28 +585,6 @@ public static function fixedSafeDescr($descr, $length): string
585585
return $result . ' ';
586586
}
587587

588-
/**
589-
* Run rrdtool and parse the version from the output.
590-
*
591-
* @return string
592-
*/
593-
public static function version(): string
594-
{
595-
try {
596-
$rrd = app(RrdProcess::class, ['timeout' => 10]);
597-
$output = $rrd->run('--version');
598-
$parts = explode(' ', $output, 3);
599-
600-
if (isset($parts[1])) {
601-
return str_replace('1.7.01.7.0', '1.7.0', $parts[1]);
602-
}
603-
} catch (Exception) {
604-
//
605-
}
606-
607-
return '';
608-
}
609-
610588
/**
611589
* Only track update and create primarily, just put all others in an "other" bin
612590
*

app/Http/Controllers/AboutController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
use Illuminate\Http\JsonResponse;
5656
use Illuminate\Http\Request;
5757
use Illuminate\Support\Facades\App;
58-
use LibreNMS\Data\Store\Rrd;
5958
use LibreNMS\Util\Http;
6059
use LibreNMS\Util\Version;
6160

@@ -81,7 +80,7 @@ public function index(Request $request)
8180
'version_laravel' => App::version(),
8281
'version_python' => $version->python(),
8382
'version_webserver' => $request->server('SERVER_SOFTWARE'),
84-
'version_rrdtool' => Rrd::version(),
83+
'version_rrdtool' => $version->rrdtool(),
8584
'version_netsnmp' => $version->netSnmp(),
8685

8786
'stat_apps' => Application::count(),

0 commit comments

Comments
 (0)