• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Tom Elliott
    3. Best
    • Profile
    • Following 27
    • Followers 83
    • Topics 116
    • Posts 18,890
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Multicast De-Sync When Resizing Disks

      @christop The UDPCAST_MAXWAIT should be the time (in minutes) for all udpcast started jobs.

      If your setting isn’t working (I don’t know why it wouldn’t be, but there could have been a change that broke this unexpectedly) it would default back to 60 seconds in total.

      The value is stored in minutes on the UI side of things and then converted to seconds when and where required.

      I see a potential typo in /var/www/fog/lib/service/multicasttask.class.php at line 660 though, that seems might have been there for a while.

      If you can change it to multiply by 60. Otherwise you were just multiplying by six:

      So 10 * 6 = 60 seconds (one minute). 15 * 6 = 90 (1 minute 30 seconds)

      YOu can fix this by updating your UI value from 10 to the period you’re expecting. Or you can edit the file.

      i’m pushing what i hope will fix the issue in dev-branch if you’re wanting to go by a method that’s more “developed already” kind of thing.

      posted in FOG Problems
      Tom ElliottT
      Tom Elliott
    • RE: Minor issue with logging out of FOG web UI: HTTP ERROR 500

      @Fog_Newb This should be fixed in the latest dev-branch please let me know if it’s not.

      Thank you!

      posted in FOG Problems
      Tom ElliottT
      Tom Elliott
    • RE: Multicast De-Sync When Resizing Disks

      @christop Roger, sorry I’ve been doing a lot of programming in python lately and introduced “int(…)” which isn’t valid PHP syntax. This is corrected in the latest, please pull/install and let me know if it helps?

      Thank you for letting me know.

      posted in FOG Problems
      Tom ElliottT
      Tom Elliott
    • RE: FOG Reboot

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

      posted in FOG Problems
      Tom ElliottT
      Tom Elliott
    • RE: FOG Kernel update showing same version number for new Kernels - 6.12.35

      @rogalskij What you’re seeing is a list of all available kernels for download. The on that’s installed is the currently full release one. I don’t know which version that iss off the top of my head, but I believe it’s the October 14, 2025 at this point.

      posted in FOG Problems
      Tom ElliottT
      Tom Elliott
    • RE: Assign multiple host to a group

      @sapeurorca You can find host ID’s by name and parse it how ever you like. The api system handles things at the simplest level, which is by id’s (most API’s follow this same type of approach).

      This was not implemented with 1.3.3 no so you would have to script it entirely by yourself as needed.

      You can write a php script to do what you need.

      Something like:

      <?php
      require('/var/www/fog/commons/base.inc.php');
      /**
       * Could be handled more dynamically by making this a get variable.
       * This would allow you to call <scriptname>.php?groupname=SomeGroupName
       */
      //$groupname = filter_input(INPUT_GET, 'groupname');
      $groupname = 'groupnamehere';
      /**
       * Get the group object.
       */
      $group = FOGCore::getClass('Group')
          ->set('name', $groupname)
          ->load('name');
      /**
       * If the group isn't valid or doesn't exist, make it.
       */
      if (!$group->isValid()) {
          $group->save();
      }
      /**
       * Get the groups ID.
       */
      $groupID = $group->get('id');
      /**
       * The file must be in hostname1,hostname2 format (or csv if you will), You could modify to
       * process as csv where new hostnames are on new lines too. Something like:
       * hostname1
       * hostname2
       *
       * This would be handled by explode("\n", $hostnames) <Use of double quotes important>
       */
      $hostnames = file_get_contents('/path/to/csv/of/justhostnames.csv');
      /**
       * Just filters and makes the list unique (less work to try to process later on).
       */
      $listOfNames = array_filter(array_unique(explode(',', $hostnames)));
      /**
       * Just get's the hostID's that are already present. The hosts must already exist.
       * This will only return hostID's for valid hosts.
       */
      $hostIDs = FOGCore::getSubObjectIDs(
          'Host',
          array('name' => $listOfNames)
      );
      /**
       * The group association fields to be inserted.
       * GroupID is the group you're associating with gotten earlier.
       * HostID is the list of host IDs from earlier.
       */
      $fieldstogroupinsert = array(
          'groupID',
          'hostID'
      );
      /**
       * Starts our array of items to be inserted.
       */
      $items = array();
      /**
       * Loops each of the host ID's to build our query appropriately.
       */
      foreach ($hostIDs as &$hostID) {
          $items[] = array(
              $groupID,
              $hostID
          );
      }
      /**
       * Inserts all of the new associations.
       */
      FOGCore::getClass('GroupAssociationManager')
          ->insertBatch(
              $fieldstogroupinsert,
              $items
          );
      /**
       * Just let's you know it's finished.
       * NOTE: You could add error checking here if you want.
       */
      echo _('All done');
      ?>
      

      Hopefully all of that makes some sort of sense, if it were me I’d say do the PHP option and stick the file in /var/www/html/.

      Then you just call the script with: http://<fogip>/groupinsert.php (if groupinsert.php was the filename you called it.)

      Update the csv file when you need it and rerun the url call. You can script the call to the url with a curl request on a cron schedule if you needed to.

      Mind you I give no guarantees and I have not tested what I wrote (I just wrote it right now to give an example of how you could approach this). I suggest putting the file in /var/www/html so if you do update you don’t lose your script during upgrades, and the functionality should remain regardless of if you update or not.

      Take account you may need to add your own error handling to this script. I’m just giving a base suggestion, how you approach it is totally up to you.

      The csv file would just be a csv of hostnames, no headers or other information. e.g.:
      hostname1,hostname2,hostname3

      The script I wrote does not contain any space handling/trimming, nor does it take into account special characters. So you need to make sure your CSV is safe. Notice I’m not allowing any options, so you don’t have to worry about another person “exploiting” but security is up to you.

      If you want to semi automate it, the groupname line (line number three of the script) you could change it to:

      $groupname = filter_input(INPUT_GET, 'groupname');
      

      This would allow you to call the script appended with: ?groupname=SomeGroupNameHere. (Not a huge threat).

      You can also change the “file-get-contents” to be automated in a similar fashion though i’d highly recommend against it. But if you “must” you would specify the file name similarly. (Could be a huge threat).

      posted in FOG Problems
      Tom ElliottT
      Tom Elliott
    • 1 / 1