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

    FOG Reboot

    Scheduled Pinned Locked Moved Unsolved FOG Problems
    4 Posts 2 Posters 16 Views
    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.
    • C
      chevengur
      last edited by chevengur

      Hi everyone, I ran into an issue: I’m trying to perform a one-time system reboot in Power Management via Python requests. However, the problem is that after this command, the computer creates a Cron Schedule, causing it to reboot continuously. Is there any way to avoid this? In the GUI, there is a “Perform Immediately” flag that sends a one-time reboot request.

      fogproject.PNG

      def reboot(self):
              REBOOT_URL = "http://IP/fog/powermanagement"
              payload = {
                  "performImmediately": 1, # doesn't work
                  "hostID": 13,
                  "min": 0,
                  "hour": 0,
                  "dom": 0,
                  "month": 0,
                  "dow": 0,
                  "action": "reboot"
              }
      
              r = requests.post(
                  REBOOT_URL,
                  headers=self.headers,
                  json=payload,
                  verify=False
              )
      
              print(r.status_code, r.text)
      
      Tom ElliottT 1 Reply Last reply Reply Quote 0
      • Tom ElliottT
        Tom Elliott @chevengur
        last edited by

        @chevengur I believe you just check the box for perform immediately and dont’ define anythign against the cron side of 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! 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

        C 1 Reply Last reply Reply Quote 0
        • C
          chevengur @Tom Elliott
          last edited by

          @Tom-Elliott That’s right, in the UI I check the box, but in the POST request this flag is missing, or maybe I’m not naming it correctly?

          Tom ElliottT 1 Reply Last reply Reply Quote 0
          • Tom ElliottT
            Tom Elliott @chevengur
            last edited by

            @chevengur The flag is onDemand -> 0 = No, 1 = yes.

            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 0
            • 1 / 1
            • First post
              Last post

            113

            Online

            12.4k

            Users

            17.4k

            Topics

            155.9k

            Posts
            Copyright © 2012-2025 FOG Project