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 monitoring for more types of interfaces #1756

Closed
wants to merge 1 commit into from
Closed

Adding monitoring for more types of interfaces #1756

wants to merge 1 commit into from

Conversation

krish7919
Copy link

  • Scollector monitors interfaces whose interface names have a specific prefix.
  • Adding tun, wlan and ppp to be monitored too

- Scollector monitors interfaces whose interface names have a specific prefix.
- Adding tun*, wlan* and ppp* to be monitored too
@kylebrandt
Copy link
Member

kylebrandt commented May 26, 2016

#1353 also adds things.

What these need is for the interfaces to be categorized into the proper metric. So the scheme should be:

 [os|linux].net (physical interfaces)
 [os|linux].net.bond (for teams and bonds)
 [os|linux].net.tunnel (for tunnel interfaces)
 [os|linux].net.virtual (vlans)
 [os|linux].net.other (whatever)

See reference at bottom.

This way the aggregation of os.net.bytes should be total traffic and we don't double count things.

image

When we do this from SNMP, we use the ifType table as follows in cmd/scollector/collectors/snmp_ifaces To give you an idea:

func switchInterfaceMetric(metric string, iname string, ifType int64) string {
    switch ifType {
    case 6:
        return metric
    case 53, 161:
        return osNet + ".bond" + strings.TrimPrefix(metric, osNet)
    case 135:
        return osNet + ".virtual" + strings.TrimPrefix(metric, osNet)
    case 131:
        return osNet + ".tunnel" + strings.TrimPrefix(metric, osNet)
    default:
        //Cisco ASAs don't mark port channels correctly
        if strings.Contains(iname, "port-channel") {
            return osNet + ".bond" + strings.TrimPrefix(metric, osNet)
        }
        return osNet + ".other" + strings.TrimPrefix(metric, osNet)
    }
}

@krish7919
Copy link
Author

@kylebrandt : On it. Will send another PR soon.

@krish7919
Copy link
Author

@kylebrandt : I went through the source this weekend. However, I could not find where to add the metrics aggregation property. Can you please guide?

@kylebrandt
Copy link
Member

I am not sure what you mean by 'metrics aggregation property'. Can you expand?

@krish7919
Copy link
Author

  1. "interface to be categorized into proper metric" and the scheme. => I renamed it to metics aggregation. And am confused where to edit for taking into account other interfaces.
  2. The sample code is for snmp isn't very helpful. Shed some light please?

P.S. I am new to bosun and this is my first PR.
Bosun is awesome; we are just testing it out for now.

@kylebrandt
Copy link
Member

@krish7919 Sorry for the delay, was focused on getting 0.5.0 out the door. There is no aggregation property, but tsdb, i.e. opentsdb will do aggregation operations on tags for a metric when querying. So if you query say os.net.bytes with no tags specified and using the sum aggregator, all the series will be summed over time.

So the metric layout matches this schema so only i.e. physical interfaces are under os.net.bytes, so when you query it and aggregate you are not double counting bytes that also pass through virtual / tunnel / bond.

Make sense?

@stale
Copy link

stale bot commented Mar 15, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 15, 2021
@stale stale bot closed this Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants