FOG Service - PLEASE recompile



  • Hi Guys

    I was wondering if anyone of you could possible recompile the Fog Service for me. It sounds like a weird request, but I believe it will solve many issues for me when it comes to wireless devices post imaging.

    AbstractFOGService.cs on line 405 tests for “IPEndabled” to locate MAC addresses on the computer.

    I would like to simply change “IPEnabled” to “DHCPEnabled”

    If anyone can do this for me that would be fantastic and would solve all my issues.

    Right now, fog checks for tasks to run based on all MAC Addresses found in the system. It does this by making a call to getmacaddress which sounds noble enough, however, this function only looks for mac addresses which have a current connection. So… if you’ve imaged your laptop, once you go wireless you wont be able to send snap-in’s to it… correct?

    unless you allow it to pick up the non connected mac address of the LAN interface which would have DHCP enabled (in my case it will anyway) thereby allowing snap-ins scheduled for the LAN interface to deploy on the wireless interface.

    PLEASE HELP ME.


  • Developer

    Here is the new version of getMacAddress() i just wrote. It’s untested, see how you go.

    [code] public ArrayList getMacAddress()
    {
    // Variables
    ArrayList alMacs = new ArrayList();

            try
            {
                // Get all network interaces
                NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
     
                // Iterate all network interaces
                foreach (NetworkInterface adapter in adapters)
                {
                    // Get IP Properties
                    IPInterfaceProperties properties = adapter.GetIPProperties();
         
                    // Push MAC address into array
                    alMacs.Add( adapter.GetPhysicalAddress().ToString() );
         
                    // DEBUG
                    //log("N/A", "Found network interface: Name: " + adapter.Description + ", MAC: " + adapter.GetPhysicalAddress().ToString());
                }
            }
            catch (Exception e)
            {
                log("N/A", e.Message);
            }
    
            return alMacs;
        }[/code]
    

    I have attached a compiled DLL, give it a shot and let me know how it goes.

    EDIT: I’ve tested this and it worked as intended.

    [code] 30/08/2012 1:48 PM FOG::MODDebug Reading config settings…
    30/08/2012 1:48 PM FOG::MODDebug Reading of config settings passed.
    30/08/2012 1:48 PM FOG::MODDebug Starting Core processing…
    30/08/2012 1:48 PM FOG::MODDebug Operating System ID: 6
    30/08/2012 1:48 PM FOG::MODDebug Operating System Minor: 1
    30/08/2012 1:48 PM FOG::MODDebug MAC ID 0 BC:5F:F4:49:96:63
    30/08/2012 1:48 PM FOG::MODDebug MAC ID 1 00:50:56:C0:00:01
    30/08/2012 1:48 PM FOG::MODDebug MAC ID 2 00:50:56:C0:00:08
    30/08/2012 1:48 PM FOG::MODDebug MAC POST String: BC:5F:F4:49:96:63|00:50:56:C0:00:01|00:50:56:C0:00:08
    30/08/2012 1:48 PM FOG::MODDebug A user is currently logged in
    30/08/2012 1:48 PM FOG::MODDebug Username: BLACKOUT\Blackout
    30/08/2012 1:48 PM FOG::MODDebug Hostname: BLACKOUT
    30/08/2012 1:48 PM FOG::MODDebug Attempting to open connect to: http://10.0.0.23/fog/service/debug.php
    30/08/2012 1:48 PM FOG::MODDebug Server responded with: Hello FOG Client
    30/08/2012 1:48 PM FOG::MODDebug Module has finished work and will now exit.[/code]

    I have also attached the latest version of MODDebug which outputs the above as soon as the service starts (it used to wait 100 seconds)

    [url="/_imported_xf_attachments/0/162_MODDebug.dll?:"]MODDebug.dll[/url][url="/_imported_xf_attachments/0/163_AbstractFOGService.dll?:"]AbstractFOGService.dll[/url]


  • Developer

    I dont think changing to DHCPEnabled would work, what about static IPs?

    I’d rather change the code to something that gets all MAC Addresses regardless of up / down status.

    Write that for me and I’ll implement & recompile it for you :)



  • [quote=“chad-bisd, post: 4646, member: 18”]I think microsoft gives away a free version of it’s .net compiler, like Visual Studio Express or something?[/quote]

    I think I might have a solution, for those intersted, if you run into the same problem…

    1. MAC Spoofing (ie, make the wireless NIC pretend it is the ethernet NIC) IS NOT an option… windows 7 does not allow a wireless MAC address starting with anything other than 02, 04, 06 … so thats out the window.

    2. Recompiling FOG Service or fog tray, for me, is not an option - Sadly… i don’t think i could be bothered learning C# or contending with re-compiling source code. been there… done that… it wasnt a pretty picture.

    3. Forcing IPEnabled to stay true for non connected NIC in Windows 7 is not possible (although i believe XP maintains the TCP/IP binding on the ethernet card even after a cable is unplugged)… so thats out the window too.

    The solution presented itself after half a pack of smokes (i wish i could give it up) and 3 cans of Red Bull…

    I will create a .vbs file which executes on the host machien on boot up (sent from the DC), grab the ethernet nic MAC and the wireless MAC, then, through MySQL ODBC connection, will UPDATE every MAC address entry which it matches with the ethernet MAC for the wireless MAC. The file will then delete itself.

    On shut down, the process is reversed - just in case we want to plug into local LAN again… ofcourse, turning off the automatic host mac registration feature in FOG is a must.

    If anyone is interested, let me know and I can put the scripts up.

    its 1:00am here so im not sure if my plan has any flaws in it just yet… i cant think of any, but if you can see issues with what I am proposing, then please let me know… and who knows… perhaps this could be a programmed feature in the next fog agent release to solve the wirelss vs wired MAC address conundrum (not sure if I spelled that correctly)…


  • Moderator

    I think microsoft gives away a free version of it’s .net compiler, like Visual Studio Express or something?


Log in to reply
 

390
Online

38982
Users

10712
Topics

101677
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.