mirror of
https://github.com/limosek/zaf-plugins.git
synced 2024-11-01 08:17:19 +01:00
44 lines
885 B
Plaintext
44 lines
885 B
Plaintext
|
|
Plugin: psx
|
|
Description::
|
|
Plugin which will make deeper look to processess and their usage.
|
|
::
|
|
|
|
Version: 0.2
|
|
Url: https://raw.githubusercontent.com/limosek/zaf-plugins/master/psx
|
|
Web: https://github.com/limosek/zaf-plugins/
|
|
Maintainer: Lukas Macura <lukas@macura.cz>
|
|
|
|
# Dependencies
|
|
Depends-dpkg: dash curl
|
|
Depens-opkg: busybox curl
|
|
Depends-rpm: curl
|
|
Depends-bin: curl ps
|
|
|
|
Item discovery:
|
|
Description::
|
|
Discovery of runing processes
|
|
::
|
|
Testparameters: ps systemd,root
|
|
Parameters::
|
|
pregex '.*' '' # regexp to match process name
|
|
uregex '.*' '' # regexp to match user name
|
|
::
|
|
Script::
|
|
|
|
if [ "${ZAF_PKG}" = "opkg" ]; then
|
|
AWK='{ print $5" "$2; }'
|
|
PS="w"
|
|
else
|
|
AWK='{ print $11" "$1; }'
|
|
PS="--no-headers caux"
|
|
fi
|
|
|
|
ps $PS | awk "$AWK" | sort | uniq | sed -e 's/\//\\\//g' -e '$s/.$//' | grep -E "^$pregex" | grep -E "$uregex\$" | zaf_discovery '{#PSNAME}' '{#PSUSER}'
|
|
|
|
::
|
|
/Item
|
|
|
|
|
|
|