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

Hooks

Scheduled Pinned Locked Moved Solved
General
3
11
2.9k
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.
  • I
    ibloss
    last edited by ibloss Oct 2, 2015, 9:03 AM Oct 2, 2015, 3:02 PM

    Is there any event for when a host successfully images that I can write a hook for?

    1 Reply Last reply Reply Quote 0
    • J
      Joe Schmitt Senior Developer
      last edited by Oct 2, 2015, 3:10 PM

      Yes: ‘HOST_IMAGE_COMPLETE’

      See my Pushbullet plugin for an example: https://github.com/FOGProject/fogproject/tree/dev-branch/packages/web/lib/plugins/pushbullet
      Specifically this file for registering the hook: https://github.com/FOGProject/fogproject/blob/dev-branch/packages/web/lib/plugins/pushbullet/events/ImageComplete_PushBullet.event.php#L18

      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.

      1 Reply Last reply Reply Quote 2
      • I
        ibloss
        last edited by Oct 2, 2015, 3:15 PM

        Awesome, you just made my fog/puppet stack workflow alot easier.

        1 Reply Last reply Reply Quote 1
        • I
          ibloss
          last edited by ibloss Oct 2, 2015, 11:40 AM Oct 2, 2015, 5:30 PM

          I forgot to specify that I’m currently running 1.2.0.

          I’m looking at the HookManager class file and I don’t see ‘HOST_IMAGE_COMPLETE’ event.

          Is it that your ImageComplete_PushBullet.event.php declares the event to be hooked?

          Or is ‘HOST_IMAGE_COMPLETE’ defined only in 1.3 beta?

          1 Reply Last reply Reply Quote 0
          • T
            Tom Elliott
            last edited by Oct 2, 2015, 6:40 PM

            Event’s, as @Jbob has described, was only added in the current versions of FOG.

            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

            I 1 Reply Last reply Oct 2, 2015, 6:52 PM Reply Quote 0
            • I
              ibloss @Tom Elliott
              last edited by Oct 2, 2015, 6:52 PM

              @Tom-Elliott

              Thanks for the clarification Tom, any idea where I could drop an interpolated bash command anywhere after the imaging process?

              need something like this

              “puppet cert clean ${hostname}”

              1 Reply Last reply Reply Quote 0
              • T
                Tom Elliott
                last edited by Oct 2, 2015, 7:03 PM

                If the intent is to do this from the “client” before it reboots into windows, then you can use the postdownloadscripts.

                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

                I 2 Replies Last reply Oct 2, 2015, 7:10 PM Reply Quote 1
                • I
                  ibloss @Tom Elliott
                  last edited by Oct 2, 2015, 7:10 PM

                  @Tom-Elliott

                  No this is from the server, I was under the assumption that after the linux pxe image on the “client” was done running partclone that it would return some form of success, seeing that if the machine fails halfway through the task that when pxe booting again will try running the scheduled image task.

                  1 Reply Last reply Reply Quote 0
                  • I
                    ibloss @Tom Elliott
                    last edited by Oct 2, 2015, 9:21 PM

                    @Tom-Elliott

                    Looked a little more into postdownloadscripts, and I can send a network message to my server which makes for an okay hack at the moment for what I need to do, but if you have a solution for something that runs server side that would be desired.

                    1 Reply Last reply Reply Quote 0
                    • J
                      Joe Schmitt Senior Developer
                      last edited by Oct 2, 2015, 10:49 PM

                      @ibloss

                      service/Post_Stage3.php is called on the server side when a client finishes imaging.

                      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.

                      I 1 Reply Last reply Oct 6, 2015, 4:49 PM Reply Quote 1
                      • I
                        ibloss @Joe Schmitt
                        last edited by Oct 6, 2015, 4:49 PM

                        @Jbob exactly what I was looking for thanks!

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        1 / 1
                        • First post
                          8/11
                          Last post

                        283

                        Online

                        12.0k

                        Users

                        17.3k

                        Topics

                        155.2k

                        Posts
                        Copyright © 2012-2024 FOG Project