NAS scripting assistance

Discussion created by pbehrensmeyer on Sep 1, 2010
Latest reply on Sep 1, 2010 by carstein.seeberg

We would like to set up a condition in the NAS where if a certain alarm is found, for example, after power failure, robots generates a robot inactive with IP address, we want to programatically restart the nimbus_watcher via a AO script via $hostname.   However, I am having difficulty getting this to execute through either the COMMAND auto-operator rule or a LUA script executed via the SCRIPT auto-operator rule.

The script is simple and will connect to a server, fed in as an argument ,via WMI and restart the NimbusWatcherService. The command syntax verified working through command line is "wscript <C:\path\script> <server>". Runas permissions are set in the script itself to avoid permission issues as Nimsoft will execute the script from SYSTEM.

When trying to execute through COMMAND auto-operator, I get path failures because it takes "\" in the path as the end of the line, so it will consider the actual script as an argument and generate unknown command or path not found - error below.

Aug 25 09:34:17:994 [4728] nas: Execute command: 'wscript "C:\RestartNimbus.vbs"', \RestartNimbus.vbs" customerhub arguments: 'RestartNimbus.vbs" customerhub'
Aug 25 09:34:17:994 [4728] nas: Execute command FAILED: 'wscript "C:\RestartNimbus.vbs"' - The filename, directory name, or volume label syntax is incorrect.

When trying to execute via a LUA script auto-operator
os.execute("wscript " .. '"'C:\RestartNimbus.vbs'"' .. " $hostnamel")
a wscript process will be launched but will time out after a long period of time, leading me to believe that the arguments are not being passed appropriately.

Any advice on how to proceed would be greatly appreciated.