Skip to content

Commit

Permalink
Added router log size checks
Browse files Browse the repository at this point in the history
  • Loading branch information
u220374 committed Aug 31, 2017
1 parent 29a760f commit 2069c53
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions daemon/client/checks/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ func CheckRouterLogoutput() error {
}
}

if logSize < 100 {
return fmt.Errorf("Router %v has less log lines than 100. Seems that it is stuck!", routerName)
if logSize < 1 {
return fmt.Errorf("Router %v has no log lines. Seems that it is stuck!", routerName)
}
}
}
Expand All @@ -282,7 +282,7 @@ func CheckRouterLogoutput() error {
}

func getRouterLogSize(routerName string) (int, error) {
out, err := exec.Command("bash", "-c", "oc logs --timestamps=false --since=60s "+routerName+" | wc -l").Output()
out, err := exec.Command("bash", "-c", "oc logs -n default --timestamps=false --since=60s "+routerName+" | wc -l").Output()
if err != nil {
msg := fmt.Sprintf("Could not logs of router: %v, Error: %v", routerName, err.Error())
log.Println(msg)
Expand Down
4 changes: 0 additions & 4 deletions daemon/client/handlers/major.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ func HandleMajorChecks(daemonType string, w http.ResponseWriter, r *http.Request
if err := checks.CheckDnsServiceNode(); err != nil {
errors = append(errors, err.Error())
}

if err := checks.CheckRouterLogoutput(); err != nil {
errors = append(errors, err.Error())
}
}

if daemonType == "STORAGE" {
Expand Down
4 changes: 4 additions & 0 deletions daemon/client/handlers/minor.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ func HandleMinorChecks(daemonType string, w http.ResponseWriter, r *http.Request
if err := checks.CheckLoggingRestartsCount(); err != nil {
errors = append(errors, err.Error())
}

if err := checks.CheckRouterLogoutput(); err != nil {
errors = append(errors, err.Error())
}
}

if daemonType == "STORAGE" {
Expand Down

0 comments on commit 2069c53

Please sign in to comment.