-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'tag' support for NetDiscovery/NetInventory tasks #828
Conversation
I think you missed few points. First using the tag means you add the agent tag to all scanned devices. This is not the same logic than for computers where each computer can have its own tag. This is probably not a problem in your context as you probably have dedicated agent to each customer, but this could become one for other people: if they scan all their network, they will have problem if the scanning agent has a tag for the computer inventory and a rule starts to relocate their devices in the wrong entity because of this. Than there's still a way to import network devices and have them into the expected entity:
Most people use this entity allocation rules, if I merged you PR, I'm sure we will start to have unexpected side-effect with a lot of users. |
Yes, I saw that there's an |
Hello,
This commit adds the same Computer tag to NetDiscovery/NetInventory and ESX inventory tasks. This fix glpi-project/glpi-inventory-plugin#504
A little background: I have a small IT company and I act more like a MSP for other small business. These clients doesn't have condition to keep a GLPI server on their own. I use an Entity for each client have access to their own assets and I was able to create a Entity rule (Administration > Rules > Rules for assigning an item to an entity) based on GLPI-Agent tag, but it was working only for Computer inventory, other devices (like SNMP switches and printers) was being assigned to the default Entity and I had to move them manually to the respective Entity. I couldn't find any attribute that I could use to differ the clients based only on the available Entity rules fields - I couldn't use the subnet/IP address because most clients have a 192.168.0.0/24 network so it wouldn't be reliable. As those tasks doesn't provide the TAG field, I decided to create this PR to be able to use the Computer tag to assign those devices to the correct Entity.
Here's the Entity rule I've created:
Here's a screenshot to prove it's working:
Here's sample inventory files I've used to test the rule (a SNMP printer):
esx_esxi01.xml.txt
netdiscovery_brother.xml.txt
netinventory_brother.xml.txt
Note: For some reason, it works only when importing a non-existing device, if it already exists, it updates it's information but it doesn't change it's Entity. It seems that the Entity rules is applied only when the device is created on GLPI, but I'm not sure if it's a bug or an intended feature.