Esempio n. 1
0
func (self *Manager) ProcessWindows(windows []*Window) {

	var detector *Detector
	for _, w := range windows {
		detector = self.mapper.Map(w)
		if detector == nil {
			glog.Warningf("No mapping found for window %s %s", w.Name, w.Tags)
			continue
		}

		if detector.IsAnomalous(w) {
			self.RecordAnomalous(w)
		}
	}
}
Esempio n. 2
0
func (self *RiemannNotifier) connect() error {
	if self.client != nil {
		self.client.Close()
	}
	client, err := raidman.Dial("tcp", fmt.Sprintf("%s:%d", self.host, self.port))
	if err != nil {
		glog.Warningf(
			"Error connecting to riemann: %s host: %s port: %d",
			err.Error(),
			self.host,
			self.port,
		)
		return err
	}
	self.client = client
	self.retries = maxRetries
	return nil
}