web-dev-qa-db-ja.com

ローカルssh接続を介したマシン上のモニターの検出

ローカルネットワーク内のマシン上のビデオ関連のものをチェックするためのスクリプトを作成する必要があります。

  • モニターは接続されていますか?
  • ビデオドライバは最新で、ハードウェアに適していますか?
  • Xorgは実行されていますか?

ただし、ローカルのssh接続を介してモニターが接続されているかどうかを確認する信頼できる方法を見つけるのに問題があります。たとえば、マシンAから同じサブネット上にある別のマシンBにSSHで接続すると、xrandrツールは、マシンBではなくマシンAに接続されているモニターに関する情報を返します。他のツールをいくつか試しました。しかし、すべて同じ効果があります。シェルセッションを実行しているマシンではなく、接続しているマシンに接続されているモニターをプローブしていることを確認するにはどうすればよいですか?

6
jayhendren

X11転送を無効にし(-xスイッチをsshに使用)、マシンBのDISPLAY環境変数を設定します。たとえば、これにより、マシンBの:0の設定がわかります。

ssh -x machineB
DISPLAY=:0 xrandr
8
depquid

「get-edid」という名前のツールを使用すると、モニターから識別情報を読み取ることができます read-edid Webサイト拡張ディスプレイ識別データ

および「parse-edid」は、正しいX構成モニターセクションであるget-edidから作成します。

私のマシンの例:

# get-edid | parse-edid 
parse-edid: parse-edid version 2.0.0
get-edid: get-edid version 2.0.0

Performing real mode VBE call
Interrupt 0x10 ax=0x4f00 bx=0x0 cx=0x0
Function supported
Call successful

VBE version 300
VBE string at 0xc01f0 "ATI ATOMBIOS"

VBE/DDC service about to be called
Report DDC capabilities

Performing real mode VBE call
Interrupt 0x10 ax=0x4f15 bx=0x0 cx=0x0
Function supported
Call successful

Monitor and video card combination does not support DDC1 transfers
Monitor and video card combination supports DDC2 transfers
0 seconds per 128 byte EDID block transfer
Screen is not blanked during DDC transfer

Reading next EDID block

VBE/DDC service about to be called
Read EDID

Performing real mode VBE call
Interrupt 0x10 ax=0x4f15 bx=0x1 cx=0x0
Function supported
Call successful

parse-edid: EDID checksum passed.

# EDID version 1 revision 3
Section "Monitor"
# Block type: 2:0 3:fd
# Block type: 2:0 3:fc
Identifier "Acer H233H"
VendorName "ACR"
ModelName "Acer H233H"
# Block type: 2:0 3:fd
HorizSync 30-83
VertRefresh 56-75
# Max dot clock (video bandwidth) 170 MHz
# Block type: 2:0 3:fc
# Block type: 2:0 3:ff
# DPMS capabilities: Active off:yes  Suspend:no  Standby:no

Mode    "1920x1080" # vfreq 60.000Hz, hfreq 67.500kHz
    DotClock    148.500000
    HTimings    1920 2008 2052 2200
    VTimings    1080 1084 1089 1125
    Flags   "+HSync" "+VSync"
EndMode
# Block type: 2:0 3:fd
# Block type: 2:0 3:fc
# Block type: 2:0 3:ff
EndSection

それらを使用するには、rootである必要があります。 /etc/X11/xorg.confには何も書かれていません

1
ericc