Some Quick Reg questions.
-
Hi All,
I have a few questions about FOG.
-
Is it pssible to set the PC on quick reg to name it to the serial number instead of the mac address?
-
Is it possible to auto register machines that are not registered?
TIA.
Sam -
-
@slipke said in Some Quick Reg questions.:
Is it pssible to set the PC on quick reg to name it to the serial number instead of the mac address?
Yes and no. Is this a native feature of FOG, no. Yes if you have the ability to modify the autoreg script in the inits. Its really not that hard if you understand the basics of bash programming.
Is it possible to auto register machines that are not registered?
It depends on what you mean auto register machines that are not registered. If the FOG client is installed and it checks into the FOG server the client will put the registration in a pending state. Understand I don’t use the fog client, but I seen this activity when I was testing the fog client. If you have the registration in a text file you can upload that into the host management page via the web gui.
-
@george1421 said in Some Quick Reg questions.:
what you mean auto register machines that are not registered. If the FOG client is installed and it checks into the FOG server the client will put the registration in a pending state. Understand I don’t use the fog client,
Hey,
Any tips on where to start with the Auto PC Name script?
Regards,
Sam -
@slipke Well if you wanted to do it in the auto reg it will be a bit harder than manual registration, but here is the curl call in the fog.auto.reg program. https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.auto.reg#L73
Before that curl call you will need to collect the serial number of the machine. The trick is the serial number is saved in the smbios in different locations for different manufacturers.
If you look at this post it shows you how to get the serial number for the two chassis types I had to interact with: https://forums.fogproject.org/topic/6304/fog-2-0-request-advanced-host-naming/2 It also shows how to create a complex computer name based on several factors on the fly. So you will need to compute/collect the serial number and pass it along with the other arguments to the php file mentioned in the curl call. And then in the php code read that variable and place it in the hostname variable instead of the mac address.
If you wanted to do this using the manual registration fog.man.reg where it asks for the user to input the host name into $host just use the dmidecode value to copy the serialno value into the host variable. https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.man.reg#L161