From 3400e1f48111f498c92fe6accf0212b4634c29f0 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 8 Jul 2023 01:03:22 -0400 Subject: [PATCH] add stats scripts --- connection-stats | 20 ++++++++++++++++++++ nginx-stats | 19 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 connection-stats create mode 100755 nginx-stats diff --git a/connection-stats b/connection-stats new file mode 100755 index 0000000..0756631 --- /dev/null +++ b/connection-stats @@ -0,0 +1,20 @@ +#!/bin/bash + +set -o errexit -o nounset -o pipefail + +[[ $# -ge 1 ]] || exit 1 + +user=root + +. hosts.sh + +declare -n hosts=hosts_$1 +shift +for host in ${hosts[@]}; do + echo $host + echo + + ssh $user@$host ss -s + + echo +done diff --git a/nginx-stats b/nginx-stats new file mode 100755 index 0000000..39ca72e --- /dev/null +++ b/nginx-stats @@ -0,0 +1,19 @@ +#!/bin/bash + +set -o errexit -o nounset -o pipefail + +[[ $# -ge 1 ]] || exit 1 + +user=root + +. hosts.sh + +declare -n hosts=hosts_$1 +shift +for host in ${hosts[@]}; do + echo $host + echo + + ssh $user@$host curl -sS --unix-socket /run/nginx/status.sock http://localhost/ + echo +done