Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Status for OMR-Tracker scripts #463

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions omr-tracker/files/bin/omr-tracker-server
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ basename="$(basename $0)"

. /usr/lib/unbound/iptools.sh

export OMR_TRACKER_STATUS
export OMR_TRACKER_STATUS_MSG

_log() {
logger -p daemon.info -t "${basename}" "$@"
}
Expand Down Expand Up @@ -213,6 +216,7 @@ _check_master() {
echo -e "Subject: $OMR_SYSNAME: Server ${name} (${ip}) is UP\n. The reason is \"$OMR_TRACKER_STATUS_MSG\"." | sendmail $(uci -q get mail.default.to)
fi
}
OMR_TRACKER_STATUS="OK"
script_alert_up="$(uci -q get omr-tracker.proxy.script_alert_up)"
[ -n "$script_alert_up" ] && eval $script_alert_up
count=$((count+1))
Expand Down Expand Up @@ -241,6 +245,7 @@ _check_master() {
echo -e "Subject: $OMR_SYSNAME: Server ${name} (${ip}) is down\n. The reason is \"$OMR_TRACKER_STATUS_MSG\"." | sendmail $(uci -q get mail.default.to)
fi
}
OMR_TRACKER_STATUS="ERROR"
script_alert_down="$(uci -q get omr-tracker.proxy.script_alert_down)"
[ -n "$script_alert_down" ] && eval $script_alert_down
fi
Expand Down
4 changes: 4 additions & 0 deletions omr-tracker/files/bin/omr-tracker-ss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ else
IPTABLESSAVE="/usr/sbin/iptables-save"
fi

export OMR_TRACKER_STATUS
export OMR_TRACKER_PREV_STATUS
export OMR_TRACKER_STATUS_MSG



_log() {
Expand Down
4 changes: 4 additions & 0 deletions omr-tracker/files/bin/omr-tracker-v2ray
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ else
IPTABLES="/usr/sbin/iptables"
fi

export OMR_TRACKER_STATUS
export OMR_TRACKER_PREV_STATUS
export OMR_TRACKER_STATUS_MSG


_log() {
logger -p daemon.info -t "${basename}" "$@"
Expand Down
3 changes: 3 additions & 0 deletions omr-tracker/files/bin/omr-tracker-xray
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ else
IPTABLES="/usr/sbin/iptables"
fi

export OMR_TRACKER_STATUS
export OMR_TRACKER_PREV_STATUS
export OMR_TRACKER_STATUS_MSG

_log() {
logger -p daemon.info -t "${basename}" "$@"
Expand Down