mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
committed by
Neil Lathwood
parent
5e8a144c2d
commit
4c6f917d9e
@@ -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;
|
||||
}
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user