• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. RobTitian16
    3. Posts
    • Profile
    • Following 0
    • Followers 1
    • Topics 39
    • Posts 256
    • Best 7
    • Controversial 0
    • Groups 0

    Posts made by RobTitian16

    • FOG API AD JSON Settings

      Hi all,

      I’ve created a PowerShell module for managing our FOG server, and I’m currently having difficulty getting the AD settings to work as expected. I currently have the following when adding a new FOG computer:

      $HostJson = @{
                  "name"=  $MachineName
                  "macs" =  @($MacAddress)
                  "imageID"= $Image.id
                  "imagename" =  $ImageName
                  "useAD" = $UseAD
                  "ADDomain" = $ADDomain
                  "ADUser" = $ADUser
      	    "ADPass" = $FOGPWD
                  "enforce" = $Enforce
      }
      Try{                    
          $CreateHostJson = ConvertTo-Json($HostJson)
          $CreateHostURL = $BaseUri +"/host/create"
          $CreateHostResult = Invoke-RestMethod -Uri $CreateHostURL -Method POST -body $CreateHostJson -Headers $Headers -ContentType "application/json"
      }
      Catch{
      Write-Error $_.Exception.Message
      Break
      }
      

      However, when checking the FOG client AD settings, I see everything is left unchecked, and the FOG log shows:

      Service Creating user agent cache
      Middleware::Response Invalid time
      Middleware::Response No Printers
      Middleware::Response Module is disabled globally on the FOG server
      Service Initializing modules
      

      It is only after removing the host manually and running the PowerShell command again (and then rebooting the system) that FOG finally recognises it, but the AD settings still aren’t displayed unless I check the ‘Join Domain After Deploy’ checkbox.
      Is there a way to set that through the FOG API, and have the default settings for the domain join filled out? This would also save users of this module having to find and copy/paste the admin password for joining the domain.

      Any help with this would be greatly appreciated!

      posted in FOG Problems powershell api help active director
      RobTitian16R
      RobTitian16
    • RE: Cloning VMs/Directly Edit FOG MYSQL Database?

      @george1421 Actually, I’ve just figured it out for the most part. However, is there a way to set it to use the default values already set in FOG?
      I’ve updated the JSON to have:
      “useAD” = “Y”
      This ticks the ‘Join Domain after deploy’ box. I don’t particularly fancy having to tap in the details for the system to join the domain when they’re already configured within FOG itself, though.

      posted in General
      RobTitian16R
      RobTitian16
    • RE: Cloning VMs/Directly Edit FOG MYSQL Database?

      @george1421 Is there an Active Directory core object missing from the documentation (found here: https://news.fogproject.org/simplified-api-documentation/)?

      I’ve managed to create a new host with the correct MAC address. I just now need to ensure ‘Join after domain deploy’ is somehow enabled through the API (if possible) to get it working as I’d like it to.

      posted in General
      RobTitian16R
      RobTitian16
    • RE: Cloning VMs/Directly Edit FOG MYSQL Database?

      @george1421 Thanks very much! I’ll give it a go.

      posted in General
      RobTitian16R
      RobTitian16
    • Cloning VMs/Directly Edit FOG MYSQL Database?

      Hi all,

      First, let me explain the scenario: we often have to clone VMs in Hyper-V, which means we need to run sysyprep.exe on the VM we want to clone, copy the associated VHD file, and then create a new VM with the copied VHD file.

      The problem comes when we want to automate this with PowerShell, and we’re unable to join the systems to the domain automatically (both the original and the clone). If we were running Server 2016 on all of our hypervisors, this would be no problem considering we could connect in through Hyper-V’s cmdlets. Alas, we’re running Server 2012 R2 with no plan to upgrade for some years.

      My line of thinking is that if the original has the FOG client installed, I’d just need PowerShell to edit the MYSQL database on the FOG server to create a new record with the associated image, group, etc (the key thing being the MAC address and having it set to join the domain automatically).

      So, a few questions:

      1. Is this the way to go about doing this, or is there a better method?
      2. Is this possible with FOG?
      3. If it is possible with FOG, what’s the recommended method of creating a new record? Is it to directly edit the MYSQL database? Or would I be able to connect through an API?

      I’d be interested to know if anyone else has had a similar issue and how they’ve worked around it.
      I did wonder whether it was worth uploading the image of the clone and then redeploying it, but that would take far too long.

      Any help as usual would be greatly appreciated!

      posted in General
      RobTitian16R
      RobTitian16
    • RE: Failed to open stream: Permission denied in /var/www/html/fog/status/logtoview.php

      This can be marked as solved. I updated to 1.5.4 and everything is confirmed to be working once more. Thanks!

      posted in FOG Problems
      RobTitian16R
      RobTitian16
    • Failed to open stream: Permission denied in /var/www/html/fog/status/logtoview.php

      Hi all,

      In my clients recently, the FOG log has been reporting the following error:

      08/08/2018 15:56 Client-Info Client Version: 0.11.16
      08/08/2018 15:56 Client-Info Client OS: Windows
      08/08/2018 15:56 Client-Info Server Version: 1.5.2
      08/08/2018 15:56 Middleware::Response ERROR: Unable to get subsection
      08/08/2018 15:56 Middleware::Response ERROR: Object reference not set to an instance of an object.
      08/08/2018 15:56 Service Sleeping for 110 seconds

      I’ve checked the Apache log, and I can see the following error:
      [Wed Aug 08 15:14:08.956419 2018] [proxy_fcgi:error] [pid 39315] [client 10.1.1.107:58244] AH01071: Got error ‘PHP message: PHP Warning: fopen(/var/log/apache2/error.log): failed to open stream: Permission denied in /var/www/html/fog/status/logtoview.php on line 86\n’

      Running the following check seems to come back OK (ls -la /var/www/html/fog/status/😞
      total 60
      drwxrwxrwx 2 www-data www-data 4096 May 17 07:33 .
      drwxrwxrwx 10 www-data www-data 4096 May 17 09:42 …
      -rwxrwxrwx 1 www-data www-data 3304 May 17 07:33 bandwidth.php
      -rwxrwxrwx 1 www-data www-data 884 May 17 07:33 dbrunning.php
      -rwxrwxrwx 1 www-data www-data 1184 May 17 07:33 freespace.php
      -rwxrwxrwx 1 www-data www-data 1437 May 17 07:33 getfiles.php
      -rwxrwxrwx 1 www-data www-data 772 May 17 07:33 gethash.php
      -rwxrwxrwx 1 www-data www-data 661 May 17 07:33 getservertime.php
      -rwxrwxrwx 1 www-data www-data 813 May 17 07:33 hw.php
      -rwxrwxrwx 1 www-data www-data 587 May 17 07:33 index.php
      -rwxrwxrwx 1 www-data www-data 1515 May 17 07:33 kernelvers.php
      -rwxrwxrwx 1 www-data www-data 4416 May 17 07:33 logtoview.php
      -rwxrwxrwx 1 www-data www-data 830 May 17 07:33 mainversion.php
      -rwxrwxrwx 1 www-data www-data 721 May 17 07:33 newtoken.php

      I’ve restarted Apache, etc. but still this error persists in the log. It’s annoying as I can’t deploy any snapins to my client machines at the moment, which, as you all know, is pretty useful.
      Any help with this would of course be greatly appreciated as always!

      FOG INFO:
      You are currently running version: 1.5.2

      Latest stable version is 1.5.4

      Latest svn version is 6078

      Latest git version is 1.5.4

      posted in FOG Problems apache permission
      RobTitian16R
      RobTitian16
    • RE: Updating FOG Groups Not Working

      @tom-elliott Yes indeed, thanks very much!

      posted in Bug Reports
      RobTitian16R
      RobTitian16
    • RE: Updating FOG Groups Not Working

      @wayne-workman Indeed, it’s a follow on from my previous thread here: https://forums.fogproject.org/topic/11308/hostname-changer-access-denied-code-5/19

      Seabastian Roth asked that I create a new one.

      @Tom-Elliott Ah, that’s interesting… my other groups have 0 members, but I’ve just added 2 to one of the groups known to not be working, updated the AD details, and now it’s saved the changes!
      So, is that intentional? Or is that still classified as a bug?

      posted in Bug Reports
      RobTitian16R
      RobTitian16
    • Updating FOG Groups Not Working

      Running Version 1.5.0-RC-10
      SVN Revision: 6080

      Issue:
      When I try to update various groups within the FOG GUI with AD details or snapins, the update doesn’t work. It says it has updated, but when I go back to the AD details page or the snapin settings, the details I added are missing. Strangely, this doesn’t happen for the first group I created - only for all subsequent ones.
      I’ve also tried cleaning the MYSQL database to no avail. Any help with this would be appreciated.

      posted in Bug Reports
      RobTitian16R
      RobTitian16
    • RE: Hostname Changer Access Denied, Code = 5

      @tom-elliott From the post above: “However, now when updating the different groups with the AD details and what snapins they should include, upon pressing ‘Update’ on the page it says it’s updated, but when I go back to check the details the fields are blank.”

      I also posted the error messages from the Apache error log further down the page.
      I’ve tried updating the group with snapins, and this hasn’t saved either, so it seems to be a general issue of saving groups, rather than a specific one of setting the Active Directory defaults in the group.

      posted in Bug Reports
      RobTitian16R
      RobTitian16
    • RE: Hostname Changer Access Denied, Code = 5

      @tom-elliott That part is actually resolved now. This was raised as a bug because not all of the groups are updating with the correct AD details. It’s only worked for one, which was the very first group I created. Now whenever I save the AD details and reload the page, it’s as if it never saved in the first place.
      Let me know if you need anymore details/logs.

      posted in Bug Reports
      RobTitian16R
      RobTitian16
    • RE: Hostname Changer Access Denied, Code = 5

      @wayne-workman Groups, not hosts.

      posted in Bug Reports
      RobTitian16R
      RobTitian16
    • RE: Hostname Changer Access Denied, Code = 5

      @wayne-workman I get the following:

      [Thu Jan 18 15:08:27.427489 2018] [php7:error] [pid 8958] [client 10.1.2.88:49534] PHP Fatal error: Uncaught Error: Call to a member function isValid() on null in /var/www/html/fog/lib/fog/host.class.php:778\nStack trace:\n#0 /var/www/html/fog/lib/fog/host.class.php(792): Host->_setAlo()\n#1 /var/www/html/fog/lib/client/autologout.class.php(43): Host->getAlo()\n#2 /var/www/html/fog/lib/fog/fogpage.class.php(3094): Autologout->json()\n#3 /var/www/html/fog/lib/fog/fogpage.class.php(249): FOGPage->requestClientInfo()\n#4 /var/www/html/fog/lib/pages/processlogin.class.php(57): FOGPage->__construct('')\n#5 /var/www/html/fog/lib/fog/fogpagemanager.class.php(381): ProcessLogin->__construct()\n#6 [internal function]: FOGPageManager->{closure}('/var/www/html/f...')\n#7 /var/www/html/fog/lib/fog/fogpagemanager.class.php(386): array_map(Object(Closure), Array)\n#8 /var/www/html/fog/lib/fog/fogpagemanager.class.php(79): FOGPageManager->loadPageClasses()\n#9 [internal function]: FOGPageManager->__construct()\n#10 /var/www/html/fog/lib/fog/fogbase.class.php(481): ReflectionClass->newInstanceArgs(Array)\n#11 /var/www/html/fog/manageme in /var/www/html/fog/lib/fog/host.class.php on line 778
      [Thu Jan 18 15:06:26.192618 2018] [php7:error] [pid 10510] [client 10.1.2.88:49532] PHP Fatal error: Uncaught Error: Call to a member function isValid() on null in /var/www/html/fog/lib/fog/host.class.php:778\nStack trace:\n#0 /var/www/html/fog/lib/fog/host.class.php(792): Host->_setAlo()\n#1 /var/www/html/fog/lib/client/autologout.class.php(43): Host->getAlo()\n#2 /var/www/html/fog/lib/fog/fogpage.class.php(3094): Autologout->json()\n#3 /var/www/html/fog/lib/fog/fogpage.class.php(249): FOGPage->requestClientInfo()\n#4 /var/www/html/fog/lib/pages/processlogin.class.php(57): FOGPage->__construct('')\n#5 /var/www/html/fog/lib/fog/fogpagemanager.class.php(381): ProcessLogin->__construct()\n#6 [internal function]: FOGPageManager->{closure}('/var/www/html/f...')\n#7 /var/www/html/fog/lib/fog/fogpagemanager.class.php(386): array_map(Object(Closure), Array)\n#8 /var/www/html/fog/lib/fog/fogpagemanager.class.php(79): FOGPageManager->loadPageClasses()\n#9 [internal function]: FOGPageManager->__construct()\n#10 /var/www/html/fog/lib/fog/fogbase.class.php(481): ReflectionClass->newInstanceArgs(Array)\n#11 /var/www/html/fog/manageme in /var/www/html/fog/lib/fog/host.class.php on line 778
      

      Strangely, the first group I made (well over a year ago) is perfectly fine; it’s all the groups I created the other day that are having the issue.

      posted in Bug Reports
      RobTitian16R
      RobTitian16
    • RE: Hostname Changer Access Denied, Code = 5

      @wayne-workman I have updated, though I wasn’t prompted when connecting to the FOG web GUI to update the database. It’s still showing that my FOG version is the same as well.

      posted in Bug Reports
      RobTitian16R
      RobTitian16
    • RE: Hostname Changer Access Denied, Code = 5

      @wayne-workman

      Running Version 1.5.0-RC-10
      SVN Revision: 6080
      Jan 17, 2018 15:48 pm

      I’ll try updating tomorrow and see if that resolves the issue.

      posted in Bug Reports
      RobTitian16R
      RobTitian16
    • RE: Hostname Changer Access Denied, Code = 5

      @wayne-workman Actually, it does work now: it was a trailing space as the end of the LDAP format that was causing the issue.
      However, now when updating the different groups with the AD details and what snapins they should include, upon pressing ‘Update’ on the page it says it’s updated, but when I go back to check the details the fields are blank.

      posted in Bug Reports
      RobTitian16R
      RobTitian16
    • RE: Hostname Changer Access Denied, Code = 5

      @wayne-workman It works perfectly fine for the adding of systems to the domain without setting a default OU, so it cannot be a bad username or password issue. It is definitely related to the LDAP format I’m using.
      I have also tried: “ou=Computers,ou=CompanyName UK,dc=CompanyName,dc=co,dc=uk” with no further joy.

      posted in Bug Reports
      RobTitian16R
      RobTitian16
    • Hostname Changer Access Denied, Code = 5

      Hi all,

      I’m trying to set up different groups in FOG so that the systems belonging to them are put in different OUs. However, I’m running into the issue at the moment where the FOG log is saying: “Hostname changer access denied, code =5”. I have seen this code before when there are old AD accounts still lurking about, but I’ve just deleted the AD account that used to belong to my test VM, and I’m certain the way I’ve configured it through the FOG GUI is wrong.
      I’ve attached a screenshot of my current settings below. If someone could help me get this working, it would very much be appreciated.

      0_1516120210650_2.PNG

      posted in Bug Reports
      RobTitian16R
      RobTitian16
    • RE: Postdownload Script Cannot Find PostDrivers Script In Debug Mode?

      It turns out this is working fine - we just didn’t have the correct folder on our FOG server for the model of laptop (which the script relies on). We’ve made some adjustments to the script and can confirm this now works.
      Thanks very much for the help!

      posted in FOG Problems
      RobTitian16R
      RobTitian16
    • 1 / 1