• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. KaterKarlo99
    K
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    KaterKarlo99

    @KaterKarlo99

    0
    Reputation
    80
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    KaterKarlo99 Unfollow Follow

    Latest posts made by KaterKarlo99

    • RE: FOG 1.5.4 API host module settings

      Hi Tom,

      thanks for the answer, this works fine during the host creation.

      I’ve tryed to activate the modules after the host creation by creating a moduleassociation for the newly created host object.
      For example:

       #Hostname Changer
              $TaskdataSet = @{
                  "hostID" = $HostID
                  "moduleID" = "9"
                  "state" = "1"
                  }
              Try{
                  $taskdataToSend = ConvertTo-JSON($TaskdataSet)
                  New-FogObject -type object -coreObject moduleassociation -jsonData $TaskdataSet
                  }Catch{Write-Host "Failed to create Module association for Module 4 in Fog" -ForegroundColor Red
                      $error[0] | Format-List -Force
                      Exit 1
                      }
      

      But i think this was the wrong way. Could you tell me the right way to activate the modules after the host creation step?

      And one further question:
      If i try to define a ‘AllSnapin task’ for the new created host it doesn’t work.
      So my last step should be the deployment of the already, successfully assigned snapins after the hostname was
      changed (which is now working if i activate the hostchanger module during the host creation step). That’s why i try to create a “AllSnapin” task for
      the newly created host object like this:

      #Create Snapin Tasks for new Host    
                      
              $HostID = $createHostResult.id          
              $TaskURL = $baseUri + "/host/" + $HostID + "/task"
              $TaskdataSet = @{
                  "hostname" = $createHostResult.name
                  "taskTypeID" = $AllSnapinID
                  }
              Try{
                  $taskdataToSend = ConvertTo-JSON($TaskdataSet)
                  $TaskResult = Invoke-RestMethod -Method Post -Uri $TaskURL -Headers $headers -Body $taskdataToSend -ContentType "application/json"
                  }Catch{Write-Host "Failed to create All Snapin Task in Fog" -ForegroundColor Red
                      $error[0] | Format-List -Force
                      Exit 1
                      }
      

      But this dosen’t work, i guess because the deployment task is in the queue for the new host? Would it be the right way to create the “AllSnapin Task”
      after the deployment task has finished? Is that the clue?

      Thank you for your support!

      posted in FOG Problems
      K
      KaterKarlo99
    • FOG 1.5.4 API host module settings

      Hi,

      when i create a new host via the api i figured out that the host module settings of this new host are all not enabled.

      0_1530519546865_fog_host-module-settings.JPG

      All of these modules are enabled at fog server level. If i create the new host via the gui or the pxe menu (full host registration) they
      are also enabled.

      My question now is if somebody can give me an example how i can enable these settings on the new host via the api after the
      new host creation task. I use windows powershell to access the fog api, based on this forum post.

      Any help is appreciated!

      posted in FOG Problems fogapi-psmodule
      K
      KaterKarlo99
    • API not available FOG Server 1.5.2

      Hi,

      i’ve set up a fresh, CentOS based, FOG Server based on latest Release 1.5.2.
      Basically everything works fine (PXE Boot, UEFI Boot, Imageing, etc,…) and now i try to automate the host deployment.
      For this i try the powershell script from this post API - Powershell Create host and Deploy task script adapted to my environment (tokens, server ip, etc…).

      On my server is the API enabled and the API is enabled for the user i use in the script.
      0_1526457588638_FOG_Server_API_Setting.JPG
      0_1526457604264_FOG_User_API_Setting.JPG

      The problem now is that it seems that the API URLS didn’t exist… the script returns always an error 404 for the requestesd API URLs.
      0_1526457649018_FOG_URL_not_found.JPG

      It makes no difference if i specify the FOG server IP or the name.

      Any advice?

      Thanks in advance!

      posted in FOG Problems
      K
      KaterKarlo99