• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Need help to understand host.class.php

Scheduled Pinned Locked Moved
FOG Problems
1
2
437
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    Jamaal
    last edited by Jamaal Mar 31, 2022, 4:42 PM Mar 31, 2022, 11:17 AM

    Hello all,

    I’m banging my head to understand the host.class.php file.
    I have a few posts based on Powershell to add the “location” field for a computer to be created for example.

    host.PNG

    I already have the locations plug in installed and it works fine in the gui, but when I run the powershell script, location doesn’t show in Powershell, but in the gui.

    I’m not trying to image yet, but I want to be able to add on a custom website; ex; Jira ticket system, the host location. It should match up in the “location” field in Powershelll.

    I saw a post you can edit the host.class.php file.

    I did and here’s a screen shot:
    host php.PNG

    I went to create a host and it doesn’t show up, not sure what I’m doing wrong.

    Here’s when I went to see if the host got created when attempting to add it via the gui. I forgot to get the words before it, but it says hosts not found.
    attempt 2.PNG

    If I can get some guidance to what I’m donig wrong, I appreciate it.

    Here’s my version of FOG:
    version.PNG

    J 1 Reply Last reply Apr 2, 2022, 3:25 AM Reply Quote 0
    • J
      Jamaal @Jamaal
      last edited by Jamaal Apr 1, 2022, 9:25 PM Apr 2, 2022, 3:25 AM

      @jamaal said in Need help to understand host.class.php:

      Hello all,

      I’m banging my head to understand the host.class.php file.
      I have a few posts based on Powershell to add the “location” field for a computer to be created for example.

      host.PNG

      I already have the locations plug in installed and it works fine in the gui, but when I run the powershell script, location doesn’t show in Powershell, but in the gui.

      I’m not trying to image yet, but I want to be able to add on a custom website; ex; Jira ticket system, the host location. It should match up in the “location” field in Powershelll.

      I saw a post you can edit the host.class.php file.

      I did and here’s a screen shot:
      host php.PNG

      I went to create a host and it doesn’t show up, not sure what I’m doing wrong.

      Here’s when I went to see if the host got created when attempting to add it via the gui. I forgot to get the words before it, but it says hosts not found.
      attempt 2.PNG

      If I can get some guidance to what I’m donig wrong, I appreciate it.

      Here’s my version of FOG:
      version.PNG

      All,

      This can be resolved. I finally was able to add location via Powershell! I didn’t even need to mess with the host.class file in FOG. This is thanks too @JJ-Fullmer . He had a reference to a post he had about Powershell and FOG via adding groups:

      https://forums.fogproject.org/topic/12026/powershell-api-module/15?_=1648864559519

      So I ended up adding another variable called $newassocias2

      resolution.PNG

      Again thanks to everyone that contributes to this page. I’m happy & grateful to using this product.

      1 Reply Last reply Reply Quote 3
      • 1 / 1
      1 / 1
      • First post
        2/2
        Last post

      171

      Online

      12.1k

      Users

      17.3k

      Topics

      155.3k

      Posts
      Copyright © 2012-2024 FOG Project