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

New server not updating inventory

Scheduled Pinned Locked Moved Solved
FOG Problems
3
8
1.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.
  • A
    adukes40
    last edited by Mar 26, 2016, 2:49 AM

    So I built a server a few days ago in our test lab. When registering a machine it works great. So today I built a server in production. When I went to do a full registration, I noticed the host name did not stick. When I clicked the host I saw that the inventory said there was no data, but the host exists. I decided to try a new machine but this time using quick reg. Same result. It gets more strange, in the host list it has a green marker next to it. I then tried to capture an image. It started the image capture and in the FOG GUI it then had a red marker saying “no device or address”. the second machine did the same thing. Yet I could deploy an image to it.
    I am not sure where to begin. What kind of information do you all need? I did just update to the latest SVN as of tonight which was 6951?? I think.

    Thanks a bunch

    1 Reply Last reply Reply Quote 0
    • S
      Sebastian Roth Moderator
      last edited by Mar 26, 2016, 12:06 PM

      Seams like a recent change is causing this. en/decoding of values being the problem. Here is a tested patch proposal:

      diff --git a/packages/web/lib/fog/fogbase.class.php b/packages/web/lib/fog/fogbase.class.php
      index ad5d778..b9c99b4 100644
      --- a/packages/web/lib/fog/fogbase.class.php
      +++ b/packages/web/lib/fog/fogbase.class.php
      @@ -552,9 +552,8 @@ abstract class FOGBase {
           public static function stripAndDecode(&$item) {
               $item = (array)$item;
               foreach($item AS $key => &$val) {
      -            $val = urlencode($val);
                   $tmp = trim(base64_decode(preg_replace('#[[:space:]]#','+',$val)));
      -            if ($tmp && mb_detect_encoding($tmp,'utf-8',true)) $val = $tmp;
      +            if (isset($tmp) && mb_detect_encoding($tmp,'utf-8',true)) $val = $tmp;
                   unset($tmp);
                   $val = trim(htmlentities(urldecode($val),ENT_QUOTES,'utf-8'));
               }
      diff --git a/packages/web/service/inventory.php b/packages/web/service/inventory.php
      index 2c92d5e..1846655 100644
      --- a/packages/web/service/inventory.php
      +++ b/packages/web/service/inventory.php
      @@ -2,7 +2,7 @@
       require('../commons/base.inc.php');
       FOGCore::stripAndDecode($_REQUEST);
       try {
      -    $Host = $FOGCore->getHostItem(false,true);
      +    $Host = $FOGCore->getHostItem(false,false);
           $Inventory = $Host->get('inventory')
               ->set('hostID',$Host->get('id'));
           foreach ($_REQUEST AS $var => &$val) {
      

      @Tom-Elliott And I am wondering if we need all the ‘preg_replace’, ‘urldecode’, ‘htmlentities’ stuff at all?!?

      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
      • S
        Sebastian Roth Moderator
        last edited by Mar 26, 2016, 1:46 PM

        Sorry, forgot about the other values…

        diff --git a/src/buildroot/package/fog/scripts/bin/fog.man.reg b/src/buildroot/package/fog/scripts/bin/fog.man.reg
        index 6c3a013..6afdadb 100755
        --- a/src/buildroot/package/fog/scripts/bin/fog.man.reg
        +++ b/src/buildroot/package/fog/scripts/bin/fog.man.reg
        @@ -249,7 +249,7 @@ while [[ -z $askme ]]; do
                     askme="N"
                     ;;
                 [Yy]|[Yy][Ee][Ss])
        -            blDoAD=1
        +            blDoAD=$(echo -n "1" | base64)
                     askme="Y"
                     ;;
                 *)
        @@ -293,7 +293,7 @@ while [[ -z $askme ]]; do
                             '#!ok')
                                 echo " * This host will reboot and imaging will start!"
                                 ret=$tmp
        -                        realdoimage=1
        +                        realdoimage=$(echo -n "1" | base64)
                                 break
                                 ;;
                             '#!il')
        @@ -313,7 +313,7 @@ done
         dots "Attempting to register host"
         res=""
         while [[ -z $res ]]; do
        -    res=$(wget --post-data="mac=$mac&advanced=1&host=$host&imageid=$imageid&primaryuser=$primaryuser&other1=$other1&other2=$other2&doimage=$realdoimage&doad=$blDoAD&location=$locationid&username=$user64&groupid=$group64&snapinid=$snapin64&productKey=$productKey" -qO - http://${web}service/auto.register.php 2>/dev/null)
        +    res=$(wget --post-data="mac=$mac&advanced=$(echo -n "1" | base64)&host=$host&imageid=$imageid&primaryuser=$primaryuser&other1=$other1&other2=$other2&doimage=$realdoimage&doad=$blDoAD&location=$locationid&username=$user64&groupid=$group64&snapinid=$snapin64&productKey=$productKey" -qO - http://${web}service/auto.register.php 2>/dev/null)
             echo "$res"
             usleep 2000000
         done
        

        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
        • A
          adukes40
          last edited by Mar 26, 2016, 2:17 PM

          Did you need me to provide anything? I’m new to Linux, but learning. I can try to pull things if you need, but might need a little step by step if so… Thanks again

          1 Reply Last reply Reply Quote 0
          • S
            Sebastian Roth Moderator
            last edited by Mar 26, 2016, 2:25 PM

            @adukes40 No, please stay tuned. You found a bug and we are discussing how we are going to fix this “the best way”. Will let you know when you can pull the latest update.

            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
            • A
              adukes40
              last edited by Mar 26, 2016, 3:09 PM

              Ok, thanks Sebastian. I appreciate the quick responses.

              T 1 Reply Last reply Mar 26, 2016, 9:39 PM Reply Quote 0
              • T
                Tom Elliott @adukes40
                last edited by Mar 26, 2016, 9:39 PM

                @adukes40 This should now be fixed.

                I added all the suggestions in this thread.

                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
                • A
                  adukes40
                  last edited by Mar 26, 2016, 10:17 PM

                  Just wanted to say I updated to SVN 6955 and inventory is running great. Thanks Sebastian and Tom for the hard work.

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

                  162

                  Online

                  12.0k

                  Users

                  17.3k

                  Topics

                  155.2k

                  Posts
                  Copyright © 2012-2024 FOG Project