How to run nas scripts from the command line

Document ID : KB000034621
Last Modified Date : 14/02/2018
Show Technical Document Details

Summary:

How to run NAS probe scripts from the command line using the probe utility.



Instructions:

If you want to run a script, e.g db_dump.lua from command line and the script is located under $NIM_ROOT\probes\service\nas\scripts\custom folder then you need to run the script using the following format:

$NIM_ROOT\bin\pu.exe -u <Nimsoft user_name> -p p@swword /NMS/NMS-Server/NMS-Robot/nas script_run name "custom\db_dump.lua"

"e:\Program Files (x86)\Nimsoft\bin\pu.exe" -u administrator -p password /NMS/NMS-Server/NMS-Robot/nas script_run name "custom\db_dump.lua"

Note that "scripts" is the starting folder for nas scripts so you don't want to include that in the path. For example:

"e:\Program Files (x86)\Nimsoft\bin\pu.exe" -u administrator -p password /NMS/NMS-Server/NMS-Robot/nas script_run name "scripts\custom\db_dump.lua"

That and any incorrect path will give the following error:

May 9 09:13:09:880 pu: SSL - init: mode=0, cipher=DEFAULT, context=OK
======================================================
Address: /NMS/NMS-Server/NMS-Robot/nas Request: script_run
======================================================
script_run failed: error