assh icon indicating copy to clipboard operation
assh copied to clipboard

Notifications don't work when using gateways.

Open lvets opened this issue 5 years ago • 1 comments

Hello,

I'm playing around with the Hooks examples in https://github.com/moul/assh/blob/master/examples/readme-full-example/assh.yml and notifications on macOS 10.15.6. All our connections require a bastion host, so I do the following:

hosts:
  bastion:
    Hostname: <hostname>
  server:
    Hostname: <hostname>
    Gateways: bastion

I also have the following from the examples I mentioned:

defaults:
  Hooks:
    AfterConfigWrite:
      # Alert me with a Desktop notification
      - notify "{{.SSHConfigPath}} has been rewritten"

    OnConnect:
      # Alert me with a Desktop notification
      - notify "New SSH connection to {{.Host.Prototype}} at {{.Stats.ConnectedAt}}."

    OnDisconnect:
      # write on terminal and in a Desktop notification some statistics about the finished connection
      - "write SSH connection to {{.Host.HostName}} closed, {{.Stats.WrittenBytes }} bytes written in {{.Stats.ConnectionDuration}} ({{.Stats.AverageSpeed}}bps)."
      - "notify SSH connection to {{.Host.HostName}} closed, {{.Stats.WrittenBytes }} bytes written in {{.Stats.ConnectionDuration}} ({{.Stats.AverageSpeed}}bps)."

I always get the "{{.SSHConfigPath}} has been rewritten" notification correctly, but I do not get the others at all. I tested with another server that has a direct ssh connection (so no bastion) and I do get the notifications for that connection consistently.

Any idea what I might be doing wrong?

lvets avatar Aug 11 '20 00:08 lvets

same issue for me too

srajasimman avatar Jan 27 '22 18:01 srajasimman