summaryrefslogtreecommitdiff
path: root/app/fetch.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/fetch.go')
-rw-r--r--app/fetch.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/fetch.go b/app/fetch.go
index e56205a..f6c4fed 100644
--- a/app/fetch.go
+++ b/app/fetch.go
@@ -19,6 +19,7 @@ func CheckPages(h []Host) []Host {
for k, v := range h {
if !h[k].Monitored {
+ h[k].Class = "danger"
continue
}
if resp, _, err := HttpGet(v.Url); err != nil {
@@ -31,9 +32,14 @@ func CheckPages(h []Host) []Host {
} else {
h[k].Status = resp.Status
h[k].StatusCode = int64(resp.StatusCode)
- h[k].Success = true
+ if h[k].StatusCode < 400 {
+ h[k].Success = true
+ h[k].Class = "success"
+ } else {
+ h[k].Success = false
+ h[k].Class = "danger"
+ }
h[k].Reason = ""
- h[k].Class = "success"
}
}