Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislavs Sokurenko <vladislavs.sokurenko@zabbix.com>2022-03-01 14:00:40 +0300
committerVladislavs Sokurenko <vladislavs.sokurenko@zabbix.com>2022-03-01 14:00:40 +0300
commit0c7828a1aa8432d785480ae6813363e6f191e515 (patch)
tree71de57d922e3a0e0d3d16e419a9aa72ff5331800
parent3cff9eee8b83da53c995d0f8d58e4e7460fa52e0 (diff)
...G...... [ZBXNEXT-7116] backported ability to force active checks on restart
-rw-r--r--src/go/conf/zabbix_agent2.conf2
-rw-r--r--src/go/internal/agent/scheduler/manager.go15
-rw-r--r--src/go/internal/agent/scheduler/query.go3
3 files changed, 4 insertions, 16 deletions
diff --git a/src/go/conf/zabbix_agent2.conf b/src/go/conf/zabbix_agent2.conf
index 66c6234a043..fcebe6028e3 100644
--- a/src/go/conf/zabbix_agent2.conf
+++ b/src/go/conf/zabbix_agent2.conf
@@ -928,5 +928,3 @@ ControlSocket=/tmp/agent.sock
# Range: 0-1
# Default:
# ForceActiveChecksOnStart=0
-
-# Include configuration files for plugins
diff --git a/src/go/internal/agent/scheduler/manager.go b/src/go/internal/agent/scheduler/manager.go
index 1aa27909e67..58fa08384dd 100644
--- a/src/go/internal/agent/scheduler/manager.go
+++ b/src/go/internal/agent/scheduler/manager.go
@@ -538,20 +538,10 @@ func NewManager(options *agent.AgentOptions) (mannager *Manager, err error) {
}
func getPluginOptions(optsRaw interface{}, name string) (capacity int, forceActiveChecksOnStart int) {
- pluginCap, pluginSystemCap, pluginForceActiveChecksOnStart := getPluginOpts(optsRaw, name)
+ pluginSystemCap, pluginForceActiveChecksOnStart := getPluginOpts(optsRaw, name)
if pluginSystemCap > 0 {
- if pluginCap > 0 {
- log.Warningf("both Plugins.%s.Capacity and Plugins.%s.System.Capacity configuration parameters are set, using System.Capacity: %d",
- name, name, pluginSystemCap)
- }
capacity = pluginSystemCap
- } else if pluginCap > 0 {
- log.Warningf(
- "plugin %s configuration parameter Plugins.%s.Capacity is deprecated, use Plugins.%s.System.Capacity instead",
- name, name, name,
- )
- capacity = pluginCap
} else {
capacity = plugin.DefaultCapacity
}
@@ -571,7 +561,7 @@ func getPluginOptions(optsRaw interface{}, name string) (capacity int, forceActi
return
}
-func getPluginOpts(optsRaw interface{}, name string) (pluginCap, pluginSystemCap int, forceActiveChecksOnStart *int) {
+func getPluginOpts(optsRaw interface{}, name string) (pluginSystemCap int, forceActiveChecksOnStart *int) {
var opt pluginOptions
if optsRaw == nil {
@@ -584,7 +574,6 @@ func getPluginOpts(optsRaw interface{}, name string) (pluginCap, pluginSystemCap
return
}
- pluginCap = opt.Capacity
pluginSystemCap = opt.Capacity
forceActiveChecksOnStart = opt.ForceActiveChecksOnStart
diff --git a/src/go/internal/agent/scheduler/query.go b/src/go/internal/agent/scheduler/query.go
index e499c041fc8..b1eac3c0641 100644
--- a/src/go/internal/agent/scheduler/query.go
+++ b/src/go/internal/agent/scheduler/query.go
@@ -58,7 +58,8 @@ func (m *Manager) getStatus() (result string) {
for _, info := range infos {
status.WriteString(fmt.Sprintf("[%s]\nactive: %t\ncapacity: %d/%d\ncheck on start: %d\ntasks: %d\n",
- info.ref.name(), info.ref.active(), info.ref.usedCapacity, info.ref.maxCapacity, info.ref.forceActiveChecksOnStart, len(info.ref.tasks)))
+ info.ref.name(), info.ref.active(), info.ref.usedCapacity, info.ref.maxCapacity,
+ info.ref.forceActiveChecksOnStart, len(info.ref.tasks)))
sort.Slice(info.metrics, func(l, r int) bool { return info.metrics[l].Key < info.metrics[r].Key })
for _, metric := range info.metrics {