目的
複数台のマシンの死活監視をする場合に良いソフトはないかなと探した所、deadmanを発見した。そこで今回はdeadmanを使ってみる。
構築
構築とは言ってもただダウンロードするだけ
git clone https://github.com/upa/deadman.git
cd deadman/
設定ファイルの編集
nano /deadman.conf
以下の様に編集
#
# deadman config
#
gateway 192.168.11.1
user1 192.168.11.2
user2 192.168.11.3
user3 192.168.11.4
user4 192.168.11.5
user5 192.168.11.6
user6 192.168.11.7
user7 192.168.11.8
user8 192.168.11.9
user9 192.168.11.10
user10 192.168.11.11
user11 192.168.11.12
user12 192.168.11.13
user13 192.168.11.14
user14 192.168.11.15
#
# ping via ssh relay host.
#
# Syntax
# Name Address relay=SSHHOST os=Linux user=USER key=RSAKEYPATH
#
# In order to use ssh-relay, "relay" attribute must be specified.
# if "os" is not specified, same OS name running the daedman is used.
#google-via-ssh 173.194.117.176 relay=X.X.X.X os=Linux
#
# ping via snmpping (SNMPv2). See RFC4560.
#
# Syntax
# Name Address relay=SNMPHOST via=snmp community=COMMUNITY
#
#googleDNS-via-snmp 8.8.8.8 relay=X.X.X.X via=snmp community=public
#
# ping via network namespace (Linux only).
# Note: root privilege is required to exec anything on netns
#
# Syntax
# Name Address relay=NETNSNAME via=netns
#
#googleDNS-via-netns 8.8.8.8 relay=netns1 via=netns
#
# ping via vrf (Linux only).
# Note: root privilege is required to exec anything on vrf
#
# Syntax
# Name Address relay=VRFNAME via=vrf
#
#googleDNS-via-vrf 8.8.8.8 relay=vrf1 via=vrf
#
# tcp based ping (Linux only).
# Note: root privilege is required to manipulate raw-socket
# Note: tested with only linux, but macOS can be work.
#
# Syntax
# Name Address tcp=dstport:80
#
#wide-tcp80 203.178.136.59 tcp=dstport:80
実行
$ ./deadman deadman.conf
確認
おぉすごい
From: LAPTOP-HADFF4IQ (127.0.1.1) [ver 22.02.10]
RTT Scale 10ms. Keys: (r)efresh
HOSTNAME ADDRESS LOSS RTT AVG SNT RESULT
gateway 192.168.11.1 0% 4 3 78 ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▄▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
user1 192.168.11.2 100% 0 0 78 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
user2 192.168.11.3 0% 0 0 78 ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
user3 192.168.11.4 100% 0 0 78 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
user4 192.168.11.5 100% 0 0 78 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
user5 192.168.11.6 100% 0 0 78 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
user6 192.168.11.7 0% 4 4 78 ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
user7 192.168.11.8 100% 0 0 78 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
user8 192.168.11.9 100% 0 0 78 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
user9 192.168.11.10 100% 0 0 78 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
user10 192.168.11.11 100% 0 0 78 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
user11 192.168.11.12 100% 0 0 78 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
user12 192.168.11.13 100% 0 0 78 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
user13 192.168.11.14 1% 102 135 78 █▇███████▂█▁▅█▁▄██▂█▄█▃▄▇▁███████▆▆▂███▅▅█████▅███▅███▇█
> user14 192.168.11.15 100% 0 0 77 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX