Skip to content

Commit

Permalink
Merge pull request #9 from treydock/fix-output
Browse files Browse the repository at this point in the history
Fix enabling output metric
  • Loading branch information
treydock authored Dec 16, 2020
2 parents d5cc696 + 758c4d0 commit fdecbee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ssh_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func metricsHandler(c *config.Config, logger log.Logger) http.HandlerFunc {
http.Error(w, fmt.Sprintf("Unknown module %s", t), http.StatusNotFound)
return
}
level.Debug(logger).Log("msg", "Loaded module", "module", module.ModuleName)

target := &config.Target{
Host: t,
Expand All @@ -69,6 +70,8 @@ func metricsHandler(c *config.Config, logger log.Logger) http.HandlerFunc {
Timeout: module.Timeout,
Command: module.Command,
CommandExpect: module.CommandExpect,
OutputMetric: module.OutputMetric,
OutputTruncate: module.OutputTruncate,
}
sshCollector := collector.NewCollector(target, log.With(logger, "target", target.Host))
registry.MustRegister(sshCollector)
Expand Down

0 comments on commit fdecbee

Please sign in to comment.