Fix various issues with loading os definitions (#11640)

* Ping only device doesn't display
if os was set to something, ping os wasn't loaded and we try to get overview graphs from it.

* Fix snmp_disable device page load error
When other os is set.

* Revamp os setting loading
the only safe way to access is Config::getOsSetting()

* Remove getOsSetting fallback behavior
Most instances don't use it and it can have unexpected results Config::getOsSetting('blah', 'group') == 'librenms'

* refactor and remove unneeded load_os/loadOs calls now since getOsSetting automatically loads it.

* restore unix overview graphs, they are different
small cleanups

* fix
This commit is contained in:
Tony Murray
2020-05-19 14:35:32 -05:00
committed by GitHub
parent 0b68c70a97
commit d5a52ca4eb
28 changed files with 173 additions and 271 deletions

View File

@@ -27,6 +27,9 @@ namespace LibreNMS\Tests;
use Illuminate\Support\Str;
use LibreNMS\Config;
use LibreNMS\Util\OS;
use const false;
use const true;
class OSDiscoveryTest extends TestCase
{
@@ -145,7 +148,7 @@ class OSDiscoveryTest extends TestCase
// make sure all OS are loaded
$config_os = array_keys(Config::get('os'));
if (count($config_os) < count(glob(Config::get('install_dir').'/includes/definitions/*.yaml'))) {
load_all_os();
OS::loadAllDefinitions(false, true);
$config_os = array_keys(Config::get('os'));
}