Created
January 4, 2021 14:54
-
-
Save tsleite/0ab85edb84c7dcdb8d557a8b15fddb9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Foked script | |
# Discovery all process running | |
# Data: 01/09/2020 | |
set -e | |
run=`echo -n '{"data":[' ;ps -A -o comm= -o time= -o vsz= | grep -v ' 00:00:00' | awk '$3 != 0' | cut -c-15 | sed 's/ *$//' | awk '!a[$0]++' | sed 's/\(.*\)/{"{#N_PROCESSO}":"\1"}/g' | sed '$!s/$/,/' | tr '\n' ' ' ;echo -n ']}'` | |
echo -e "$run" | jq . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Build json for Zabbix.