A
A
Arthur Mikhailovich2017-10-25 19:07:12
linux
Arthur Mikhailovich, 2017-10-25 19:07:12

How to remotely take a screenshot in linux?

Running a huge zoo of linux machines that run through gui. I, as a lazy person, am writing a program in which there are a number of automated things (it is clear that it is not difficult to enter 15-40 characters to solve something, but why refuse to decide with one button "do it well"? :) )
There is access to the machines via ssh and vnc, the software sometimes throws out a number of "standard" errors, but the logs for this case are not sharpened, so the task has become - how can I get a screenshot of the user's screen in order to quickly determine what happened there?
Google googled lines like
DISPLAY=":0.0" import -window root screenshot.png
however, it turned out that ImageMagick is needed on the machine for this, and how to imagine that you need to install it on each one, then your hands drop (the machines are in the region of 500-800, maybe even more, it’s hard to say, and if you automate, ip is not always known, some may just be temporarily unavailable).
The question is - is it still possible to do without installing additional software on the machine and implement screen capture via ssh and vnc?
Thank you for your time, if something is not clear - I will answer.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
TyzhSysAdmin, 2017-10-25
@grymen

however, it turned out that this requires ImageMagick on the machine, but how to imagine that you need to install it on each

Ansible, Chef, etc.
there is also a utility `xwd`
xwd -root -out screenshot.xwd
convert screenshot.xwd -type TrueColor screenshot.bmp

`scrot`
scrot -t 20 -d 5

A
Alexey Cheremisin, 2017-10-25
@leahch

It seems that DISPLAY .... You will not work. Since the X session will not be allowed, not even root. You need to do more xhosts + in the X session

I
Ingvar, 2017-10-26
@take

Artur Mikhailovich , so what did you adopt?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question