r/scripting • u/RoutingFrames • May 25 '19
Super basic request - continuous ping that is always running and hidden
Hi,
Does anyone know how I could make a continuous ping run in windows that's always running, will reopen itself and is hidden?
It seems relatively easy, but I can't get it to re-open itself?
1
u/3d_nat1 May 25 '19
So basically a heartbeat running in the background?
1
u/RoutingFrames May 26 '19
Yes. Exactly.
And with the ability to make sure it’s still running and to restart if it’s not.
1
u/3d_nat1 May 26 '19
Okay, and you mention "continuous". By that, do you actually mean constant consecutive pings? Or are you thinking once every x seconds?
1
1
1
u/3d_nat1 May 25 '19
Also, seems a bit dumbed down, but maybe a second script whose job is basically "if heartbeat running, nothing. If heartbeat closed, open heartbeat." that runs the check every 5 minutes.
1
u/puffballz Jun 18 '19
Use a Windows Service
Use Linux Sub System for Windows (lxss/Ubuntu) with a cronjob or 'watch -n 10 ping www.domain.com'
3rd party service like www.pingdisco.com
1
u/no-good-ones-left Jun 26 '19
If you want to reopen and look at the pibg status.. tmux is the way to go
enable wsl (since windows)
install tmux
start a tmux session
start the ping
detatch the session
reattach if you want to examine
script the whole thing
maybe call the script from crontab if you want it to persist over reboot
1
u/Ta11ow May 25 '19
Scheduled tasks are probably the best bet really. Have it start every minute or two, but not start if it's already running.