Postdownload scripts variable issues.
-
@Tom-Elliott
When in debug, if I type “echo $othertag” it doesn’t return any results.echo $hostname, $osid, $mac all return results.
-
@Greg-Plamondon Are you sure the machien that’s loading has an other1 tag defined to it?
Looking at the php that returns the export variables, other1 maps to
$othertag
and other2 maps to$othertag1
-
This post is deleted! -
Well, this seems strange to me…
I can see the field populated in the GUI, but if I look in the database in the inventory table for host ID 248, the iOtherTag and iOthertag1 tables are empty -
This post is deleted! -
@Greg-Plamondon said in Postdownload scripts variable issues.:
Well, this seems strange to me…
I can see the field populated in the GUI, but if I look in the database in the inventory table for host ID 248, the iOtherTag and iOthertag1 tables are emptyiID 248 wasn’t the host i thought it was. I needed to search for I iHostID 248 set the other tag to a specific string and verified it was getting set in the database, So it is getting set in the table from the GUI.
-
@Tom-Elliott said in Postdownload scripts variable issues.:
@Greg-Plamondon Are you sure the machien that’s loading has an other1 tag defined to it?
Looking at the php that returns the export variables, other1 maps to
$othertag
and other2 maps to$othertag1
Tom,
I ran this query on the fog database to confirm the field is populate.
SELECT * -> FROM inventory -> WHERE iHostID = 248; +-----+---------+--------------+-----------+------------+---------------------+---------------------+---------+-------------+-------------------+------------+---------------+--------------+-------------+------------+--------+----------------+------------------------------+-----------+----------+----------------------+------------------------------------------+-------------------------+---------------------+----------------------+---------------------------+-------------+----------------+----------+----------+-------------+------------+--------------------------------------+-------------------+-----------------+ | iID | iHostID | iPrimaryUser | iOtherTag | iOtherTag1 | iCreateDate | iDeleteDate | iSysman | iSysproduct | iSysversion | iSysserial | iSystype | iBiosversion | iBiosvendor | iBiosdate | iMbman | iMbproductname | iMbversion | iMbserial | iMbasset | iCpuman | iCpuversion | iCpucurrent | iCpumax | iMem | iHdmodel | iHdfirmware | iHdserial | iCaseman | iCasever | iCaseserial | iCaseasset | iSystemUUID | iGpuvendors | iGpuproducts | +-----+---------+--------------+-----------+------------+---------------------+---------------------+---------+-------------+-------------------+------------+---------------+--------------+-------------+------------+--------+----------------+------------------------------+-----------+----------+----------------------+------------------------------------------+-------------------------+---------------------+----------------------+---------------------------+-------------+----------------+----------+----------+-------------+------------+--------------------------------------+-------------------+-----------------+ | 205 | 248 | | HOME | HOME | 2022-05-18 15:47:26 | 0000-00-00 00:00:00 | LENOVO | 10MR0004US | ThinkCentre M710q | MJ080Q8C | Type: Mini PC | M1AKT48A | LENOVO | 11/22/2019 | LENOVO | 3111 | SDK0J40697 WIN 3305170406748 | | | Intel(R) Corporation | Intel(R) Core(TM) i5-7500T CPU @ 2.70GHz | Current Speed: 2600 MHz | Max Speed: 3300 MHz | MemTotal: 7934940 kB | SAMSUNGMZVLB256HAHQ-000L7 | 1L2QEXD7 | S41GNX1KA42571 | LENOVO | None | MJ080Q8C | | e3669280-1ea8-11e9-892a-6e6ca85d4600 | Intel Corporation | HD Graphics 630 | +-----+---------+--------------+-----------+------------+---------------------+---------------------+---------+-------------+-------------------+------------+---------------+--------------+-------------+------------+--------+----------------+------------------------------+-----------+----------+----------------------+------------------------------------------+-------------------------+---------------------+----------------------+---------------------------+-------------+----------------+----------+----------+-------------+------------+--------------------------------------+-------------------+-----------------+ 1 row in set (0.001 sec)
-
To debug a little further, I placed an echo statement and debugPause before the case statement.
echo "Othertag = $othertag" debugPause case $othertag in [Hh][Oo][Mm][Ee]) . ${postdownpath}fog.replace-files_home . ${postdownpath}fog.eastereggs . ${postdownpath}fog.drivers ;; [Bb][Aa][Yy]) . ${postdownpath}fog.log . ${postdownpath}fog.replace-files_bay . ${postdownpath}fog.eastereggs . ${postdownpath}fog.drivers . ${postdownpath}fog.ad_bay ;; [Kk][Ee][Ee][Nn][Aa][Nn]) . ${postdownpath}fog.log . ${postdownpath}fog.replace-files_keenan . ${postdownpath}fog.eastereggs . ${postdownpath}fog.drivers . ${postdownpath}fog.ad_keenan ;; [Mm][Tt][Ss]) . ${postdownpath}fog.log . ${postdownpath}fog.replace-files . ${postdownpath}fog.eastereggs . ${postdownpath}fog.drivers . ${postdownpath}fog.ad_mts ;; *) . ${postdownpath}fog.log . ${postdownpath}fog.replace-files . ${postdownpath}fog.eastereggs . ${postdownpath}fog.drivers . ${postdownpath}fog.ad_mts ;; esac
While running a debug deploy, it returned: Othertag=
-
@Greg-Plamondon I forget what version of fog you’re running but I suspect (and had just forgotten initially, apologies) that you need to get the token:
Process for that is as such:
Would be to change:curl -A "" -Lkso /tmp/hinfo.sh "${web}/service/hostinfo.php?mac=$mac"
To:
base64mac=$(echo $mac | base64) token=$(curl -Lks --data "mac=$base64mac" "${web}status/hostgetkey.php") curl -A "" -Lkso /tmp/hinfo.sh --data "sysuuid=${sysuuid}&mac=$mac&hosttoken=${token}" "${web}service/hostinfo.php"
Hopefully this helps?
-
@Tom-Elliott
That was it, Tom. Thank you so much for helping me with this. I was starting to lose some hair! -
T Tom Elliott has marked this topic as solved