glpi-inventory-plugin icon indicating copy to clipboard operation
glpi-inventory-plugin copied to clipboard

Use IP range set on task for Device NetInventory

Open eduardomozart opened this issue 1 year ago • 6 comments

Fix https://github.com/glpi-project/glpi-inventory-plugin/issues/523

eduardomozart avatar Jul 09 '24 21:07 eduardomozart

Hello guys, I did some changes on the script to handle cenarios where there's some sort of VIP (virtual IP, used for redundancy on network devices). On my infrastructure, we have an Aruba Instant Access Points (IAP) cluster (a virtual controller that handle all APs on our site), as you can see below, both devices contains "192.168.0.6", which is a VIP that I use to manage the IAP cluster (only one device assume this IP at the time, and if this AP is down, other devices assume this VIP, so the cluster management is always available), but each AP has it's own AP: image image So this virtual IP (192.168.0.6) is on the same range than my task (192.168.0.0/24), but it will be used only if there's no other unique IP available on the same network range.

eduardomozart avatar Jul 10 '24 14:07 eduardomozart

This would need tests

trasher avatar Jul 29 '24 06:07 trasher

Please fix CS

trasher avatar Jul 29 '24 06:07 trasher

This would need tests

I'll see what I can do.

Please fix CS

Which line(s)?

eduardomozart avatar Jul 29 '24 18:07 eduardomozart

Please fix CS Which line(s)?

See GH actions output: https://github.com/glpi-project/glpi-inventory-plugin/actions/runs/9891523512/job/28031989775?pr=524

trasher avatar Jul 30 '24 08:07 trasher

Hello, I added the Unit Tests as requested by trasher but as cedric already approved those changes and the changes I made after his approval was minimal (only continued loop if IP wasn't unique instead of breaking it), I believe it should work as expected. The changes I made after cedric approval may not be needed (at least, for Aruba IAP cluster Virtual IPs) if #536 be investigated further, but maybe other systems of redundancy can also assign an VIP for more than one device, so this kind of check maybe useful to keep.

eduardomozart avatar Jul 30 '24 14:07 eduardomozart