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

Data missing from the database after host is imaged.

Scheduled Pinned Locked Moved Unsolved
FOG Problems
3
14
1.3k
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.
  • G
    Greg Plamondon Testers
    last edited by Greg Plamondon May 2, 2018, 12:41 PM May 2, 2018, 6:40 PM

    I really don’t know how to explain this issue without using a –>>VIDEO<<–.
    We use the “iOtherTag” in the inventory section to determine what company a PC belongs to, we also use this field to trigger what unattend.xml amongst other post init scripts to use. When we image the PC the “iOtherTag” table data for that host gets removed from the DB.

    Here is my “fog.postdownload”

    #!/bin/bash
    . /usr/share/fog/lib/funcs.sh
    curl -A "" -Lkso /tmp/hinfo.sh "${web}/service/hostinfo.php?mac=$mac"
    . /tmp/hinfo.sh
    [[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
    case $osid in
        5|6|7|9)
            clear
            [[ ! -d /ntfs ]] && mkdir -p /ntfs
            getHardDisk
            if [[ -z $hd ]]; then
                handleError "Could not find hdd to use"
                
            fi
            getPartitions $hd
            for part in $parts; do
                true
            done
            dots "Mounting partition $part"
            ntfs-3g -o force,rw $part /ntfs >/dev/null 2>&1
            if [[ ! $? -eq 0 ]]; then
                echo "Failed"
                debugPause
                handleError "Failed to mount $part ($0)\n    Args: $*"
            fi
            echo "Done"
            case $othertag in
                BAY)
                    . ${postdownpath}fog.log
                    . ${postdownpath}fog.bay_replace-files
                    . ${postdownpath}fog.drivers
                    . ${postdownpath}fog.ad
                    ;;
                MPMI)
                    . ${postdownpath}fog.log
                    . ${postdownpath}fog.canada_replace-files
                    . ${postdownpath}fog.drivers
                    . ${postdownpath}fog.ad
                    ;;
                JET)
                    . ${postdownpath}fog.log
                    . ${postdownpath}fog.jet_replace-files
                    . ${postdownpath}fog.drivers
                    . ${postdownpath}fog.ad
                    ;;	
                *)
                    . ${postdownpath}fog.log
                    . ${postdownpath}fog.replace-files
                    . ${postdownpath}fog.drivers
                    . ${postdownpath}fog.ad
                    ;;
            esac
            umount /ntfs
            ;;
        *)
            echo "Invalid OS"
            debugPause
            return
            ;;
    esac
    

    as always thanks for the help all!

    1 Reply Last reply Reply Quote 0
    • G
      george1421 Moderator
      last edited by May 2, 2018, 6:52 PM

      Unless you are making FOG API calls in one of those other scripts there is no way a post install script can even touch the database to remove the host.

      I do remember a thread about hosts disappearing from the database, but I’m almost 100% sure its not related to a postinstall script.

      What version of FOG are you using?

      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!

      G 2 Replies Last reply May 2, 2018, 7:20 PM Reply Quote 0
      • G
        Greg Plamondon Testers @george1421
        last edited by Greg Plamondon May 2, 2018, 1:21 PM May 2, 2018, 7:20 PM

        @george1421

        It’s not removing the host. its removing data from the inventory section of the database.

        You are currently running version: 1.5.2.10
        

        did you watch the video?

        1 Reply Last reply Reply Quote 0
        • G
          Greg Plamondon Testers @george1421
          last edited by May 2, 2018, 7:23 PM

          This post is deleted!
          G 1 Reply Last reply May 2, 2018, 7:34 PM Reply Quote 0
          • G
            Greg Plamondon Testers @Greg Plamondon
            last edited by May 2, 2018, 7:34 PM

            @greg-plamondon said in Data missing from the database after host is imaged.:

            @george1421

            if i comment out this section…

                   case $othertag in
                        BAY)
                            . ${postdownpath}fog.log
                            . ${postdownpath}fog.bay_replace-files
                            . ${postdownpath}fog.drivers
                            . ${postdownpath}fog.ad
                            ;;
                        MPMI)
                            . ${postdownpath}fog.log
                            . ${postdownpath}fog.canada_replace-files
                            . ${postdownpath}fog.drivers
                            . ${postdownpath}fog.ad
                            ;;
                        JET)
                            . ${postdownpath}fog.log
                            . ${postdownpath}fog.jet_replace-files
                            . ${postdownpath}fog.drivers
                            . ${postdownpath}fog.ad
                            ;;	
                        *)
                            . ${postdownpath}fog.log
                            . ${postdownpath}fog.replace-files
                            . ${postdownpath}fog.drivers
                            . ${postdownpath}fog.ad
                            ;;
                    esac
            

            the data remains after imaging.

            I take that back… The data doesn’t persist regardless if I comment it out.

            1 Reply Last reply Reply Quote 0
            • G
              Greg Plamondon Testers
              last edited by May 2, 2018, 7:55 PM

              Ok, it doesn’t matter what I do with the scripts. the Othertag data is removed after I image the PC.

              G 1 Reply Last reply May 2, 2018, 8:06 PM Reply Quote 0
              • G
                george1421 Moderator @Greg Plamondon
                last edited by May 2, 2018, 8:06 PM

                @greg-plamondon So just for clarity, if you disable your fog post install script from running (from the master script) the Othertag data is removed from the database?

                I could see if you might have altered Othertag data it might happen.

                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!

                G 1 Reply Last reply May 2, 2018, 8:59 PM Reply Quote 0
                • G
                  Greg Plamondon Testers @george1421
                  last edited by Greg Plamondon May 2, 2018, 3:00 PM May 2, 2018, 8:59 PM

                  @george1421 said in Data missing from the database after host is imaged.:

                  @greg-plamondon So just for clarity, if you disable your fog post install script from running (from the master script) the Othertag data is removed from the database?

                  I could see if you might have altered Othertag data it might happen.

                  Yes, the othertag is removed. Interesting enough I am able to use the “Other Tag #2” ie “iOtherTag1” field fine.

                  I also reverted back to fog 1.5.2 and I am having the same issue.

                  T 1 Reply Last reply May 2, 2018, 9:00 PM Reply Quote 0
                  • T
                    Tom Elliott @Greg Plamondon
                    last edited by May 2, 2018, 9:00 PM

                    @greg-plamondon I’ve yet to hear of imaging causing a change on the other tags. Only during registration does this happen. I’ll take a look at the inventory update script, maybe I missed something?

                    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

                    G 1 Reply Last reply May 2, 2018, 9:02 PM Reply Quote 0
                    • G
                      Greg Plamondon Testers @Tom Elliott
                      last edited by May 2, 2018, 9:02 PM

                      @tom-elliott said in Data missing from the database after host is imaged.:

                      @greg-plamondon I’ve yet to hear of imaging causing a change on the other tags. Only during registration does this happen. I’ll take a look at the inventory update script, maybe I missed something?

                      I have found a work around using the “Other Tag #2” for now.
                      Thanks!

                      1 Reply Last reply Reply Quote 0
                      • T
                        Tom Elliott
                        last edited by May 2, 2018, 9:03 PM

                        Found it.

                        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

                        G 1 Reply Last reply May 2, 2018, 9:03 PM Reply Quote 0
                        • G
                          Greg Plamondon Testers @Tom Elliott
                          last edited by May 2, 2018, 9:03 PM

                          @tom-elliott said in Data missing from the database after host is imaged.:

                          Found it.

                          WOW that was fast

                          1 Reply Last reply Reply Quote 0
                          • T
                            Tom Elliott
                            last edited by May 2, 2018, 9:13 PM

                            Fixed in working.

                            Basically what was happening was the other1 field is used to send emails. That part still can happen (as any value that’s not an email will just not receive an email), but it was clearing the field after it sent the email out.

                            I just commented out the line as I cannot remember exactly why I was clearing it to begin with.

                            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

                            G 1 Reply Last reply May 2, 2018, 9:35 PM Reply Quote 2
                            • G
                              Greg Plamondon Testers @Tom Elliott
                              last edited by May 2, 2018, 9:35 PM

                              @tom-elliott said in Data missing from the database after host is imaged.:

                              Fixed in working.

                              Basically what was happening was the other1 field is used to send emails. That part still can happen (as any value that’s not an email will just not receive an email), but it was clearing the field after it sent the email out.

                              I just commented out the line as I cannot remember exactly why I was clearing it to begin with.

                              Thanks Tom!

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

                              127

                              Online

                              12.1k

                              Users

                              17.3k

                              Topics

                              155.3k

                              Posts
                              Copyright © 2012-2024 FOG Project