Updates to snmptrap handling (#9010)

* Updates to snmptrap handling
fix a bug in findDeviceByIP.  Add more tests for that.
Move handle outside of the Trap class, it doesn't fit.
Add developer docs.

* fix tests copy paste issue.

* Fix findByIp when port may not exist.

* Logging: Output context (and extra) if they exist

* Generic trap event logging and new config setting.
This commit is contained in:
Tony Murray
2018-08-14 01:56:16 -05:00
committed by Neil Lathwood
parent 5e8a144c2d
commit 4c6f917d9e
20 changed files with 279 additions and 49 deletions

View File

@@ -68,9 +68,12 @@ $factory->define(\App\Models\Ipv4Address::class, function (Faker\Generator $fake
return [
'ipv4_address' => $ip->uncompressed(),
'ipv4_prefixlen' => $prefix,
'port_id' => function () {
return factory(\App\Models\Port::class)->create()->port_id;
},
'ipv4_network_id' => function () use ($ip) {
return factory(\App\Models\Ipv4Network::class)->create(['ipv4_network' => $ip->getNetworkAddress() . '/' . $ip->cidr])->ipv4_network_id;
}
},
];
});