I have the problem that I will have multiple servers that perform jobs. They all request a joblist from the same API and need to identify them with a unique id. So that I know which server is running which jobs and have no distribution collisions etc.
I am now trying to figure out a way to generate a unique server id. It is not critical that it stays the same forever. But it should be unique.
I noticed the PHP build time in phpinfo() but couldn't find any documentation about it. What if php is installed as a binary package? It will probably not change if two servers use the same package.
I would prefer some sort of mother board serial number or something.
A yeah, and it should be portable. So I would rather like to avoid something like calling a shell command using shell_exec or so.
Going for the external IP could also be an option. But how to reliably determine the "external" ip adress? what if there are more? What if its natted? Then i would need a combination of external and internal adress.
I could request the API one time and ask it to give me the external ip adress and combine. But this is going way to complicated and extensive...
Do you have any recommendations on this?