aboutsummaryrefslogtreecommitdiffstats
path: root/community/zabbix/zabbix_agent2-uname-linux.patch
diff options
context:
space:
mode:
authorKevin Daudt <kdaudt@alpinelinux.org>2019-10-14 19:57:55 +0000
committerKevin Daudt <kdaudt@alpinelinux.org>2019-10-26 18:39:52 +0000
commitcc818f3748b65d8fdbb398e2606fb2a2c7ce9461 (patch)
tree7cc0a074720445402bf9fbcf39a3c990b4a36a3f /community/zabbix/zabbix_agent2-uname-linux.patch
parentb16f8914f301f38649513463743e623f935faa61 (diff)
downloadaports-cc818f3748b65d8fdbb398e2606fb2a2c7ce9461.tar.bz2
aports-cc818f3748b65d8fdbb398e2606fb2a2c7ce9461.tar.xz
community/zabbix: enable zabbix-agent2
This is a new agent written in go. A patch is necessary to build for ppc64le and s390x. x86 is not working yet, so the agent is not there.
Diffstat (limited to 'community/zabbix/zabbix_agent2-uname-linux.patch')
-rw-r--r--community/zabbix/zabbix_agent2-uname-linux.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/community/zabbix/zabbix_agent2-uname-linux.patch b/community/zabbix/zabbix_agent2-uname-linux.patch
new file mode 100644
index 0000000000..08ca12ea2f
--- /dev/null
+++ b/community/zabbix/zabbix_agent2-uname-linux.patch
@@ -0,0 +1,65 @@
+diff --git a/go/src/zabbix/plugins/system/uname/uname_int8.go b/go/src/zabbix/plugins/system/uname/uname_int8.go
+new file mode 100644
+index 0000000..5bad4ca
+--- /dev/null
++++ b/go/src/zabbix/plugins/system/uname/uname_int8.go
+@@ -0,0 +1,15 @@
++// +build linux,386 linux,amd64 linux,arm64
++
++package uname
++
++func arrayToString(unameArray *[65]int8) string {
++ var byteString [65]byte
++ var indexLength int
++ for ; indexLength < len(unameArray); indexLength++ {
++ if 0 == unameArray[indexLength] {
++ break
++ }
++ byteString[indexLength] = uint8(unameArray[indexLength])
++ }
++ return string(byteString[:indexLength])
++}
+diff --git a/go/src/zabbix/plugins/system/uname/uname_linux.go b/go/src/zabbix/plugins/system/uname/uname_linux.go
+index 874569f..6dac18b 100644
+--- a/go/src/zabbix/plugins/system/uname/uname_linux.go
++++ b/go/src/zabbix/plugins/system/uname/uname_linux.go
+@@ -24,18 +24,6 @@ import (
+ "syscall"
+ )
+
+-func arrayToString(unameArray *[65]int8) string {
+- var byteString [65]byte
+- var indexLength int
+- for ; indexLength < len(unameArray); indexLength++ {
+- if 0 == unameArray[indexLength] {
+- break
+- }
+- byteString[indexLength] = uint8(unameArray[indexLength])
+- }
+- return string(byteString[:indexLength])
+-}
+-
+ func getUname() (uname string, err error) {
+ var utsname syscall.Utsname
+ if err = syscall.Uname(&utsname); err != nil {
+diff --git a/go/src/zabbix/plugins/system/uname/uname_uint8.go b/go/src/zabbix/plugins/system/uname/uname_uint8.go
+new file mode 100644
+index 0000000..893d6c5
+--- /dev/null
++++ b/go/src/zabbix/plugins/system/uname/uname_uint8.go
+@@ -0,0 +1,15 @@
++// +build linux,arm linux,ppc64le linux,s390x
++
++package uname
++
++func arrayToString(unameArray *[65]uint8) string {
++ var byteString [65]byte
++ var indexLength int
++ for ; indexLength < len(unameArray); indexLength++ {
++ if 0 == unameArray[indexLength] {
++ break
++ }
++ byteString[indexLength] = uint8(unameArray[indexLength])
++ }
++ return string(byteString[:indexLength])
++}