-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Monitor System Upgrades with Healthchecks.io
- Loading branch information
Showing
9 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
{ config, pkgs, ... }: | ||
{ | ||
age.secrets.monitoring-healthchecks-url.file = ../secrets/monitoring-healthchecks-url.age; | ||
|
||
|
||
# [Unit] | ||
# Description=Important service | ||
# OnFailure=healthchecks-monitor@deda567a-21e0-4744-ba9e-603c51e258b0:failure.service | ||
# OnSuccess=healthcheck-monitor@deda567a-21e0-4744-ba9e-603c51e258b0:success.service | ||
# Wants=healthcheck-monitor@deda567a-21e0-4744-ba9e-603c51e258b0:start.service | ||
|
||
systemd.services.healthchecks-monitor = { | ||
description = "Pings healthchecks (%i)"; | ||
wantedBy = [ "multi-user.target" ]; | ||
path = [ pkgs.curl ]; | ||
scriptArgs = "%i"; | ||
script = '' | ||
HC_URL=$(cat ${age.secrets.monitoring-healthchecks-url.file}) | ||
IFS=: read -r SLUG ACTION <<< "%i" | ||
if [ "$ACTION" = "start" ]; then | ||
LOGS="" | ||
EXIT_CODE="start" | ||
else | ||
LOGS=$(journalctl --no-pager -n 50 -u $MONITOR_UNIT) | ||
EXIT_CODE=$MONITOR_EXIT_STATUS | ||
fi | ||
curl -fSs -m 10 --retry 3 --data-raw "$LOGS" "$HC_URL/$SLUG/$EXIT_CODE?create=1" | ||
''; | ||
serviceConfig = { | ||
Type = "oneshot"; | ||
}; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
age-encryption.org/v1 | ||
-> ssh-ed25519 wif8hg y9pSpLSRoSL33nMjYmiQXHJoF6iNaHwmy9yYv7083HA | ||
3f2i9v701+Anszp08IKzDJ7FMLJynNa7CZaUE1U86fU | ||
-> ssh-ed25519 UoFiFw XEQeUqkKDKlmq62EFKGuUJHdW2Joe/VIeZYZSfszLDg | ||
2g4e+iYXjq+MwdvGr5zD6q+bsWCQfPpZdzDJoNTqngs | ||
-> ssh-ed25519 iBa5uA NuUybgtIFuid8kX1SrzV9oc6cfZqbPB9yZ1CFNUXpnA | ||
+pIUsAi6dlCKUs6muzh1indPpCuvAdGWSp+5G+0UdCs | ||
-> ssh-ed25519 zwzZhA ciDHJxI/j+Pv4+mLdZTGKhgu5xkBX/wNxwjWSyB5fEo | ||
sQOj9R0GYmQ7leKK2YR8YKHLM9qKWU1mMjRN9cXw1Og | ||
-> ssh-ed25519 32ekKQ SEPfPSNhe0g97C2XecG9yOWFpjBAkbzf50M+r3sojkE | ||
X5GnBPqzFsEOSvX5XVsmKkj4PkWncE6M8CsVQ1wzCYw | ||
-> ssh-ed25519 ogl6Cg Vos8gCiIMfnby8nQYwbabbOl952zJpInv9O3ma48eG4 | ||
ZXhR+69Gxc+7eoQbc++wraTTQB7Iz+UrRtlM+REwm1M | ||
--- UvVdQOF5XJaSv6SqmxXiErVEZUh1Uc96J+yWItlibxM | ||
�_��z�M����n����,��z�m�ԪƢ�*Rz5�|p[5���`�����<�7�Ξ\zy%����� |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters