diff options
author | Sergey Simonenko <sergey.simonenko@zabbix.com> | 2022-02-18 17:53:37 +0300 |
---|---|---|
committer | Sergey Simonenko <sergey.simonenko@zabbix.com> | 2022-02-18 17:53:37 +0300 |
commit | c6395855eb02359fb664214ccef0cd4f5c9bbfe7 (patch) | |
tree | 351c032725c3e640c84ab95573eb992de907458c /src/go/plugins | |
parent | 0c04bd027980eb04481d2ccc4425b42885a7a2c9 (diff) |
.......... [ZBXNEXT-7408] fixed merge error (vfs.dir.get)
Diffstat (limited to 'src/go/plugins')
-rw-r--r-- | src/go/plugins/plugins_darwin.go | 1 | ||||
-rw-r--r-- | src/go/plugins/plugins_linux.go | 1 | ||||
-rw-r--r-- | src/go/plugins/plugins_windows.go | 1 | ||||
-rw-r--r-- | src/go/plugins/zabbix/sync/sync.go | 41 | ||||
-rw-r--r-- | src/go/plugins/zabbix/sync/sync_nix.go | 28 | ||||
-rw-r--r-- | src/go/plugins/zabbix/sync/sync_windows.go | 26 |
6 files changed, 98 insertions, 0 deletions
diff --git a/src/go/plugins/plugins_darwin.go b/src/go/plugins/plugins_darwin.go index fb8a166049b..273324cdf64 100644 --- a/src/go/plugins/plugins_darwin.go +++ b/src/go/plugins/plugins_darwin.go @@ -39,4 +39,5 @@ import ( _ "zabbix.com/plugins/web/page" _ "zabbix.com/plugins/zabbix/async" _ "zabbix.com/plugins/zabbix/stats" + _ "zabbix.com/plugins/zabbix/sync" ) diff --git a/src/go/plugins/plugins_linux.go b/src/go/plugins/plugins_linux.go index d6d8bc9c87f..d0e6fd33620 100644 --- a/src/go/plugins/plugins_linux.go +++ b/src/go/plugins/plugins_linux.go @@ -56,4 +56,5 @@ import ( _ "zabbix.com/plugins/web/page" _ "zabbix.com/plugins/zabbix/async" _ "zabbix.com/plugins/zabbix/stats" + _ "zabbix.com/plugins/zabbix/sync" ) diff --git a/src/go/plugins/plugins_windows.go b/src/go/plugins/plugins_windows.go index a7d232bcab6..95b9060aaae 100644 --- a/src/go/plugins/plugins_windows.go +++ b/src/go/plugins/plugins_windows.go @@ -56,4 +56,5 @@ import ( _ "zabbix.com/plugins/windows/wmi" _ "zabbix.com/plugins/zabbix/async" _ "zabbix.com/plugins/zabbix/stats" + _ "zabbix.com/plugins/zabbix/sync" ) diff --git a/src/go/plugins/zabbix/sync/sync.go b/src/go/plugins/zabbix/sync/sync.go new file mode 100644 index 00000000000..dde57d8d57b --- /dev/null +++ b/src/go/plugins/zabbix/sync/sync.go @@ -0,0 +1,41 @@ +/* +** Zabbix +** Copyright (C) 2001-2022 Zabbix SIA +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +**/ + +package zabbixsync + +import ( + "zabbix.com/pkg/plugin" + "zabbix.com/pkg/zbxlib" +) + +// Plugin - +type Plugin struct { + plugin.Base +} + +var impl Plugin + +func (p *Plugin) Export(key string, params []string, ctx plugin.ContextProvider) (result interface{}, err error) { + return zbxlib.ExecuteCheck(key, params) +} + +func init() { + plugin.RegisterMetrics(&impl, "ZabbixSync", getMetrics()...) + impl.SetCapacity(1) +} diff --git a/src/go/plugins/zabbix/sync/sync_nix.go b/src/go/plugins/zabbix/sync/sync_nix.go new file mode 100644 index 00000000000..c88eae2df79 --- /dev/null +++ b/src/go/plugins/zabbix/sync/sync_nix.go @@ -0,0 +1,28 @@ +// +build !windows + +/* +** Zabbix +** Copyright (C) 2001-2022 Zabbix SIA +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +**/ + +package zabbixsync + +func getMetrics() []string { + return []string{ + "vfs.dir.get", "Directory entry list.", + } +} diff --git a/src/go/plugins/zabbix/sync/sync_windows.go b/src/go/plugins/zabbix/sync/sync_windows.go new file mode 100644 index 00000000000..846d59d9ae1 --- /dev/null +++ b/src/go/plugins/zabbix/sync/sync_windows.go @@ -0,0 +1,26 @@ +/* +** Zabbix +** Copyright (C) 2001-2022 Zabbix SIA +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +**/ + +package zabbixsync + +func getMetrics() []string { + return []string{ + "vfs.dir.get", "Directory entry list.", + } +} |