W
W
webrapinfo2021-04-20 10:01:42
Automation
webrapinfo, 2021-04-20 10:01:42

How can you implement automatic shutdown of servers in Python?

Good afternoon. A task has arisen. I want to try to implement in Python recently started learning.
The essence of the problem.
1) Power is turned off - Turns on UPS
2) While the server's UPS is turned off "Shutdown"
I see the logic as follows: There is a lot of network equipment in the building that can serve as an indicator of a power outage.
You can ping 10 routers. If everything returns the result is that all hardware is not available. Then run the server shutdown script.
Ideally, the script should run on 1 server and extinguish all PCs with a check and turn itself off at the end.
PS. I don’t understand yet just how to go to a computer on the network on Payton and give it a shutdown command.
Thanks in advance to everyone who has shared their thoughts.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question