Skip to content

Commit

Permalink
GROUNDWORK-4166: add debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
VladislavSenkevich committed Jan 30, 2025
1 parent 1ef4287 commit efe22ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions connectors/connectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ func addThresholdsToStatusText(statusText string, service *transit.MonitoredServ
log.Warn().Err(err).Msgf("could not get metric %s value for service %s", metric.MetricName, service.Name)
continue
}
fmt.Println("METRIC VALUE TEXT " + mValText)
wt := noneThresholdText
crt := noneThresholdText
if metric.Thresholds != nil {
Expand Down Expand Up @@ -768,6 +769,7 @@ func addThresholdsToStatusText(statusText string, service *transit.MonitoredServ

var thText string
if noneThresholdText != wt && noneThresholdText != crt {
fmt.Println("==== HERE 1")
wtVal, err := strconv.ParseFloat(wt, 64)
if err != nil {
log.Warn().Err(err).Msgf("could not parse warning threshold value %s for service %s", wt, service.Name)
Expand All @@ -794,6 +796,7 @@ func addThresholdsToStatusText(statusText string, service *transit.MonitoredServ
}
}
} else if noneThresholdText != wt {
fmt.Println("==== HERE 2")
wtVal, err := strconv.ParseFloat(wt, 64)
if err != nil {
log.Warn().Err(err).Msgf("could not parse warning threshold value %s for service %s", wt, service.Name)
Expand All @@ -805,6 +808,7 @@ func addThresholdsToStatusText(statusText string, service *transit.MonitoredServ
thText = strings.ReplaceAll(thText, "{w}", wt)
}
} else if noneThresholdText != crt {
fmt.Println("==== HERE 3")
crtVal, err := strconv.ParseFloat(crt, 64)
if err != nil {
log.Warn().Err(err).Msgf("could not parse critical threshold value %s for service %s", crt, service.Name)
Expand Down
1 change: 1 addition & 0 deletions connectors/snmp/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ func (device *DeviceExt) retrieveMonitoredServices(metricDefinitions map[string]
log.Err(err).Msgf("could not create monitored service '%s:%s'", device.Name, iFace.Name)
}
if mService != nil {
fmt.Println(mService.LastPluginOutput)
switch iFace.Status {
case 0:
mService.Status = transit.ServiceWarning
Expand Down

0 comments on commit efe22ec

Please sign in to comment.