Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SSH banner as a metric in the lua ssh2 check #224

Merged
merged 2 commits into from May 11, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/modules-lua/noit/module/ssh2.lua
Expand Up @@ -267,6 +267,9 @@ function initiate(module, check)
local banner = e:read("\n")
if banner == nil then return cerr("failed to read SSH banner") end

local trimmed_banner = banner:gsub("%s+$", "")
check.metric_string("banner", trimmed_banner)

if e:write("SSH-2.0-Reconnoiter\r\n") < 0 then
return cerr("failed to write SSH banner")
end
Expand Down