DX Unified Infrastructure Management

Expand all | Collapse all

How to Utilize Auto-operator>script and nexec probe to bind any specific alarm generated from a robot to a script or an application.

  • 1.  How to Utilize Auto-operator>script and nexec probe to bind any specific alarm generated from a robot to a script or an application.

    Posted Aug 11, 2017 08:34 AM

    Hi all,

     

    I want to execute an application inside some of my robots/servers when ever a physical memory alert is triggered in UIM.

     

    How to achieve this with the help of auto-operator in nas probe and nexec probe?

     

    All Inputs are welcome!

     

    Regards,

    Saju Mathew



  • 2.  Re: How to Utilize Auto-operator>script and nexec probe to bind any specific alarm generated from a robot to a script or an application.



  • 3.  Re: How to Utilize Auto-operator>script and nexec probe to bind any specific alarm generated from a robot to a script or an application.

    Posted Aug 15, 2017 07:26 AM

    Hi Franklin,

     

    Thank you for the KBs. I have question on same. The nexec probe should be inside the NAS or all individual robot to get the script work?

     

    Regards,

    Saju Mathew



  • 4.  Re: How to Utilize Auto-operator>script and nexec probe to bind any specific alarm generated from a robot to a script or an application.

    Posted Aug 15, 2017 07:26 AM

    Sorry Inside the core HUB... not NAS. By bad!



  • 5.  Re: How to Utilize Auto-operator>script and nexec probe to bind any specific alarm generated from a robot to a script or an application.

    Broadcom Employee
    Posted Aug 15, 2017 07:52 AM

    nexec probe can be deployed to the various robots with profiles configured to run the desired
    scripts/commands. These profiles can be executed via LUA script from the nas (central point) via
    nimbus.request() calls in response to specific alarms.

     

    https://search.ca.com/assets/SiteAssets/TEC000003305_External/cnvnexec2.pdf



  • 6.  Re: How to Utilize Auto-operator>script and nexec probe to bind any specific alarm generated from a robot to a script or an application.

    Posted Aug 15, 2017 11:30 AM

    Hi Franklin,

     

    When ever I try a=alarm.get()... I get error attempt to index global 'a' (a nil value). What can be done for this?

     

    Regards,

    Saju Mathew 



  • 7.  Re: How to Utilize Auto-operator>script and nexec probe to bind any specific alarm generated from a robot to a script or an application.

    Posted Aug 18, 2017 09:46 AM

    The script I am trying inside the NAS to get Alarm is:, please correct me If I am doing anything wrong.

     

    a=alarm.get()
    nimid=a.nimid
    domain=a.domian
    hub=a.origin
    robot=a.robot
    addr="/"..domain.."/"..hub.."/"..robot.."/nexec/"

    pdsIn=pds.create ()
    pds.putString (pdsIn,"profile","Script1")
    outTable=nimbus.request(addr,"run_profile",pdsIn)
    stdout=outTable['stdout']
    print("Output is"..stdout)
    notepds=pds.create ()
    pds.putString(notepds,"nimid",nimid)
    pds.putString(notepds,"Discription","Output from Exec")
    pds.putString(notepds,"body",stdout)
    nimbus.request("nas","note_attach",notepds)



  • 8.  Re: How to Utilize Auto-operator>script and nexec probe to bind any specific alarm generated from a robot to a script or an application.

    Posted Sep 20, 2018 08:23 AM

    saju_mathew Did you ever get a reply to this? I as well am looing at and trying to test this example from the PDF mentioned. I am getting the exact same LUA error and the script is copied from the PDF documentation exactly?

     

    "Error in line 2: attempt to index global 'a' (a nil value)"

     

    Anyone else solve this?



  • 9.  Re: How to Utilize Auto-operator>script and nexec probe to bind any specific alarm generated from a robot to a script or an application.

    Broadcom Employee
    Posted Sep 20, 2018 09:18 AM

    I presume you are testing this in the NAS script window.

    The script above is setup for when it is tied to an AO profile and the alarm details will be place in "a”

     

    When you are testing in the NAS gui you need to comment out that line "a=alarm.get()” and replace with "a=alarm.get("RC43670325-12873")”

    Where the id in quotes is the nimid of a CURRENT alarm in the NAS, ie the alarm you want to trigger the script.

     



  • 10.  Re: How to Utilize Auto-operator>script and nexec probe to bind any specific alarm generated from a robot to a script or an application.

    Posted Sep 20, 2018 09:42 AM

    RowanCollis ok understood. Specifically I am most interested in the piece of the code that calls an nexec profile. Is there a chance you have an example or can cut that piece out and give me an example of just the LUA script that runs one of the nexec profiles on a robot?



  • 11.  Re: How to Utilize Auto-operator>script and nexec probe to bind any specific alarm generated from a robot to a script or an application.

    Broadcom Employee
    Posted Sep 20, 2018 09:56 AM

    Here you go…

     

    this assumes there is a profile called test-script in the nexec on the robot already

     

    nimAddr = "/"..al.domain.."/"..al.hub.."/"..al.robot.."/nexec"

    args = pds.create()

    profile = "test-script"

    pds.putString(args,"profile",profile)

    reply,rc = nimbus.request(nimAddr,"run_profile",args)

     

    if rc ~= NIME_OK then

       print("fire nexec script: ERROR on run profile to "..nimAddr.." (error "..rc..")")

    else

       print("fire nexec script worked!!!")

    end