Skip to content

Commit

Permalink
Set some log commands to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
deven96 committed Nov 10, 2022
1 parent feb965a commit 0017dba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions client/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ func (hosts *HostsController) sendMetric(host config.Host, client *Client) {
// check for error 127 which means command was not found
var errorContent string
if !strings.Contains(fmt.Sprintf("%s", err), "127") {
errorContent = fmt.Sprintf("Could not retrieve metric %s from driver %s with error %s, resetting connection...", metric, host.Address, err)
errorContent = fmt.Sprintf("Could not retrieve metric %s from driver %s with error %s", metric, host.Address, err)
} else {
errorContent = fmt.Sprintf("Command %s not found on driver %s", metric, host.Address)
}
log.Error(errorContent)
log.Debug(errorContent)
//FIXME: what kind of errors do we especially want to reset driver for
if _, ok := err.(*driver.SSHConnectError); ok {
hosts.resetDriver(host)
Expand Down Expand Up @@ -131,7 +131,7 @@ func (hosts *HostsController) Poll(client *Client) {
go hosts.sendMetric(host, client)
}
}
log.Infof("Delaying for %d seconds", hosts.Info.PollInterval)
log.Debugf("Delaying for %d seconds", hosts.Info.PollInterval)
time.Sleep(time.Duration(hosts.Info.PollInterval) * time.Second)
}
}
Expand Down
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ func GetDashboardInfoConfig(config *Config) *DashboardInfo {
for _, host := range dashboardInfo.Hosts {
log.Debugf("%s: %v", host.Address, host.Connection)
}
if config.PollInterval < 10 {
log.Fatal("Cannot set poll interval below 10 seconds")
if config.PollInterval < 5 {
log.Fatal("Cannot set poll interval below 5 seconds")
}
dashboardInfo.PollInterval = config.PollInterval
return dashboardInfo
Expand Down
2 changes: 1 addition & 1 deletion driver/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (d *SSH) String() string {
// set the goph Client
func (d *SSH) Client() (*goph.Client, error) {
if d.SessionClient == nil {
log.Debugf("re-establishing connection with %s ...", d.Host)
log.Infof("re-establishing connection with %s ...", d.Host)
var err error
var client *goph.Client
var auth goph.Auth
Expand Down

0 comments on commit 0017dba

Please sign in to comment.