DSM Script - Unknown variable: COMPUTERPATH

book

Article ID: 6297

calendar_today

Updated On:

Products

CA Automation Suite for Data Centers - Configuration Automation CA Client Automation - Asset Management CA Client Automation - IT Client Manager CA Client Automation CA Client Automation - Remote Control CA Client Automation - Asset Intelligence CA Client Automation - Desktop Migration Manager CA Client Automation - Patch Manager

Issue/Introduction

When executing a dms script manually with dmscript following error occurs "Unknown variable: COMPUTERPATH"

 

On Windows following message appears: 

<Please see attached file for image>

1.jpg

 

On Unix/Linux following message appears:

 

<Please see attached file for image>

2.jpg

 

Environment

Release: UASIT.99000-12.8-Asset Intelligence
Component:

Resolution

This problem occurs if the DMS script is using a predefined AM string constant like ComputerPath and this variable has not be initialized.

 

On Windows

dmscript.exe executes a command like this in order to generate a file with values for all AM constants :

amagentsvc "/computerscriptvars=c:\users\Administrator\AppData\Local\Temp\dms6717.tmp"

 

But if AM Agent is running at the same time, this command fails and dmscript executes the DMS script without initialization of AM constants. It is why ComputerPath is not defined.

 

The solution is :

  • Wait that AM Agent is terminated before executing dmscript.

or

  • Execute this command when AM Agent is not running :

amagentsvc "/computerscriptvars=c:\temp\script.ini"

and execute dmscript with parameter -i_dms. This command will work even if AM Agent is running :

dmscript test.dms "-i_dms: F:\temp\script.ini"

 

<Please see attached file for image>

src="/servlet/servlet.FileDownload?file=0150c000004AKSHAA4" alt="4.jpg" width="557" height="566">

 

 

 

 

On Unix/Linux

The file with AM constants is stored under file $CA_ITRM_BASEDIR/Agent/AM/data/config/script.ini

 

Remark :

This file is created on the machine if at least one AM job of type script is attached to the machine.

If the file does not exist, create a small test script AM job and attach it on the machine. Then execute "caf start amagent".

This will create the file $CA_ITRM_BASEDIR/Agent/AM/data/config/script.ini

 

Then execute these command lines :

cp $CA_ITRM_BASEDIR/Agent/AM/data/config/script.ini /tmp

dmscript test.dms -i_dms: /tmp/script.ini

 

<Please see attached file for image>

src="/servlet/servlet.FileDownload?file=0150c000004AKSGAA4" alt="3.jpg" width="723" height="176">

 

Additional Information

See following link for a list of "Asset Management Scripting Language Predefined String Constants" :

https://docops.ca.com/ca-client-automation/14-0/en/using/desktop-management-script-interpreter/asset-management-scripting-language-predefined-string-constants

 

 

Attachments

1558714684393000006297_sktwi1f5rjvs16tjm.jpeg get_app
1558714682236000006297_sktwi1f5rjvs16tjl.jpeg get_app
1558714680317000006297_sktwi1f5rjvs16tjk.jpeg get_app
1558714678373000006297_sktwi1f5rjvs16tjj.jpeg get_app