From 1a39374a66852b467f4820201d05e43ad1fe1457 Mon Sep 17 00:00:00 2001 From: nmaguiar Date: Tue, 12 Mar 2024 21:45:44 +0000 Subject: [PATCH] #177 correct find command --- .package.yaml | 2 +- config/objects/nInput_JavaGC.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.package.yaml b/.package.yaml index 99173b7..35d282b 100644 --- a/.package.yaml +++ b/.package.yaml @@ -385,7 +385,7 @@ filesHash: config/objects/nInput_IMMemory.js: 69f6e3d39aa5a75c83d2e4f8e2ece0b28df7e3f1 config/objects/nInput_Init.js: 9631c3e1fb87117000eb9da225ae760c9a4cd1a0 config/objects/nInput_JMX.js: fce9011c729efafd1abe79588a274ee36aac3c16 - config/objects/nInput_JavaGC.js: 263b41d9e676566c60245345fc873c42167dc2a3 + config/objects/nInput_JavaGC.js: 49acab1ac18ee25630e1845ee9d4f5a17b5767ef config/objects/nInput_Kube_Events.js: 7a36aa2e72973d9369b856c6ef2ce4eddcab8459 config/objects/nInput_Kube_NodesMetrics.js: 1eb83e5f43535c9b688424a022c4bcb38fc791f3 config/objects/nInput_Kube_Pods.js: 3afb158052eb3eb1b9ffb70d68f0fa23c20b7c81 diff --git a/config/objects/nInput_JavaGC.js b/config/objects/nInput_JavaGC.js index ce1c620..ccd8a52 100644 --- a/config/objects/nInput_JavaGC.js +++ b/config/objects/nInput_JavaGC.js @@ -126,9 +126,10 @@ nInput_JavaGC.prototype.get = function(keyData, extra) { newM.pod = r.metadata.name newM.namespace = r.metadata.namespace try { - var res = nattrmon.shExec("kube", newM).exec(["/bin/sh", "-c", "/bin/sh -c 'echo ${TMPDIR:-/tmp} && echo \"||\" && find ${TMPDIR:-/tmp} -perm -u+r -type f'"]) + var res = nattrmon.shExec("kube", newM).exec(["/bin/sh", "-c", "/bin/sh -c 'echo ${TMPDIR:-/tmp} && echo \"||\" && find ${TMPDIR:-/tmp} -type f -exec test -r {} \\\; -print'"]) if (isDef(res.stdout)) { var _tmp = String(res.stdout).split("||") + if (isUnDef(_tmp) || isUnDef(_tmp[1])) return var lst = _tmp[1] .split("\n") .filter(l => l.indexOf(_tmp[0].replace(/\n/g, "") + "/hsperfdata_") == 0)