monitower

nimble and trivial monitoring suite
Log | Files | Refs

commit 192b6422061ba39d9afa887ef8d56e8e5ecfd745
parent 0e5cbc0c7c1ca16274356504f146a39e5ef58745
Author: Josuah Demangeon <me@josuah.net>
Date:   Thu, 24 Sep 2020 08:19:17 +0200

seemingly working

Diffstat:
Mbin/check-dns | 4+++-
Mbin/check-tcp | 4+++-
Mbin/monitower-event | 5+----
3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/bin/check-dns b/bin/check-dns @@ -1,4 +1,6 @@ #!/bin/sh -eu for x; do export "var_$x"; done -exec dig -t "$var_type" "@$var_ip" "$var_dom" +: ${var_timeout:=3} + +exec dig +timeout="$var_timeout" -t "$var_type" "@$var_ip" "$var_dom" diff --git a/bin/check-tcp b/bin/check-tcp @@ -1,4 +1,6 @@ #!/bin/sh -eu for x; do export "var_$x"; done -exec nc -vz "$var_ip" "$var_port" +: ${var_timeout:=3} + +exec nc -w "$var_timeout" -vz "$var_ip" "$var_port" diff --git a/bin/monitower-event b/bin/monitower-event @@ -1,6 +1,3 @@ #!/bin/sh -eu -# Trigger an alert on monitoring event failure. - -printf ' [["%s"]]' "$@" -printf '\n' +exec logger -nc -d "$*" -t monitower -p alert