Skip to content

Commit

Permalink
Revert "mirrors/monitor: Change script to output integers"
Browse files Browse the repository at this point in the history
This reverts commit c8acabb.
  • Loading branch information
iBug committed Dec 31, 2023
1 parent c8acabb commit 0f10598
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/assets/mirrors/connection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

port_list_input=${1//:/|}
port_list=${port_list_input:-"80|443"}
netstat -ntW | gawk '{print tolower($6),gensub(/^(.+):([^:]+)$/,"\\1 \\2","g",$4)}' | grep -P " ($port_list)\$" | sort | uniq -c | sort -k 4 -k 3 | awk "{printf(\"connection,protocol=tcp,port=%s,address=%s %s=%si\n\",\$4,\$3,\$2,\$1)}"
netstat -ntW | gawk '{print tolower($6),gensub(/^(.+):([^:]+)$/,"\\2","g",$4)}' | grep -P " ($port_list)\$" | sort | uniq -c | sort -k 3 | awk "{printf(\"connection,protocol=tcp,port=%s,address=any %s=%si\n\",\$3,\$2,\$1)}"
netstat -ntW | gawk '{print tolower($6),gensub(/^(.+):([^:]+)$/,"\\1 \\2","g",$4)}' | grep -P " ($port_list)\$" | sort | uniq -c | sort -k 4 -k 3 | awk "{printf(\"connection,protocol=tcp,port=%s,address=%s %s=%s\n\",\$4,\$3,\$2,\$1)}"
netstat -ntW | gawk '{print tolower($6),gensub(/^(.+):([^:]+)$/,"\\2","g",$4)}' | grep -P " ($port_list)\$" | sort | uniq -c | sort -k 3 | awk "{printf(\"connection,protocol=tcp,port=%s,address=any %s=%s\n\",\$3,\$2,\$1)}"
2 changes: 1 addition & 1 deletion docs/assets/mirrors/nfacct.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

sudo nfacct list | awk '-F[ ,;]' "{printf(\"nfacct,object=%s bytes=%ii,pkgs=%ii\n\",\$11,\$8,\$4)}"
sudo nfacct list | awk '-F[ ,;]' "{printf(\"nfacct,object=%s bytes=%i,pkgs=%i\n\",\$11,\$8,\$4)}"
2 changes: 1 addition & 1 deletion docs/assets/mirrors/process.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

ps -e -o s= -o comm= | grep -v '^S' | sort | uniq -c | awk '{printf("process,state=%s,name=%s count=%ii\n",$2,$3,$1)}'
ps -e -o s= -o comm= | grep -v '^S' | sort | uniq -c | awk '{printf("process,state=%s,name=%s count=%i\n",$2,$3,$1)}'

0 comments on commit 0f10598

Please sign in to comment.