Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding NAT2 #168

Merged
merged 1 commit into from
Jan 13, 2022
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
2 changes: 2 additions & 0 deletions collectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/czerwonk/junos_exporter/ldp"
"github.com/czerwonk/junos_exporter/mac"
"github.com/czerwonk/junos_exporter/nat"
"github.com/czerwonk/junos_exporter/nat2"
"github.com/czerwonk/junos_exporter/ospf"
"github.com/czerwonk/junos_exporter/power"
"github.com/czerwonk/junos_exporter/route"
Expand Down Expand Up @@ -85,6 +86,7 @@ func (c *collectors) initCollectorsForDevices(device *connector.Device) {
c.addCollectorIfEnabledForDevice(device, "l2c", f.L2Circuit, l2circuit.NewCollector)
c.addCollectorIfEnabledForDevice(device, "ldp", f.LDP, ldp.NewCollector)
c.addCollectorIfEnabledForDevice(device, "nat", f.NAT, nat.NewCollector)
c.addCollectorIfEnabledForDevice(device, "nat2", f.NAT2, nat2.NewCollector)
c.addCollectorIfEnabledForDevice(device, "ospf", f.OSPF, func() collector.RPCCollector {
return ospf.NewCollector(c.logicalSystem)
})
Expand Down
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type FeatureConfig struct {
OSPF bool `yaml:"ospf,omitempty"`
ISIS bool `yaml:"isis,omitempty"`
NAT bool `yaml:"nat,omitempty"`
NAT2 bool `yaml:"nat2,omitempty"`
L2Circuit bool `yaml:"l2circuit,omitempty"`
LDP bool `yaml:"ldp,omitempty"`
Routes bool `yaml:"routes,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var (
isisEnabled = flag.Bool("isis.enabled", false, "Scrape ISIS metrics")
l2circuitEnabled = flag.Bool("l2circuit.enabled", false, "Scrape l2circuit metrics")
natEnabled = flag.Bool("nat.enabled", false, "Scrape NAT metrics")
nat2Enabled = flag.Bool("nat2.enabled", false, "Scrape NAT2 metrics")
ldpEnabled = flag.Bool("ldp.enabled", true, "Scrape ldp metrics")
routingEngineEnabled = flag.Bool("routingengine.enabled", true, "Scrape Routing Engine metrics")
routesEnabled = flag.Bool("routes.enabled", true, "Scrape routing table metrics")
Expand Down Expand Up @@ -197,6 +198,7 @@ func loadConfigFromFlags() *config.Config {
f.IPSec = *ipsecEnabled
f.ISIS = *isisEnabled
f.NAT = *natEnabled
f.NAT2 = *nat2Enabled
f.OSPF = *ospfEnabled
f.LDP = *ldpEnabled
f.L2Circuit = *l2circuitEnabled
Expand Down
Loading