Compare commits
16 Commits
bfa68743da
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9a0cb6d272 | |||
| 77c06befda | |||
| 638e05a13a | |||
| eaa55c69b4 | |||
| 03eb96661e | |||
| baa3b60ef3 | |||
| 2d1f10cd26 | |||
| 231051bd8f | |||
| 67eea6f149 | |||
| ff7f95e1bb | |||
| 0682019085 | |||
| e2b7d93035 | |||
| 43929736ca | |||
| f0e0bf4db8 | |||
| bd12ee9e49 | |||
| 6f77993798 |
152
Manifest.toml
152
Manifest.toml
@@ -2,18 +2,66 @@
|
||||
|
||||
julia_version = "1.12.5"
|
||||
manifest_format = "2.0"
|
||||
project_hash = "9b274fc74610c14aa65af9a9d85650d80d379917"
|
||||
project_hash = "b869f60c186657e1a66a3bb09e6f25647cba4a4b"
|
||||
|
||||
[[deps.Artifacts]]
|
||||
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.Base64]]
|
||||
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.BitFlags]]
|
||||
git-tree-sha1 = "0691e34b3bb8be9307330f88d1a3c3f25466c24d"
|
||||
uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35"
|
||||
version = "0.1.9"
|
||||
|
||||
[[deps.CodecZlib]]
|
||||
deps = ["TranscodingStreams", "Zlib_jll"]
|
||||
git-tree-sha1 = "962834c22b66e32aa10f7611c08c8ca4e20749a9"
|
||||
uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
|
||||
version = "0.7.8"
|
||||
|
||||
[[deps.ConcurrentUtilities]]
|
||||
deps = ["Serialization", "Sockets"]
|
||||
git-tree-sha1 = "21d088c496ea22914fe80906eb5bce65755e5ec8"
|
||||
uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb"
|
||||
version = "2.5.1"
|
||||
|
||||
[[deps.Dates]]
|
||||
deps = ["Printf"]
|
||||
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.ExceptionUnwrapping]]
|
||||
deps = ["Test"]
|
||||
git-tree-sha1 = "d36f682e590a83d63d1c7dbd287573764682d12a"
|
||||
uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4"
|
||||
version = "0.1.11"
|
||||
|
||||
[[deps.HTTP]]
|
||||
deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "PrecompileTools", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"]
|
||||
git-tree-sha1 = "51059d23c8bb67911a2e6fd5130229113735fc7e"
|
||||
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.InteractiveUtils]]
|
||||
deps = ["Markdown"]
|
||||
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.JLLWrappers]]
|
||||
deps = ["Artifacts", "Preferences"]
|
||||
git-tree-sha1 = "0533e564aae234aff59ab625543145446d8b6ec2"
|
||||
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
|
||||
version = "1.7.1"
|
||||
|
||||
[[deps.JSON]]
|
||||
deps = ["Dates", "Logging", "Parsers", "PrecompileTools", "StructUtils", "UUIDs", "Unicode"]
|
||||
git-tree-sha1 = "eb04df293213df64ddd720c86de3c431f5f8ccf1"
|
||||
git-tree-sha1 = "b3ad4a0255688dcb895a52fafbaae3023b588a90"
|
||||
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
||||
version = "1.2.1"
|
||||
version = "1.4.0"
|
||||
|
||||
[deps.JSON.extensions]
|
||||
JSONArrowExt = ["ArrowTypes"]
|
||||
@@ -21,10 +69,61 @@ version = "1.2.1"
|
||||
[deps.JSON.weakdeps]
|
||||
ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd"
|
||||
|
||||
[[deps.JuliaSyntaxHighlighting]]
|
||||
deps = ["StyledStrings"]
|
||||
uuid = "ac6e5ff7-fb65-4e79-a425-ec3bc9c03011"
|
||||
version = "1.12.0"
|
||||
|
||||
[[deps.Libdl]]
|
||||
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.Logging]]
|
||||
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.LoggingExtras]]
|
||||
deps = ["Dates", "Logging"]
|
||||
git-tree-sha1 = "f00544d95982ea270145636c181ceda21c4e2575"
|
||||
uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36"
|
||||
version = "1.2.0"
|
||||
|
||||
[[deps.Markdown]]
|
||||
deps = ["Base64", "JuliaSyntaxHighlighting", "StyledStrings"]
|
||||
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.MbedTLS]]
|
||||
deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "NetworkOptions", "Random", "Sockets"]
|
||||
git-tree-sha1 = "8785729fa736197687541f7053f6d8ab7fc44f92"
|
||||
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
|
||||
version = "1.1.10"
|
||||
|
||||
[[deps.MbedTLS_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl"]
|
||||
git-tree-sha1 = "ff69a2b1330bcb730b9ac1ab7dd680176f5896b8"
|
||||
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
|
||||
version = "2.28.1010+0"
|
||||
|
||||
[[deps.MozillaCACerts_jll]]
|
||||
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
|
||||
version = "2025.11.4"
|
||||
|
||||
[[deps.NetworkOptions]]
|
||||
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
|
||||
version = "1.3.0"
|
||||
|
||||
[[deps.OpenSSL]]
|
||||
deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "NetworkOptions", "OpenSSL_jll", "Sockets"]
|
||||
git-tree-sha1 = "1d1aaa7d449b58415f97d2839c318b70ffb525a0"
|
||||
uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c"
|
||||
version = "1.6.1"
|
||||
|
||||
[[deps.OpenSSL_jll]]
|
||||
deps = ["Artifacts", "Libdl"]
|
||||
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
|
||||
version = "3.5.4+0"
|
||||
|
||||
[[deps.Parsers]]
|
||||
deps = ["Dates", "PrecompileTools", "UUIDs"]
|
||||
git-tree-sha1 = "7d2f8f21da5db6a806faf7b9b292296da42b2810"
|
||||
@@ -39,9 +138,9 @@ version = "1.3.3"
|
||||
|
||||
[[deps.Preferences]]
|
||||
deps = ["TOML"]
|
||||
git-tree-sha1 = "0f27480397253da18fe2c12a4ba4eb9eb208bf3d"
|
||||
git-tree-sha1 = "8b770b60760d4451834fe79dd483e318eee709c4"
|
||||
uuid = "21216c6a-2e73-6563-6e65-726566657250"
|
||||
version = "1.5.0"
|
||||
version = "1.5.2"
|
||||
|
||||
[[deps.Printf]]
|
||||
deps = ["Unicode"]
|
||||
@@ -57,25 +156,59 @@ version = "1.11.0"
|
||||
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
|
||||
version = "0.7.0"
|
||||
|
||||
[[deps.Serialization]]
|
||||
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.SimpleBufferStream]]
|
||||
git-tree-sha1 = "f305871d2f381d21527c770d4788c06c097c9bc1"
|
||||
uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7"
|
||||
version = "1.2.0"
|
||||
|
||||
[[deps.Sockets]]
|
||||
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.StructUtils]]
|
||||
deps = ["Dates", "UUIDs"]
|
||||
git-tree-sha1 = "79529b493a44927dd5b13dde1c7ce957c2d049e4"
|
||||
git-tree-sha1 = "fa95b3b097bcef5845c142ea2e085f1b2591e92c"
|
||||
uuid = "ec057cc2-7a8d-4b58-b3b3-92acb9f63b42"
|
||||
version = "2.6.0"
|
||||
version = "2.7.1"
|
||||
|
||||
[deps.StructUtils.extensions]
|
||||
StructUtilsMeasurementsExt = ["Measurements"]
|
||||
StructUtilsStaticArraysCoreExt = ["StaticArraysCore"]
|
||||
StructUtilsTablesExt = ["Tables"]
|
||||
|
||||
[deps.StructUtils.weakdeps]
|
||||
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
|
||||
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
|
||||
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
|
||||
|
||||
[[deps.StyledStrings]]
|
||||
uuid = "f489334b-da3d-4c2e-b8f0-e476e12c162b"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.TOML]]
|
||||
deps = ["Dates"]
|
||||
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
|
||||
version = "1.0.3"
|
||||
|
||||
[[deps.Test]]
|
||||
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
|
||||
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.TranscodingStreams]]
|
||||
git-tree-sha1 = "0c45878dcfdcfa8480052b6ab162cdd138781742"
|
||||
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
|
||||
version = "0.11.3"
|
||||
|
||||
[[deps.URIs]]
|
||||
git-tree-sha1 = "bef26fb046d031353ef97a82e3fdb6afe7f21b1a"
|
||||
uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
|
||||
version = "1.6.1"
|
||||
|
||||
[[deps.UUIDs]]
|
||||
deps = ["Random", "SHA"]
|
||||
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
|
||||
@@ -84,3 +217,8 @@ version = "1.11.0"
|
||||
[[deps.Unicode]]
|
||||
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.Zlib_jll]]
|
||||
deps = ["Libdl"]
|
||||
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
|
||||
version = "1.3.1+2"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
[deps]
|
||||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
|
||||
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
|
||||
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
||||
|
||||
@@ -29,11 +29,11 @@ Both scripts run continuously in the background, performing periodic health chec
|
||||
```julia
|
||||
const ROUTER_IP = "192.168.88.1" # Target router IP address
|
||||
const TIMEOUT_SECS = 30 # Request timeout in seconds
|
||||
const ATTEMPTS_PER_CHECK = 3 # Number of ping attempts per check
|
||||
const BACKOFF_BETWEEN_ATTEMPTS = 60 # Seconds between retry attempts
|
||||
const ATTEMPTS_PER_CHECK = 1 # Number of ping attempts per check
|
||||
const BACKOFF_BETWEEN_ATTEMPTS = 1 # Seconds between retry attempts
|
||||
const FAILS_TO_REBOOT = 3 # Consecutive failures before reboot
|
||||
const COOLDOWN_AFTER_REBOOT_SECS = 600 # Minimum seconds between reboots
|
||||
const DRY_RUN = true # Set false to enable actual reboots
|
||||
const DRY_RUN = false # Set false to enable actual reboots
|
||||
const CHECK_INTERVAL_SECS = 60 # Check interval in seconds
|
||||
```
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"last_reboot_datetime":"2026-03-19T18:27:53.682","consecutive_fails":0}
|
||||
{"last_reboot_datetime":"2026-03-20T15:23:19.868","consecutive_fails":2}
|
||||
@@ -7,26 +7,33 @@
|
||||
# ------------------------------------------------------------------------------------------------ #
|
||||
# add the following to root's crontab (sudo crontab -e) #
|
||||
# ------------------------------------------------------------------------------------------------ #
|
||||
# *** juliar is root's julia (sudo crontab -e) but I symlinked to juliar because I want to seperate it from user's julia
|
||||
# @reboot /usr/local/bin/juliar /home/ton/docker-programs/check_and_reboot/check_router_reboot.jl >> /var/log/check_reboot.log 2>&1
|
||||
# @reboot /root/.juliaup/bin/julia /root/docker-apps/check_and_reboot/check_router_reboot.jl >> /var/log/check_reboot.log 2>&1
|
||||
|
||||
# ---------------- For PC that has juliar for root user and julia for normal user ---------------- #
|
||||
# linux_prompt> @reboot sleep 30 && /usr/local/bin/juliar /home/ton/docker-programs/check_and_reboot/check_router_reboot.jl >> /var/log/check_reboot.log 2>&1
|
||||
# *** juliar is julia that I install separately for root user (sudo crontab -e) which I symlinked to juliar because I want to separate it from user's julia
|
||||
|
||||
# ---------------------------------- For PC that has only julia ---------------------------------- #
|
||||
# linux_prompt> @reboot sleep 30 && /root/.juliaup/bin/julia /root/docker-apps/check_and_reboot/check_router_reboot.jl >> /var/log/check_reboot.log 2>&1
|
||||
|
||||
|
||||
|
||||
using Dates, Printf, JSON
|
||||
|
||||
# Configuration
|
||||
const ROUTER_IP = "192.168.88.1"
|
||||
const TIMEOUT_SECS = 30 # request timeout
|
||||
const ATTEMPTS_PER_CHECK = 3 # number of ping attempts per check
|
||||
const BACKOFF_BETWEEN_ATTEMPTS = 60 # seconds between attempts
|
||||
const ATTEMPTS_PER_CHECK = 1 # number of ping attempts per check
|
||||
const BACKOFF_BETWEEN_ATTEMPTS = 1 # seconds between ping attempts
|
||||
const FAILS_TO_REBOOT = 3 # consecutive failed checks required to trigger reboot
|
||||
const COOLDOWN_AFTER_REBOOT_SECS = 600 # do not reboot again within this many seconds
|
||||
const COOLDOWN_AFTER_REBOOT_SECS = 300 # do not reboot again within this many seconds
|
||||
const DRY_RUN = false # set false to actually reboot
|
||||
const CHECK_INTERVAL_SECS = 60 # run a check every CHECK_INTERVAL_SECS seconds
|
||||
|
||||
const thisFolderPath = @__DIR__
|
||||
const thisFilePath = @__FILE__
|
||||
const LogFilePath = "$thisFolderPath/check_router_reboot_log.txt" # write logs here and also broadcast
|
||||
const StateFilePath = "$thisFolderPath/check_and_reboot_state.json"
|
||||
|
||||
# println(0)
|
||||
# Simple broadcast helper
|
||||
# Simple broadcast helper (safe Cmd construction)
|
||||
function broadcast_msg(msg::AbstractString)
|
||||
@@ -120,6 +127,7 @@ function load_state(StateFilePath)
|
||||
return State(cf, DateTime(lr))
|
||||
end
|
||||
catch e
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("Warning loading state: $e")
|
||||
end
|
||||
return State(0, nothing)
|
||||
@@ -199,6 +207,7 @@ end
|
||||
function do_reboot()
|
||||
cmd = reboot_command()
|
||||
if cmd === nothing
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("Reboot not supported on this OS")
|
||||
return false
|
||||
end
|
||||
@@ -207,10 +216,11 @@ function do_reboot()
|
||||
cmd_str = join(map(x -> replace(x, '"' => "\\\""), cmd), " ")
|
||||
|
||||
if DRY_RUN
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("DRY RUN: would run reboot command: $cmd_str")
|
||||
return true
|
||||
end
|
||||
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("Executing reboot command: $cmd_str")
|
||||
try
|
||||
# Construct a Cmd from an array so arguments are passed directly (no shell)
|
||||
@@ -218,6 +228,7 @@ function do_reboot()
|
||||
run(Cmd(cmd_array))
|
||||
return true
|
||||
catch e
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("Failed to execute reboot command: $e")
|
||||
return false
|
||||
end
|
||||
@@ -226,62 +237,60 @@ end
|
||||
|
||||
# Single check iteration
|
||||
function perform_check!(st::State)
|
||||
# Check if we're in cooldown period
|
||||
in_cooldown = false
|
||||
if st.last_reboot_datetime !== nothing
|
||||
timepass = ((Dates.now() - st.last_reboot_datetime).value / 1000) |> floor |> Int
|
||||
|
||||
if timepass < COOLDOWN_AFTER_REBOOT_SECS
|
||||
in_cooldown = true
|
||||
end
|
||||
end
|
||||
|
||||
# println(1)
|
||||
success = false
|
||||
last_res7ult = nothing
|
||||
last_result = nothing
|
||||
for i in 1:ATTEMPTS_PER_CHECK
|
||||
|
||||
# # for testing without actual ping
|
||||
# ok, result = values(JSON.parsefile("/home/ton/docker-programs/check_and_reboot/test_ping_result.json"))
|
||||
|
||||
ok, result = check_router_once(ROUTER_IP)
|
||||
last_result = result
|
||||
|
||||
if ok
|
||||
success = true
|
||||
break
|
||||
end
|
||||
sleep(BACKOFF_BETWEEN_ATTEMPTS)
|
||||
end
|
||||
routerresult = isnothing(last_result) ? "no response" : last_result
|
||||
|
||||
# Check if we're in cooldown period
|
||||
in_cooldown = false
|
||||
if st.last_reboot_datetime !== nothing
|
||||
timepass = ((Dates.now() - st.last_reboot_datetime).value / 1000) |> floor |> Int
|
||||
if timepass < COOLDOWN_AFTER_REBOOT_SECS
|
||||
in_cooldown = true
|
||||
end
|
||||
end
|
||||
# @show in_cooldown
|
||||
# println(2)
|
||||
if in_cooldown
|
||||
# println("2-1")
|
||||
# During cooldown, track failures but don't trigger reboot yet
|
||||
if success
|
||||
broadcast_msg("Broadcasting from file: $thisFilePath")
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("$ROUTER_IP is reachable during cooldown. Router is back online! Resetting state.")
|
||||
st.consecutive_fails = 0
|
||||
save_state(st, StateFilePath)
|
||||
else
|
||||
# println("2-2")
|
||||
st.consecutive_fails += 1
|
||||
routerresult = isnothing(last_result) ? "no response" : last_result
|
||||
broadcast_msg("Broadcasting from file: $thisFilePath")
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("$ROUTER_IP is unreachable during cooldown. Consecutive fails: $(st.consecutive_fails)/$FAILS_TO_REBOOT.")
|
||||
save_state(st, StateFilePath)
|
||||
|
||||
# Check if we've reached threshold by now
|
||||
if st.consecutive_fails >= FAILS_TO_REBOOT
|
||||
logmsg("Cooldown has expired and router is still unreachable. Triggering reboot.")
|
||||
ok = do_reboot()
|
||||
if ok
|
||||
thisFilePath = @__FILE__
|
||||
broadcast_msg("Broadcasting from file: $thisFilePath")
|
||||
logmsg("Reboot executed (or simulated). Resetting failure counter.")
|
||||
st.consecutive_fails = 0
|
||||
st.last_reboot_datetime = Dates.now()
|
||||
save_state(st, StateFilePath)
|
||||
else
|
||||
logmsg("Reboot attempt failed; will retry after next interval.")
|
||||
end
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
# println(3)
|
||||
# Outside cooldown - full check with potential reboot
|
||||
if success
|
||||
# println("3-1")
|
||||
if st.consecutive_fails > 0
|
||||
# println("3-2")
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("$ROUTER_IP is reachable; resetting consecutive failure counter.")
|
||||
else
|
||||
# logmsg("$ROUTER_IP is reachable.")
|
||||
@@ -291,39 +300,61 @@ function perform_check!(st::State)
|
||||
return
|
||||
else
|
||||
st.consecutive_fails += 1
|
||||
routerresult = isnothing(last_result) ? "no response" : last_result
|
||||
broadcast_msg("Broadcasting from file: $thisFilePath")
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("$ROUTER_IP is unreachable (last result: $routerresult). Consecutive fails: $(st.consecutive_fails)/$FAILS_TO_REBOOT.")
|
||||
save_state(st, StateFilePath)
|
||||
end
|
||||
# println(4)
|
||||
if st.consecutive_fails >= FAILS_TO_REBOOT
|
||||
# println("4-1")
|
||||
save_state(st, StateFilePath)
|
||||
ok = do_reboot()
|
||||
if ok
|
||||
thisFilePath = @__FILE__
|
||||
# println("4-2")
|
||||
broadcast_msg("Broadcasting from file: $thisFilePath")
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("Reboot executed (or simulated). Resetting failure counter.")
|
||||
st.consecutive_fails = 0
|
||||
st.last_reboot_datetime = Dates.now()
|
||||
@show st
|
||||
@show StateFilePath
|
||||
save_state(st, StateFilePath)
|
||||
else
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("Reboot attempt failed; will retry after next interval.")
|
||||
end
|
||||
end
|
||||
# println(5)
|
||||
end
|
||||
|
||||
|
||||
function limitTextFileLines(LogFilePath::String; maxlines::Integer=100)
|
||||
log = readlines(LogFilePath)
|
||||
if length(log) < (maxlines - 1)
|
||||
total_lines = length(log)
|
||||
if total_lines < maxlines
|
||||
return nothing
|
||||
end
|
||||
exceeding_row = total_lines - maxlines # can be 0 or more
|
||||
reduced_lines = log[exceeding_row+2:end]
|
||||
reducedLog = ""
|
||||
for i in log[end-(maxlines-1):end]
|
||||
for i in reduced_lines
|
||||
reducedLog = reducedLog * i * "\n"
|
||||
end
|
||||
write(LogFilePath, reducedLog)
|
||||
end
|
||||
|
||||
# function limitTextFileLines(LogFilePath::String; maxlines::Integer=100)
|
||||
# log = readlines(LogFilePath)
|
||||
# if length(log) < (maxlines - 1)
|
||||
# return nothing
|
||||
# end
|
||||
# reducedLog = ""
|
||||
# for i in log[end-(maxlines-1):end]
|
||||
# reducedLog = reducedLog * i * "\n"
|
||||
# end
|
||||
# write(LogFilePath, reducedLog)
|
||||
# end
|
||||
|
||||
# Main loop: runs indefinitely every CHECK_INTERVAL_SECS
|
||||
function main_loop()
|
||||
# Ensure log file exists
|
||||
@@ -333,15 +364,16 @@ function main_loop()
|
||||
end
|
||||
end
|
||||
# limit log file to latest 100 events
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
thisFilePath = @__FILE__
|
||||
broadcast_msg("Broadcasting from file: $thisFilePath")
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("Starting check loop. Checking router $ROUTER_IP every $(CHECK_INTERVAL_SECS) seconds.")
|
||||
st = load_state(StateFilePath)
|
||||
while true
|
||||
try
|
||||
perform_check!(st)
|
||||
catch e
|
||||
limitTextFileLines(LogFilePath; maxlines=100)
|
||||
logmsg("Error during check: $e")
|
||||
end
|
||||
sleep(CHECK_INTERVAL_SECS)
|
||||
|
||||
@@ -1,109 +1,108 @@
|
||||
[2026-03-11T15:51:04.131] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing)
|
||||
[2026-03-11T15:52:04.197] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing)
|
||||
[2026-03-11T15:53:04.266] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing)
|
||||
[2026-03-11T16:10:04.474] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-11T16:10:05.449] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing)
|
||||
[2026-03-11T16:12:13.704] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-11T16:12:14.671] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing)
|
||||
[2026-03-11T16:13:14.215] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-11T16:13:15.192] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing)
|
||||
[2026-03-11T16:14:19.623] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-11T16:14:20.610] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing)
|
||||
[2026-03-11T16:14:54.601] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-11T16:14:55.573] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing)
|
||||
[2026-03-11T16:15:48.563] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-11T16:15:49.540] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing)
|
||||
[2026-03-11T16:27:47.181] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-11T16:30:28.572] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-11T16:43:50.213] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-11T17:37:15.954] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-11T20:38:46.720] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-11T20:50:40.732] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-12T18:00:51.749] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-18T15:31:58.643] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-19T15:08:25.431] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 1/3.
|
||||
[2026-03-19T15:12:34.906] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 2/3.
|
||||
[2026-03-19T15:16:44.259] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 3/3.
|
||||
[2026-03-19T15:16:44.266] Executing reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-19T15:16:44.304] Failed to execute reboot command: Base.IOError("could not spawn `/usr/bin/sudo systemctl reboot`: no such file or directory (ENOENT)", -2)
|
||||
[2026-03-19T15:16:44.305] Reboot attempt failed; will retry after next interval.
|
||||
[2026-03-19T15:20:53.852] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 4/3.
|
||||
[2026-03-19T15:20:53.853] Executing reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-19T15:20:53.853] Failed to execute reboot command: Base.IOError("could not spawn `/usr/bin/sudo systemctl reboot`: no such file or directory (ENOENT)", -2)
|
||||
[2026-03-19T15:20:53.853] Reboot attempt failed; will retry after next interval.
|
||||
[2026-03-19T15:25:00.572] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 5/3.
|
||||
[2026-03-19T15:25:00.573] Executing reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-19T15:25:00.573] Failed to execute reboot command: Base.IOError("could not spawn `/usr/bin/sudo systemctl reboot`: no such file or directory (ENOENT)", -2)
|
||||
[2026-03-19T15:25:00.574] Reboot attempt failed; will retry after next interval.
|
||||
[2026-03-19T15:29:10.082] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 6/3.
|
||||
[2026-03-19T15:29:10.084] Executing reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-19T15:29:10.084] Failed to execute reboot command: Base.IOError("could not spawn `/usr/bin/sudo systemctl reboot`: no such file or directory (ENOENT)", -2)
|
||||
[2026-03-19T15:29:10.084] Reboot attempt failed; will retry after next interval.
|
||||
[2026-03-19T15:33:19.474] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 7/3.
|
||||
[2026-03-19T15:33:19.475] Executing reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-19T15:33:19.475] Failed to execute reboot command: Base.IOError("could not spawn `/usr/bin/sudo systemctl reboot`: no such file or directory (ENOENT)", -2)
|
||||
[2026-03-19T15:33:19.475] Reboot attempt failed; will retry after next interval.
|
||||
[2026-03-19T15:37:28.886] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 8/3.
|
||||
[2026-03-19T15:37:28.886] Executing reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-19T15:37:28.887] Failed to execute reboot command: Base.IOError("could not spawn `/usr/bin/sudo systemctl reboot`: no such file or directory (ENOENT)", -2)
|
||||
[2026-03-19T15:37:28.887] Reboot attempt failed; will retry after next interval.
|
||||
[2026-03-19T15:41:38.214] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 9/3.
|
||||
[2026-03-19T15:41:38.215] Executing reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-19T15:41:38.215] Failed to execute reboot command: Base.IOError("could not spawn `/usr/bin/sudo systemctl reboot`: no such file or directory (ENOENT)", -2)
|
||||
[2026-03-19T15:41:38.215] Reboot attempt failed; will retry after next interval.
|
||||
[2026-03-19T15:45:47.554] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 10/3.
|
||||
[2026-03-19T15:45:47.555] Executing reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-19T15:45:47.556] Failed to execute reboot command: Base.IOError("could not spawn `/usr/bin/sudo systemctl reboot`: no such file or directory (ENOENT)", -2)
|
||||
[2026-03-19T15:45:47.556] Reboot attempt failed; will retry after next interval.
|
||||
[2026-03-19T15:49:57.051] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 11/3.
|
||||
[2026-03-19T15:49:57.051] Executing reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-19T15:49:57.052] Failed to execute reboot command: Base.IOError("could not spawn `/usr/bin/sudo systemctl reboot`: no such file or directory (ENOENT)", -2)
|
||||
[2026-03-19T15:49:57.052] Reboot attempt failed; will retry after next interval.
|
||||
[2026-03-19T15:54:06.519] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 12/3.
|
||||
[2026-03-19T15:54:06.520] Executing reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-19T15:54:06.553] Failed to execute reboot command: Base.IOError("could not spawn `/usr/bin/sudo systemctl reboot`: no such file or directory (ENOENT)", -2)
|
||||
[2026-03-19T15:54:06.554] Reboot attempt failed; will retry after next interval.
|
||||
[2026-03-19T15:58:26.336] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-19T15:58:26.462] 192.168.88.1 is reachable; resetting consecutive failure counter.
|
||||
[2026-03-19T16:27:27.839] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-19T16:34:04.850] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 1/3.
|
||||
[2026-03-19T16:38:14.247] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 2/3.
|
||||
[2026-03-19T16:42:23.657] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 3/3.
|
||||
[2026-03-19T16:42:23.669] Executing reboot command: /bin/systemctl reboot
|
||||
[2026-03-19T16:42:23.678] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-19T16:43:49.992] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-19T16:43:50.104] In cooldown after recent reboot; skipping check. 86/600 seconds
|
||||
[2026-03-19T16:44:50.144] In cooldown after recent reboot; skipping check. 146/600 seconds
|
||||
[2026-03-19T16:45:50.206] In cooldown after recent reboot; skipping check. 206/600 seconds
|
||||
[2026-03-19T16:46:50.222] In cooldown after recent reboot; skipping check. 266/600 seconds
|
||||
[2026-03-19T16:47:50.283] In cooldown after recent reboot; skipping check. 326/600 seconds
|
||||
[2026-03-19T16:48:50.344] In cooldown after recent reboot; skipping check. 386/600 seconds
|
||||
[2026-03-19T16:49:50.351] In cooldown after recent reboot; skipping check. 446/600 seconds
|
||||
[2026-03-19T16:50:50.412] In cooldown after recent reboot; skipping check. 506/600 seconds
|
||||
[2026-03-19T16:51:50.465] In cooldown after recent reboot; skipping check. 566/600 seconds
|
||||
[2026-03-19T16:56:00.122] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 1/3.
|
||||
[2026-03-19T17:00:09.642] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 2/3.
|
||||
[2026-03-19T17:04:19.199] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 3/3.
|
||||
[2026-03-19T17:04:19.213] Executing reboot command: /bin/systemctl reboot
|
||||
[2026-03-19T17:04:19.221] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-19T17:05:36.172] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-19T17:05:36.285] In cooldown after recent reboot; skipping check. 77/600 seconds
|
||||
[2026-03-19T17:06:36.327] In cooldown after recent reboot; skipping check. 137/600 seconds
|
||||
[2026-03-19T17:07:36.348] In cooldown after recent reboot; skipping check. 197/600 seconds
|
||||
[2026-03-19T17:08:36.359] In cooldown after recent reboot; skipping check. 257/600 seconds
|
||||
[2026-03-19T17:09:36.420] In cooldown after recent reboot; skipping check. 317/600 seconds
|
||||
[2026-03-19T18:15:58.573] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-19T18:19:34.550] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 1/3.
|
||||
[2026-03-19T18:23:44.126] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 2/3.
|
||||
[2026-03-19T18:27:53.662] 192.168.88.1 is unreachable (last result: ProcessFailedException(Base.Process[Process(`ping -c 1 -W 30 192.168.88.1`, ProcessExited(1))])). Consecutive fails: 3/3.
|
||||
[2026-03-19T18:27:53.673] Executing reboot command: /bin/systemctl reboot
|
||||
[2026-03-19T18:27:53.682] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-19T18:30:25.480] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-19T18:30:25.618] In cooldown after recent reboot; skipping check. 151/600 seconds
|
||||
[2026-03-19T18:31:25.627] In cooldown after recent reboot; skipping check. 211/600 seconds
|
||||
[2026-03-19T18:32:25.631] In cooldown after recent reboot; skipping check. 271/600 seconds
|
||||
[2026-03-19T18:33:25.644] In cooldown after recent reboot; skipping check. 331/600 seconds
|
||||
[2026-03-19T18:34:25.706] In cooldown after recent reboot; skipping check. 392/600 seconds
|
||||
[2026-03-19T18:35:25.731] In cooldown after recent reboot; skipping check. 452/600 seconds
|
||||
[2026-03-19T18:36:25.793] In cooldown after recent reboot; skipping check. 512/600 seconds
|
||||
[2026-03-19T18:37:25.855] In cooldown after recent reboot; skipping check. 572/600 seconds
|
||||
[2026-03-20T10:49:28.409] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-20T10:50:49.333] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T10:50:50.033] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||
[2026-03-20T10:51:50.626] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||
[2026-03-20T10:52:50.699] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||
[2026-03-20T10:53:50.763] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||
[2026-03-20T10:54:50.784] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||
[2026-03-20T10:55:50.800] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||
[2026-03-20T10:56:51.025] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||
[2026-03-20T10:57:51.056] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||
[2026-03-20T10:58:51.132] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||
[2026-03-20T11:04:22.285] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T11:10:08.650] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T11:10:10.725] Error during check: UndefVarError(:thisFilePath, 0x000000000000975f, :local)
|
||||
[2026-03-20T11:12:40.556] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T11:12:43.912] Error during check: SystemError("opening file \"test_ping_result.json\"", 2, nothing)
|
||||
[2026-03-20T12:42:13.923] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T12:42:15.861] Error during check: UndefVarError(:thisFilePath, 0x000000000000975f, :local)
|
||||
[2026-03-20T12:43:25.591] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T12:43:27.556] Error during check: UndefVarError(:thisFilePath, 0x000000000000975f, :local)
|
||||
[2026-03-20T12:44:06.281] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T12:44:08.202] Error during check: UndefVarError(:thisFilePath, 0x000000000000975f, :local)
|
||||
[2026-03-20T12:45:23.028] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T12:45:24.799] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||
[2026-03-20T12:46:26.403] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||
[2026-03-20T12:47:27.427] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||
[2026-03-20T12:47:27.525] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-20T12:47:27.528] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-20T12:48:06.389] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T12:48:08.162] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||
[2026-03-20T12:49:09.763] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||
[2026-03-20T12:50:10.833] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||
[2026-03-20T12:50:10.937] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-20T12:50:10.942] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-20T12:54:25.047] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T12:54:26.823] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||
[2026-03-20T12:56:13.713] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T12:56:15.487] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||
[2026-03-20T12:57:17.055] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||
[2026-03-20T12:58:18.125] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||
[2026-03-20T12:58:18.353] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-20T12:58:18.357] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-20T12:59:43.699] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T12:59:45.472] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||
[2026-03-20T13:00:47.029] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||
[2026-03-20T13:01:48.056] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||
[2026-03-20T13:01:48.151] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-20T13:01:48.154] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-20T13:02:22.831] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T13:02:24.606] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
||||
[2026-03-20T13:03:06.170] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T13:03:08.073] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||
[2026-03-20T13:06:43.902] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T13:06:45.688] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||
[2026-03-20T13:20:26.911] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T13:20:27.794] Error during check: SystemError("opening file \"test_ping_result.json\"", 2, nothing)
|
||||
[2026-03-20T13:22:32.247] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T13:22:34.026] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||
[2026-03-20T13:23:38.078] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T13:23:39.856] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||
[2026-03-20T13:24:16.835] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T13:24:18.606] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||
[2026-03-20T13:24:19.209] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-20T13:24:19.213] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-20T13:25:20.400] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
||||
[2026-03-20T13:26:21.625] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
||||
[2026-03-20T13:27:22.681] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
||||
[2026-03-20T13:28:23.700] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 4/3.
|
||||
[2026-03-20T13:29:04.947] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T13:29:06.721] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 5/3.
|
||||
[2026-03-20T14:32:48.752] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T14:32:50.528] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 6/3.
|
||||
[2026-03-20T14:32:51.123] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-20T14:32:51.128] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-20T14:33:52.347] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
||||
[2026-03-20T14:34:53.367] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||
[2026-03-20T14:35:54.418] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||
[2026-03-20T14:35:54.452] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-20T14:35:54.455] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-20T14:36:55.528] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
||||
[2026-03-20T14:38:00.916] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T14:38:02.688] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||
[2026-03-20T14:39:04.303] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||
[2026-03-20T14:39:04.396] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-20T14:39:04.398] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-20T14:39:32.271] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T14:39:34.046] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
||||
[2026-03-20T14:40:27.209] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T14:40:28.984] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
||||
[2026-03-20T14:41:30.736] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||
[2026-03-20T14:41:30.836] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-20T14:41:30.839] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-20T14:42:13.075] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T14:42:14.852] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
||||
[2026-03-20T14:43:15.578] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||
[2026-03-20T14:44:16.617] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||
[2026-03-20T14:45:17.675] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||
[2026-03-20T14:46:18.745] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||
[2026-03-20T14:46:18.841] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||
[2026-03-20T14:46:18.844] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-20T15:21:15.466] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||
[2026-03-20T15:21:17.191] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||
[2026-03-20T15:22:18.736] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||
[2026-03-20T15:23:19.802] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||
[2026-03-20T15:23:19.865] DRY RUN: would run reboot command: /bin/systemctl reboot
|
||||
[2026-03-20T15:23:19.867] Reboot executed (or simulated). Resetting failure counter.
|
||||
[2026-03-20T15:24:21.083] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
||||
[2026-03-20T15:25:22.150] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||
|
||||
1
test_ping_result.json
Normal file
1
test_ping_result.json
Normal file
@@ -0,0 +1 @@
|
||||
{"ok": false, "result": "no response"}
|
||||
Reference in New Issue
Block a user