A variable of the bundle name or the actual bundle version would be nice.
At the moment I do this manually by adding/editing a System Variable at the bundle.

I use this to document a bundle installation in the registry for reporting purposes and special update scripts.

Comments

  • we need this, too

  • This is a good idea! And probably very easy to implement in ZENworks!

  • This is an excellent idea and I was actually going to submit something very similar but now I can just paste it here:

    We want to leverage the built-in appliance logging and not manage separate log files when building Linux bundles with script actions.

    This can be done by using some code like this:

    script_logger () {
    /usr/bin/logger --prio-prefix "${SYSLOG_LEFT_SEP}${SYSLOG_TAG}${SYSLOG_RIGHT_SEP} ${SYSLOG_LEFT_SEP}${BUNDLE_NAME}${SYSLOG_RIGHT_SEP}" -- $*
    }

    Then call that function to log something:

    script_logger "Starting script"
    script_logger "End script with ${USERADD_EXIT}"

    We chose to leverage variables for a lot of things including the separators. Since we are putting everything into a centralized log, we felt consistency was extremely important for parsing and analysis. We set all of those variables at a high level so they are pretty much set and forget. What we wind up with in the logs are clean and consistent lines that look like:

    [DATE] [TAG(We use our Team name)] [Bundle Name] Don't read me, I am not a real log entry.

    This requires that we create a variable for every bundle with a run script action that is the bundle name itself which feels redundant. If the bundle name changes, we have to remember to change the variable. If the bundle has to run multiple scripts or is part of a complex chain then having the action name would also be extremely helpful but we have not found a feasible way to do this.

    Request:

    We would like the agent to have a few global variables that can be queried at any time: 1) The name of the currently running bundle, and 2) the name of the currently running action. The bundle name just saves time and reduces human error. The action name allows for simplified troubleshooting and auditing. We think it makes sense for these same variables to be available on all platforms, not just Linux. We just first encountered it on appliances.

  • this idea would have many very useful benefits

  • Thank you Chad for sharing your solution.