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

Add Full Inventory Task to PXE Menu

Scheduled Pinned Locked Moved
FOG Problems
3
24
2.8k
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.
  • F
    FlareImp
    last edited by Dec 9, 2020, 7:38 PM

    Hello! Is there a way to add the Inventory task to the PXE Boot Menu so I do not need to access the web GUI to execute it?

    Thanks

    G 1 Reply Last reply Dec 9, 2020, 8:07 PM Reply Quote 0
    • G
      george1421 Moderator @FlareImp
      last edited by Dec 9, 2020, 8:07 PM

      @flareimp Can you explain this a bit more? What are you doing in the web gui in regards? Are you doing this via the advanced tasks in this host configuration?

      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!

      G F 2 Replies Last reply Dec 9, 2020, 8:17 PM Reply Quote 0
      • G
        george1421 Moderator @george1421
        last edited by Dec 9, 2020, 8:17 PM

        @george1421 If I guessed right lets see what this does. You will need to go into FOG Configuration -> New iPXE Menu and fill it out like this

        Menu Item: fog.custom.inventory
        Description: Custom Quick Inventory
        Parameters:
        kernel bzImage loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 web=${boot-url}/ consoleblank=0 rootfstype=ext4 storage=${fog-ip}:/images/ storageip=${fog-ip} loglevel=4 mode=inventory deployed=1
        imgfetch init.xz || goto MENU
        Menu Show with: All Hosts

        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!

        F 1 Reply Last reply Dec 14, 2020, 8:33 PM Reply Quote 0
        • F
          FlareImp @george1421
          last edited by Dec 14, 2020, 8:27 PM

          @george1421 I’m going into the web gui for the client and choosing the advanced menu and then clicking on inventory to start an inventory task. then I go to the client that I chose and boot it into pxe to start the task. I would like to be able to just run the inventory task directly from the pxe menu.

          1 Reply Last reply Reply Quote 0
          • F
            FlareImp @george1421
            last edited by Dec 14, 2020, 8:33 PM

            @george1421 I tried the task you listed, when I run it, it says

            “Could not boot: No such file or directory (http://pxe.org/2d16208e))”

            G 1 Reply Last reply Dec 14, 2020, 8:49 PM Reply Quote 0
            • G
              george1421 Moderator @FlareImp
              last edited by george1421 Dec 15, 2020, 9:23 AM Dec 14, 2020, 8:49 PM

              @flareimp Ok lets change the parameters up a bit.

              Menu Item: fog.custom.inventory
              Description: Custom Quick Inventory
              Parameters:
              kernel bzImage
              imgfetch init.xz
              imgargs loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 web=${boot-url}/ consoleblank=0 rootfstype=ext4 storage=${fog-ip}:/images/ storageip=${fog-ip} loglevel=4 mode=inventory deployed=1
              boot || goto MENU
              Menu Show with: All Hosts

              You should paste the parameters in directly without trying to decode anything.

              If it still doesn’t work what I want you to do with a browser key in the following URL http://<fog_server_ip>/fog/service/ipxe/boot.php&mac=00:00:00:00:00:01

              This is the text behind the iPXE boot menu. Copy and paste that text into a post here. I want to look at how the menu is created if the above doesn’t work. The instructions I provided should not have created that error message. Maybe another error message, but not that one.

              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!

              F 1 Reply Last reply Dec 15, 2020, 3:07 PM Reply Quote 0
              • F
                FlareImp @george1421
                last edited by Dec 15, 2020, 3:07 PM

                @george1421 here is what it shows

                Capture.PNG

                G 2 Replies Last reply Dec 15, 2020, 3:22 PM Reply Quote 0
                • G
                  george1421 Moderator @FlareImp
                  last edited by Dec 15, 2020, 3:22 PM

                  @flareimp Something wasn’t added right to the menu. Please call the url I mentioned before and post the results here.

                  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!

                  1 Reply Last reply Reply Quote 0
                  • G
                    george1421 Moderator @FlareImp
                    last edited by george1421 Dec 15, 2020, 9:26 AM Dec 15, 2020, 3:24 PM

                    @flareimp OK I see what it did. In the post it looks like “loglevel=4 mode=inventory deployed=1” is on a new line, but that needs to be part of the entire imgarg command. On the screen it wraps.

                    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!

                    F 1 Reply Last reply Dec 15, 2020, 3:31 PM Reply Quote 0
                    • F
                      FlareImp @george1421
                      last edited by Dec 15, 2020, 3:31 PM

                      @george1421 Okay, i deleted out the new line from loglevel=4 so its one string but am still seeing the output above. How do I call the URL your asking for?

                      G 1 Reply Last reply Dec 15, 2020, 3:36 PM Reply Quote 0
                      • G
                        george1421 Moderator @FlareImp
                        last edited by george1421 Dec 15, 2020, 9:36 AM Dec 15, 2020, 3:36 PM

                        @flareimp From a computer on the same network as your FOG server http://<fog_server_ip>/fog/service/ipxe/boot.php&mac=00:00:00:00:00:01 just replace <fog_server_ip> with the IP address of your fog server.

                        I guess I should also ask what version of FOG are you using?

                        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!

                        F 2 Replies Last reply Dec 15, 2020, 3:38 PM Reply Quote 0
                        • F
                          FlareImp @george1421
                          last edited by FlareImp Dec 15, 2020, 9:39 AM Dec 15, 2020, 3:38 PM

                          @george1421 Okay, I did that and it just takes me to the fog web gui and has me log into the home screen.

                          I am running Ubuntu 16.04 with Fog 1.5.9

                          1 Reply Last reply Reply Quote 0
                          • F
                            FlareImp @george1421
                            last edited by Dec 15, 2020, 4:00 PM

                            @george1421 If I delete the “&mac=00:00:00:00:00:01” part I get the following output

                            #!ipxe
                            set fog-ip 10.220.9.50
                            set fog-webroot fog
                            set boot-url http://${fog-ip}/${fog-webroot}
                            cpuid --ext 29 && set arch x86_64 || set arch i386
                            goto get_console
                            :console_set
                            colour --rgb 0x00567a 1 ||
                            colour --rgb 0x00567a 2 ||
                            colour --rgb 0x00567a 4 ||
                            cpair --foreground 7 --background 2 2 ||
                            goto MENU
                            :alt_console
                            cpair --background 0 1 ||
                            cpair --background 1 2 ||
                            goto MENU
                            :get_console
                            console --picture http://10.220.9.50/fog/service/ipxe/bg.png --left 100 --right 80 && goto console_set || goto alt_console
                            :MENU
                            menu
                            colour --rgb 0xff0000 0 ||
                            cpair --foreground 1 1 ||
                            cpair --foreground 0 3 ||
                            cpair --foreground 4 4 ||
                            item --gap Host is NOT registered!
                            item --gap -- -------------------------------------
                            item fog.local Boot from hard disk
                            item fog.memtest Run Memtest86+
                            item fog.reginput Perform Full Host Registration and Inventory
                            item fog.reg Quick Registration and Inventory
                            item fog.deployimage Deploy Image
                            item fog.multijoin Join Multicast Session
                            item fog.sysinfo Client System Information (Compatibility)
                            item fog.custom.inventory Custom Quick Inventory
                            choose --default fog.local --timeout 3000 target && goto ${target}
                            :fog.local
                            chain -ar ${boot-url}/service/ipxe/grub.exe --config-file="rootnoverify (hd0);chainloader +1" || goto MENU
                            :fog.memtest
                            kernel memdisk initrd=memtest.bin iso raw
                            initrd memtest.bin
                            boot || goto MENU
                            :fog.reginput
                            kernel bzImage32 loglevel=4 initrd=init_32.xz root=/dev/ram0 rw ramdisk_size=275000 web=http://10.220.9.50/fog/ consoleblank=0 rootfstype=ext4 storage=10.220.9.50:/images/ storageip=10.220.9.50 nvme_core.default_ps_max_latency_us=0 loglevel=4 mode=manreg
                            imgfetch init_32.xz
                            boot || goto MENU
                            :fog.reg
                            kernel bzImage32 loglevel=4 initrd=init_32.xz root=/dev/ram0 rw ramdisk_size=275000 web=http://10.220.9.50/fog/ consoleblank=0 rootfstype=ext4 storage=10.220.9.50:/images/ storageip=10.220.9.50 nvme_core.default_ps_max_latency_us=0 loglevel=4 mode=autoreg
                            imgfetch init_32.xz
                            boot || goto MENU
                            :fog.deployimage
                            login
                            params
                            param mac0 ${net0/mac}
                            param arch ${arch}
                            param username ${username}
                            param password ${password}
                            param qihost 1
                            isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme
                            isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme
                            param sysuuid ${uuid}
                            :fog.multijoin
                            login
                            params
                            param mac0 ${net0/mac}
                            param arch ${arch}
                            param username ${username}
                            param password ${password}
                            param sessionJoin 1
                            isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme
                            isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme
                            param sysuuid ${uuid}
                            :fog.sysinfo
                            kernel bzImage32 loglevel=4 initrd=init_32.xz root=/dev/ram0 rw ramdisk_size=275000 web=http://10.220.9.50/fog/ consoleblank=0 rootfstype=ext4 storage=10.220.9.50:/images/ storageip=10.220.9.50 nvme_core.default_ps_max_latency_us=0 loglevel=4 mode=sysinfo
                            imgfetch init_32.xz
                            boot || goto MENU
                            :fog.custom.inventory
                            kernel bzImage
                            imgfetch init.xz
                            imgargs loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 web=${boot-url}/ consoleblank=0 rootfstype=ext4 storage=${fog-ip}:/images/ storageip=${fog-ip} loglevel=4 mode=inventory deployed=1
                            boot|| goto MENU
                            param sysuuid ${uuid}
                            :bootme
                            chain -ar http://10.220.9.50/fog/service/ipxe/boot.php##params ||
                            goto MENU
                            autoboot
                            
                            G 1 Reply Last reply Dec 15, 2020, 4:54 PM Reply Quote 0
                            • G
                              george1421 Moderator @FlareImp
                              last edited by george1421 Dec 15, 2020, 10:55 AM Dec 15, 2020, 4:54 PM

                              @flareimp said in Add Full Inventory Task to PXE Menu:

                              If we look at the FOG created menu for system info

                              :fog.sysinfo
                              kernel bzImage32 loglevel=4 initrd=init_32.xz root=/dev/ram0 rw ramdisk_size=275000 web=http://10.220.9.50/fog/ consoleblank=0 rootfstype=ext4 storage=10.220.9.50:/images/ storageip=10.220.9.50 nvme_core.default_ps_max_latency_us=0 loglevel=4 mode=sysinfo
                              imgfetch init_32.xz
                              boot || goto MENU
                              

                              And we look at the custom menu I initially provided they should match exactly except for a few changed parameters. This should work. I did notice in your menu item that boot and the double pipe symbols don’t have a space between.

                              :fog.custom.inventory
                              kernel bzImage loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 web=${boot-url}/ consoleblank=0 rootfstype=ext4 storage=${fog-ip}:/images/ storageip=${fog-ip} loglevel=4 mode=inventory deployed=1
                              imgfetch init.xz
                              boot|| goto MENU
                              

                              The bzImage32 and init_32.xz is just an artifact of calling the menu via a browser and can be ignored.

                              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!

                              F 1 Reply Last reply Dec 16, 2020, 2:15 PM Reply Quote 0
                              • F
                                FlareImp @george1421
                                last edited by Dec 16, 2020, 2:15 PM

                                @george1421 adding the space after the boot|| has gotten me farther now.

                                Now it is displaying Attempting to check in …Failed
                                Invalid MAC Address! (in line for )

                                G 1 Reply Last reply Dec 16, 2020, 2:33 PM Reply Quote 0
                                • G
                                  george1421 Moderator @FlareImp
                                  last edited by george1421 Dec 16, 2020, 8:35 AM Dec 16, 2020, 2:33 PM

                                  @flareimp I didn’t want to confuse the subject so I didn’t initially include this.

                                  When you schedule an inventory task this is the call to launch the FOS Linux client.

                                  #!ipxe
                                  set fog-ip 192.168.50.53
                                  set fog-webroot fog
                                  set boot-url https://${fog-ip}/${fog-webroot}
                                  set storage-ip 192.168.50.53
                                  kernel http://192.168.50.53/fog/service/ipxe/bzImage32 loglevel=4 initrd=init_32.xz root=/dev/ram0 rw ramdisk_size=275000 web=https://192.168.50.53/fog/ consoleblank=0 rootfstype=ext4 mdraid=true mac=00:00:00:87:c2:09 ftp=192.168.50.53 storage=192.168.50.53:/images/dev/ storageip=192.168.50.53 osid=9 irqpoll hostname=00000087c209 mode=inventory deployed=1 mdraid=true
                                  imgfetch http://192.168.50.53/fog/service/ipxe/init_32.xz
                                  boot
                                  

                                  What we are doing is simulating that call via an iPXE menu. I discarded the parameters above that shouldn’t be needed for a hardware inventory. I may have discarded too many. So I do see it passing the mac address during this invocation. Understand what we are doing is not using FOG as it was intended. It should work by YMMV.

                                  So lets tweak the last command I gave you by adding in the mac address (there is room for this command it get it wrong if you have multiple nic adapters in the computer).

                                  :fog.custom.inventory
                                  kernel bzImage loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 web=${boot-url}/ consoleblank=0 rootfstype=ext4 storage=${fog-ip}:/images/ storageip=${fog-ip} loglevel=4 mac=${net0/mac} mode=inventory deployed=1
                                  imgfetch init.xz
                                  boot|| goto MENU
                                  

                                  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!

                                  F 1 Reply Last reply Dec 16, 2020, 2:39 PM Reply Quote 0
                                  • F
                                    FlareImp @george1421
                                    last edited by Dec 16, 2020, 2:39 PM

                                    @george1421 after adding your changes to the config now it is showing the hostname and mac but saying no task found. So would the next step be adding a command to create and start the inventory task?

                                    G 1 Reply Last reply Dec 16, 2020, 2:46 PM Reply Quote 0
                                    • G
                                      george1421 Moderator @FlareImp
                                      last edited by Dec 16, 2020, 2:46 PM

                                      @flareimp So it looks like this route isn’t possible to perform an immediate inventory since a task needs to be deployed on the FOG server. This appears to not be target computer driven. Sorry I should have tested it in my lab first. I know when you run a registration from the iPXE menu it also sends an inventory to the FOG server and that is target computer driven.

                                      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!

                                      F 1 Reply Last reply Dec 16, 2020, 2:52 PM Reply Quote 0
                                      • F
                                        FlareImp @george1421
                                        last edited by Dec 16, 2020, 2:52 PM

                                        @george1421 If I have a host that is not registered in fog and I choose to run the Full Inventory task from the PXE menu, can’t we do something similar to that with hosts that are already registered? I do remember back in the Fog .32 days it was possible.

                                        Thanks for all your assistance!

                                        G 1 Reply Last reply Dec 16, 2020, 3:04 PM Reply Quote 0
                                        • G
                                          george1421 Moderator @FlareImp
                                          last edited by Dec 16, 2020, 3:04 PM

                                          @flareimp said in Add Full Inventory Task to PXE Menu:

                                          can’t we do something similar to that with hosts that are already registered? I do remember back in the Fog .32 days it was possible.

                                          This was my initial thought as the inventory was driven by the client computer. But as we just confirmed this is no longer the case with FOG 1.5.9. With 1.5.9 a task has to be running on the fog server to start the inventory process.

                                          Does your environment use the FOG Client? If so that should also perform an inventory on some interval.

                                          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!

                                          F 1 Reply Last reply Dec 16, 2020, 3:10 PM Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          1 / 2
                                          • First post
                                            6/24
                                            Last post

                                          241

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project