Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions collectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
"github.com/czerwonk/junos_exporter/pkg/features/storage"
"github.com/czerwonk/junos_exporter/pkg/features/subscriber"
"github.com/czerwonk/junos_exporter/pkg/features/system"
"github.com/czerwonk/junos_exporter/pkg/features/systemstatistics"
"github.com/czerwonk/junos_exporter/pkg/features/twamp"
"github.com/czerwonk/junos_exporter/pkg/features/vpws"
"github.com/czerwonk/junos_exporter/pkg/features/vrrp"
Expand Down Expand Up @@ -130,6 +131,8 @@ func (c *collectors) initCollectorsForDevices(device *connector.Device, descRe *
c.addCollectorIfEnabledForDevice(device, "ddosprotection", f.DDOSProtection, ddosprotection.NewCollector)
c.addCollectorIfEnabledForDevice(device, "krt", f.KRT, krt.NewCollector)
c.addCollectorIfEnabledForDevice(device, "twamp", f.TWAMP, twamp.NewCollector)
c.addCollectorIfEnabledForDevice(device, "system_statistics", f.SystemStatistics, systemstatistics.NewCollector)

}

func (c *collectors) addCollectorIfEnabledForDevice(device *connector.Device, key string, enabled bool, newCollector func() collector.RPCCollector) {
Expand Down
3 changes: 3 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ type FeatureConfig struct {
DDOSProtection bool `yaml:"ddos_protection,omitempty"`
KRT bool `yaml:"krt,omitempty"`
TWAMP bool `yaml:"twamp,omitempty"`
SystemStatistics bool `yaml:"system_statistics,omitempty"`

}

// New creates a new config
Expand Down Expand Up @@ -182,6 +184,7 @@ func setDefaultValues(c *Config) {
f.License = false
f.MACSec = true
f.Poe = false
f.SystemStatistics = true
}

// FeaturesForDevice gets the feature set configured for a device
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ var (
poeEnabled = flag.Bool("poe.enabled", true, "Scrape PoE metrics")
krtEnabled = flag.Bool("krt.enabled", false, "Scrape KRT queue metrics")
twampEnabled = flag.Bool("twamp.enabled", false, "Scrape TWAMP metrics")
systemstatisticsEnabled = flag.Bool("systemstatistics.enabled", true, "Scrape system statistics metrics")
cfg *config.Config
devices []*connector.Device
connManager *connector.SSHConnectionManager
Expand Down Expand Up @@ -266,6 +267,7 @@ func loadConfigFromFlags() *config.Config {
f.Poe = *poeEnabled
f.KRT = *krtEnabled
f.TWAMP = *twampEnabled
f.SystemStatistics = *systemstatisticsEnabled
return c
}

Expand Down
927 changes: 927 additions & 0 deletions pkg/features/systemstatistics/collector.go

Large diffs are not rendered by default.

453 changes: 453 additions & 0 deletions pkg/features/systemstatistics/rpc.go

Large diffs are not rendered by default.

Loading
Loading