DX Infrastructure Management

Expand all | Collapse all

NAS Auto-operator and Script parameter

Jump to Best Answer
  • 1.  NAS Auto-operator and Script parameter

    Posted 11-10-2011 07:16 PM
      |   view attached

    Can anyone explain how to use the 'parameter' option in the NAS Auto-Operator profiles script function?  I'm trying to configure an AO profile to pass the robot name to a script and I assume that's what the 'parameter' input on the profile function is for, but I can't find any documentation on how to use it.



  • 2.  Re: NAS Auto-operator and Script parameter

    Posted 11-10-2011 07:27 PM

    you need two lines in your LUA script to pull in the argument. Do the below and robotname will be your variable to use. then you do whatever with it. 

     

     

    local data = pds.create()

    pds.putString(data,"ao_argument",robotname)



  • 3.  Re: NAS Auto-operator and Script parameter
    Best Answer

    Posted 11-10-2011 08:04 PM
      |   view attached

    In the nas AO profile the arguments/parameters are passed as a comma separated list. these will be available to the script contained in the constant SCRIPT_ARGUMENT

    Excerpt below from the NAS Tech Brief version 3.60

    SCRIPT_ARGUMENT = the argument string passed from the executing AO profile.

     

    In the lua script you will extract the individual arguments into an array like this

     

    args = split(SCRIPT_ARGUMENT,"/,") --split the string at the comma into individual elements

     

    If I only pass in one argument, like robotname, then I could just use something like this

    robotname = SCRIPT_ARGUMENT

    or just use the SCRIPT_ARGUMENT constant to reference the robotname.

    Attachment(s)



  • 4.  Re: NAS Auto-operator and Script parameter

    Posted 11-10-2011 08:29 PM

    Wow much easier than the way i have use it :smileyhappy: Thanks !



  • 5.  Re: NAS Auto-operator and Script parameter

    Posted 11-10-2011 09:29 PM

    Thanks, I believe that should provide what I need.



  • 6.  Re: NAS Auto-operator and Script parameter

    Posted 11-10-2011 08:49 PM

    Also if you want the Robot Name for the Current Alarm that the AO is processing you can use the below. Using Alarm.get can get any information for the alarm.

     

    Local a

    a = alarm.get()

    printf(a.robot)

     

     

    The NAS PDF has a full listing of the alarm.get info.