From a21bf2c2150a7a18f847a6e2a0ff6d6585d8b28c Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 1 May 2026 07:18:11 -0400 Subject: [PATCH] Handle ssh attempt to VM that is down --- bin/malpd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/malpd b/bin/malpd index 3875ed5..d0c66b3 100755 --- a/bin/malpd +++ b/bin/malpd @@ -147,8 +147,10 @@ def read_vm_dominfo(name) end def read_vm_info(name) - ssh_out = `ssh -Ti /root/.ssh/malp-vm-key malp@#{name}` - JSON.parse(ssh_out) + ssh_out = `ssh -o ConnectTimeout=1 -Ti /root/.ssh/malp-vm-key malp@#{name} 2>/dev/null` + if ssh_out != "" + JSON.parse(ssh_out) + end end def read_virtual_machines @@ -159,7 +161,7 @@ def read_virtual_machines names.map do |name| dom_info = read_vm_dominfo(name) - vm_info = read_vm_info(name) + vm_info = read_vm_info(name) || {} { "type" => "vm", "name" => name,