Update syslog-notify-oxidized.php (#14005)

* Update syslog-notify-oxidized.php

For oxidized to be able to catch from syslog a configuration change on a CISCO switch via SNMP.

* Update syslog-notify-oxidized.php

Small mistake with ","

* Update syslog-notify-oxidized.php

Modify with @murrant helps.
This commit is contained in:
kruczek8989
2022-06-04 20:17:37 +02:00
committed by GitHub
parent 2f4c7ce401
commit 6039293a7c

View File

@ -9,7 +9,7 @@ $os = $argv[2];
$msg = $argv[3];
$oxidized_api = new \App\ApiClients\Oxidized();
if (preg_match('/(SYS-(SW[0-9]+-)?5-CONFIG_I|VSHD-5-VSHD_SYSLOG_CONFIG_I): Configured from .+ by (?P<user>.+) on .*/', $msg, $matches)) {
if (preg_match('/(SYS-(SW[0-9]+-)?5-CONFIG_I|VSHD-5-VSHD_SYSLOG_CONFIG_I): Configured from .+ by (?P<user>\S+)( on .*)?$/', $msg, $matches)) {
$oxidized_api->updateNode($hostname, $msg, $matches['user']);
} elseif (preg_match('/GBL-CONFIG-6-DB_COMMIT : Configuration committed by user \\\\\'(?P<user>.+?)\\\\\'..*/', $msg, $matches)) {
$oxidized_api->updateNode($hostname, $msg, $matches['user']);