ncc.zabbix_fbsd_templates

Yohn Y. 2024-12-20 Parent:0f46afe818e3

14:6f7c75523337 Go to Latest

ncc.zabbix_fbsd_templates/src/aw.fbsd-mon-helper/lib/log.sh

* Не верное расположение временных директорий

History
1 log_get_timer () {
2 date '+%s'
3 }
5 v_log_timer="$(log_get_timer)"
6 v_log_section="None"
8 log () {
9 logger -t "aw-fbsd-monitoring" "$@"
10 }
12 to_status () {
13 cat | awk -v n="$1" '{print n, " : ", $0}' >> "$STATE_ROOT/status"
14 }
16 log_err () {
17 log -p user.err -s "$@" 2<&1 | to_status
18 }
22 write_status () {
23 local module="$1"
24 shift
25 echo "$0" | to_status "$module"
26 }
28 log_start () {
29 log "$1: start"
30 v_log_timer="$(log_get_timer)"
31 v_log_section="$1"
32 }
34 log_end () {
35 local t
36 t="$(( $(log_get_timer) - $v_log_timer ))"
37 log "${v_log_section}: end in $t seconds"
38 }