func NewCollector(alarmsFilter string) collector.RPCCollector {
	c := &alarmCollector{}
	if len(alarmsFilter) > 0 {
		c.filter = regexp.MustCompile(alarmsFilter)
	}
	return c
}
NewCollector creates a new collector
package alarm
import (
	"regexp"
	"github.com/czerwonk/junos_exporter/collector"
	"github.com/czerwonk/junos_exporter/rpc"
	"github.com/prometheus/client_golang/prometheus"
)
const prefix = "junos_alarms_"
var (
	alarmsYellowCount *prometheus.Desc
	alarmsRedCount    *prometheus.Desc
)
func init() {
	l := []string{"target"}
	alarmsYellowCount = prometheus.NewDesc(prefix+"yellow_count", "Number of yollow alarms (not silenced)", l, nil)
	alarmsRedCount = prometheus.NewDesc(prefix+"red_count", "Number of red alarms (not silenced)", l, nil)
}
type alarmCollector struct {
	filter *regexp.Regexp
}