Fix OpenBSD Support and Other Bugs
Changes: * Fix OpenBSD cpu.sh output to match others * Fix OpenBSD df.sh output (no need for %% here) * Do not use sudo or doas when running as root * Use #!/usr/bin/env bash to support OpenBSD in run_nix_ta_commands * Fix rsyslog example to trim whitespace in run_nix_ta_commands * Add /usr/local/sbin:/usr/local/bin to PATH in run_nix_ta_commands * Fix getting hour and minute for OpenBSD in run_nix_ta_commands "08" shows up to printf as octal * Support difference in OpenBSD logger command: Requires modifying /etc/syslog.conf and setting facility in /etc/nix_ta.conf
This commit is contained in:
parent
8c02cbc5cc
commit
a24e4c8ee5
10 changed files with 92 additions and 32 deletions
|
@ -21,12 +21,14 @@ declare -A bw_start
|
|||
[[ $0 =~ .*_metric.sh ]] && mode=metric
|
||||
|
||||
# Either add the splunk user to the docker group or add the following to /etc/sudoers:
|
||||
# splunk ALL=(root) NOPASSWD: /usr/bin/docker stats --no-stream --no-trunc --all
|
||||
# splunk ALL=(root) NOPASSWD: /usr/bin/docker ps --all --no-trunc --format *
|
||||
# splunk ALL=(root) NOPASSWD: /usr/bin/docker inspect -f *
|
||||
# splunk ALL=(root) NOPASSWD: /usr/bin/docker stats --no-stream --no-trunc --all
|
||||
# splunk ALL=(root) NOPASSWD: /usr/bin/docker ps --all --no-trunc --format *
|
||||
# splunk ALL=(root) NOPASSWD: /usr/bin/docker inspect -f *
|
||||
|
||||
docker_cmd=docker
|
||||
! groups | grep -q "\bdocker\b" && docker_cmd="sudo -n $docker_cmd"
|
||||
if [ $(id -u) != 0 ]; then
|
||||
! groups | grep -q "\bdocker\b" && docker_cmd="sudo -n $docker_cmd"
|
||||
fi
|
||||
docker_list=$($docker_cmd ps --all --no-trunc --format '{{ .ID }}')
|
||||
|
||||
header_string="ContainerId Name CPUPct MemUsage MemTotal MemPct NetRX RXps NetTX TXps BlockRead BRps BlockWrite BWps Pids"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue