Giter Club home page Giter Club logo

Comments (10)

mcaulifn avatar mcaulifn commented on May 31, 2024 1

I'd like to hear back from the author first to see if he is OK with it.

from ansible-telegraf.

mcaulifn avatar mcaulifn commented on May 31, 2024

Found this while searching: https://github.com/jtyr/yaml2toml-converter
Might be helpful for a completely generic template

from ansible-telegraf.

dj-wasabi avatar dj-wasabi commented on May 31, 2024

@mcaulifn That looks nice, ever worked with it?

from ansible-telegraf.

mcaulifn avatar mcaulifn commented on May 31, 2024

just found it and then tried it out. there seem to be a few kinks but overall a great start.

telegraf_custom_plugins_extra:
  switches:
    inputs.snmp:
      agents:
        - 172.16.1.0
        - 172.16.1.6
        - 172.16.0.30
      version: 2
      community: publiv
      name: system
      field:
        - name: hostname
          oid: .1.3.6.1.2.1.1.5.0
          is_tag: true
        - name: uptime
          oid: .1.3.6.1.2.1.1.3.0
        - name: sysObjectID
          oid: .1.3.6.1.2.1.1.2.0
      table:
        - name: interface_stats
          inherit_tags:
            - hostname
          field:
            - name: ifName
              oid: .1.3.6.1.2.1.31.1.1.1.1
              is_tag: true
      tags:
          deviceType: switch
          customer: me

gets me:

[inputs.snmp]
agents = ['172.16.1.0', '172.16.1.6', '172.16.0.30']
community = "publiv"
name = "system"
version = 2

  [[inputs.snmp.field]]
  is_tag = True
  name = "hostname"
  oid = ".1.3.6.1.2.1.1.5.0"

  [[inputs.snmp.field]]
  name = "uptime"
  oid = ".1.3.6.1.2.1.1.3.0"

  [[inputs.snmp.field]]
  name = "sysObjectID"
  oid = ".1.3.6.1.2.1.1.2.0"

  [[inputs.snmp.table]]
  inherit_tags = ['hostname']
  name = "interface_stats"

    [[field]]
    is_tag = True
    name = "ifName"
    oid = ".1.3.6.1.2.1.31.1.1.1.1"

  [inputs.snmp.tags]
  customer = "me"
  deviceType = "switch"

I can hack around field being incorrect by adding inputs.snmp.table to that level. However, True should be true.

I opened an issue: jtyr/yaml2toml-converter#1

from ansible-telegraf.

dj-wasabi avatar dj-wasabi commented on May 31, 2024

@mcaulifn Nice!

Do you think you can make a PR that includes the usage of the converter?

from ansible-telegraf.

dj-wasabi avatar dj-wasabi commented on May 31, 2024

@mcaulifn Yeah sure, I agree. 👍

from ansible-telegraf.

NotDead avatar NotDead commented on May 31, 2024

Is it still open? I have searched for snmp config and as I can see this issue is hanging.
The first time I used this role, I thought it was done like @zachdesai suggested and did the wrong config =)

from ansible-telegraf.

 avatar commented on May 31, 2024

@mcaulifn Could you share to us the modifications that you did in order to get the ability to set the template like you described in #91 (comment)?

from ansible-telegraf.

mcaulifn avatar mcaulifn commented on May 31, 2024

@emiliencartesoft There is a link to another PR with the modification I made. I couldn't find anything else locally that I would have changed.

from ansible-telegraf.

 avatar commented on May 31, 2024

@mcaulifn

@emiliencartesoft There is a link to another PR with the modification I made. I couldn't find anything else locally that I would have changed.

I'm sorry but where is the link of the PR? I can't find it.

from ansible-telegraf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.