Hello
So you want to put the IP in the agent name, right? You can register the agents using a command that obtains the IP. Please take a look at these two examples:
Linux
The command I used:
/var/ossec/bin/agent-auth -m 172.17.0.2 -A $(hostname -I)
where hostname -I give me the IP. In some cases, this command can return more than one IP, so you should use cut or grep for getting the desired IP isolated.
Windows
The command I used:
PS C:\Program Files (x86)\ossec-agent> .\agent-auth.exe -m 172.17.0.2 -A (Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias "Ethernet 2").IPAddress
Note that (Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias "Ethernet 2").IPAddress return me the Ethernet 2 interface IP. Maybe in your case, you should change this value.
Please let me know if this works for you.
Regards,
Alberto R