Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9a0cb6d272 | |||
| 77c06befda | |||
| 638e05a13a | |||
| eaa55c69b4 | |||
| 03eb96661e | |||
| baa3b60ef3 | |||
| 2d1f10cd26 | |||
| 231051bd8f | |||
| 67eea6f149 | |||
| ff7f95e1bb | |||
| 0682019085 | |||
| e2b7d93035 |
152
Manifest.toml
152
Manifest.toml
@@ -2,18 +2,66 @@
|
|||||||
|
|
||||||
julia_version = "1.12.5"
|
julia_version = "1.12.5"
|
||||||
manifest_format = "2.0"
|
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.Dates]]
|
||||||
deps = ["Printf"]
|
deps = ["Printf"]
|
||||||
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
|
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
|
||||||
version = "1.11.0"
|
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.JSON]]
|
||||||
deps = ["Dates", "Logging", "Parsers", "PrecompileTools", "StructUtils", "UUIDs", "Unicode"]
|
deps = ["Dates", "Logging", "Parsers", "PrecompileTools", "StructUtils", "UUIDs", "Unicode"]
|
||||||
git-tree-sha1 = "eb04df293213df64ddd720c86de3c431f5f8ccf1"
|
git-tree-sha1 = "b3ad4a0255688dcb895a52fafbaae3023b588a90"
|
||||||
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
||||||
version = "1.2.1"
|
version = "1.4.0"
|
||||||
|
|
||||||
[deps.JSON.extensions]
|
[deps.JSON.extensions]
|
||||||
JSONArrowExt = ["ArrowTypes"]
|
JSONArrowExt = ["ArrowTypes"]
|
||||||
@@ -21,10 +69,61 @@ version = "1.2.1"
|
|||||||
[deps.JSON.weakdeps]
|
[deps.JSON.weakdeps]
|
||||||
ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd"
|
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]]
|
[[deps.Logging]]
|
||||||
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
|
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
|
||||||
version = "1.11.0"
|
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.Parsers]]
|
||||||
deps = ["Dates", "PrecompileTools", "UUIDs"]
|
deps = ["Dates", "PrecompileTools", "UUIDs"]
|
||||||
git-tree-sha1 = "7d2f8f21da5db6a806faf7b9b292296da42b2810"
|
git-tree-sha1 = "7d2f8f21da5db6a806faf7b9b292296da42b2810"
|
||||||
@@ -39,9 +138,9 @@ version = "1.3.3"
|
|||||||
|
|
||||||
[[deps.Preferences]]
|
[[deps.Preferences]]
|
||||||
deps = ["TOML"]
|
deps = ["TOML"]
|
||||||
git-tree-sha1 = "0f27480397253da18fe2c12a4ba4eb9eb208bf3d"
|
git-tree-sha1 = "8b770b60760d4451834fe79dd483e318eee709c4"
|
||||||
uuid = "21216c6a-2e73-6563-6e65-726566657250"
|
uuid = "21216c6a-2e73-6563-6e65-726566657250"
|
||||||
version = "1.5.0"
|
version = "1.5.2"
|
||||||
|
|
||||||
[[deps.Printf]]
|
[[deps.Printf]]
|
||||||
deps = ["Unicode"]
|
deps = ["Unicode"]
|
||||||
@@ -57,25 +156,59 @@ version = "1.11.0"
|
|||||||
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
|
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
|
||||||
version = "0.7.0"
|
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.StructUtils]]
|
||||||
deps = ["Dates", "UUIDs"]
|
deps = ["Dates", "UUIDs"]
|
||||||
git-tree-sha1 = "79529b493a44927dd5b13dde1c7ce957c2d049e4"
|
git-tree-sha1 = "fa95b3b097bcef5845c142ea2e085f1b2591e92c"
|
||||||
uuid = "ec057cc2-7a8d-4b58-b3b3-92acb9f63b42"
|
uuid = "ec057cc2-7a8d-4b58-b3b3-92acb9f63b42"
|
||||||
version = "2.6.0"
|
version = "2.7.1"
|
||||||
|
|
||||||
[deps.StructUtils.extensions]
|
[deps.StructUtils.extensions]
|
||||||
StructUtilsMeasurementsExt = ["Measurements"]
|
StructUtilsMeasurementsExt = ["Measurements"]
|
||||||
|
StructUtilsStaticArraysCoreExt = ["StaticArraysCore"]
|
||||||
StructUtilsTablesExt = ["Tables"]
|
StructUtilsTablesExt = ["Tables"]
|
||||||
|
|
||||||
[deps.StructUtils.weakdeps]
|
[deps.StructUtils.weakdeps]
|
||||||
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
|
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
|
||||||
|
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
|
||||||
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
|
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
|
||||||
|
|
||||||
|
[[deps.StyledStrings]]
|
||||||
|
uuid = "f489334b-da3d-4c2e-b8f0-e476e12c162b"
|
||||||
|
version = "1.11.0"
|
||||||
|
|
||||||
[[deps.TOML]]
|
[[deps.TOML]]
|
||||||
deps = ["Dates"]
|
deps = ["Dates"]
|
||||||
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
|
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
|
||||||
version = "1.0.3"
|
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.UUIDs]]
|
||||||
deps = ["Random", "SHA"]
|
deps = ["Random", "SHA"]
|
||||||
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
|
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
|
||||||
@@ -84,3 +217,8 @@ version = "1.11.0"
|
|||||||
[[deps.Unicode]]
|
[[deps.Unicode]]
|
||||||
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
|
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
|
||||||
version = "1.11.0"
|
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]
|
[deps]
|
||||||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
|
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
|
||||||
|
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
|
||||||
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"last_reboot_datetime":"2026-03-20T08:56:37.673","consecutive_fails":0}
|
{"last_reboot_datetime":"2026-03-20T15:23:19.868","consecutive_fails":2}
|
||||||
@@ -7,9 +7,15 @@
|
|||||||
# ------------------------------------------------------------------------------------------------ #
|
# ------------------------------------------------------------------------------------------------ #
|
||||||
# add the following to root's crontab (sudo crontab -e) #
|
# 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
|
# ---------------- For PC that has juliar for root user and julia for normal user ---------------- #
|
||||||
# @reboot sleep 30 && /root/.juliaup/bin/julia /root/docker-apps/check_and_reboot/check_router_reboot.jl >> /var/log/check_reboot.log 2>&1
|
# 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
|
using Dates, Printf, JSON
|
||||||
|
|
||||||
@@ -19,14 +25,15 @@ const TIMEOUT_SECS = 30 # request timeout
|
|||||||
const ATTEMPTS_PER_CHECK = 1 # number of ping attempts per check
|
const ATTEMPTS_PER_CHECK = 1 # number of ping attempts per check
|
||||||
const BACKOFF_BETWEEN_ATTEMPTS = 1 # seconds between ping attempts
|
const BACKOFF_BETWEEN_ATTEMPTS = 1 # seconds between ping attempts
|
||||||
const FAILS_TO_REBOOT = 3 # consecutive failed checks required to trigger reboot
|
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 DRY_RUN = false # set false to actually reboot
|
||||||
const CHECK_INTERVAL_SECS = 60 # run a check every CHECK_INTERVAL_SECS seconds
|
const CHECK_INTERVAL_SECS = 60 # run a check every CHECK_INTERVAL_SECS seconds
|
||||||
|
|
||||||
const thisFolderPath = @__DIR__
|
const thisFolderPath = @__DIR__
|
||||||
|
const thisFilePath = @__FILE__
|
||||||
const LogFilePath = "$thisFolderPath/check_router_reboot_log.txt" # write logs here and also broadcast
|
const LogFilePath = "$thisFolderPath/check_router_reboot_log.txt" # write logs here and also broadcast
|
||||||
const StateFilePath = "$thisFolderPath/check_and_reboot_state.json"
|
const StateFilePath = "$thisFolderPath/check_and_reboot_state.json"
|
||||||
|
# println(0)
|
||||||
# Simple broadcast helper
|
# Simple broadcast helper
|
||||||
# Simple broadcast helper (safe Cmd construction)
|
# Simple broadcast helper (safe Cmd construction)
|
||||||
function broadcast_msg(msg::AbstractString)
|
function broadcast_msg(msg::AbstractString)
|
||||||
@@ -120,6 +127,7 @@ function load_state(StateFilePath)
|
|||||||
return State(cf, DateTime(lr))
|
return State(cf, DateTime(lr))
|
||||||
end
|
end
|
||||||
catch e
|
catch e
|
||||||
|
limitTextFileLines(LogFilePath; maxlines=100)
|
||||||
logmsg("Warning loading state: $e")
|
logmsg("Warning loading state: $e")
|
||||||
end
|
end
|
||||||
return State(0, nothing)
|
return State(0, nothing)
|
||||||
@@ -199,6 +207,7 @@ end
|
|||||||
function do_reboot()
|
function do_reboot()
|
||||||
cmd = reboot_command()
|
cmd = reboot_command()
|
||||||
if cmd === nothing
|
if cmd === nothing
|
||||||
|
limitTextFileLines(LogFilePath; maxlines=100)
|
||||||
logmsg("Reboot not supported on this OS")
|
logmsg("Reboot not supported on this OS")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -207,10 +216,11 @@ function do_reboot()
|
|||||||
cmd_str = join(map(x -> replace(x, '"' => "\\\""), cmd), " ")
|
cmd_str = join(map(x -> replace(x, '"' => "\\\""), cmd), " ")
|
||||||
|
|
||||||
if DRY_RUN
|
if DRY_RUN
|
||||||
|
limitTextFileLines(LogFilePath; maxlines=100)
|
||||||
logmsg("DRY RUN: would run reboot command: $cmd_str")
|
logmsg("DRY RUN: would run reboot command: $cmd_str")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
limitTextFileLines(LogFilePath; maxlines=100)
|
||||||
logmsg("Executing reboot command: $cmd_str")
|
logmsg("Executing reboot command: $cmd_str")
|
||||||
try
|
try
|
||||||
# Construct a Cmd from an array so arguments are passed directly (no shell)
|
# Construct a Cmd from an array so arguments are passed directly (no shell)
|
||||||
@@ -218,6 +228,7 @@ function do_reboot()
|
|||||||
run(Cmd(cmd_array))
|
run(Cmd(cmd_array))
|
||||||
return true
|
return true
|
||||||
catch e
|
catch e
|
||||||
|
limitTextFileLines(LogFilePath; maxlines=100)
|
||||||
logmsg("Failed to execute reboot command: $e")
|
logmsg("Failed to execute reboot command: $e")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -226,12 +237,16 @@ end
|
|||||||
|
|
||||||
# Single check iteration
|
# Single check iteration
|
||||||
function perform_check!(st::State)
|
function perform_check!(st::State)
|
||||||
|
# println(1)
|
||||||
success = false
|
success = false
|
||||||
last_result = nothing
|
last_result = nothing
|
||||||
for i in 1:ATTEMPTS_PER_CHECK
|
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)
|
ok, result = check_router_once(ROUTER_IP)
|
||||||
# ok, result = values(JSON.parsefile("test_ping_result.json")) # for testing without actual ping
|
|
||||||
if ok
|
if ok
|
||||||
success = true
|
success = true
|
||||||
break
|
break
|
||||||
@@ -244,87 +259,102 @@ function perform_check!(st::State)
|
|||||||
in_cooldown = false
|
in_cooldown = false
|
||||||
if st.last_reboot_datetime !== nothing
|
if st.last_reboot_datetime !== nothing
|
||||||
timepass = ((Dates.now() - st.last_reboot_datetime).value / 1000) |> floor |> Int
|
timepass = ((Dates.now() - st.last_reboot_datetime).value / 1000) |> floor |> Int
|
||||||
|
|
||||||
if timepass < COOLDOWN_AFTER_REBOOT_SECS
|
if timepass < COOLDOWN_AFTER_REBOOT_SECS
|
||||||
in_cooldown = true
|
in_cooldown = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
# @show in_cooldown
|
||||||
|
# println(2)
|
||||||
if in_cooldown
|
if in_cooldown
|
||||||
|
# println("2-1")
|
||||||
# During cooldown, track failures but don't trigger reboot yet
|
# During cooldown, track failures but don't trigger reboot yet
|
||||||
if success
|
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.")
|
logmsg("$ROUTER_IP is reachable during cooldown. Router is back online! Resetting state.")
|
||||||
st.consecutive_fails = 0
|
st.consecutive_fails = 0
|
||||||
save_state(st, StateFilePath)
|
save_state(st, StateFilePath)
|
||||||
else
|
else
|
||||||
|
# println("2-2")
|
||||||
st.consecutive_fails += 1
|
st.consecutive_fails += 1
|
||||||
|
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.")
|
logmsg("$ROUTER_IP is unreachable during cooldown. Consecutive fails: $(st.consecutive_fails)/$FAILS_TO_REBOOT.")
|
||||||
save_state(st, StateFilePath)
|
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
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
# println(3)
|
||||||
# Outside cooldown - full check with potential reboot
|
# Outside cooldown - full check with potential reboot
|
||||||
if success
|
if success
|
||||||
if st.consecutive_fails > 0
|
# println("3-1")
|
||||||
logmsg("$ROUTER_IP is reachable; resetting consecutive failure counter.")
|
if st.consecutive_fails > 0
|
||||||
else
|
# println("3-2")
|
||||||
# logmsg("$ROUTER_IP is reachable.")
|
limitTextFileLines(LogFilePath; maxlines=100)
|
||||||
end
|
logmsg("$ROUTER_IP is reachable; resetting consecutive failure counter.")
|
||||||
st.consecutive_fails = 0
|
else
|
||||||
save_state(st, StateFilePath)
|
# logmsg("$ROUTER_IP is reachable.")
|
||||||
return
|
end
|
||||||
|
st.consecutive_fails = 0
|
||||||
|
save_state(st, StateFilePath)
|
||||||
|
return
|
||||||
else
|
else
|
||||||
st.consecutive_fails += 1
|
st.consecutive_fails += 1
|
||||||
logmsg("$ROUTER_IP is unreachable (last result: $routerresult). Consecutive fails: $(st.consecutive_fails)/$FAILS_TO_REBOOT.")
|
broadcast_msg("Broadcasting from file: $thisFilePath")
|
||||||
save_state(st, StateFilePath)
|
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
|
end
|
||||||
|
# println(4)
|
||||||
if st.consecutive_fails >= FAILS_TO_REBOOT
|
if st.consecutive_fails >= FAILS_TO_REBOOT
|
||||||
|
# println("4-1")
|
||||||
|
save_state(st, StateFilePath)
|
||||||
|
ok = do_reboot()
|
||||||
|
if ok
|
||||||
|
# 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)
|
save_state(st, StateFilePath)
|
||||||
ok = do_reboot()
|
else
|
||||||
if ok
|
limitTextFileLines(LogFilePath; maxlines=100)
|
||||||
thisFilePath = @__FILE__
|
logmsg("Reboot attempt failed; will retry after next interval.")
|
||||||
broadcast_msg("Broadcasting from file: $thisFilePath")
|
end
|
||||||
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
|
||||||
|
# println(5)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function limitTextFileLines(LogFilePath::String; maxlines::Integer=100)
|
function limitTextFileLines(LogFilePath::String; maxlines::Integer=100)
|
||||||
log = readlines(LogFilePath)
|
log = readlines(LogFilePath)
|
||||||
if length(log) < (maxlines - 1)
|
total_lines = length(log)
|
||||||
|
if total_lines < maxlines
|
||||||
return nothing
|
return nothing
|
||||||
end
|
end
|
||||||
|
exceeding_row = total_lines - maxlines # can be 0 or more
|
||||||
|
reduced_lines = log[exceeding_row+2:end]
|
||||||
reducedLog = ""
|
reducedLog = ""
|
||||||
for i in log[end-(maxlines-1):end]
|
for i in reduced_lines
|
||||||
reducedLog = reducedLog * i * "\n"
|
reducedLog = reducedLog * i * "\n"
|
||||||
end
|
end
|
||||||
write(LogFilePath, reducedLog)
|
write(LogFilePath, reducedLog)
|
||||||
end
|
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
|
# Main loop: runs indefinitely every CHECK_INTERVAL_SECS
|
||||||
function main_loop()
|
function main_loop()
|
||||||
# Ensure log file exists
|
# Ensure log file exists
|
||||||
@@ -334,15 +364,16 @@ function main_loop()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
# limit log file to latest 100 events
|
# limit log file to latest 100 events
|
||||||
limitTextFileLines(LogFilePath; maxlines=100)
|
|
||||||
thisFilePath = @__FILE__
|
thisFilePath = @__FILE__
|
||||||
broadcast_msg("Broadcasting from file: $thisFilePath")
|
broadcast_msg("Broadcasting from file: $thisFilePath")
|
||||||
|
limitTextFileLines(LogFilePath; maxlines=100)
|
||||||
logmsg("Starting check loop. Checking router $ROUTER_IP every $(CHECK_INTERVAL_SECS) seconds.")
|
logmsg("Starting check loop. Checking router $ROUTER_IP every $(CHECK_INTERVAL_SECS) seconds.")
|
||||||
st = load_state(StateFilePath)
|
st = load_state(StateFilePath)
|
||||||
while true
|
while true
|
||||||
try
|
try
|
||||||
perform_check!(st)
|
perform_check!(st)
|
||||||
catch e
|
catch e
|
||||||
|
limitTextFileLines(LogFilePath; maxlines=100)
|
||||||
logmsg("Error during check: $e")
|
logmsg("Error during check: $e")
|
||||||
end
|
end
|
||||||
sleep(CHECK_INTERVAL_SECS)
|
sleep(CHECK_INTERVAL_SECS)
|
||||||
|
|||||||
@@ -1,110 +1,108 @@
|
|||||||
[2026-03-20T07:22:26.223] DRY RUN: would run reboot command: /bin/systemctl reboot
|
[2026-03-20T10:49:28.409] Reboot executed (or simulated). Resetting failure counter.
|
||||||
[2026-03-20T07:22:26.224] 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-20T07:34:46.993] 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-20T07:34:48.140] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
[2026-03-20T10:51:50.626] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||||
[2026-03-20T07:35:48.328] 192.168.88.1 is reachable; resetting consecutive failure counter.
|
[2026-03-20T10:52:50.699] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||||
[2026-03-20T07:36:49.337] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
[2026-03-20T10:53:50.763] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||||
[2026-03-20T07:37:50.385] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
[2026-03-20T10:54:50.784] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||||
[2026-03-20T07:38:51.439] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
[2026-03-20T10:55:50.800] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||||
[2026-03-20T07:38:51.451] DRY RUN: would run reboot command: /bin/systemctl reboot
|
[2026-03-20T10:56:51.025] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||||
[2026-03-20T07:38:51.452] Reboot executed (or simulated). Resetting failure counter.
|
[2026-03-20T10:57:51.056] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||||
[2026-03-20T08:01:26.083] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
[2026-03-20T10:58:51.132] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
||||||
[2026-03-20T08:03:30.730] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
[2026-03-20T11:04:22.285] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:04:34.872] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
[2026-03-20T11:10:08.650] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:05:39] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
[2026-03-20T11:10:10.725] Error during check: UndefVarError(:thisFilePath, 0x000000000000975f, :local)
|
||||||
[2026-03-20T08:05:39.012] Executing reboot command: /bin/systemctl reboot
|
[2026-03-20T11:12:40.556] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:05:39.019] Reboot executed (or simulated). Resetting failure counter.
|
[2026-03-20T11:12:43.912] Error during check: SystemError("opening file \"test_ping_result.json\"", 2, nothing)
|
||||||
[2026-03-20T08:07:37.784] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
[2026-03-20T12:42:13.923] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:07:42.190] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
[2026-03-20T12:42:15.861] Error during check: UndefVarError(:thisFilePath, 0x000000000000975f, :local)
|
||||||
[2026-03-20T08:08:42.390] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T12:43:25.591] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:10:13.455] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
[2026-03-20T12:43:27.556] Error during check: UndefVarError(:thisFilePath, 0x000000000000975f, :local)
|
||||||
[2026-03-20T08:11:17.576] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
[2026-03-20T12:44:06.281] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:12:21.703] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
[2026-03-20T12:44:08.202] Error during check: UndefVarError(:thisFilePath, 0x000000000000975f, :local)
|
||||||
[2026-03-20T08:12:21.703] Cooldown has expired and router is still unreachable. Triggering reboot.
|
[2026-03-20T12:45:23.028] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:12:21.715] Executing reboot command: /bin/systemctl reboot
|
[2026-03-20T12:45:24.799] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||||
[2026-03-20T08:12:21.722] Reboot executed (or simulated). Resetting failure counter.
|
[2026-03-20T12:46:26.403] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||||
[2026-03-20T08:14:14.104] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
[2026-03-20T12:47:27.427] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||||
[2026-03-20T08:14:14.238] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T12:47:27.525] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||||
[2026-03-20T08:15:14.374] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T12:47:27.528] Reboot executed (or simulated). Resetting failure counter.
|
||||||
[2026-03-20T08:16:14.436] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T12:48:06.389] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:17:14.458] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T12:48:08.162] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||||
[2026-03-20T08:18:14.474] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T12:49:09.763] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||||
[2026-03-20T08:19:45.773] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
[2026-03-20T12:50:10.833] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||||
[2026-03-20T08:20:49.912] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
[2026-03-20T12:50:10.937] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||||
[2026-03-20T08:21:53.976] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
[2026-03-20T12:50:10.942] Reboot executed (or simulated). Resetting failure counter.
|
||||||
[2026-03-20T08:21:53.976] Cooldown has expired and router is still unreachable. Triggering reboot.
|
[2026-03-20T12:54:25.047] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:21:53.988] Executing reboot command: /bin/systemctl reboot
|
[2026-03-20T12:54:26.823] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||||
[2026-03-20T08:21:53.995] Reboot executed (or simulated). Resetting failure counter.
|
[2026-03-20T12:56:13.713] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:24:02.098] 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-20T08:24:06.510] 192.168.88.1 is unreachable during cooldown. 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-20T08:25:10.722] 192.168.88.1 is unreachable during cooldown. 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-20T08:26:14.850] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
[2026-03-20T12:58:18.353] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||||
[2026-03-20T08:26:14.851] Cooldown has expired and router is still unreachable. Triggering reboot.
|
[2026-03-20T12:58:18.357] Reboot executed (or simulated). Resetting failure counter.
|
||||||
[2026-03-20T08:26:14.862] Executing reboot command: /bin/systemctl reboot
|
[2026-03-20T12:59:43.699] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:26:14.869] Reboot executed (or simulated). Resetting failure counter.
|
[2026-03-20T12:59:45.472] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||||
[2026-03-20T08:27:50.027] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
[2026-03-20T13:00:47.029] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||||
[2026-03-20T08:27:54.438] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
[2026-03-20T13:01:48.056] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||||
[2026-03-20T08:28:58.658] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
[2026-03-20T13:01:48.151] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||||
[2026-03-20T08:30:02.786] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
[2026-03-20T13:01:48.154] Reboot executed (or simulated). Resetting failure counter.
|
||||||
[2026-03-20T08:30:02.787] Cooldown has expired and router is still unreachable. Triggering reboot.
|
[2026-03-20T13:02:22.831] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:30:02.797] Executing reboot command: /bin/systemctl reboot
|
[2026-03-20T13:02:24.606] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
||||||
[2026-03-20T08:30:02.804] Reboot executed (or simulated). Resetting failure counter.
|
[2026-03-20T13:03:06.170] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:31:38.059] 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-20T08:31:42.504] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
[2026-03-20T13:06:43.902] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:32:46.784] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
[2026-03-20T13:06:45.688] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||||
[2026-03-20T08:33:50.912] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
[2026-03-20T13:20:26.911] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:33:50.912] Cooldown has expired and router is still unreachable. Triggering reboot.
|
[2026-03-20T13:20:27.794] Error during check: SystemError("opening file \"test_ping_result.json\"", 2, nothing)
|
||||||
[2026-03-20T08:33:50.923] Executing reboot command: /bin/systemctl reboot
|
[2026-03-20T13:22:32.247] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:33:50.930] Reboot executed (or simulated). Resetting failure counter.
|
[2026-03-20T13:22:34.026] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||||
[2026-03-20T08:35:25.114] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
[2026-03-20T13:23:38.078] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:35:29.577] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
[2026-03-20T13:23:39.856] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||||
[2026-03-20T08:36:33.792] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
[2026-03-20T13:24:16.835] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:37:37.920] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
[2026-03-20T13:24:18.606] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||||
[2026-03-20T08:37:37.952] Cooldown has expired and router is still unreachable. Triggering reboot.
|
[2026-03-20T13:24:19.209] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||||
[2026-03-20T08:37:37.962] Executing reboot command: /bin/systemctl reboot
|
[2026-03-20T13:24:19.213] Reboot executed (or simulated). Resetting failure counter.
|
||||||
[2026-03-20T08:37:37.969] 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-20T08:39:12.910] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
[2026-03-20T13:26:21.625] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
||||||
[2026-03-20T08:39:17.371] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
[2026-03-20T13:27:22.681] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
||||||
[2026-03-20T08:40:21.592] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
[2026-03-20T13:28:23.700] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 4/3.
|
||||||
[2026-03-20T08:41:25.719] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
[2026-03-20T13:29:04.947] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:41:25.720] Cooldown has expired and router is still unreachable. Triggering reboot.
|
[2026-03-20T13:29:06.721] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 5/3.
|
||||||
[2026-03-20T08:41:25.731] Executing reboot command: /bin/systemctl reboot
|
[2026-03-20T14:32:48.752] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:41:25.738] Reboot executed (or simulated). Resetting failure counter.
|
[2026-03-20T14:32:50.528] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 6/3.
|
||||||
[2026-03-20T08:43:02.074] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
[2026-03-20T14:32:51.123] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||||
[2026-03-20T08:43:06.506] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
[2026-03-20T14:32:51.128] Reboot executed (or simulated). Resetting failure counter.
|
||||||
[2026-03-20T08:44:10.719] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
[2026-03-20T14:33:52.347] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
||||||
[2026-03-20T08:45:14.847] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
[2026-03-20T14:34:53.367] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||||
[2026-03-20T08:45:14.848] Cooldown has expired and router is still unreachable. Triggering reboot.
|
[2026-03-20T14:35:54.418] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||||
[2026-03-20T08:45:14.859] Executing reboot command: /bin/systemctl reboot
|
[2026-03-20T14:35:54.452] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||||
[2026-03-20T08:45:14.866] Reboot executed (or simulated). Resetting failure counter.
|
[2026-03-20T14:35:54.455] Reboot executed (or simulated). Resetting failure counter.
|
||||||
[2026-03-20T08:46:49.831] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
[2026-03-20T14:36:55.528] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
||||||
[2026-03-20T08:46:54.237] 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-20T08:47:58.458] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
[2026-03-20T14:38:02.688] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||||
[2026-03-20T08:49:02.586] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
[2026-03-20T14:39:04.303] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||||
[2026-03-20T08:49:02.586] Cooldown has expired and router is still unreachable. Triggering reboot.
|
[2026-03-20T14:39:04.396] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||||
[2026-03-20T08:49:02.597] Executing reboot command: /bin/systemctl reboot
|
[2026-03-20T14:39:04.398] Reboot executed (or simulated). Resetting failure counter.
|
||||||
[2026-03-20T08:49:02.604] 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-20T08:50:37.054] 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-20T08:50:41.498] 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-20T08:51:45.720] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
[2026-03-20T14:40:28.984] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
||||||
[2026-03-20T08:52:49.848] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
[2026-03-20T14:41:30.736] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||||
[2026-03-20T08:52:49.849] Cooldown has expired and router is still unreachable. Triggering reboot.
|
[2026-03-20T14:41:30.836] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||||
[2026-03-20T08:52:49.859] Executing reboot command: /bin/systemctl reboot
|
[2026-03-20T14:41:30.839] Reboot executed (or simulated). Resetting failure counter.
|
||||||
[2026-03-20T08:52:49.867] 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-20T08:54:24.890] 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-20T08:54:29.366] 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-20T08:55:33.590] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 2/3.
|
[2026-03-20T14:44:16.617] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||||
[2026-03-20T08:56:37.653] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 3/3.
|
[2026-03-20T14:45:17.675] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||||
[2026-03-20T08:56:37.654] Cooldown has expired and router is still unreachable. Triggering reboot.
|
[2026-03-20T14:46:18.745] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||||
[2026-03-20T08:56:37.666] Executing reboot command: /bin/systemctl reboot
|
[2026-03-20T14:46:18.841] DRY RUN: would run reboot command: /usr/bin/sudo systemctl reboot
|
||||||
[2026-03-20T08:56:37.673] Reboot executed (or simulated). Resetting failure counter.
|
[2026-03-20T14:46:18.844] Reboot executed (or simulated). Resetting failure counter.
|
||||||
[2026-03-20T08:58:14.067] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
[2026-03-20T15:21:15.466] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
|
||||||
[2026-03-20T08:58:14.202] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T15:21:17.191] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 1/3.
|
||||||
[2026-03-20T08:59:14.320] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T15:22:18.736] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||||
[2026-03-20T09:00:14.415] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T15:23:19.802] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 3/3.
|
||||||
[2026-03-20T09:01:14.477] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T15:23:19.865] DRY RUN: would run reboot command: /bin/systemctl reboot
|
||||||
[2026-03-20T09:02:14.534] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T15:23:19.867] Reboot executed (or simulated). Resetting failure counter.
|
||||||
[2026-03-20T09:03:14.597] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T15:24:21.083] 192.168.88.1 is unreachable during cooldown. Consecutive fails: 1/3.
|
||||||
[2026-03-20T09:04:14.660] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
[2026-03-20T15:25:22.150] 192.168.88.1 is unreachable (last result: no response). Consecutive fails: 2/3.
|
||||||
[2026-03-20T09:05:14.722] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
|
||||||
[2026-03-20T09:06:14.784] 192.168.88.1 is reachable during cooldown. Router is back online! Resetting state.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user