DX Unified Infrastructure Management

  • 1.  NAS Scripts passing parameters

    Posted Aug 16, 2017 10:52 AM

    How do i pass an argument or multiple arguments into a NAS script so i dont have to create the same script multiple times but with a different host name in each one?



  • 2.  Re: NAS Scripts passing parameters

    Broadcom Employee
    Posted Aug 16, 2017 04:56 PM

    HI can you provide mode details?

    Usually when using a nas script you read in the information from the alarm

    so the host, or IP or robot name is in the incoming alarm and you can use that as needed in the script.

     

    If you can provide an example of what you are trying to accomplish we might be better able to help you.



  • 3.  Re: NAS Scripts passing parameters

    Posted Aug 17, 2017 06:18 PM

    You don't indicate how you are running the nas script so the answer here will vary.

     

    If this is an AO profile that's running a script, on the profile definition there's a place to put arguments. In your LUA code you'd access that argument value with something like:

     

    local recipient = SCRIPT_ARGUMENT

     

    If you are running the script from the command line, it puts the parameters into a table called arg. At least that's my recollection.

     

    -Garin



  • 4.  Re: NAS Scripts passing parameters

    Posted Aug 18, 2017 03:51 AM

    the plan is to use a profile to call the script and to pass in a host name as an argument. ive seen the arguments in the profile definition but it doesnt seem to be working when im testing the scripts. 



  • 5.  Re: NAS Scripts passing parameters

    Posted Aug 20, 2017 06:06 PM

    Hi,

     

    NAS Scripts dont take start arguments. A Bash/Perl/Java script should match your need no ?

     

    Best Regards,

    Thomas



  • 6.  Re: NAS Scripts passing parameters

    Posted Aug 21, 2017 03:40 AM

    Thomas is actually incorrect, you can pass arguments to an AO profile. 


    https://communities.ca.com/thread/241722025