summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhaturatu <taro@eyes4you.org>2024-09-22 18:17:14 +0900
committerhaturatu <taro@eyes4you.org>2024-09-22 18:17:14 +0900
commit0981dfe8eef53544153274c885fe62773814f7b4 (patch)
tree41344ad2c918bc627ed7339c23f919101ead3624
war pigs
-rw-r--r--README.md26
-rwxr-xr-xpnd.sh25
2 files changed, 51 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..6eb090f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,26 @@
+# paranoid
+## Usage
+```
+chmod +x pnd.sh
+./pnd.sh
+
+## CPU情報
+model name : Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz
+
+## メモリ情報
+合計メモリ: 7.47 GB
+
+## ディスク使用量
+ファイルシス サイズ 使用 残り 使用% マウント位置
+dev 10M 8.0K 10M 1% /dev
+run 3.8G 2.4M 3.8G 1% /run
+/dev/sda1 234G 159G 64G 72% /
+shm 3.8G 139M 3.6G 4% /dev/shm
+tmpfs 3.8G 77M 3.7G 3% /tmp
+tmpfs 765M 16K 765M 1% /run/user/1000
+
+## リッスンポート
+pulseaudi 1000 *:42613/TCP
+pulseaudi 1000 *:42733/TCP
+pulseaudi 1000 *:4713/TCP
+```
diff --git a/pnd.sh b/pnd.sh
new file mode 100755
index 0000000..5b8dc72
--- /dev/null
+++ b/pnd.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# 必要なコマンドのリスト
+commands=("grep" "awk" "df" "lsof" "sort" "uniq" "column")
+
+# コマンドの存在確認
+for cmd in "${commands[@]}"; do
+ if ! which "$cmd" > /dev/null 2>&1; then
+ echo "エラー: $cmd コマンドが見つかりません。"
+ exit 1
+ fi
+done
+
+# サーバー情報の出力
+echo -e "## CPU情報"
+grep "model name" /proc/cpuinfo | head -1
+
+echo -e "\n## メモリ情報"
+awk '/MemTotal/ { printf "合計メモリ: %.2f GB\n", $2 / 1024 / 1024 }' /proc/meminfo
+
+echo -e "\n## ディスク使用量"
+df -h
+
+echo -e "\n## リッスンポート"
+lsof -i -P -n -l | grep "LISTEN" | awk '{print $1 "," $3 "," $9 "/" $8}' | sort | uniq | column -t -s ","