tnich/honssh

Hook when the TTY of the session is written

unixfox opened this issue · 2 comments

I'm writing a script to upload the TTY of the session but with the actual hooks I can't have the sensor name and the timestamp is not the same as given by channel_closed and connection_lost hooks.
Values given by the connection_lost hook:

CONNECTION_LOST 20161105_005233_290255 xxxx.xxxx.xxxx.xxxx 49311 172.17.0.4 22 5cf1f1e431e840d592d751dcbc5adf07

And when I execute ls inside the directory of the session:

root@honssh:~/honssh/sessions/735c7a44c9a3017a41268063ed209d3bdf88034f6aad455f0804e605e796ba2f/xxx.xxx.xxx.xxx# ls
20161105_005230_961622.log  20161105_005231_039121_TERM0.tty

Is it possible to add a hook when the TTY of the session is written (with the sensor name value) or change the value of CHANNEL_ID/uuid by the sensor name?

tnich commented

Hey, I have added a ttylog_closed hook into HonSSH which gives output like:
TTYLOG_CLOSED Testing sessions/Testing/10.0.1.1/20161106_151800_759987_TERM0.tty

Is this what you were after?

Also, if you are writing your script in python, you might want to look at the plugins/output/example.py as these provide access to the raw information in HonSSH.

I'll take a look tonight, I think that's exactly what I was searching 👍 ! Thank you!