]> arthur.barton.de Git - netdata.git/blob - charts.d/exim.chart.sh
better log management for charts.d.plugin - fixes #1144
[netdata.git] / charts.d / exim.chart.sh
1 # no need for shebang - this file is loaded from charts.d.plugin
2
3 # the exim command to run
4 exim_command=
5
6 # how frequently to collect queue size
7 exim_update_every=5
8
9 exim_priority=60000
10
11 exim_check() {
12     if [ -z "${exim_command}" ]
13     then
14         require_cmd exim || return 1
15         exim_command="${EXIM_CMD}"
16     fi
17
18         if [ $(${exim_command} -bpc 2>&1 | grep -c denied) -ne 0 ]
19         then
20                 error "permission denied - please set 'queue_list_requires_admin = false' in your exim options file"
21                 return 1
22         fi
23
24         return 0
25 }
26
27 exim_create() {
28     cat <<EOF
29 CHART exim_local.qemails '' "Exim Queue Emails" "emails" queue exim.queued.emails line $((exim_priority + 1)) $exim_update_every
30 DIMENSION emails '' absolute 1 1
31 EOF
32     return 0
33 }
34
35 exim_update() {
36     echo "BEGIN exim_local.qemails $1"
37     echo "SET emails = " $(run ${exim_command} -bpc)
38     echo "END"
39     return 0
40 }