Severity Enum (#14620)

* Severity Enum
Replace old Alert constants

* Fix whitespace

* Additional uses

* style fixes

* Fix test too

* More missed locations

* More
This commit is contained in:
Tony Murray
2023-08-05 12:12:36 -05:00
committed by GitHub
parent 9382959c8c
commit d1b7004fef
172 changed files with 591 additions and 473 deletions

View File

@@ -32,7 +32,7 @@ use DeviceCache;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use LibreNMS\Config;
use LibreNMS\Enum\Alert;
use LibreNMS\Enum\Severity;
use LibreNMS\Util\Debug;
use LibreNMS\Util\Oid;
use LibreNMS\Util\Rewrite;
@@ -467,9 +467,9 @@ class NetSnmpQuery implements SnmpQueryInterface
{
if ($code) {
if (Str::startsWith($error, 'Invalid authentication protocol specified')) {
Eventlog::log('Unsupported SNMP authentication algorithm - ' . $code, $this->device, 'poller', Alert::ERROR);
Eventlog::log('Unsupported SNMP authentication algorithm - ' . $code, $this->device, 'poller', Severity::Error);
} elseif (Str::startsWith($error, 'Invalid privacy protocol specified')) {
Eventlog::log('Unsupported SNMP privacy algorithm - ' . $code, $this->device, 'poller', Alert::ERROR);
Eventlog::log('Unsupported SNMP privacy algorithm - ' . $code, $this->device, 'poller', Severity::Error);
}
Log::debug('Exitcode: ' . $code, [$error]);
}