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

    USB ethernet adapter mac(s) for imaging multiple hosts. (Universal Imaging Nics) (Wired Nic for All Wireless Devices)

    Scheduled Pinned Locked Moved
    Feature Request
    usb-to-ethernet image wireless
    5
    25
    6.4k
    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.
    • S
      Sebastian Roth Moderator
      last edited by

      @jj-fullmer:

      I have quite a few non-ethernet devices, and it’s a growing number.

      Yes, we have more and more users with devices not having an onboard NIC and therefore we want to handle this properly.

      A more dynamic and or integrated solution would be great, but I get that having the service use uuid and eventually phasing out the MAC addresses as a registration entity is that solution and that it will take some time. If there’s anything I can do to help with that, I would love to contribute.

      Absolutely, this is what we are aiming for. I will get back to you on this I am sure!

      PS: About the API cmdlet. You should talk to @Wayne-Workman who’s working on a native Linux API cmd thing.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      1 Reply Last reply Reply Quote 1
      • Wayne WorkmanW
        Wayne Workman @JJ Fullmer
        last edited by Wayne Workman

        @jj-fullmer I’m writing a fog-cli using Python3, which can run on any OS. You’re of course welcome to keep going down the powershell path, but for the Python3 based project your talents would certainly be appreciated and your welcome to help.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
        Daily Clean Installation Results:
        https://fogtesting.fogproject.us/
        FOG Reporting:
        https://fog-external-reporting-results.fogproject.us/

        JJ FullmerJ 1 Reply Last reply Reply Quote 2
        • JJ FullmerJ
          JJ Fullmer Testers @Wayne Workman
          last edited by

          @wayne-workman I’m certainly more fluent in powershell, but I know some python.
          Where might I find a git repo or other place to see what you got.
          Maybe I’ll still make my powershell module but do it in something of a port style and match any functions you create to give users options.

          Just playing with my little invoke-api cmdlet function I posted here I’ve been able to easily create so many more functions and functionalities. I imagine python has similar rest methods built in that create objects and such.

          Have you tried the FogApi powershell module? It's pretty cool IMHO
          https://github.com/darksidemilk/FogApi
          https://fogapi.readthedocs.io/en/latest/
          https://www.powershellgallery.com/packages/FogApi
          https://forums.fogproject.org/topic/12026/powershell-api-module

          1 Reply Last reply Reply Quote 0
          • JJ FullmerJ
            JJ Fullmer Testers @JJ Fullmer
            last edited by

            @jj-fullmer In case anyone is wanting to play with this further. Here’s another function to get the current host or get a host by a given uuid, mac, or hostname.

            function Get-FogHost {
                [CmdletBinding()]
                param (
                    [string]$uuid,
                    [string]$hostName,
                    [string]$macAddr
                )
                
                begin {
                    [bool]$found = $false;
                    Write-Verbose 'Checking for passed variables'
                    if (!$uuid -and !$hostName -and !$macAddr) {
                        Write-Verbose 'no params given, getting current computer variables';
                        $uuid = (Get-WmiObject Win32_ComputerSystemProduct).UUID;
                        $macAddr = ((Get-NetAdapter | Select-Object MacAddress)[0].MacAddress).Replace('-',':');
                        $hostName = $(hostname);
                    }
                    Write-Verbose 'getting all hosts to search...';
                    $hosts = (Invoke-FogApi).hosts;
                    Write-Verbose "search terms: uuid is $uuid, macAddr is $macAddr, hostname is $hostName";
                }
                
                process {
                    Write-Verbose 'finding host in hosts';
                    $hostObj = $hosts | Where-Object {
                        ($uuid -ne "" -AND $_.inventory.sysuuid -eq $uuid) -OR `
                        ($hostName -ne "" -AND $_.name -match $hostName) -OR `
                        ($macAddr -ne "" -AND $_.macs -contains $macAddr);
                        if  ($uuid -ne "" -AND $_.inventory.sysuuid -eq $uuid) {
                             Write-Verbose "$($_.inventory.sysuuid) matches the uuid $uuid`! host found"; 
                             $found = $true;
                        }
                        if  ($hostName -ne "" -AND $_.name -match $hostName) {
                            Write-Verbose "$($_.name) matches the hostname $hostName`! host found"; 
                            $found = $true;
                        }
                        if ($macAddr -ne "" -AND $_.macs -contains $macAddr) {
                            Write-Verbose "$($_.macs) matches the macaddress $macAddr`! host found";
                            $found = $true;
                        }
                    }
            
                }
                
                end {
                    if ($found){
                        return $hostObj;
                    }
                    return $found; #return false if host not found
                }
            }
            

            Have you tried the FogApi powershell module? It's pretty cool IMHO
            https://github.com/darksidemilk/FogApi
            https://fogapi.readthedocs.io/en/latest/
            https://www.powershellgallery.com/packages/FogApi
            https://forums.fogproject.org/topic/12026/powershell-api-module

            Wayne WorkmanW 1 Reply Last reply Reply Quote 0
            • Wayne WorkmanW
              Wayne Workman @JJ Fullmer
              last edited by

              @jj-fullmer said in USB ethernet adapter mac(s) for imaging multiple hosts. (Universal Imaging Nics) (Wired Nic for All Wireless Devices):

              current host or get a host by a given uuid, mac, or hostname.

              You should fork the fog-community-scripts repository and add this stuff to it. Just label it the powershell cli or something, give it some snazzy name.

              For the Python project, I’m calling it fog-cli.

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
              Daily Clean Installation Results:
              https://fogtesting.fogproject.us/
              FOG Reporting:
              https://fog-external-reporting-results.fogproject.us/

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

              189

              Online

              12.0k

              Users

              17.3k

              Topics

              155.2k

              Posts
              Copyright © 2012-2024 FOG Project