Implement 'inteval' config parameter -> number of seconds between checks

This commit is contained in:
Soulou
2015-08-23 17:33:23 +02:00
parent 270dbd361b
commit 76b897eb05
3 changed files with 73 additions and 16 deletions

View File

@@ -4,13 +4,14 @@ import (
"encoding/json"
"flag"
"fmt"
"github.com/castawaylabs/cachet-monitor/system"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
"github.com/castawaylabs/cachet-monitor/system"
)
// Static config
@@ -69,6 +70,13 @@ func init() {
os.Exit(1)
}
for _, mon := range Config.Monitors {
if mon.Interval <= 0 {
mon.Interval = 1
}
mon.stopC = make(chan struct{})
}
if len(systemName) > 0 {
Config.SystemName = systemName
}