「SmokePing」:修訂間差異
跳至導覽
跳至搜尋
無編輯摘要 |
|||
(未顯示同一使用者於中間所作的 11 次修訂) | |||
第2行: | 第2行: | ||
== 安裝 == | == 安裝 == | ||
在[[Ubuntu]]下可以直接透過系統內的套件安裝: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo apt install -y smokeping | sudo apt install -y smokeping; sudo apt clean | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== 設定 == | == 設定 == | ||
目前[[Ubuntu]]內建的[[systemd]]有兩個問題會透過drop-in設定修正: | |||
* 有dependency的問題,不能保證開機後會正確啟動(可能會在網路還沒起來的時候就先啟動了)。 | |||
* 在發生問題後不會自動重啟的問題。 | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo mkdir -p /etc/systemd/system/smokeping.service.d; echo -e "#\n[Unit]\nRequires=network-online.target\n\n[Service]\nRestart=on-failure" | sudo tee /etc/systemd/system/smokeping.service.d/override.conf; sudo systemctl daemon-reload | |||
</syntaxhighlight> | |||
=== 網頁介面 === | |||
這邊為了在網頁上可以看,會另外安裝[[FastCGI]]相關的套件以及相關的設定: | |||
<syntaxhighlight lang="bash"> | |||
sudo apt install -y spawn-fcgi; sudo apt clean; sudo ln -s ../smokeping.cgi /usr/share/smokeping/www/smokeping.fcgi | |||
</syntaxhighlight> | |||
使用[[nginx]]時可以這樣設定: | |||
<syntaxhighlight lang="nginx"> | |||
location /smokeping/ { | |||
alias /usr/share/smokeping/www/; | |||
index smokeping.fcgi; | |||
location ~ \.fcgi$ { | |||
include fastcgi_params; | |||
fastcgi_intercept_errors on; | |||
fastcgi_pass unix:/var/run/smokeping-fcgi.sock; | |||
} | |||
} | |||
</syntaxhighlight> | |||
另外[[systemd]]的設定可以放在<code>/etc/systemd/system/smokeping-fcgi.service</code>下: | |||
<syntaxhighlight lang="ini"> | |||
# | |||
# Install into /etc/systemd/system | |||
[Unit] | |||
Description=Smokeping FastCGI daemon | |||
Requires=remote-fs.target smokeping.service | |||
[Service] | |||
ExecStart=/usr/bin/spawn-fcgi -s /var/run/smokeping-fcgi.sock -P /var/run/smokeping-fcgi.pid -u www-data -g www-data -- /usr/share/smokeping/www/smokeping.fcgi | |||
PIDFile=/run/smokeping-fcgi.pid | |||
Restart=always | |||
RestartSec=60 | |||
Type=simple | |||
[Install] | |||
WantedBy=multi-user.target | |||
</syntaxhighlight> | </syntaxhighlight> | ||
第16行: | 第68行: | ||
=== 我自己的 === | === 我自己的 === | ||
* https://home.gslin.org/smokeping/ | * https://home.gslin.org/smokeping/ | ||
* https://rent-hinet.gslin.com/smokeping/ | * https://rent-hinet.gslin.com/smokeping/ |
於 2024年4月9日 (二) 18:04 的最新修訂
SmokePing是一套監控網路品質的軟體。
安裝
在Ubuntu下可以直接透過系統內的套件安裝:
sudo apt install -y smokeping; sudo apt clean
設定
目前Ubuntu內建的systemd有兩個問題會透過drop-in設定修正:
- 有dependency的問題,不能保證開機後會正確啟動(可能會在網路還沒起來的時候就先啟動了)。
- 在發生問題後不會自動重啟的問題。
sudo mkdir -p /etc/systemd/system/smokeping.service.d; echo -e "#\n[Unit]\nRequires=network-online.target\n\n[Service]\nRestart=on-failure" | sudo tee /etc/systemd/system/smokeping.service.d/override.conf; sudo systemctl daemon-reload
網頁介面
這邊為了在網頁上可以看,會另外安裝FastCGI相關的套件以及相關的設定:
sudo apt install -y spawn-fcgi; sudo apt clean; sudo ln -s ../smokeping.cgi /usr/share/smokeping/www/smokeping.fcgi
使用nginx時可以這樣設定:
location /smokeping/ {
alias /usr/share/smokeping/www/;
index smokeping.fcgi;
location ~ \.fcgi$ {
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/smokeping-fcgi.sock;
}
}
另外systemd的設定可以放在/etc/systemd/system/smokeping-fcgi.service
下:
#
# Install into /etc/systemd/system
[Unit]
Description=Smokeping FastCGI daemon
Requires=remote-fs.target smokeping.service
[Service]
ExecStart=/usr/bin/spawn-fcgi -s /var/run/smokeping-fcgi.sock -P /var/run/smokeping-fcgi.pid -u www-data -g www-data -- /usr/share/smokeping/www/smokeping.fcgi
PIDFile=/run/smokeping-fcgi.pid
Restart=always
RestartSec=60
Type=simple
[Install]
WantedBy=multi-user.target
站台
我自己的
- https://home.gslin.org/smokeping/
- https://rent-hinet.gslin.com/smokeping/
- https://rpi.gslin.com/smokeping/
其他
外部連結
- 官方網站 (英文)