Dos/Cmd Error Handling - Symantec ALTIRIS DEPLOYMENT SOLUTION 6.9 SP4 - V1.0 Manual

Table of Contents

Advertisement

Logevent
Parameter
[-c:#]
[-l:#]
[-ss:Msg]
[-n:Prog]

DOS/CMD Error Handling

Deployment Solution
To provide additional feedback when running scripts, Altiris provides an error logging
utility, called logevent, for DOS, Windows, and Linux.
This utility lets you send error, warning, and informational messages back to your server
from within scripts, and job execution can be stopped based on the messages you
return.
When executing scripts, it is important to note that DS cannot stop script execution
directly; DS delivers the script and returns the execution status, but the operating
sytem handles the actual execution. DS does not automatically stop script processing
when an error is encountered, you must provide that logic in your script.
Usage:
LOGEVENT
[-c:#] [-l:#] [-ss:Msg] [-n:Prog]
Description
A ReturnCode between -32768 and +32767. Default = 0
Additional indicator of type of message.Where # = 0-3; 0 = Unknown, 1
= Information, 2 = Warning,
Any string enclosed in double quotes. Default = "No Message"
Name of the program that was executed. Default = "User Defined"
In the DOS automation environment, the logevent utility is called LOGEVENT, and is
available on your eXpress share. Since this is the default directory in the automation
environment, LOGEVENT can be executed directly in your scripts.
In the Windows production environment, the logevent utility is called WLogevent.exe. In
order to use WLogevent.exe, you must make the executable available to the Windows
client, either by providing it with an image, a software deployment, or by simply copying
the file directly before your script executes.
On DOS, events are queued until the script completes and they are returned to the
server. The Windows and Linux utilities return messages as soon as they are
encountered.
The following script uses GOTO commands to control how a script is processed based on
the outcome of executed commands, and uses logevent to return the script status:
@ECHO OFF
REM Call requestNewHardware.exe. This fails and returns an error.
requestNewHardware.exe
IF ERRORLEVEL 2 GOTO TWO
IF ERRORLEVEL 1 GOTO ONE
GOTO END
:TWO
Deploying Scripts
238

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ALTIRIS DEPLOYMENT SOLUTION 6.9 SP4 - V1.0 and is the answer not in the manual?

This manual is also suitable for:

Altiris deployment solution 6.9 sp4

Table of Contents