オムロンさんの無停電電源装置を使う事に.

装置の一覧はこちら https://socialsolution.omron.com/jp/ja/products_service/ups/product/ups.html
っで停電が起こった際にUSBとかで繋がっているマシンを止めてくれるアプリはこちら https://socialsolution.omron.com/jp/ja/products_service/ups/product/soft/soft.html

どちらも停止前に自前のコマンドを発行できるみたい. どちらも無償.

PowerAttendant Standard Edition

https://socialsolution.omron.com/jp/ja/products_service/ups/product/soft/powerattendant_standardedition.html
ダウンロードした「PowerAttendant-2.1.2-1.x86_64.rpm」をインストール.
epelのリポジトリが必要です

[root@rockylinux9 ~]# dnf install epel-release
 
[root@rockylinux9 ~]# unzip PASV212_linux_redhat.zip
[root@rockylinux9 ~]# cd PASV212_linux_redhat
 
[root@rockylinux9 PASV212_linux_redhat]# rpm -Uvh ./PowerAttendant-2.1.2-1.x86_64.rpm     <-- dnf localinstall ではダメみたい
 :
Do you agree this license? [ y/n ] y                                   <-- yを入力
Please input a http port number(1~65535) of this software[80]: 8080    <-- PowerAttendant のwebサービスを提供するport番号
Updating / installing...
   1:PowerAttendant-2.1.2-1           ################################# [100%]
Created symlink /etc/systemd/system/multi-user.target.wants/powerattendantd.service → /etc/systemd/system/powerattendantd.service.
Installation of PowerAttendant is finished.
 
[root@rockylinux9 PASV212_linux_redhat]#

systemctlでサービスは管理されて

[root@rockylinux9 PASV212_linux_redhat]# systemctl status powerattendantd.service
● powerattendantd.service - PowerAttendant service
     Loaded: loaded (/etc/systemd/system/powerattendantd.service; enabled; preset: disabled)
     Active: active (running) since Sun 2026-03-22 22:50:21 JST; 51s ago
   Main PID: 65219 (PowerAttendant)
      Tasks: 16 (limit: 101925)
     Memory: 88.7M (peak: 89.4M)
        CPU: 4.004s
     CGroup: /system.slice/powerattendantd.service
             mq65219 /opt/OMRON/PowerAttendant/PowerAttendant
 
Mar 22 22:50:21 rockylinux9 systemd[1]: Starting PowerAttendant service...
Mar 22 22:50:21 rockylinux9 systemd[1]: Started PowerAttendant service.
Mar 22 22:50:21 rockylinux9 systemd[1]: /etc/systemd/system/powerattendantd.service:2: Unknown key name 'Name' in section 'Unit', ignoring.
Mar 22 22:50:21 rockylinux9 systemd[1]: /etc/systemd/system/powerattendantd.service:7: Unknown key name 'StartLimitIntervalSec' in section 'Service', ign>
[root@rockylinux9 PASV212_linux_redhat]#

となっている。ちなみにportを確認すると

[root@rockylinux9 PASV212_linux_redhat]# lsof -i -P
 :
PowerAtte 65297   root  346u  IPv4  96088      0t0  TCP localhost:8080 (LISTEN)
PowerAtte 65297   root  347u  IPv6  96089      0t0  TCP localhost:8080 (LISTEN)
 :
[root@rockylinux9 PASV212_linux_redhat]#

と「localhost:8080」なので、ローカルマシンからでないとアクセスできない。他のマシンからリモートでこのサービス(8080)にはアクセスできない。
どうしてもなら、

[root@rockylinux9 ~]# cp -a /opt/OMRON/PowerAttendant/appsettings.json /opt/OMRON/PowerAttendant/appsettings.json.orig
 
[root@rockylinux9 ~]# vi /opt/OMRON/PowerAttendant/appsettings.json
{"Kestrel": {"Endpoints": {"Http": {"Url": "http://localhost:8080"} } } }
 ↓
{"Kestrel": {"Endpoints": {"Http": {"Url": "http://0.0.0.0:8080"} } } }
[root@rockylinux9 ~]#

