diff --git a/examples/limcontrol.py b/examples/limcontrol.py new file mode 100644 index 0000000..ca5a61e --- /dev/null +++ b/examples/limcontrol.py @@ -0,0 +1,18 @@ +from pythonlsf import lsf + + +# the hostname you want to operate lim running on +host = "your_hostname" + +# set opCode to 1 if you need to reboot lim +#set to 2 if you want to shutdown it +opCode = 1 + +if lsf.lsb_init("test") > 0: + print("failed to initialize") + exit +if lsf.ls_limcontrol(host, opCode) == 0 : + print("host operated successfully") +else : + print("host operated failed") + diff --git a/examples/restartMbd.py b/examples/restartMbd.py new file mode 100644 index 0000000..dc6a29f --- /dev/null +++ b/examples/restartMbd.py @@ -0,0 +1,15 @@ +from pythonlsf import lsf + +req = lsf.mbdCtrlReq() +req.opCode = 0 +req.message = "" +req.name = "mbd" + +if lsf.lsb_init("test") > 0 : + print("failed to initialize") + exit +if lsf.lsb_reconfig(req) == 0 : + print("mbd restarted successfully") +else : + print("failed to restart mbd") +