FOG 1.0.1 Snapin Client disabled
-
I tested Snapins on my VirtualBox test client and got always the message that the snapin module is disabled on this host.
Checked the checkbox in the host and its checked, unchecking and checking it again didn’t helped.Have now taked a look into the file servicemodule-active.php and added debug messages. The method
[CODE]$modState->isValid()[/CODE]
returns nothing on my side, I expected a value of 0 or 1.
Checking ths method
[CODE]$modState->get(‘state’)[/CODE]
returns the value of 1.Is here missing the override of the method isValid in the file ModuleAssociation.class.php?
-
[quote=“Albatros, post: 27405, member: 16710”]I tested Snapins on my VirtualBox test client and got always the message that the snapin module is disabled on this host.
Checked the checkbox in the host and its checked, unchecking and checking it again didn’t helped.Have now taked a look into the file servicemodule-active.php and added debug messages. The method
[CODE]$modState->isValid()[/CODE]
returns nothing on my side, I expected a value of 0 or 1.[/quote]
The $modState->isValid() simply returns true or false. If you are comfortable with mysql statements from the console could you give some output to the following statement:
[code]SELECT hostID FROM hosts WHERE hostName = ‘<hostname>’ \G;
SELECT * FROM moduleStatusByHost WHERE msHostID = ‘<hostID>’ \G;[/code]You should see all your modules, but msState should be 1. Also make sure the msID is not 0 for the related Module ID. If it is zero, this is likely why you’re seeing the problem. An MSID of 0 is not valid, so it doesn’t pass the isValid() check. Also, verify that the msHostID is set to the correct hostID. My guess, though is the MSID has an ID of 0 and this is why it’s not getting the service properly.
[quote=“Albatros, post: 27405, member: 16710”]Checking ths method
[CODE]$modState->get(‘state’)[/CODE]
returns the value of 1.Is here missing the override of the method isValid in the file ModuleAssociation.class.php?[/quote]
There should not be an isValid override in ModuleAssociation.class.php. Unless I need to specify required fields, which may come into play in this file. Required fields would be module id that is a valid module and host id that is a valid host.
-
[CODE]SELECT hostID FROM hosts WHERE hostName = ‘ITFOGWinxp’ \G;[/CODE]
Result
[CODE]hostID: 14
1 row in set (0.00 sec)[/CODE][CODE]SELECT * FROM moduleStatusByHost WHERE msHostID = ‘<hostID>’ \G;[/CODE]
Result
[CODE]msID: 111
msHostID: 14
msModuleID: 6
msState: 1
1 row in set (0.00 sec)[/CODE]How I see the msState has teh value of 1.
-
Albatros, do me a favor and uncheck all the service modules on this particular host.
Click update and perform the 2nd sql statement from above.
There should be no output at all for that host.
The only module that appears to be active on that particular system is the snapin client, but is it enabled on the server/globally enabled?
-
Albatros, if you’re daring, can you try from the latest svn?
I found an easier, and probably, more accurate way to find the state of a module.
Before I was just looping through everything and having it print out the status as it looped through. It turns out, we don’t even need to verify the state or validity of the module. When you uncheck the service modules within the host services settings, it actually removes the reference from the database. This makes the state part of the database not really needed and makes it simpler to find out if the modules are active on a host or not.
I’ve made these corrections in SVN 1706 and tested. All seems correct on my side and hopefully will correct this on your side:
[code]wget -O /var/www/fog/service/servicemodule-active.php https://svn.code.sf.net/p/freeghost/code/trunk/packages/web/service/servicemodule-active.php[/code] -
Update to revision 1706 and if the services are enabled, then it works.
If I disable the services I get an internal server error. This is in the apache log file
[CODE][Mon May 19 13:16:12 2014] [error] [client 192.168.9.14] PHP Warning: mysqli_close(): Couldn’t fetch mysqli in /var/www/fog/lib/db/MySQL.class.php on line 45, referer: http://192.168.9.13/fog/management/index.php?node=host&sub=edit&id=14[/CODE] -
Try upgrading to SVN 1708 and see if it still occurs. I moved to mysqli functions and was finally able to get them class based as well.
-
Updated to rev 1708 tested it and if no services selected this error appears.
[CODE]PHP Fatal error: Call to a member function get() on a non-object in /var/www/fog/service/servicemodule-active.php on line 37[/CODE] -
Will push fix for that shortly. Sorry.
-
svn 1709 should address that error as well as remove mysql_ functions and use the $this->DB calls for database purely where needed.
-
The error is gone and now FOG Services works fine
Ty very much
-
How can I get the svn versions you mentioned? I cannot get snapins to deploy at all.
-
Here is a nice tutorial on the wiki
[url]http://fogproject.org/wiki/index.php/SVN[/url] -
[quote=“Tom Elliott, post: 27440, member: 7271”]svn 1709 should address that error as well as remove mysql_ functions and use the $this->DB calls for database purely where needed.[/quote]
Nice, upgraded to revision 1710 and everything works now. So far.
Thx.