collectd: expose more global parameters to uci
Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
This commit is contained in:
parent
a5d87390f2
commit
8ab9fd7fff
|
@ -286,7 +286,8 @@ process_plugins() {
|
||||||
|
|
||||||
process_config() {
|
process_config() {
|
||||||
local alt_config_file BaseDir Include PIDFile PluginDir TypesDB
|
local alt_config_file BaseDir Include PIDFile PluginDir TypesDB
|
||||||
local Interval ReadThreads Hostname
|
local Interval ReadThreads WriteThreads Hostname
|
||||||
|
local WriteQueueLimitHigh WriteQueueLimitLow CollectInternalStats
|
||||||
|
|
||||||
rm -f "$COLLECTD_CONF"
|
rm -f "$COLLECTD_CONF"
|
||||||
|
|
||||||
|
@ -321,7 +322,25 @@ process_config() {
|
||||||
printf "Interval %s\n" "$Interval" >> "$COLLECTD_CONF"
|
printf "Interval %s\n" "$Interval" >> "$COLLECTD_CONF"
|
||||||
|
|
||||||
config_get ReadThreads globals ReadThreads 2
|
config_get ReadThreads globals ReadThreads 2
|
||||||
printf "ReadThreads \"%s\"\n" "$ReadThreads" >> "$COLLECTD_CONF"
|
printf "ReadThreads %s\n" "$ReadThreads" >> "$COLLECTD_CONF"
|
||||||
|
|
||||||
|
config_get WriteThreads globals WriteThreads 2
|
||||||
|
printf "WriteThreads %s\n" "$WriteThreads" >> "$COLLECTD_CONF"
|
||||||
|
|
||||||
|
config_get WriteQueueLimitLow globals WriteQueueLimitLow 0
|
||||||
|
[ "$WriteQueueLimitLow" -ne 0 ] \
|
||||||
|
&& printf "WriteQueueLimitLow %s\n" "$WriteQueueLimitLow" >> "$COLLECTD_CONF"
|
||||||
|
|
||||||
|
config_get WriteQueueLimitHigh globals WriteQueueLimitHigh 0
|
||||||
|
[ "$WriteQueueLimitHigh" -ne 0 ] \
|
||||||
|
&& printf "WriteQueueLimitHigh %s\n" "$WriteQueueLimitHigh" >> "$COLLECTD_CONF"
|
||||||
|
|
||||||
|
config_get_bool CollectInternalStats globals CollectInternalStats 0
|
||||||
|
if [ "$CollectInternalStats" = "0" ]; then
|
||||||
|
printf "CollectInternalStats false\n" >> "$COLLECTD_CONF"
|
||||||
|
else
|
||||||
|
printf "CollectInternalStats true\n" >> "$COLLECTD_CONF"
|
||||||
|
fi
|
||||||
|
|
||||||
config_get Hostname globals Hostname "$(uname -n)"
|
config_get Hostname globals Hostname "$(uname -n)"
|
||||||
printf "Hostname \"%s\"\n" "$Hostname" >> "$COLLECTD_CONF"
|
printf "Hostname \"%s\"\n" "$Hostname" >> "$COLLECTD_CONF"
|
||||||
|
|
|
@ -7,6 +7,10 @@ config globals 'globals'
|
||||||
# option TypesDB '/usr/share/collectd/types.db'
|
# option TypesDB '/usr/share/collectd/types.db'
|
||||||
# option Interval '30'
|
# option Interval '30'
|
||||||
# option ReadThreads '2'
|
# option ReadThreads '2'
|
||||||
|
# option WriteThreads '2'
|
||||||
|
# option WriteQueueLimitLow '0'
|
||||||
|
# option WriteQueueLimitHigh '0'
|
||||||
|
# option CollectInternalStats '0'
|
||||||
|
|
||||||
#config plugin 'apcups'
|
#config plugin 'apcups'
|
||||||
# option enable '0'
|
# option enable '0'
|
||||||
|
|
Loading…
Reference in New Issue