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

Can I use some kind of script to create image and ghost my lab machines

Scheduled Pinned Locked Moved Unsolved
FOG Problems
8
36
14.1k
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.
  • A
    AndrewG78
    last edited by Sep 6, 2017, 11:38 AM

    @george1421 Thank you. I have 1.4.2 . Do you maybe know if there are some changes in API between my version and 1.4.4 ?
    https://news.fogproject.org/fog-1-4-4-officially-released/ keeps popping out 502 error

    G 1 Reply Last reply Sep 6, 2017, 12:20 PM Reply Quote 0
    • G
      george1421 Moderator @AndrewG78
      last edited by Sep 6, 2017, 12:20 PM

      @andrewg78 There were some tweaks to the API between 1.4.2 and 1.4.4, but I can’t tell you off the top of my head. You would be better to move to 1.4.4 anyway outside of the API stuff. There were some issues with 1.4.2 that was address in 1.4.3 and finally in 1.4.4.

      The developers are still on holiday, but let me see if I can ping one of them to kickstart the news server.

      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
      • A
        AndrewG78
        last edited by AndrewG78 Sep 11, 2017, 8:50 AM Sep 6, 2017, 2:33 PM

        May u please validate my curl command?
        I keep getting same error as I mentioned few months ago.
        {
        “error”: “Invalid tasking type passed”
        }

        I’m trying to task multicast process.

        curl --header “fog-api-token: <token>=” --header “fog-user-token: <token>=” --data ‘{“taskTypeID”:8}’ -X POST http://<IP>/fog/group/2/task

        W 1 Reply Last reply Sep 6, 2017, 5:20 PM Reply Quote 0
        • G
          george1421 Moderator
          last edited by Sep 6, 2017, 4:16 PM

          @Wayne-Workman any ideas since you have been working with the API more than most?

          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
          • W
            Wayne Workman @AndrewG78
            last edited by Sep 6, 2017, 5:20 PM

            @andrewg78 The tokens should not have an “equals” symbol added. My examples have an equals at the end because that was coincidentally part of the token. So if you’re adding an equals, remove that.

            And you’re missing this header: -H 'Content-Type: application/json'

            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 1
            • A
              AndrewG78
              last edited by AndrewG78 Sep 7, 2017, 4:05 AM Sep 7, 2017, 9:45 AM

              @Wayne-Workman Hi, thx but " " are needed. I think they depends on the curl version(I’m on WIndows). Without “equals” I got “can not resolve host” error. Moreover, my command gets proper response from the server that tasking type is invalid. I assume API does not support multicast yet. Please confirm that. If you have something not committed to repo yet, please do commit it, as I can test it. Doing CI integration through Jenkins now

              W 1 Reply Last reply Sep 7, 2017, 1:39 PM Reply Quote 0
              • W
                Wayne Workman @AndrewG78
                last edited by Wayne Workman Sep 7, 2017, 7:40 AM Sep 7, 2017, 1:39 PM

                @andrewg78 The API supports multicast. The documentation here shows us how: https://news.fogproject.org/simplified-api-documentation/

                You must specify multicastsession as the task type. This is how:

                curl --silent -k -H 'Content-Type: application/json' -H 'fog-user-token: NTcwZTkwYzA5ZDE5NGI0ZTQ3NDgzYzE5ZmM5YWZiZjU5YmZjNjcxMzhiODNlMDczNTlhMWNiNjIxNDVlYmM4ZmZjMGVlOTFiNmUzNzFkNjY5ZmFjNzViMjRiNmJiNWNlM2JiYTM3ZDIxNzk3N2Y3YmM5N2JkM2U4ODZhODdmZjk=' -H 'fog-api-token: M2JhM2ViZmJhZDM1MmQ1MTU4NTNjMTNmZjY4YTY3MGUxMTZmNzgyMmQxYzlhOWMwMmRjMTg0NWNmYTE4MmZiY2FkNjFjYzY1ZjY5NGQ4ZTE1Yjk4ZTg5NTQ0YTBiYmIwYzFjYmFiNTFiYzkwZTQ0YzI5MzFlNWM0NzhmMzEyNTk=' http://10.0.0.28/fog/group/1/multicastsession
                

                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
                • A
                  AndrewG78
                  last edited by Sep 11, 2017, 2:50 PM

                  @Wayne-Workman
                  Thx, I’ve tried this, and there is no any action 😞
                  I have no error but task is not being created.
                  curl --header “Content-Type: application/json” --header “fog-api-token: <my_token>” --header “fog-user-token: <my_token>” --data ‘{“taskTypeID”:8}’ -X POST http://<IP>/fog/group/3/multicastsession

                  W T 2 Replies Last reply Sep 11, 2017, 5:08 PM Reply Quote 0
                  • S
                    Sebastian Roth Moderator
                    last edited by Sep 11, 2017, 4:35 PM

                    @AndrewG78 Anything you see in the apache error logs when running the curl command?

                    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
                    • W
                      Wayne Workman @AndrewG78
                      last edited by Sep 11, 2017, 5:08 PM

                      @andrewg78 Yes, please check the apache error logs. The command I posted did work on my home fog server.

                      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
                      • T
                        Tom Elliott @AndrewG78
                        last edited by Tom Elliott Sep 11, 2017, 11:19 AM Sep 11, 2017, 5:17 PM

                        @andrewg78 I don’t think you need the --data '{"taskTypeID": 8}' though it shouldn’t really matter. Is there any return output from the command losing teh --silent component should show you what’s going on more directly.

                        Something like:

                        curl -vvv -H 'Content-Type: application/json' -H 'fog-api-token: <my_token>' -H 'fog-user-token: <my_token>' http://<IP>/fog/group/3/task -X POST --data '{"taskTypeID": 8}'

                        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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                        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
                        • A
                          AndrewG78
                          last edited by Sep 12, 2017, 11:28 AM

                          I have three groups. I wanted to process group ID==3

                          curl -vvv --header “Content-Type: application/json” --header “fog-api-token: <my_token>” --header “fog-user-token:<my_token>” -X POST http://<IP>/fog/group/3/multicastsession

                          < HTTP/1.1 501 Not Implemented
                          < Date: Tue, 12 Sep 2017 11:25:28 GMT
                          < Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/5.6.31
                          < X-Powered-By: PHP/5.6.31
                          < X-Frame-Options: sameorigin
                          < X-XSS-Protection: 1; mode=block
                          < X-Content-Type-Options: nosniff
                          < Strict-Transport-Security: max-age=31536000
                          < Content-Security-Policy: default-src ‘none’;script-src ‘self’ ‘unsafe-eval’;co
                          nnect-src ‘self’;img-src ‘self’ data:;style-src ‘self’ ‘unsafe-inline’;font-src
                          ‘self’;
                          < Access-Control-Allow-Origin: *
                          < Content-Length: 0
                          < Connection: close
                          < Content-Type: application/json
                          <

                          • Closing connection 0
                          T 1 Reply Last reply Sep 12, 2017, 11:57 AM Reply Quote 0
                          • T
                            Tom Elliott @AndrewG78
                            last edited by Sep 12, 2017, 11:57 AM

                            @andrewg78 Why don’t you try what I suggested?

                            curl -vvv -H 'Content-Type: application/json' -H 'fog-api-token: <my_token>' -H 'fog-user-token: <my_token>' http://<IP>/fog/group/3/task -X POST --data '{"taskTypeID": 8}'

                            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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                            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
                            • A
                              AndrewG78
                              last edited by Sep 14, 2017, 8:00 AM

                              @Tom-Elliott
                              Actually I tried your suggestion and have some issue.
                              curl -vvv --header “Content-Type: application/json” --header “fog-api-token: <my_token>” --header “fog-user-token:<my_token>” -X POST --data ‘{“taskTypeID”: 8}’ http://<IP>/fog/group/3/task

                              • upload completely sent off: 13 out of 13 bytes
                                < HTTP/1.1 501 Not Implemented
                                < Date: Thu, 14 Sep 2017 07:59:06 GMT
                                < Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/5.6.31
                                < X-Powered-By: PHP/5.6.31
                                < X-Frame-Options: sameorigin
                                < X-XSS-Protection: 1; mode=block
                                < X-Content-Type-Options: nosniff
                                < Strict-Transport-Security: max-age=31536000
                                < Content-Security-Policy: default-src ‘none’;script-src ‘self’ ‘unsafe-eval’;co
                                nnect-src ‘self’;img-src ‘self’ data:;style-src ‘self’ ‘unsafe-inline’;font-src
                                ‘self’;
                                < Access-Control-Allow-Origin: *
                                < Content-Length: 42
                                < Connection: close
                                < Content-Type: application/json
                                <
                                { “error”: “Invalid tasking type passed”
                                }* Closing connection 0

                              but GET method works perfectly
                              curl --header “Content-Type: application/json” --header “fog-api-token: <my_token>” --header “fog-user-token: <my_token>” --data ‘{“hostID”:13}’ -X GET http://<IP>/fog/task/active

                              • upload completely sent off: 13 out of 13 bytes
                                < HTTP/1.1 200 OK
                                < Date: Thu, 14 Sep 2017 08:02:15 GMT
                                < Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/5.6.31
                                < X-Powered-By: PHP/5.6.31
                                < X-Frame-Options: sameorigin
                                < X-XSS-Protection: 1; mode=block
                                < X-Content-Type-Options: nosniff
                                < Strict-Transport-Security: max-age=31536000
                                < Content-Security-Policy: default-src ‘none’;script-src ‘self’ ‘unsafe-eval’;co
                                nnect-src ‘self’;img-src ‘self’ data:;style-src ‘self’ ‘unsafe-inline’;font-src
                                ‘self’;
                                < Access-Control-Allow-Origin: *
                                < Content-Length: 27
                                < Connection: close
                                < Content-Type: application/json
                                <
                                { “count”: 0, “tasks”: []
                                }* Closing connection 0
                              W 1 Reply Last reply Sep 14, 2017, 1:12 PM Reply Quote 0
                              • W
                                Wayne Workman @AndrewG78
                                last edited by Sep 14, 2017, 1:12 PM

                                @andrewg78 Maybe you install Insomnia and work-through the request there first?

                                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
                                • A
                                  AndrewG78 @Wayne Workman
                                  last edited by Nov 28, 2017, 4:04 PM

                                  Hi @wayne-workman
                                  When I use your example to Get task status of host ID 1,
                                  I always receive status of all hosts, but not the particular one.
                                  Could you help here?
                                  I’m on 1.4.4
                                  regards

                                  W 1 Reply Last reply Nov 28, 2017, 11:55 PM Reply Quote 1
                                  • W
                                    Wayne Workman @AndrewG78
                                    last edited by Nov 28, 2017, 11:55 PM

                                    @andrewg78 There’s an example of that very thing here: https://forums.fogproject.org/topic/9779/can-i-use-some-kind-of-script-to-create-image-and-ghost-my-lab-machines/9?page=2

                                    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
                                    • L
                                      lebrun78
                                      last edited by Dec 13, 2017, 10:08 AM

                                      This post is deleted!
                                      1 Reply Last reply Reply Quote 0
                                      • A
                                        abulhol @Wayne Workman
                                        last edited by Mar 17, 2021, 11:23 AM

                                        @wayne-workman This call has to be made using the DELETE method.

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

                                        192

                                        Online

                                        12.0k

                                        Users

                                        17.3k

                                        Topics

                                        155.2k

                                        Posts
                                        Copyright © 2012-2024 FOG Project