Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

scollector: More generic SNMP collector #1089

Merged
merged 1 commit into from
Jul 1, 2015
Merged

scollector: More generic SNMP collector #1089

merged 1 commit into from
Jul 1, 2015

Conversation

captncraig
Copy link
Contributor

Review on Reviewable

@captncraig
Copy link
Contributor Author

  [MIBS.fortinet]
    BaseOid = "1.3.6.1.4.1.12356.101"

    [[MIBS.fortinet.Metrics]]
      Metric = "fortinet.cpu"
      Oid = ".4.1.3.0"
      Unit = "percent"

    [[MIBS.fortinet.Metrics]]
      Metric = "fortinet.mem.used"
      Oid = ".4.1.4.0"
      Unit = "percent"

    [[MIBS.fortinet.Metrics]]
      Metric = "fortinet.mem.capacity"
      Oid = ".4.1.5.0"
      Unit = "kbytes"

    [[MIBS.fortinet.Trees]]
      #VPN Tunnels table
      BaseOid = ".12.2.2.1"
      TagKey = "name"
      LabelSourceOid = ".2"
      [[MIBS.fortinet.Trees.Metrics]]
        Metric = "fortinet.vpn.tunnelStatus"
        Oid = ".20"
        Unit = "bool"
      [[MIBS.fortinet.Trees.Metrics]]
        Metric = "fortinet.vpn.bytes.in"
        Oid = ".18"
        Unit = "bytes"
        RateType = "counter"
      [[MIBS.fortinet.Trees.Metrics]]
        Metric = "fortinet.vpn.bytes.out"
        Oid = ".19"
        Unit = "bytes"
        RateType = "counter"
  [MIBS.cisco]
    BaseOid = "1.3.6.1.4.1.9.9"
    [[MIBS.cisco.Metrics]]
      Metric = "cisco.cpu"
      Oid = ".109.1.1.1.1.6"
      Unit = "percent"
    [[MIBS.cisco.Trees]]
      BaseOid = ".48.1.1.1"
      TagKey = "name"
      LabelSourceOid = ".2"
      [[MIBS.cisco.Trees.Metrics]]
        Metric = "cisco.mem.used"
        Oid = ".5"
      [[MIBS.cisco.Trees.Metrics]]
        Metric = "cisco.mem.free"
        Oid = ".6"

[[SNMP]]
    Host = "fortinet01"
    Community = "dddddd"
    MIBs = ["fortinet", "ifaces"]

[[SNMP]]
    Host = "ny-switch02"
    Community = "cccccc"
    MIBs = ["cisco"]

@captncraig captncraig changed the title WIP - More generic SNMP collector scollector: More generic SNMP collector Jun 24, 2015
)

func SNMP(community, host string) error {
if host == "" {
var builtInSnmps = map[string]func(cfg conf.SNMP){"ifaces": SNMPIfaces, "cisco": SNMPCisco}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this multiline so future additions are just one line changes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

builtInSNMPs

var ok bool
tagVal, ok = tagCache[tag.Key][i]
if !ok {
fmt.Println("CCCCCC")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove debug

@maddyblue
Copy link
Contributor

LGTM

captncraig added a commit that referenced this pull request Jul 1, 2015
scollector: More generic SNMP collector
@captncraig captncraig merged commit 45749e4 into master Jul 1, 2015
@captncraig captncraig deleted the snmp branch July 1, 2015 20:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants