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

FOG With BASH

Scheduled Pinned Locked Moved
General
4
13
4.5k
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.
  • N
    Nika
    last edited by Jan 21, 2016, 4:21 PM

    Hello.
    I have FOG 1.2.0

    How can i WIPE hard disk with Bash or Python in Linux? (fog WIPE any computer)
    How can i restore any image with command line of Linux?
    and how can i delete COMPUTERS with Bash or Python in Linux ?

    Thanks.

    1 Reply Last reply Reply Quote 0
    • W
      Wayne Workman
      last edited by Jan 21, 2016, 4:24 PM

      Do you have FOG 1.2.0 working? It can do all these things already.

      Why do you want bash commands for those things?

      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/

      J 1 Reply Last reply Jan 22, 2016, 8:38 AM Reply Quote 0
      • W
        Wayne Workman
        last edited by Jan 21, 2016, 4:24 PM

        Oh this request is regarding this: https://forums.fogproject.org/topic/6454/wipe-and-restore

        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
        • J
          JJ Fullmer Testers
          last edited by Jan 21, 2016, 4:28 PM

          So you can do these things in the gui with much ease. I’m guessing you’re trying to write a script of some sort to automate it further?
          If you run a debug session then you can run any of those commands on the computer you’re imaging with things like fog.wipe and fog.download.

          Since the actions you make in the gui are essentially doing things in the database, I suppose that it would be possible to manually edit the database with a script to queue the actions you want on the computers you want. But I don’t know the database well enough to help much more than point you in that direction.

          What exactly are you trying to do though? You can set up cron style jobs in the gui if you are trying to just have wipes and restores done regularly, you could set that up in the gui without custom code. Just select cron style deployment when you queue a job in the gui.

          Hopefully that’s helpful in some way.

          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

          W 1 Reply Last reply Jan 21, 2016, 4:30 PM Reply Quote 1
          • W
            Wayne Workman @JJ Fullmer
            last edited by Jan 21, 2016, 4:30 PM

            @Arrowhead-IT said:

            Since the actions you make in the gui are essentially doing things in the database, I suppose that it would be possible to manually edit the database with a script to queue the actions you want on the computers you want.

            I outlined how it’d be done in the thread I posted below.

            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/

            J 1 Reply Last reply Jan 21, 2016, 4:55 PM Reply Quote 1
            • J
              JJ Fullmer Testers @Wayne Workman
              last edited by Jan 21, 2016, 4:55 PM

              @Wayne-Workman I see that now, You posted while I was writing my post so I didn’t see that. I got distracted whilst writing it.

              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 1
              • J
                jc35 @Wayne Workman
                last edited by Jan 22, 2016, 8:38 AM

                @Wayne-Workman said:

                Do you have FOG 1.2.0 working? It can do all these things already.
                Yes we have FOG 1.2.0 working.

                Why do you want bash commands for those things?

                We need to automate some actions. We use glpi and rabbit mq.
                when we put a machine discarded with glpi, rabbit mq send to fog " a wipe and imaging and delete a machine."

                J 1 Reply Last reply Jan 22, 2016, 4:26 PM Reply Quote 1
                • J
                  JJ Fullmer Testers @jc35
                  last edited by Jan 22, 2016, 4:26 PM

                  @jc35 Just to be sure I understand what you’re trying to do,
                  You have an inventory system in glpi.
                  You want to make it so if you hit delete on a computer in your inventory rabbit mq sends a message to fog to wipe the machine and put a default image (like a retail windows or basic linux that the computer can be sold with I’m guessing) on the deleted computer.

                  So you want to click one button to delete the computer from your inventory and it automatically prepares itself to be safely disposed/surplussed/sold or what have you.

                  Do I understand correctly?

                  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

                  J 1 Reply Last reply Jan 25, 2016, 7:40 AM Reply Quote 1
                  • J
                    jc35 @JJ Fullmer
                    last edited by Jan 25, 2016, 7:40 AM

                    @Arrowhead-IT
                    Yes you understand correctly.

                    J 1 Reply Last reply Jan 25, 2016, 5:15 PM Reply Quote 0
                    • J
                      JJ Fullmer Testers @jc35
                      last edited by Jan 25, 2016, 5:15 PM

                      @jc35 So I think you can do this
                      I would follow the help @Wayne-Workman gave you on this post
                      https://forums.fogproject.org/topic/6454/wipe-and-restore

                      Using the information of what the database tables need to say you could write a bash or python script to edit the mysql database of fog.
                      The next question is whether or not you need help with that part too.
                      The basics steps you would need to do

                      • make a remote mysql user with access to the fog database on the fog server.
                      • Compose and test some mysql commands remotely based on the tables you need to edit and make sure it works
                      • Take those commands and put them into a script. In bash it is possible to send a single command to mysql, I don’t remember the parameter of the top of my head though, I would have to go find a script where I did that if need be.

                      Hopefully that helps you get started.

                      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

                      W J 2 Replies Last reply Jan 25, 2016, 6:35 PM Reply Quote 1
                      • W
                        Wayne Workman @JJ Fullmer
                        last edited by Jan 25, 2016, 6:35 PM

                        @Arrowhead-IT said:

                        In bash it is possible to send a single command to mysql, I don’t remember the parameter of the top of my head though, I would have to go find a script where I did that if need be.

                        Some good references:

                        http://stackoverflow.com/questions/20033648/how-to-run-mysql-command-on-bash

                        http://stackoverflow.com/questions/1636977/bash-script-select-from-database-into-variable

                        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/

                        J 1 Reply Last reply Jan 26, 2016, 2:41 PM Reply Quote 0
                        • J
                          jc35 @JJ Fullmer
                          last edited by Jan 26, 2016, 2:27 PM

                          @Arrowhead-IT
                          Thank you very much.

                          1 Reply Last reply Reply Quote 1
                          • J
                            jc35 @Wayne Workman
                            last edited by Jan 26, 2016, 2:41 PM

                            @Wayne-Workman
                            thank you very much.

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

                            189

                            Online

                            12.0k

                            Users

                            17.3k

                            Topics

                            155.2k

                            Posts
                            Copyright © 2012-2024 FOG Project