Distribution of Zebra Lifeguard updates based on installed version

Solved
M
MaikStrassmann
KWS SAAT SE

Hi,

I've been asked to make sure that our Zebra devices always have the highest LifeGuard security updates installed.
Unfortunately, some of our devices are seasonally used devices. Some are also in continuous use.
Now Zebra has full updates and then delta updates.
I would like to have the updates done with a FileSync at the weekend, maybe with the help of the task scheduler.

How do you distribute the updates?


I would need the following functionality somehow:
If "OEM Version" < Full Update then install Full Update
if "OEM Version" < Delta 1 Update then Install Delta 1".
if "OEm Version" < Delta 2 Update then Install Delta 2".
and so on.
Unfortunately, we will have very different versions as the systems gradually report in.

But something like "if" does not seem to work with the legacy Scripting. With JavaScript I currently dont see the option to get the information from "OEM Version"

How could I best solve this? I would then build in another IF query for each upcoming version until a new full update comes along at some point.

2 years ago
SOTI MobiControl
ANSWERS
7
74HCT04
2 years ago

I think mobicontrol.os.buildNumber gets you the OEM Version - at least it does on my Honeywell devices. Try this Javascript on a test device:

mobicontrol.log.info(mobicontrol.os.buildNumber);

See here for more information and an example with an if statement: https://www.soti.net/mc/help/javascriptapi/en/mobicontrol.os.html#.buildNumber

Sorry that this isn't a full answer to your question, but perhaps it will get you started.

Solution
M
MaikStrassmann
2 years ago

Same with Zebra.

Thanks! I will some Javascript Action then :)

7
74HCT04
2 years ago

You're welcome. I am currently trying to do something similar to you but my 'fleet' of devices are all currently running the same firmware version. I've not finished the development yet...

Good luck!

M
MaikStrassmann
2 years ago

My current version looks like this (WIP!) Maybe it is helpful for you:

// Android 8.1.0 / API Level 27

// HIER AKTUALISIEREN!!!
const allowedVersions = ["02-52-21.00-OG-U01-STD", "02-52-21.00-OG-U02-STD", "02-52-21.00-OG-U03-STD"];


// Initialisierung des Zebra Lifeguard Updates
mobicontrol.log.info("#MST - Initiate Zebra Lifeguard Update");

// Ermittlung der aktuellen Version
const buildNumber = mobicontrol.os.buildNumber;
mobicontrol.log.info("#MST - Current Version: " + buildNumber);
const osNumber = mobicontrol.os.apiLevel;
mobicontrol.log.info("#MST - Current API Level: " + osNumber);

// Ermittlung des Batteriestatus, Ladezustands und verfügbaren Speicherplatzes
const batteryLevel = mobicontrol.battery.level;
const isCharging = mobicontrol.battery.isCharging;
const availableSpace = mobicontrol.storage.internal.availableSpace / 1073741824;

const lastAllowedVersion = allowedVersions[allowedVersions.length - 1];

// Überprüfung, ob die aktuelle Version Teil des Major Releases ist
if (allowedVersions.includes(buildNumber)) {
    mobicontrol.log.info("#MST - Current version is part of the major release, searching for possible delta updates");
    DeltaUpdateLifeguard();
} else {
    mobicontrol.log.info("#MST - Initial version too low - Starting Full Update");
    UpdateLifeguard();
}

// Durchführung des Delta Updates
function DeltaUpdateLifeguard() {
    // Überprüfung der erforderlichen Voraussetzungen für das Zebra Lifeguard Update
    if ((batteryLevel >= 0.50 || isCharging) && availableSpace >= 1 && osNumber === 27) {
        mobicontrol.log.info("#MST - Necessary requirements for Zebra Lifeguard update fulfilled");

        // Überprüfung, ob ein neues Delta Update verfügbar ist
        if (buildNumber !== lastAllowedVersion) {
            mobicontrol.log.info("#MST - New Delta Update available");
            const fileNameDelta = 'ATLAS_DELTA_UPDATE_' + lastAllowedVersion.split('-').join('_') + '.zip';
            mobicontrol.log.info(fileNameDelta);
        } else {
            mobicontrol.log.info("#MST - No further Delta Update available");
        }
    } else {
        mobicontrol.log.warn("#MST - Necessary hardware requirements for Zebra Lifeguard update not fulfilled");
    }
}

// Durchführung des Major Updates
function UpdateLifeguard() {
    // Überprüfung der erforderlichen Voraussetzungen für das Zebra Lifeguard Update
    if ((batteryLevel >= 0.50 || isCharging) && availableSpace >= 1 && osNumber === 27) {
        mobicontrol.log.info("#MST - Necessary requirements for Zebra Lifeguard update fulfilled");

        // Ermittlung des Major Releases
        const firstAllowedVersion = allowedVersions[0];
        mobicontrol.log.info("#MST - Major Release: " + firstAllowedVersion);

        // Generierung des Dateinamens für das Full Update
        const fileNameFull = 'FPU_ATLAS_' + firstAllowedVersion.split('-').join('_') + '.zip';
        mobicontrol.log.info("#MST - Full Update file name: " + fileNameFull);
    } else {
        mobicontrol.log.warn("#MST - Something went wrong");
    }
}

FB
Frank B
2 years ago

Thanks for sharing Maik !

Does anyone know then how to download that identified update file from internal SOTI server within this JAVA script ?
Is there a java command for this at all?

THX
Frank

M
MNMOD@SOTI
2 years ago

Hi Maikstrassmann,

Thank you for posting on SOTI Pulse!

I am glad that the issue got resolved and thank you for marking 74HCT04's post as Solution. If you require any more assistance, please feel free to let us know.

Have you heard? SOTI SYNC is back – this time in Munich, Germany! Save the date – 26th-28th September 2023.

Meet the experts in enterprise mobility management, mingle with peers, join our training sessions, and have fun! #SOTISYNC2023

Kind regards,

Technical Support Specialist | SOTI | +1 905.624.9828 | SOTI.net l Discussion Forum | Log a Case Online l Facebook l LinkedIn l Twitter