Quick host registration is registering my computers with the Mac address as the hostname
-
Hello all, I am installing a new fog server in my company. The old one that we used to have, registered every computer with the hostname that I want: "SITECODE-{SYSSERIAL} but it is not working on the new version. Can someone now how to change that?
Thanks in advance
-
Your old version must have been a modified version of 0.29-0.30. That feature never made it into the mainstream code base. That feature is not currently available. (I also asked the same question so many years ago)
-
I’ve not added any special strings as it actually adds quite a bit of complexity to the overall workflow.
While it’s not “overly” hard to add such a feature, I think this is something more in line with a user being able to edit and figure out.
First, you have to understand, you have to detect your “special” strings and replace them with the corresponding value. During Quick Registration, we haven’t quite gotten the inventory of the host yet, until after the host has been registered. It shouldn’t be too hard to add, but again it’s not a simple thing either.
And where do we “stop”. For example, what strings should we allow, vs, not allow?
The file you can edit, if you’d like to try adding this feature again, is located (with 1.4.4 at least)
/var/www/fog/lib/reg-task/registration.class.php
There’s two methods, _quickRegAuto and _quickReg, you’d want to modify the _quickRegAuto specifically.You’ll notice that inventory isn’t taken into account here, and therefor using the inventory data for the hostname would have to be done within the init’s.
In particular, the init file /bin/fog.auto.reg would need to be modified after the inventory line.
I’m bringing this to your attention only because FOG has changed quite a bit since 0.29/0.3x days and while this feature may have been there in the past, we have tried to make things much more manageable in general. This means some features from olden times may have been removed due to the complexity involved.
Hopefully you understand.
-
I need to add, that these “special” strings were a component of the QUICK_REG_AUTO_POP feature of fog, which from what I’m hearing here sounds like is not enabled currently. This can be found in FOG Configuration Page->FOG Settings->Quick Registration
-
@tom-elliott Is there a hook that we could use to add that feature back in? Ideally once FOG sets the host name we could hook in and rename what fog named by default. That way a plugin could be used? (asking without knowing much about what I’m saying).
-
@george1421 yes but it still requires some intervention from the inits making the plugin idea possible but not as simple. The hook would be HOST_REGISTER which again happens before inventory data has been captured.
-
@tom-elliott I looked at this a few years ago because I have the original code from the 0.3x days. I was quickly over my head in trying to sort it out.
How hard would it be for the developers to add another hook loop after the inventory has been committed during inventory process? Something like custom_host_name? Then I think the inits wouldn’t need to be touched since it would all be done in the fog backend. Then anyone with the motivation could write a host renaming plugin. The only thing the plugin would need access to outside of the host object would be the fog configuration infor for the auto naming field.
-
@tom-elliott said in Quick host registration is registering my computers with the Mac address as the hostname:
I’ve not added any special strings as it actually adds quite a bit of complexity to the overall workflow.
While it’s not “overly” hard to add such a feature, I think this is something more in line with a user being able to edit and figure out.
First, you have to understand, you have to detect your “special” strings and replace them with the corresponding value. During Quick Registration, we haven’t quite gotten the inventory of the host yet, until after the host has been registered. It shouldn’t be too hard to add, but again it’s not a simple thing either.
And where do we “stop”. For example, what strings should we allow, vs, not allow?
The file you can edit, if you’d like to try adding this feature again, is located (with 1.4.4 at least)
/var/www/fog/lib/reg-task/registration.class.php
There’s two methods, _quickRegAuto and _quickReg, you’d want to modify the _quickRegAuto specifically.You’ll notice that inventory isn’t taken into account here, and therefor using the inventory data for the hostname would have to be done within the init’s.
In particular, the init file /bin/fog.auto.reg would need to be modified after the inventory line.
I’m bringing this to your attention only because FOG has changed quite a bit since 0.29/0.3x days and while this feature may have been there in the past, we have tried to make things much more manageable in general. This means some features from olden times may have been removed due to the complexity involved.
Hopefully you understand.
@tom-elliott I understood most of the things that you said, but I am not sure what strings of the code should I have to change. Can you help me with that?