aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Daudt <kdaudt@alpinelinux.org>2021-09-22 19:09:37 +0000
committerKevin Daudt <kdaudt@alpinelinux.org>2021-10-06 18:57:27 +0000
commit265372040d34ddaf9b473716ec1ae70abf121027 (patch)
treef17077e3d322882af742408f7a6989ebc33b206a
parent6aa9f1dc325573928a5d6e7eb3db996d6258e053 (diff)
downloadaports-265372040d34ddaf9b473716ec1ae70abf121027.tar.gz
aports-265372040d34ddaf9b473716ec1ae70abf121027.tar.bz2
aports-265372040d34ddaf9b473716ec1ae70abf121027.tar.xz
community/zabbix: upgrade to 5.4.5
-rw-r--r--community/zabbix/0001-Revert-.G.-ZBXNEXT-6596-added-native-linux-proc.num-.patch269
-rw-r--r--community/zabbix/APKBUILD8
2 files changed, 3 insertions, 274 deletions
diff --git a/community/zabbix/0001-Revert-.G.-ZBXNEXT-6596-added-native-linux-proc.num-.patch b/community/zabbix/0001-Revert-.G.-ZBXNEXT-6596-added-native-linux-proc.num-.patch
deleted file mode 100644
index bd7e25ba9c..0000000000
--- a/community/zabbix/0001-Revert-.G.-ZBXNEXT-6596-added-native-linux-proc.num-.patch
+++ /dev/null
@@ -1,269 +0,0 @@
-From 581ae83ceaa4274fb4389d09fcf28d62d81f13d8 Mon Sep 17 00:00:00 2001
-From: Leonardo Arena <rnalrd@alpinelinux.org>
-Date: Wed, 18 Aug 2021 11:06:57 +0200
-Subject: [PATCH] Revert "...G...... [ZBXNEXT-6596] added native linux proc.num
- support plugin to Zabbix agent 2"
-
-This reverts commit 9427f39e32c5ff5201265ab8c5f73caff9962478.
-
-See https://support.zabbix.com/browse/ZBX-19614
----
- src/go/pkg/zbxlib/checks_linux.go | 2 +
- src/go/plugins/proc/proc_linux.go | 110 +------------------------
- src/go/plugins/proc/procfs_linux.go | 24 ------
- src/go/plugins/zabbix/sync/sync_nix.go | 1 +
- 4 files changed, 6 insertions(+), 131 deletions(-)
-
-diff --git a/src/go/pkg/zbxlib/checks_linux.go b/src/go/pkg/zbxlib/checks_linux.go
-index 206ad9542d..99cefa30cc 100644
---- a/src/go/pkg/zbxlib/checks_linux.go
-+++ b/src/go/pkg/zbxlib/checks_linux.go
-@@ -74,6 +74,8 @@ func resolveMetric(key string) (cfunc unsafe.Pointer) {
- cfunc = unsafe.Pointer(C.NET_DNS)
- case "net.dns.record":
- cfunc = unsafe.Pointer(C.NET_DNS_RECORD)
-+ case "proc.num":
-+ cfunc = unsafe.Pointer(C.PROC_NUM)
- case "system.boottime":
- cfunc = unsafe.Pointer(C.SYSTEM_BOOTTIME)
- case "net.tcp.listen":
-diff --git a/src/go/plugins/proc/proc_linux.go b/src/go/plugins/proc/proc_linux.go
-index 20af05f34f..5b58d12071 100644
---- a/src/go/plugins/proc/proc_linux.go
-+++ b/src/go/plugins/proc/proc_linux.go
-@@ -121,7 +121,6 @@ type procQuery struct {
- name string
- user string
- cmdline string
-- state string
- }
-
- const (
-@@ -129,7 +128,6 @@ const (
- procInfoName
- procInfoUser
- procInfoCmdline
-- procInfoState
- )
-
- type procInfo struct {
-@@ -138,7 +136,6 @@ type procInfo struct {
- userid int64
- cmdline string
- arg0 string
-- state string
- }
-
- type cpuUtil struct {
-@@ -172,7 +169,6 @@ func newCpuUtilQuery(q *procQuery, pattern *regexp.Regexp) (query *cpuUtilQuery,
- return
- }
- }
--
- query.cmdlinePattern = pattern
- return
- }
-@@ -185,13 +181,13 @@ func (p *Plugin) prepareQueries() (queries []*cpuUtilQuery, flags int) {
- p.mutex.Lock()
- for q, stats := range p.queries {
- if now.Sub(stats.accessed) > maxInactivityPeriod {
-- p.Debugf("removed unused CPU utilization query %+v", q)
-+ p.Debugf("removed unused CPU utilisation query %+v", q)
- delete(p.queries, q)
- continue
- }
- var query *cpuUtilQuery
- if query, stats.err = newCpuUtilQuery(&q, stats.cmdlinePattern); stats.err != nil {
-- p.Debugf("cannot create CPU utilization query %+v: %s", q, stats.err)
-+ p.Debugf("cannot create CPU utilisation query %+v: %s", q, stats.err)
- continue
- }
- queries = append(queries, query)
-@@ -415,45 +411,9 @@ func (p *Plugin) Export(key string, params []string, ctx plugin.ContextProvider)
- }
- return
- }
--func (p *PluginExport) prepareQuery(q *procQuery) (query *cpuUtilQuery, flags int, err error) {
-- regxp, err := regexp.Compile(q.cmdline)
-- if err != nil {
-- return nil, 0, fmt.Errorf("cannot compile regex for %s: %s", q.cmdline, err.Error())
-- }
--
-- if query, err = newCpuUtilQuery(q, regxp); err != nil {
-- return nil, 0, fmt.Errorf("cannot create CPU utilization query %+v: %s", q, err.Error())
-- }
--
-- if q.name != "" {
-- flags |= procInfoName | procInfoCmdline
-- }
-- if q.user != "" {
-- flags |= procInfoUser
-- }
-- if q.cmdline != "" {
-- flags |= procInfoCmdline
-- }
-- if q.state != "" {
-- flags |= procInfoState
-- }
--
-- return
--}
-
- // Export -
- func (p *PluginExport) Export(key string, params []string, ctx plugin.ContextProvider) (result interface{}, err error) {
-- switch key {
-- case "proc.mem":
-- return p.exportProcMem(params)
-- case "proc.num":
-- return p.exportProcNum(params)
-- }
--
-- return nil, plugin.UnsupportedMetricError
--}
--
--func (p *PluginExport) exportProcMem(params []string) (result interface{}, err error) {
- var name, mode, cmdline, memtype string
- var usr *user.User
-
-@@ -632,67 +592,6 @@ func (p *PluginExport) exportProcMem(params []string) (result interface{}, err e
- return memSize, nil
- }
-
--func (p *PluginExport) exportProcNum(params []string) (interface{}, error) {
-- var name, userName, state, cmdline string
-- switch len(params) {
-- case 4:
-- cmdline = params[3]
-- fallthrough
-- case 3:
-- switch params[2] {
-- case "all", "":
-- case "disk":
-- state = "D"
-- case "run":
-- state = "R"
-- case "sleep":
-- state = "S"
-- case "trace":
-- state = "T"
-- case "zomb":
-- state = "Z"
-- default:
-- return nil, errors.New("Invalid third parameter.")
-- }
-- fallthrough
-- case 2:
-- userName = params[1]
-- fallthrough
-- case 1:
-- name = params[0]
-- case 0:
-- default:
-- return nil, errors.New("Too many parameters.")
-- }
--
-- var count int
--
-- query, flags, err := p.prepareQuery(&procQuery{name, userName, cmdline, state})
-- if err != nil {
-- p.Debugf("Failed to prepare query: %s", err.Error())
-- return count, nil
-- }
--
-- procs, err := getProcesses(flags)
-- if err != nil {
-- return nil, fmt.Errorf("Failed to get local processes: %s", err.Error())
-- }
--
-- for _, proc := range procs {
-- if !query.match(proc) {
-- continue
-- }
--
-- if state != proc.state && state != "" {
-- continue
-- }
--
-- count++
-- }
--
-- return count, nil
--}
--
- func getMax(a, b float64) float64 {
- if a > b {
- return a
-@@ -776,8 +675,5 @@ func (p *PluginExport) validFile(proc *procInfo, name string, uid int64, cmdRgx
-
- func init() {
- plugin.RegisterMetrics(&impl, "Proc", "proc.cpu.util", "Process CPU utilization percentage.")
-- plugin.RegisterMetrics(&implExport, "ProcExporter",
-- "proc.mem", "Process memory utilization values.",
-- "proc.num", "The number of processes.",
-- )
-+ plugin.RegisterMetrics(&implExport, "ProcExporter", "proc.mem", "Process memory utilization values.")
- }
-diff --git a/src/go/plugins/proc/procfs_linux.go b/src/go/plugins/proc/procfs_linux.go
-index e6e1637933..cd9427647a 100644
---- a/src/go/plugins/proc/procfs_linux.go
-+++ b/src/go/plugins/proc/procfs_linux.go
-@@ -27,7 +27,6 @@ import (
- "io"
- "os"
- "strconv"
-- "strings"
- "syscall"
-
- "zabbix.com/pkg/procfs"
-@@ -62,22 +61,6 @@ func getProcessName(pid string) (name string, err error) {
- return string(data[left+1 : right]), nil
- }
-
--func getProcessState(pid string) (name string, err error) {
-- var data []byte
-- if data, err = read2k("/proc/" + pid + "/status"); err != nil {
-- return
-- }
--
-- s := strings.Split(string(data), "\n")
-- for _, tmp := range s {
-- if strings.HasPrefix(tmp, "State:") && len(tmp) > 7 {
-- return string(tmp[7:8]), nil
-- }
-- }
--
-- return "", fmt.Errorf("cannot find process state /proc/%s/status", pid)
--}
--
- func getProcessUserID(pid string) (userid int64, err error) {
- var fi os.FileInfo
- if fi, err = os.Stat("/proc/" + pid); err != nil {
-@@ -184,13 +167,6 @@ func getProcesses(flags int) (processes []*procInfo, err error) {
- continue
- }
- }
-- if flags&procInfoState != 0 {
-- if info.state, tmperr = getProcessState(entries[0].Name()); tmperr != nil {
-- impl.Debugf("cannot get process %s state: %s", entries[0].Name(), tmperr)
-- continue
-- }
-- }
--
- processes = append(processes, info)
- }
-
-diff --git a/src/go/plugins/zabbix/sync/sync_nix.go b/src/go/plugins/zabbix/sync/sync_nix.go
-index f22ef75fa7..b743d2e050 100644
---- a/src/go/plugins/zabbix/sync/sync_nix.go
-+++ b/src/go/plugins/zabbix/sync/sync_nix.go
-@@ -25,6 +25,7 @@ func getMetrics() []string {
- return []string{
- "net.dns", "Checks if DNS service is up.",
- "net.dns.record", "Performs DNS query.",
-+ "proc.num", "The number of processes.",
- "system.hw.chassis", "Chassis information.",
- "system.hw.devices", "Listing of PCI or USB devices.",
- "vfs.dir.count", "Directory entry count.",
---
-2.32.0
-
diff --git a/community/zabbix/APKBUILD b/community/zabbix/APKBUILD
index 0957bdfb0c..04812eba07 100644
--- a/community/zabbix/APKBUILD
+++ b/community/zabbix/APKBUILD
@@ -3,8 +3,8 @@
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=zabbix
-pkgver=5.4.4
-pkgrel=2
+pkgver=5.4.5
+pkgrel=0
pkgdesc="Enterprise-class open source distributed monitoring"
url="http://www.zabbix.com"
arch="all"
@@ -40,7 +40,6 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/zabbix/zabbix/archive/${pkgv
zabbix_server.conf.patch
zabbix_agent2.conf.patch
go-agent-plugin-uname-add-riscv64.patch
- 0001-Revert-.G.-ZBXNEXT-6596-added-native-linux-proc.num-.patch
"
builddir="$srcdir/$pkgname-${pkgver/_/}"
@@ -259,7 +258,7 @@ agent2_openrc() {
}
sha512sums="
-912d35da2e6a640bafa14475b32d2e5f17df0df8b5262a4df224bdf7f64dfaebee05e539c1b1e0956c8753a8a78ad5ebe7c03a34b3fa4f780170a59f45771857 zabbix-5.4.4.tar.gz
+160b116e479483d33edd5e6c2be293524560d1e4b91d68f3399fcca4f5c05b989bd8c24779b4602b1ccb56319b157818261b995cc626b95b19e5c6412a765dd7 zabbix-5.4.5.tar.gz
9998ee172a28002d98bacc3f76038ff52b8cf2b206e101418d76b4ca3de94afaf92cb4f7a6235ecf177f74beb9dd3ea1f3983c4f164b4f60bb601acba65aa175 zabbix-server.initd
9c06527bf653c40585fa7eeb3f7a0b2fc454031d24cd0d1633aed87b78a681c5227a193c5b9fcfcea0839135874e27ba7dd9b198573f905f680a2856f79e9512 zabbix-server.confd
7beca0fc6e254c1692e0e74deb9eb3d06ac78f5f6b08f3ab0491861e11e09f00f57bb4d22e11517dab86456e87bd13110805bfb38a715d2f1e68549937b29c76 zabbix-agentd.initd
@@ -271,5 +270,4 @@ a26e7ac422ff60a4b8eed3603022c3a1bde640870bb9286ab061c3cb5c2fd7e91ddb317cb3d1cf61
183e2d99800d8eebb932cb31c5a3e8742ce6a15e87aec50dc49d9c20b35840eb7ede9920aa62d2c7a5e3f584f5c3df398aa08e93f98fa537a3ba6db63b472a1f zabbix_server.conf.patch
7298af197d93f3c78be146819c31be96c43288b0987dc42df6e2352a925129a5a853c4f77a93c79c5bea5fc9bd76ddd3192520e45df1a056a9df0f6294e31513 zabbix_agent2.conf.patch
1df199b7749b5ad5b39430f2b3144dda63759b429e711838e9d60ae1f2a75572442df512606a80b538d9daecb60348e69d953db887d99f8a0431ca62bdda6345 go-agent-plugin-uname-add-riscv64.patch
-f054a34c519266e86f8c556bec3e7513d71ca0917ee54112df95d3dceb480488641dfdd225360a705348c633b962d1c8f677dbaa1d965ed1cae6827f5e902e29 0001-Revert-.G.-ZBXNEXT-6596-added-native-linux-proc.num-.patch
"