-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhost-uptime-checker.sh
executable file
·30 lines (23 loc) · 1.06 KB
/
host-uptime-checker.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# debugging switches
# set -o errexit # abort on nonzero exitstatus; same as set -e
# set -o nounset # abort on unbound variable; same as set -u
# set -o pipefail # don't hide errors within pipes
# set -o xtrace # show commands being executed; same as set -x
# set -o verbose # verbose mode; same as set -v
source /srv/timbos-hn-reader/functions.sh
source /srv/timbos-hn-reader/thnr-common-functions.sh
project_base_dir="/srv/timbos-hn-reader/"
uptime_seconds=$(cat /proc/uptime | awk '{print $1}')
uptime_seconds_whole="${uptime_seconds%%.*}"
uptime_pretty=$(prettify-duration-seconds ${uptime_seconds_whole})
"${project_base_dir}send-dashboard-event-to-kafka2.sh" \
"timestamps" "$(get-time-in-unix-seconds)" "" \
"operation" "update-text-content" \
"elementId" "scraper-host-uptime-pretty" \
"value" "${uptime_pretty}"
# "${project_base_dir}send-dashboard-event-to-kafka2.sh" \
# "operation" "update-text-content" \
# "elementId" "scraper-host-stats-last-updated-iso8601" \
# "value" "$(get-iso8601-date)"
exit 0