Hi,
I want to use the same logic to call the ntservices probe to stop and start the following ntservices: MSFTPSVC, W3SVC, HTTPFilter and IISADMIN. I have been trying out a few tricks but could not pull the rabbit out of the hat. Perhaps you have a better trick?
This is my none-working function
function SYBERJOBS_maui_IIS (robot_addr)
local svr_name = "SYBERJOBS-maui-IIS"
args = pds.create()
pds.putString(args,"command","stop_service MSFTPSVC")
pds.putString(args,"command","stop_service W3SVC")
pds.putString(args,"command","stop_service HTTPFilter")
pds.putString(args,"command","stop_service IISADMIN")
pds.putString(args,"command","start_service MSFTPSVC")
pds.putString(args,"command","start_service W3SVC")
pds.putString(args,"command","start_service HTTPFilter")
pds.putString(args,"command","start_service IISADMIN")
ret = nimbus.request (robot_addr.."/ntservices", "stop_service", args)
ret = nimbus.request (robot_addr.."/ntservices", "start_service", args)
if ret == nil then
nimbus.alarm(4,"AutoRestart: ntservices probe is NOT running on "..robot_addr)
printf("Failed to reach the ntservices probe. Make sure ntservices is running on "..robot_addr)
elseif ret.exit_value ~= 0 or ret.signal_num ~= 0 or ret.dumped_core ~= 0 then
nimbus.alarm(4, "AutoRestart "..svr_name.." FAILED with exit_value = "..ret.exit_value..", signal_num = "..ret.signal_num..", dumped_core = "..ret.dumped_core)
printf("Failed to Restart "..svr_name.." with exit_value = %d, signal_num = %d, and dumped_core = %d",ret.exit_value,ret.signal_num,ret.dumped_core)
printf("Take a look into this Restart ASAP")
else
nimbus.alarm (1,"AutoRestart "..svr_name.." OK with exit_value = "..ret.exit_value..", signal_num = "..ret.signal_num..", dumped_core = "..ret.dumped_core)
printf("Successful Restart of "..svr_name.." with exit_value = %d, signal_num = %d, and dumped_core = %d",ret.exit_value,ret.signal_num,ret.dumped_core)
printf("0 is normal")
end
end
Thanks,
Hoang