Data missing from the database after host is imaged.
-
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!
-
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?
-
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?
-
This post is deleted! -
@greg-plamondon said in Data missing from the database after host is imaged.:
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.
-
Ok, it doesn’t matter what I do with the scripts. the Othertag data is removed after I image the PC.
-
@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.
-
@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.
-
@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?
-
@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! -
Found it.
-
@tom-elliott said in Data missing from the database after host is imaged.:
Found it.
WOW that was fast
-
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.
-
@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!