A
A
Anton Forzin2021-12-08 10:10:18
Python
Anton Forzin, 2021-12-08 10:10:18

How to set up automatic reboot of the device when network availability is lost?

Good day! :)

Recently, devices have become often lose network availability. More than a thousand pieces of equipment are being remotely maintained (OS Windows 7.10). After rebooting the nettop in place - network availability is restored.
Perhaps someone has options for solving this situation, using automatic reboot through a script or through Zabbix-Agent, when a trigger fires?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
pfg21, 2021-12-08
@LastJunior

ping -n 1 ya.ru
if "%ERRORLEVEL%"=="1" shutdown /r /t 1
into scheduled tasks. run every 5 minutes.

A
Alexander, 2021-12-08
@Dem0lisher

I wrote similar batch files for myself a long time ago. At one job, we often fell off and, no, for a short time. And the reboots just tormented. And once tupanul - the computer itself reboots and that's it. Only then I remembered that there is such a batch file in the system.
In short turned off

P
pxaJJ, 2021-12-09
@pxaJJ

ping (although this happens quite rarely) returns 0 if there is no connection
Better to use something like:
ping -n ya.ru | find "(0" >nul
if not "%ERRORLEVEL%"=="0" shutdown /r /t 1
Here search "(0" is search for "(0% loss" in case of Russian localization.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question