mirror of
https://github.com/limosek/zaf.git
synced 2025-11-01 10:07:38 +01:00
First scripts
This commit is contained in:
15
plugins/process-info/control
Normal file
15
plugins/process-info/control
Normal file
@@ -0,0 +1,15 @@
|
||||
Plugin: process-info
|
||||
|
||||
Maintainer: Lukas Macura <lukas@macura.cz>
|
||||
|
||||
Item: cpu[*]
|
||||
This item will return cpu usage of given process. In zabbix, it will be prefixed automaticaly by plugin name (processlist.cpu)
|
||||
Item-cmd-cpu[*]: TOTAL=0; for PROC in $(/bin/ps u -C $1 | /bin/grep -e '^$2' | /usr/bin/awk '{ print $$3 }'); do TOTAL=$(echo "$TOTAL $PROC" | /usr/bin/awk '{print $$1 + $$2}') ; done; echo $TOTAL
|
||||
|
||||
Item: discovery
|
||||
Discovery of runing processes
|
||||
Item-cmd-discovery: echo "{\n \"data\":[" ; /bin/ps --no-headers caux | /usr/bin/awk '{ print " { \"{#PSUSER}\":\"" $1 "\", \"{#PSNAME}\":\"" $11 "\" },"}' | /usr/bin/sort | /usr/bin/uniq | /bin/sed -e 's/\//\\\//g' -e '$s/.$//' ; echo " ]\n}"
|
||||
|
||||
Binary-Depends: echo ps awk sort uniq sed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user