DX Infrastructure Manager

Expand all | Collapse all

LUA - Probe restart Script

Jump to Best Answer
  • 1.  LUA - Probe restart Script

    Posted 11-20-2014 06:50 PM

    Hi all,

     

    I'm pretty sure this has been answered many different times and in many different forms.

     

    I'm after a LUA scipt that will automatically restart the E2E_appmon probe on an External Hub of ours.

     

    I have found this script to restart the qos_processor on our Primary Hub, which works fine:

     

    addr = "/MDS/mdsmonl1/mdsmonl1/hub" -- insert the Nimsoft address for the robot where the hub runs
    probe = "qos_processor" -- specify the probe to be restarted
    local args = pds.create() -- create data structure to pass arguments to probe callbacks
    pds.putString(args,"name",probe)
    nimbus.request("qos_processor","_restart",args)
    pds.delete(args)

     

    I thought I would be able to change the PROBE name and the ADDR, it appears to run if I run this:

     

    addr = "/MDS/stecrmnimp001/stecrmnimp001/hub" -- insert the Nimsoft address for the robot where the hub runs
    probe = "e2e_appmon" -- specify the probe to be restarted
    local args = pds.create() -- create data structure to pass arguments to probe callbacks
    pds.putString(args,"name",probe)
    nimbus.request("e2e_appmon","_restart",args)
    pds.delete(args)

     

    I am a little confused as to what the second script is doing as my E2E_appmon probe doesn't sit on the stecrmnimp001 Server, it is located on another Server that reports to that Hub..

     

    There are other E2E_appmon probes located under this Hub...could it be restarting them all?

     

    If anyone has any ideas or scripts in your stockpile I'd love to have a copy? :smileyhappy:

     

    Thanks in advance,

    Sam



  • 2.  Re: LUA - Probe restart Script
    Best Answer

    Posted 11-20-2014 09:12 PM
    Got it:

    al = alarm.get("CS19805817-46323")
    robot_addr = "/"..al.domain.."/"..al.hub.."/"..al.robot
    rc = nimbus.request(robot_addr.."/e2e_appmon", "_stop")
    if not rc then
    nimbus.alarm(5, "Failed to restart E2E_appmon")
    end

    Tied this with a Schedule I can restart the probe as little, or as often as I want :smileyhappy:

    This will now fix my E2E errors :smileytongue: