AnsweredAssumed Answered

How to ensure nexec script executes via LUA script

Question asked by mroberts on Apr 15, 2011
Latest reply on Apr 19, 2011 by geir.haugom

Hi all,

 

I have a script that executes an nexec command when a trigger state is met. It is working, but occasionally the script fires, but in nexec the audit log result returns a one and in my logs I can see that the script did not execute. Is there a way I can return the result (either a 0 or a 1) and rerun the command if it fails?

 

Here is the relevant part of my current script (email variables left out and details changed):

 

if trigger.state ("Customer_Primary") and not trigger.state("Customer_Secondary") then
   probename="nexec"
      probeaddr1="/MyDomain/PrimaryDomain/myserver02/nexec"
      args = pds.create()
      pds.putString (args,"profile","Customer failover")
      reply,rc = nimbus.request(probeaddr1,"run_profile",args)
      pds.delete(args)
   action.email (recipients,title1,body1)
   end

 

And here is what I'm seeing in my nexec audit log when the command fails to run:

 

2011-04-16 01:41:03    user:nas@172.50.1.240    profile:Customer failover    returned:1

 

Just to clarify, I am seeing the majority of results return a 0 and I can confirm ran successfully.

 

Thanks!

 

Mark

Outcomes