Host Name/ Active Directory Issue
-
@Andrew134 said:
It may be important to note that when I re-added the host and let it boot up it changed the name and added the machine to AD without the need to reimage it again.
Thanks for mentioning! I think this should lead us where to look for the reason. I have to admit that I don’t know FOG 0.32 much at all. That was long before I joined in. FOG 1.2.0 (as well as current FOG trunk) have a mysql table storing which services are enabled for each host. It’s called ‘moduleStatusByHost’. Maybe FOG 0.32 didn’t have that table or it was not ex/imported properly?! Check the host’s services settings either via web gui (Host Management -> select a host -> Service Settings (menu on the left)):
mysql> SELECT modules.name,moduleStatusByHost.msState FROM modules,moduleStatusByHost WHERE moduleStatusByHost.msModuleID = modules.id AND moduleStatusByHost.msHostID = 1738; +-------------------+---------+ | name | msState | +-------------------+---------+ | Directory Cleaner | 1 | | Printer Manager | 1 | | Task Reboot | 1 | | User Tracker | 1 | | Auto Log Out | 1 | | Green FOG | 1 | | Snapins | 1 | | Client Updater | 1 | | Host Registration | 1 | | Hostname Changer | 1 | +-------------------+---------+ 10 rows in set (0.01 sec)
You definitely want to see “Hostname Changer” enabled… Otherwise renaming (and AD join) won’t work.
-
@Sebastian-Roth You may be on to something. I ran the command with a old host and then one I re-added and got this.
0_1459262584358_Modules_status.txt
Any ideas on how to fix this? Or should we try again with the old database? We still have the old fog server in place where I can check for these records as well.Update: went to old server and the modules table does not exist in the database.
-
You can certainly continue on the road of installing 1.2.0, but it’s becoming dated. And a lot of newer devices will not work with it.
Our senior developer, @Tom-Elliott says that you can upgrade to FOG Trunk from any version of fog without issue, even version 0.01. And newer hardware works with FOG Trunk, and it has better partition handling, and massive speed and performance improvements over past fog versions. We believe it’s close to release as well - but that being said, it’s the developmental version and there will be bugs, you just report them here and they are usually fixed in under an hour - the longest I’ve seen it take is a few days. (compare that to months with Google, half a year to a year with Microsoft)
I’d say if you’re building a brand new server, try trunk?
-
@Andrew134 said:
Update: went to old server and the modules table does not exist in the database.
Ok, so now at least we know why… I don’t know the older FOG versions at all. I guess I could look into the code but it’s of no use because as a matter of fact you don’t seam to have the table(s) on the old database.
I guess you better go for populating the missing DB tables yourself:
mysql> INSERT INTO `modules` VALUES (1,'Directory Cleaner','dircleanup','This setting will enable or disable the directory cleaner service module on this specific host. If the module is globally disabled, this setting is ignored.',1), (2,'User Cleanup','usercleanup','This setting will enable or disable the user cleaner service module on this specific host. If the module is globally disabled, this setting is ignored. The user clean up service will remove all stale users on the local machine, accept for user accounts that are whitelisted. This is typically used when dynamic local users is implemented on the workstation.',1), (3,'Display Manager','displaymanager','This setting will enable or disable the display manager service module on this specific host. If the module is globally disabled, this setting is ignored.',1), (4,'Auto Log Out','autologout','This setting will enable or disable the auto log out service module on this specific host. If the module is globally disabled, this setting is ignored.',1), (5,'Green FOG','greenfog','This setting will enable or disable the green fog service module on this specific host. If the module is globally disabled, this setting is ignored.',1), (6,'Snapins','snapinclient','This setting will enable or disable the snapin service module on this specific host. If the module is globally disabled, this setting is ignored.',1), (7,'Client Updater','clientupdater','This setting will enable or disable the client updater service module on this specific host. If the module is globally disabled, this setting is ignored.',1), (8,'Host Registration','hostregister','This setting will enable or disable the host register service module on this specific host. If the module is globally disabled, this setting is ignored.',1), (9,'Hostname Changer','hostnamechanger','This setting will enable or disable the hostname changer module on this specific host. If the module is globally disabled, this setting is ignored.',1), (10,'Printer Manager','printermanager','This setting will enable or disable the printer manager service module on this specific host. If the module is globally disabled, this setting is ignored.',1), (11,'Task Reboot','taskreboot','This setting will enable or disable the task reboot service module on this specific host. If the module is globally disabled, this setting is ignored.',1), (12,'User Tracker','usertracker','This setting will enable or disable the user tracker service module on this specific host. If the module is globally disabled, this setting is ignored.',1);
and
mysql> DELETE FROM moduleStatusByHost; mysql> INSERT INTO moduleStatusByHost (msHostID, msModuleID, msState) SELECT hosts.hostID,modules.id,'1' from hosts,modules WHERE modules.default = 1 ORDER BY hosts.hostID,modules.id;
This will enable all the (default) modules for all your hosts in one go!
-
@Sebastian-Roth I keep getting this error message when I attempt to run the the last command.
ERROR 1054 (42S22): Unknown column ‘modules.default’ in ‘where clause’
Any ideas?
-
@Sebastian-Roth said:
INSERT INTO moduleStatusByHost (msHostID, msModuleID, msState) SELECT hosts.hostID,modules.id,‘1’ from hosts,modules WHERE modules.default = 1 ORDER BY hosts.hostID,modules.id;
Change the line to:
INSERT INTO `moduleStatusByHost` (`msHostID`, `msModuleID`, `msState`) SELECT `hosts`.`hostID`,`modules`.`id`,'1' from `hosts`,`modules` WHERE `modules`.`default` = 1 ORDER BY `hosts`.`hostID`,`modules`.`id`;
-
This is needed because the word default is a MYSQL keyword. the backticks “escape” the caller.
-
Thanks Tom! The other option would be to dismiss the WHERE clause altogether and have it set all the modules for all hosts:
INSERT INTO moduleStatusByHost (msHostID, msModuleID, msState) SELECT hosts.hostID,modules.id,'1' from hosts,modules ORDER BY hosts.hostID,modules.id;
As well I totally agree with what Wayne said about FOG 1.2.0 being dated and looking into FOG trunk or the near release would be a good idea. BUT you still want to have all your hosts and settings in the new system and therefore we better get your DB up and ready for FOG 1.2.0 first and then move on (after taking a full backup!).
-
That seems to have done it thanks you guys.
While I am asking questions, in .32 the domain username had to be in domain\username format, however in 1.2 it was updated to just need the username is there an easy way to update all the hosts or should I just change them when I reimage those machines?
-
@Andrew134 Something you could do in MySQL as well. No guarantee this is working for all special cases. I only tested this with some values to make sure it usually works! Should not kill your entries if hostADUser has no
\
in them. But better make a backup of the hosts table before trying this and/or addWHERE hostID = X
to test on single entries first!!UPDATE hosts AS h1, hosts AS h2 SET h1.hostADUser = SUBSTR(h2.hostADUser, LOCATE('\\', h2.hostADUser)+1);
-
I ended up just adding them to groups and changing them using the group active directory section. Thanks again for all you guy’s help!