normalized all charts.d plugins
Costa Tsaousis (ktsaou) committed
Nov 20, 2015 at 01:19 UTC
f86722e7a092f5d1c6c7815499bd61866c75045c
12 files changed
+119
-82
charts.d/airsearches.chart.sh
+24
-7
@@ -6,35 +6,52 @@ airsearches_update_every=15
6
7
airsearches_get() {
8
wget 2>/dev/null -O - "$airsearches_url" |\
9
- sed -e "s|<br />|\n|g" -e "s|: |=|g" -e "s| \+|_|g" |\
9
+ sed -e "s|<br />|\n|g" -e "s|: |=|g" -e "s| \+|_|g" -e "s/^/airsearches_/g" |\
10
tr "[A-Z]\.\!@#\$%^&*()_+\-" "[a-z]_____________" |\
11
- egrep "^[a-z0-9_]+=[0-9]+$" |\
12
- sort -u
11
+ egrep "^airsearches_[a-z0-9_]+=[0-9]+$"
12
}
13
14
airsearches_check() {
15
+ # make sure we have all the commands we need
16
+ require_cmd wget || return 1
17
+
18
+ # make sure we are configured
19
+ if [ -z "$airsearches_url" ]
20
+ then
21
+ echo >&2 "$PROGRAM_NAME: airsearches: not configured. Please set airsearches_url='url' in $confd/airsearches.conf"
22
+ return 1
23
+ fi
24
+
25
# check once if the url works
26
wget 2>/dev/null -O /dev/null "$airsearches_url"
27
if [ ! $? -eq 0 ]
28
then
20
- echo >&2 "airsearches: cannot fetch the url: $airsearches_url. Please set airsearches_url='url' in $confd/airsearches.conf"
29
+ echo >&2 "$PROGRAM_NAME: airsearches: cannot fetch the url: $airsearches_url. Please set airsearches_url='url' in $confd/airsearches.conf"
30
return 1
31
fi
32
33
+ # if the admin did not give any commands
34
+ # find the available ones
35
if [ -z "$airsearches_cmds" ]
36
then
26
- airsearches_cmds="`airsearches_get | cut -d '=' -f 1`"
37
+ airsearches_cmds="$(airsearches_get | cut -d '=' -f 1 | sed "s/^airsearches_//g" | sort -u)"
38
echo
39
fi
40
+
41
+ # did we find any commands?
42
if [ -z "$airsearches_cmds" ]
43
then
31
- echo >&2 "airsearches: cannot find command list automatically. Please set airsearches_cmds='...' in $confd/airsearches.conf"
44
+ echo >&2 "$PROGRAM_NAME: airsearches: cannot find command list automatically. Please set airsearches_cmds='...' in $confd/airsearches.conf"
45
return 1
46
fi
47
+
48
+ # ok we can do it
49
return 0
50
}
51
52
airsearches_create() {
53
+ [ -z "$airsearches_cmds" ] && return 1
54
+
55
# create the charts
56
local x=
57
echo "CHART airsearches.affiliates '' 'Air Searches per affiliate' 'requests / min' airsearches '' stacked 20000 $airsearches_update_every"
@@ -55,7 +72,7 @@ airsearches_update() {
72
# remember: KEEP IT SIMPLE AND SHORT
73
74
# get the values from airsearches
58
- eval "`airsearches_get | sed "s/^/airsearches_/g"`"
75
+ eval "$(airsearches_get)"
76
77
# write the result of the work.
78
local x=
charts.d/cpu_apps.chart.sh
+7
-3
@@ -1,10 +1,14 @@
1
#!/bin/sh
2
3
-cpu_apps_apps="netdata asterisk squid apache2 mysqld dovecot cupsd sshd named clamd smbd"
3
+# THIS PLUGIN IS OBSOLETE
4
+# USE apps.plugin INSTEAD
5
+
6
+# a space separated list of command to monitor
7
+cpu_apps_apps=
8
9
# these are required for computing memory in bytes and cpu in seconds
10
#cpu_apps_pagesize="`getconf PAGESIZE`"
7
-cpu_apps_clockticks="`getconf CLK_TCK`"
11
+cpu_apps_clockticks="$(getconf CLK_TCK)"
12
13
cpu_apps_update_every=60
14
@@ -15,7 +19,7 @@ cpu_apps_check() {
19
20
if [ -z "$cpu_apps_apps" ]
21
then
18
- echo >&2 "cpu_apps: Please set cpu_apps_apps='command1 command2 ...' in $confd/cpu_apps_apps.conf"
22
+ echo >&2 "$PROGRAM_NAME: cpu_apps: Please set cpu_apps_apps='command1 command2 ...' in $confd/cpu_apps_apps.conf"
23
return 1
24
fi
25
return 0
charts.d/cpufreq.chart.sh
+2
-2
@@ -22,8 +22,8 @@ cpufreq_check() {
22
# - 0 to enable the chart
23
# - 1 to disable the chart
24
25
- [ ! -z "$( cpufreq_find_all_files $cpufreq_sys_dir )" ] && return 0
26
- return 1
25
+ [ -z "$( cpufreq_find_all_files $cpufreq_sys_dir )" ] && return 1
26
+ return 0
27
}
28
29
# _create is called once, to create the charts
charts.d/crsproxy.chart.sh
+27
-9
@@ -1,26 +1,46 @@
1
#!/bin/sh
2
3
-crsproxy_url="http://127.0.0.1:7999/counters?"
4
-crsproxy_cmds=""
3
+crsproxy_url=
4
+crsproxy_cmds=
5
crsproxy_update_every=15
6
7
+crsproxy_get() {
8
+ wget 2>/dev/null -O - "$crsproxy_url" |\
9
+ sed \
10
+ -e "s/ \+/ /g" \
11
+ -e "s/\./_/g" \
12
+ -e "s/ =/=/g" \
13
+ -e "s/= /=/g" \
14
+ -e "s/^/crsproxy_/g" |\
15
+ egrep "^crsproxy_[a-zA-Z][a-zA-Z0-9_]*=[0-9]+$"
16
+}
17
+
18
crsproxy_check() {
19
+ if [ -z "$crsproxy_url" ]
20
+ then
21
+ echo >&2 "$PROGRAM_NAME: crsproxy: not configured. Please set crsproxy_url='url' in $confd/crsproxy.conf"
22
+ return 1
23
+ fi
24
+
25
# check once if the url works
26
wget 2>/dev/null -O /dev/null "$crsproxy_url"
27
if [ ! $? -eq 0 ]
28
then
12
- echo >&2 "crsproxy: cannot fetch the url: $crsproxy_url. Please set crsproxy_url='url' in $confd/crsproxy.conf"
29
+ echo >&2 "$PROGRAM_NAME: crsproxy: cannot fetch the url: $crsproxy_url. Please set crsproxy_url='url' in $confd/crsproxy.conf"
30
return 1
31
fi
32
33
+ # if the user did not request specific commands
34
+ # find the commands available
35
if [ -z "$crsproxy_cmds" ]
36
then
18
- crsproxy_cmds="`wget 2>/dev/null -O - "$crsproxy_url" | egrep "^cmd_[a-zA-Z][a-zA-Z0-9]_[a-z_]+ *= *[0-9]+$" | cut -d '_' -f 2 | sort -u`"
19
- echo
37
+ crsproxy_cmds="$(crsproxy_get | cut -d '=' -f 1 | sed "s/^crsproxy_cmd_//g" | sort -u)"
38
fi
39
+
40
+ # if no commands are available
41
if [ -z "$crsproxy_cmds" ]
42
then
23
- echo >&2 "crsproxy: cannot find command list automatically. Please set crsproxy_cmds='...' in $confd/crsproxy.conf"
43
+ echo >&2 "$PROGRAM_NAME: crsproxy: cannot find command list automatically. Please set crsproxy_cmds='...' in $confd/crsproxy.conf"
44
return 1
45
fi
46
return 0
@@ -74,9 +94,7 @@ crsproxy_update() {
94
# remember: KEEP IT SIMPLE AND SHORT
95
96
# get the values from crsproxy
77
- eval "`wget 2>/dev/null -O - "$crsproxy_url" |\
78
- sed -e "s/ \+/ /g" -e "s/\./_/g" -e "s/ = /=/g" -e "s/^/crsproxy_/g" |\
79
- egrep "^crsproxy_[a-zA-Z][a-zA-Z0-9_]*=[0-9]+$"`"
97
+ eval "$(crsproxy_get)"
98
99
100
# write the result of the work.
charts.d/mem_apps.chart.sh
+2
-2
@@ -1,6 +1,6 @@
1
#!/bin/sh
2
3
-mem_apps_apps="netdata asterisk squid apache2 mysqld dovecot cupsd sshd named clamd smbd"
3
+mem_apps_apps=
4
5
# these are required for computing memory in bytes and cpu in seconds
6
#mem_apps_pagesize="`getconf PAGESIZE`"
@@ -15,7 +15,7 @@ mem_apps_check() {
15
16
if [ -z "$mem_apps_apps" ]
17
then
18
- echo >&2 "mem_apps: Please set mem_apps_apps='command1 command2 ...' in $confd/mem_apps_apps.conf"
18
+ echo >&2 "$PROGRAM_NAME: mem_apps: not configured. Please set mem_apps_apps='command1 command2 ...' in $confd/mem_apps_apps.conf"
19
return 1
20
fi
21
return 0
charts.d/mysql.chart.sh
+6
-8
@@ -28,9 +28,6 @@ mysql_check() {
28
29
local x m mysql_cmd
30
31
- require_cmd egrep || return 1
32
- require_cmd sed || return 1
33
-
31
[ -z "${mysql_cmd}" ] && mysql_cmd="$(which mysql)"
32
33
if [ ${#mysql_opts[@]} -eq 0 ]
@@ -45,13 +42,13 @@ mysql_check() {
42
[ -z "${mysql_cmds[$m]}" ] && mysql_cmds[$m]="$mysql_cmd"
43
if [ -z "${mysql_cmds[$m]}" ]
44
then
48
- echo >&2 "mysql: cannot get mysql command for '$m'. Please set mysql_cmds[$m]='/path/to/mysql', in $confd/mysql.conf"
45
+ echo >&2 "$PROGRAM_NAME: mysql: cannot get mysql command for '$m'. Please set mysql_cmds[$m]='/path/to/mysql', in $confd/mysql.conf"
46
fi
47
48
x="$(mysql_get "${mysql_cmds[$m]}" ${mysql_opts[$m]} | grep "^Connections[[:space:]]")"
49
if [ ! $? -eq 0 -o -z "$x" ]
50
then
54
- echo >&2 "mysql: cannot get global status for '$m'. Please set mysql_opts[$m]='options' to whatever needed to get connected to the mysql server, in $confd/mysql.conf"
51
+ echo >&2 "$PROGRAM_NAME: mysql: cannot get global status for '$m'. Please set mysql_opts[$m]='options' to whatever needed to get connected to the mysql server, in $confd/mysql.conf"
52
unset mysql_cmds[$m]
53
unset mysql_opts[$m]
54
unset mysql_ids[$m]
@@ -63,7 +60,8 @@ mysql_check() {
60
61
if [ ${#mysql_opts[@]} -eq 0 ]
62
then
66
- echo >&2 "mysql: no mysql servers found. Please set mysql_opts[name]='options' to whatever needed to get connected to the mysql server, in $confd/mysql.conf"
63
+ echo >&2 "$PROGRAM_NAME: mysql: no mysql servers found. Please set mysql_opts[name]='options' to whatever needed to get connected to the mysql server, in $confd/mysql.conf"
64
+ return 1
65
fi
66
67
return 0
@@ -157,7 +155,7 @@ mysql_update() {
155
unset mysql_ids[$m]
156
unset mysql_opts[$m]
157
unset mysql_cmds[$m]
160
- echo >&2 "mysql: failed to get values for '$m', disabling it."
158
+ echo >&2 "$PROGRAM_NAME: mysql: failed to get values for '$m', disabling it."
159
continue
160
fi
161
@@ -209,7 +207,7 @@ END
207
VALUESEOF
208
done
209
212
- [ ${#mysql_ids[@]} -eq 0 ] && echo >&2 "mysql: no mysql servers left active." && return 1
210
+ [ ${#mysql_ids[@]} -eq 0 ] && echo >&2 "$PROGRAM_NAME: mysql: no mysql servers left active." && return 1
211
return 0
212
}
213
charts.d/nut.chart.sh
-2
@@ -27,9 +27,7 @@ nut_check() {
27
28
local x
29
30
- require_cmd timeout || return 1
30
require_cmd upsc || return 1
32
- require_cmd awk || return 1
31
32
[ -z "$nut_ups" ] && nut_ups="$( nut_get_all )"
33
charts.d/opensips.chart.sh
+15
-31
@@ -1,14 +1,15 @@
1
#!/bin/sh
2
3
opensips_opts="fifo get_statistics all"
4
-opensips_cmd="opensipsctl"
4
+opensips_cmd=
5
opensips_update_every=5
6
opensips_timeout=2
7
8
opensips_get_stats() {
9
timeout $opensips_timeout "$opensips_cmd" $opensips_opts |\
10
grep "^\(core\|dialog\|net\|registrar\|shmem\|siptrace\|sl\|tm\|uri\|usrloc\):[a-zA-Z0-9_ -]\+[[:space:]]*=[[:space:]]*[0-9]\+[[:space:]]*$" |\
11
- sed -e "s|-|_|g" \
11
+ sed \
12
+ -e "s|-|_|g" \
13
-e "s|:|_|g" \
14
-e "s|[[:space:]]\+=[[:space:]]\+|=|g" \
15
-e "s|[[:space:]]\+$||" \
@@ -22,13 +23,18 @@ opensips_get_stats() {
23
}
24
25
opensips_check() {
25
- require_cmd timeout || return 1
26
+ # if the user did not provide an opensips_cmd
27
+ # try to find it in the system
28
+ if [ -z "$opensips_cmd" ]
29
+ then
30
+ require_cmd opensipsctl || return 1
31
+ fi
32
27
- # check once if the url works
33
+ # check once if the command works
34
local x="$(opensips_get_stats | grep "^opensips_core_")"
35
if [ ! $? -eq 0 -o -z "$x" ]
36
then
31
- echo >&2 "opensips: cannot get global status. Please set opensips_opts='options' whatever needed to get connected to opensips server, in $confd/opensips.conf"
37
+ echo >&2 "$PROGRAM_NAME: opensips: cannot get global status. Please set opensips_opts='options' whatever needed to get connected to opensips server, in $confd/opensips.conf"
38
return 1
39
fi
40
@@ -141,7 +147,6 @@ opensips_update() {
147
148
# do all the work to collect / calculate the values
149
# for each dimension
144
- # remember: KEEP IT SIMPLE AND SHORT
150
151
# 1. get the counters page from opensips
152
# 2. sed to remove spaces; replace . with _; remove spaces around =; prepend each line with: local opensips_
@@ -149,10 +154,9 @@ opensips_update() {
154
# local opensips_client_http_ then one or more of these a-z 0-9 _ then = and one of more of 0-9
155
# local opensips_server_all_ then one or more of these a-z 0-9 _ then = and one of more of 0-9
156
# 4. then execute this as a script with the eval
152
- #
153
- # be very carefull with eval:
154
- # prepare the script and always grep at the end the lines that are usefull, so that
155
- # even if something goes wrong, no other code can be executed
157
+ # be very carefull with eval:
158
+ # prepare the script and always grep at the end the lines that are usefull, so that
159
+ # even if something goes wrong, no other code can be executed
160
161
unset \
162
opensips_dialog_active_dialogs \
@@ -214,65 +218,54 @@ opensips_update() {
218
eval "local $(opensips_get_stats)"
219
[ $? -ne 0 ] && return 1
220
217
- [ $opensips_command_failed -eq 1 ] && echo >&2 "opensips: failed to get values, disabling." && return 1
221
+ [ $opensips_command_failed -eq 1 ] && echo >&2 "$PROGRAM_NAME: opensips: failed to get values, disabling." && return 1
222
223
# write the result of the work.
224
cat <<VALUESEOF
221
-
225
BEGIN opensips.dialogs_active $1
226
SET dialog_active_dialogs = $opensips_dialog_active_dialogs
227
SET dialog_early_dialogs = $opensips_dialog_early_dialogs
228
END
226
-
229
BEGIN opensips.users $1
230
SET usrloc_registered_users = $opensips_usrloc_registered_users
231
SET usrloc_location_users = $opensips_usrloc_location_users
232
SET usrloc_location_contacts = $opensips_usrloc_location_contacts
233
SET usrloc_location_expires = $opensips_usrloc_location_expires
234
END
233
-
235
BEGIN opensips.registrar $1
236
SET registrar_accepted_regs = $opensips_registrar_accepted_regs
237
SET registrar_rejected_regs = $opensips_registrar_rejected_regs
238
END
238
-
239
BEGIN opensips.transactions $1
240
SET tm_UAS_transactions = $opensips_tm_UAS_transactions
241
SET tm_UAC_transactions = $opensips_tm_UAC_transactions
242
END
243
-
243
BEGIN opensips.core_rcv $1
244
SET core_rcv_requests = $opensips_core_rcv_requests
245
SET core_rcv_replies = $opensips_core_rcv_replies
246
END
248
-
247
BEGIN opensips.core_fwd $1
248
SET core_fwd_requests = $opensips_core_fwd_requests
249
SET core_fwd_replies = $opensips_core_fwd_replies
250
END
253
-
251
BEGIN opensips.core_drop $1
252
SET core_drop_requests = $opensips_core_drop_requests
253
SET core_drop_replies = $opensips_core_drop_replies
254
END
258
-
255
BEGIN opensips.core_err $1
256
SET core_err_requests = $opensips_core_err_requests
257
SET core_err_replies = $opensips_core_err_replies
258
END
263
-
259
BEGIN opensips.core_bad $1
260
SET core_bad_URIs_rcvd = $opensips_core_bad_URIs_rcvd
261
SET core_unsupported_methods = $opensips_core_unsupported_methods
262
SET core_bad_msg_hdr = $opensips_core_bad_msg_hdr
263
END
269
-
264
BEGIN opensips.tm_replies $1
265
SET tm_received_replies = $opensips_tm_received_replies
266
SET tm_relayed_replies = $opensips_tm_relayed_replies
267
SET tm_local_replies = $opensips_tm_local_replies
268
END
275
-
269
BEGIN opensips.transactions_status $1
270
SET tm_2xx_transactions = $opensips_tm_2xx_transactions
271
SET tm_3xx_transactions = $opensips_tm_3xx_transactions
@@ -280,11 +273,9 @@ SET tm_4xx_transactions = $opensips_tm_4xx_transactions
273
SET tm_5xx_transactions = $opensips_tm_5xx_transactions
274
SET tm_6xx_transactions = $opensips_tm_6xx_transactions
275
END
283
-
276
BEGIN opensips.transactions_inuse $1
277
SET tm_inuse_transactions = $opensips_tm_inuse_transactions
278
END
287
-
279
BEGIN opensips.sl_replies $1
280
SET sl_1xx_replies = $opensips_sl_1xx_replies
281
SET sl_2xx_replies = $opensips_sl_2xx_replies
@@ -296,28 +287,23 @@ SET sl_sent_replies = $opensips_sl_sent_replies
287
SET sl_sent_err_replies = $opensips_sl_sent_err_replies
288
SET sl_received_ACKs = $opensips_sl_received_ACKs
289
END
299
-
290
BEGIN opensips.dialogs $1
291
SET dialog_processed_dialogs = $opensips_dialog_processed_dialogs
292
SET dialog_expired_dialogs = $opensips_dialog_expired_dialogs
293
SET dialog_failed_dialogs = $opensips_dialog_failed_dialogs
294
END
305
-
295
BEGIN opensips.net_waiting $1
296
SET net_waiting_udp = $opensips_net_waiting_udp
297
SET net_waiting_tcp = $opensips_net_waiting_tcp
298
END
310
-
299
BEGIN opensips.uri_checks $1
300
SET uri_positive_checks = $opensips_uri_positive_checks
301
SET uri_negative_checks = $opensips_uri_negative_checks
302
END
315
-
303
BEGIN opensips.traces $1
304
SET siptrace_traced_requests = $opensips_siptrace_traced_requests
305
SET siptrace_traced_replies = $opensips_siptrace_traced_replies
306
END
320
-
307
BEGIN opensips.shmem $1
308
SET shmem_total_size = $opensips_shmem_total_size
309
SET shmem_used_size = $opensips_shmem_used_size
@@ -325,7 +311,6 @@ SET shmem_real_used_size = $opensips_shmem_real_used_size
311
SET shmem_max_used_size = $opensips_shmem_max_used_size
312
SET shmem_free_size = $opensips_shmem_free_size
313
END
328
-
314
BEGIN opensips.shmem_fragments $1
315
SET shmem_fragments = $opensips_shmem_fragments
316
END
@@ -333,4 +318,3 @@ VALUESEOF
318
319
return 0
320
}
336
-
charts.d/postfix.chart.sh
+1
-1
@@ -32,7 +32,7 @@ postfix_check() {
32
33
if [ -z "$postfix_postqueue" -o ! -x "$postfix_postqueue" ]
34
then
35
- echo >&2 "postfix: cannot find postqueue. Please set 'postfix_postqueue=/path/to/postqueue' in $confd/postfix.conf"
35
+ echo >&2 "$PROGRAM_NAME: postfix: cannot find postqueue. Please set 'postfix_postqueue=/path/to/postqueue' in $confd/postfix.conf"
36
return 1
37
fi
38
charts.d/sensors.chart.sh
+4
-4
@@ -39,8 +39,8 @@ sensors_check() {
39
# - 0 to enable the chart
40
# - 1 to disable the chart
41
42
- [ ! -z "$( sensors_find_all_files $sensors_sys_dir )" ] && return 0
43
- return 1
42
+ [ -z "$( sensors_find_all_files $sensors_sys_dir )" ] && echo >&2 "$PROGRAM_NAME: sensors: no sensors found in '$sensors_sys_dir'." && return 1
43
+ return 0
44
}
45
46
sensors_check_files() {
@@ -55,7 +55,7 @@ sensors_check_files() {
55
v=$(( v + 1 - 1 ))
56
[ $v -ne 0 ] && echo "$f" && continue
57
58
- echo >&2 "charts.d: sensors: $f gives zero values"
58
+ echo >&2 "$PROGRAM_NAME: sensors: $f gives zero values"
59
done
60
}
61
@@ -74,7 +74,7 @@ sensors_check_temp_type() {
74
v=$(( v + 1 - 1 ))
75
[ $v -ne 0 ] && echo "$f" && continue
76
77
- echo >&2 "charts.d: sensors: $f is disabled"
77
+ echo >&2 "$PROGRAM_NAME: sensors: $f is disabled"
78
done
79
}
80
conf.d/Makefile.am
-1
@@ -4,6 +4,5 @@
4
MAINTAINERCLEANFILES= $(srcdir)/Makefile.in
5
6
dist_config_DATA = \
7
- charts.d.conf \
7
apps_groups.conf \
8
$(NULL)
plugins.d/charts.d.plugin
+31
-12
@@ -40,7 +40,9 @@ require_cmd basename || exit 1
40
require_cmd dirname || exit 1
41
require_cmd cat || exit 1
42
require_cmd grep || exit 1
43
+require_cmd egrep || exit 1
44
require_cmd mktemp || exit 1
45
+require_cmd awk || exit 1
46
47
# -----------------------------------------------------------------------------
48
# insternal defaults
@@ -90,6 +92,9 @@ restart_timeout=1800
92
# disabled
93
dryrunner=0
94
95
+# check for timeout command
96
+check_for_timeout=1
97
+
98
# -----------------------------------------------------------------------------
99
# parse parameters
100
@@ -160,6 +165,8 @@ if [ -f "$myconfig" ]
165
time_divisor=$((time_divisor))
166
[ $time_divisor -lt 10 ] && time_divisor=10
167
[ $time_divisor -gt 100 ] && time_divisor=100
168
+else
169
+ echo >&2 "$PROGRAM_NAME: configuration file '$myconfig' not found. Using defaults."
170
fi
171
172
if [ "$pause_method" = "suspend" ]
@@ -169,6 +176,16 @@ then
176
set -m
177
fi
178
179
+# we check for the timeout command, after we load our
180
+# configuration, so that the user may overwrite the
181
+# timeout command we use, providing a function that
182
+# can emulate the timeout command we need:
183
+# > timeout SECONDS command ...
184
+if [ $check_for_timeout -eq 1 ]
185
+ then
186
+ require_cmd timeout || exit 1
187
+fi
188
+
189
# -----------------------------------------------------------------------------
190
# internal checks
191
@@ -233,12 +250,12 @@ all_enabled_charts() {
250
for chart in $( all_charts )
251
do
252
eval "enabled=\$$chart"
236
- if [ "$enabled" = "yes" ]
253
+ if [ "$enabled" = "no" ]
254
then
255
+ echo >&2 "$PROGRAM_NAME: '$chart' is NOT enabled. Add a line with $chart=yes in $myconfig to enable it (or remove the line that disables it)."
256
+ else
257
[ $debug -eq 1 ] && echo >&2 "$PROGRAM_NAME: '$chart' is enabled."
258
local charts="$charts $chart"
240
- else
241
- echo >&2 "$PROGRAM_NAME: '$chart' is NOT enabled. Add a line with $chart=yes in $myconfig to enable it."
259
fi
260
done
261
@@ -277,15 +294,15 @@ all_enabled_charts() {
294
# fi
295
#fi
296
280
- if [ $dryrunner -eq 1 ]
281
- then
282
- "$pluginsd/charts.d.dryrun-helper.sh" "$chart" "$chartsd/$chart.chart.sh" "$confd/$chart.conf" >/dev/null
283
- if [ $? -ne 0 ]
284
- then
285
- echo >&2 "$PROGRAM_NAME: chart's $chart did not pass the dry run check. This means it uses global variables not starting with $chart. Disabling it."
286
- continue
287
- fi
288
- fi
297
+ #if [ $dryrunner -eq 1 ]
298
+ # then
299
+ # "$pluginsd/charts.d.dryrun-helper.sh" "$chart" "$chartsd/$chart.chart.sh" "$confd/$chart.conf" >/dev/null
300
+ # if [ $? -ne 0 ]
301
+ # then
302
+ # echo >&2 "$PROGRAM_NAME: chart's $chart did not pass the dry run check. This means it uses global variables not starting with $chart. Disabling it."
303
+ # continue
304
+ # fi
305
+ #fi
306
307
local charts2="$charts2 $chart"
308
done
@@ -309,6 +326,8 @@ do
326
then
327
[ $debug -eq 1 ] && echo >&2 "$PROGRAM_NAME: loading chart options: '$confd/$chart.conf'"
328
. "$confd/$chart.conf"
329
+ else
330
+ echo >&2 "$PROGRAM_NAME: $chart: configuration file '$confd/$chart.conf' not found. Using defaults."
331
fi
332
333
eval "dt=\$$chart$suffix_update_every"