と「localhost」を「0.0.0.0」に変更してpowerattendantd.serviceを再起動すればいいみたい

[root@rockylinux9 ~]# systemctl restart powerattendantd.service
[root@rockylinux9 ~]# lsof -i -P
 :
PowerAtte 65452   root  346u  IPv4 101850      0t0  TCP *:8080 (LISTEN)
 :
[root@rockylinux9 ~]#

「*:8080」なので他からのアクセスも可なのですが、「localhost」という名称でのアクセスが必要なようで、SSHトンネルを掘って、いま操作しているwin/macの特定ポート(例:8080)に「rockylinux9:8080」を繋げ、
ブラウザ上で「localhost:8080」を再現できれば、リモートでアクセス可能っぽい。
単に「「*:8080」ではダメのようで、さらにひと工夫必要みたい。

あとfirewallが動いているならその調整も必要。

[root@rockylinux9 ~]# firewall-cmd --add-port=8080/tcp --zone=public --permanent
[root@rockylinux9 ~]# firewall-cmd --reload

っで設定へ
アクセスすと下記画面が表示され「Admin」のパスワードを定義します
2026y03m22d_231609118.png

定義が完了すると下記画面になりますが、まだ「ログイン」はされていないです。
2026y03m22d_231823668.png

「ログイン」ボタンをクリックして表示されたダイアログに「Admin」とパスワードを入力してログインします
2026y03m22d_231957904.png

ログインに成功するとこんな画面に
2026y03m22d_232122808.png

「詳細設定」欄を開くと既定で用意されているタスクや指定ホスト(localhost)らが用意されている
2026y03m22d_232320663.png
2026y03m22d_232323446.png

ここらを編集して、shutdown前に特定プログラムを停止させたり、指定したホストに入って停止スクリプトを流したりする感じでしょうか。
systemctlで用意されているサービスは shutdown 時には手順良く落ちますが、それ以外のプログラムを落とす際には有効かなと。

別のマシンを連携して止める

UPSとUSB/シリアルで繋がったホスト マシンがUPSの通電停止を感知すると、バッテリー運転が始まって「待機時間」後に、PowerAttendantで設定した内容に従って処理が進む

その際はホストマシン自身の他に、ssh or telnet で接続可能なマシンに入ってコマンドを流すことができきるみたい
っでまずは相手先を登録。パスワードで行くみたい。公開鍵方式で行けるのかは不明。「root」アカウントが微妙なら別のユーザで入って、スクリプトでsudoとかで行けるようにでしょうか。
2026y03m23d_013006125.png

そして相手先で実行するスクリプトを用意します。
2026y03m23d_013300525.png
こちらはcephの停止コマンドです

ceph fs set emfs joinable false
ceph fs fail emfs
ceph osd set noout
ceph osd set norebalance
ceph osd set nobackfill
ceph osd set noautoscale

そして相手先とこのスクリプトを連携させたタスクを用意します。ここでは「実行前待機時間」を取ってます。ceph本体側でも停止作業が進んでいる場合、二重実行を回避したいので。
2026y03m23d_013859978.png

離れた場所にOSDがあって、統一したceph電源管理ができない場合のお話です。片方で停電、片方は問題ない場合でもcephを停止させる魂胆です

最新の60件
2026-05-16 2026-05-13 2026-05-12 2026-05-11 2026-05-08 2026-05-06 2026-05-05 2026-05-04 2026-05-03 2026-04-30 2026-04-29 2026-04-28 2026-04-27 2026-04-25 2026-04-24 2026-04-22 2026-04-21 2026-04-12 2026-04-08 2026-04-06 2026-04-05 2026-04-02 2026-03-26 2026-03-23
  • PowerAttendant
2026-03-21 2026-03-19 2026-03-15 2026-03-14 2026-03-13 2026-03-07 2026-03-06 2026-03-04 2026-03-02 2026-02-26 2026-02-24 2026-02-21 2026-02-18 2026-02-17 2026-02-16 2026-02-11

edit


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2026-03-23 (月) 11:50:42