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
args = pds.create()
pds.putString (args,"profile","Customer failover")
reply,rc = nimbus.request(probeaddr1,"run_profile",args)
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:email@example.com profile:Customer failover returned:1
Just to clarify, I am seeing the majority of results return a 0 and I can confirm ran successfully.