mirror of
https://github.com/falcosecurity/falco.git
synced 2025-10-21 11:29:26 +00:00
When the root directory contains the name 'agent', assume we're running an agent and provide appropriate configuration and run the agent using dragent. You can make autodrop or falco configurable within the agent via --agent-autodrop and --falco-agent. Also include some other small changes like timestamping the json points.
10 lines
436 B
Bash
10 lines
436 B
Bash
#!/bin/bash
|
|
|
|
SUBJ_PID=$1
|
|
BENCHMARK=$2
|
|
VARIANT=$3
|
|
RESULTS_FILE=$4
|
|
CPU_INTERVAL=$5
|
|
|
|
top -d $CPU_INTERVAL -b -p $SUBJ_PID | grep -E '(falco|sysdig|dragent)' --line-buffered | awk -v benchmark=$BENCHMARK -v variant=$VARIANT '{printf("{\"time\": \"%s\", \"sample\": %d, \"benchmark\": \"%s\", \"variant\": \"%s\", \"cpu_usage\": %s},\n", strftime("%Y-%m-%d %H:%M:%S", systime(), 1), NR, benchmark, variant, $9); fflush();}' >> $RESULTS_FILE
|