You can also do this with the Probe Utility against the robot . Use 'maint_until' and specify how long it should be in maintenance mode for, leave 'until' empty (this is an epoch number), and specify how many seconds in the 'for' parameter.
For example:
pu -u administrator -p xxxxxxxx /"full path to robot"/controller maint_until for 120 until ""
Remember to always include all parameters and leave the "blank" ones in the end.
The call back for the controller is:
maint_until (until, for)
To enter maintenance mode:
Specify either the 'until' value, which is a time value representing the time in seconds since the Epoch (00:00:00 UTC, January 1, 1970) or the 'for' value which is the time in seconds you want the robot to stay in maintenance mode.
To leave maintenance mode:
Use the same call but do not specify neither 'until' nor 'for'.
Another option (as previously suggested) is via Lua - all credit for the below goes to James Christensen:
----------------------------------------------------------------------------------------------------------------------------------------------------------------
You will need to edit the duration (it is in seconds), the hub name and the hub robot name. Please note that this script purposely skips putting the hub robot into maintenance for good reason. A timestamped log file is also created that will list the robots as they are put into maintenance or, in the case of the hub robot, skipped.
-------------------------------- NAS script to place all robots reporting to specified hub into maintenance mode ---------------
local duration = 60 --edit per hub - note this is in seconds local hubName = "jmc-lt-dev" --edit per hub local hubRobot = "jmc-w2k3" -- edit per hub local nmsDomain = "JMC_LT_DEV" --edit per hub local hubAddr = "/"..nmsDomain.."/"..hubName.."/"..hubRobot.."/"
local myBuffer ="ITA Scheduled Maintenance Script for "..hubName.."\n"
local fts = timestamp.format (timestamp.now(),"%d_%b_%Y_%H_%M_%S")
local ts = timestamp.format (timestamp.now(),"%c")
myBuffer = myBuffer..ts.."\n"
myBuffer = myBuffer.."Maintenance Period Duration:
"..tostring(duration).." seconds\n"
local val,rc = nimbus.request( hubAddr.."hub","getrobots") print("return code:"..tostring(rc)) if val ~= nil then
print("Val is not null and type is: "..type (val))
for i,a in pairs(val) do
print("a is not null and type is: "..type(a))
if a ~= nil then
if type(a) == "table" then
for b,t in pairs(a) do
if t.name == hubRobot then
print("Found hub robot: "..t.name)
myBuffer = myBuffer.."Found hub robot....Skipping\n"
else
local myArgs = pds.create ()
pds.putString (myArgs, "until", "")
pds.putInt (myArgs, "for", duration)
pds.putString(myArgs, "comment", "ITA Scheduled Maintenance Script")
local rc = nimbus.request(t.addr.."/controller",
"maint_until", puPds)
pds.delete(myArgs)
myBuffer = myBuffer..t.name..": "..t.addr.."\n"
print(t.name)
print(t.addr)
end
end
end
end
end
end
file.create ("C:\\ITA Scheduled Maintenance_"..fts..".log",myBuffer)
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Good luck!
Dustin