(GitHub) telegraf snmp input plugin README

网络监控:交换机监控新姿势 编者荐语: 本文是社区用户写的文章,通过 Categraf 的 SNMP 插件给网络监控提供了一个新的选择,转给大家参考。大家好,我是小斐呀。关于网络监控领域前面文章主要是基于 SNMP Exporter + Prometheus + Grafana 的架构中介绍如何使用和部署,往期文章。接下来我们基于前面的文章做一些扩展,替换前面的架构组件,使其更加友好和方便,并且性能和扩展性进一步提高;在此我们把采集器从替换为Categraf,把Prometheus替换为时序数据库, 阅读详情

说明

由于github访问非常不稳定,查阅文档十分不方便,特转载至此,以便查阅

SNMP Input Plugin

The snmp input plugin uses polling to gather metrics from SNMP agents. Support for gathering individual OIDs as well as complete SNMP tables is included.

Note about Paths

Path is a global variable, separate snmp instances will append the specified path onto the global path variable

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the CONFIGURATION.md CONFIGURATION.md] for more details.

SNMP backend: gosmi and netsnmp

Telegraf has two backends to translate SNMP objects. By default, Telegraf will use netsnmp, however, this option is deprecated and it is encouraged that users migrate to gosmi. If users find issues with gosmi that do not occur with netsnmp please open a project issue on GitHub.

The SNMP backend setting is a global-level setting that applies to all use of SNMP in Telegraf. Users can set this option in the [agent] configuration via the snmp_translator option. See the agent configuration for more details.

Configuration

# Retrieves SNMP values from remote agents
[[inputs.snmp]]
  ## Agent addresses to retrieve values from.
  ##   format:  agents = ["<scheme://><hostname>:<port>"]
  ##   scheme:  optional, either udp, udp4, udp6, tcp, tcp4, tcp6.
  ##            default is udp
  ##   port:    optional
  ##   example: agents = ["udp://127.0.0.1:161"]
  ##            agents = ["tcp://127.0.0.1:161"]
  ##            agents = ["udp4://v4only-snmp-agent"]
  agents = ["udp://127.0.0.1:161"]

  ## Timeout for each request.
  # timeout = "5s"

  ## SNMP version; can be 1, 2, or 3.
  # version = 2

  ## Unconnected UDP socket
  ## When true, SNMP responses are accepted from any address not just
  ## the requested address. This can be useful when gathering from
  ## redundant/failover systems.
  # unconnected_udp_socket = false

  ## Path to mib files
  ## Used by the gosmi translator.
  ## To add paths when translating with netsnmp, use the MIBDIRS environment variable
  # path = ["/usr/share/snmp/mibs"]

  ## SNMP community string.
  # community = "public"

  ## Agent host tag; should be set to "source" for consistent usage across plugins
  ##   example: agent_host_tag = "source"
  ## The default value is inconsistent with other plugins. Users will get a
  ## warning that can be ignored if this is not changed. However, to have a
  ## consistent experience, set this to "source" in your config to align with
  ## other plugins.
  # agent_host_tag = "agent_host"

  ## Number of retries to attempt.
  # retries = 3

  ## The GETBULK max-repetitions parameter.
  # max_repetitions = 10

  ## SNMPv3 authentication and encryption options.
  ##
  ## Security Name.
  # sec_name = "myuser"
  ## Authentication protocol; one of "MD5", "SHA", "SHA224", "SHA256", "SHA384", "SHA512" or "".
  # auth_protocol = "MD5"
  ## Authentication password.
  # auth_password = "pass"
  ## Security Level; one of "noAuthNoPriv", "authNoPriv", or "authPriv".
  # sec_level = "authNoPriv"
  ## Context Name.
  # context_name = ""
  ## Privacy protocol used for encrypted messages; one of "DES", "AES", "AES192", "AES192C", "AES256", "AES256C", or "".
  ### Protocols "AES192", "AES192", "AES256", and "AES256C" require the underlying net-snmp tools
  ### to be compiled with --enable-blumenthal-aes (http://www.net-snmp.org/docs/INSTALL.html)
  # priv_protocol = ""
  ## Privacy password used for encrypted messages.
  # priv_password = ""

  ## Add fields and tables defining the variables you wish to collect.  This
  ## example collects the system uptime and interface variables.  Reference the
  ## full plugin documentation for configuration details.
  [[inputs.snmp.field]]
    oid = "RFC1213-MIB::sysUpTime.0"
    name = "sysUptime"
    conversion = "float(2)"

  [[inputs.snmp.field]]
    oid = "RFC1213-MIB::sysName.0"
    name = "sysName"
    is_tag = true

  [[inputs.snmp.table]]
    oid = "IF-MIB::ifTable"
    name = "interface"
    inherit_tags = ["sysName"]

    [[inputs.snmp.table.field]]
      oid = "IF-MIB::ifDescr"
      name = "ifDescr"
      is_tag = true

Configure SNMP Requests

This plugin provides two methods for configuring the SNMP requests: fields and tables. Use the field option to gather single ad-hoc variables. To collect SNMP tables, use the table option.

Field

Use a field to collect a variable by OID. Requests specified with this option operate similar to the snmpget utility.

[[inputs.snmp]]
  # ... snip ...

  [[inputs.snmp.field]]
    ## Object identifier of the variable as a numeric or textual OID.
    oid = "RFC1213-MIB::sysName.0"

    ## Name of the field or tag to create.  If not specified, it defaults to
    ## the value of 'oid'. If 'oid' is numeric, an attempt to translate the
    ## numeric OID into a textual OID will be made.
    # name = ""

    ## If true the variable will be added as a tag, otherwise a field will be
    ## created.
    # is_tag = false

    ## Apply one of the following conversions to the variable value:
    ##   float(X):    Convert the input value into a float and divides by the
    ##                Xth power of 10. Effectively just moves the decimal left
    ##                X places. For example a value of `123` with `float(2)`
    ##                will result in `1.23`.
    ##   float:       Convert the value into a float with no adjustment. Same
    ##                as `float(0)`.
    ##   int:         Convert the value into an integer.
    ##   hwaddr:      Convert the value to a MAC address.
    ##   ipaddr:      Convert the value to an IP address.
    ##   hextoint:X:Y Convert a hex string value to integer. Where X is the Endian
    ##                and Y the bit size. For example: hextoint:LittleEndian:uint64
    ##                or hextoint:BigEndian:uint32. Valid options for the Endian are:
    ##                BigEndian and LittleEndian. For the bit size: uint16, uint32
    ##                and uint64.
    ##   enum(1):     Convert the value according to its syntax in the MIB (full).
    ##                (Only supported with gosmi translator)
    ##   enum:        Convert the value according to its syntax in the MIB.
    ##                (Only supported with gosmi translator)
    ##
    # conversion = ""
Table

Use a table to configure the collection of a SNMP table. SNMP requests formed with this option operate similarly way to the snmptable command.
Control the handling of specific table columns using a nested field. These nested fields are specified similarly to a top-level field.

By default all columns of the SNMP table will be collected - it is not required to add a nested field for each column, only those which you wish to modify. To only collect certain columns, omit the oid from the table section and only include oid settings in field sections. For more complex include/exclude cases for columns use metric filtering.

One metric is created for each row of the SNMP table.

[[inputs.snmp]]
  # ... snip ...

  [[inputs.snmp.table]]
    ## Object identifier of the SNMP table as a numeric or textual OID.
    oid = "IF-MIB::ifTable"

    ## Name of the field or tag to create.  If not specified, it defaults to
    ## the value of 'oid'.  If 'oid' is numeric an attempt to translate the
    ## numeric OID into a textual OID will be made.
    # name = ""

    ## Which tags to inherit from the top-level config and to use in the output
    ## of this table's measurement.
    ## example: inherit_tags = ["source"]
    # inherit_tags = []

    ## Add an 'index' tag with the table row number.  Use this if the table has
    ## no indexes or if you are excluding them.  This option is normally not
    ## required as any index columns are automatically added as tags.
    # index_as_tag = false

    [[inputs.snmp.table.field]]
      ## OID to get. May be a numeric or textual module-qualified OID.
      oid = "IF-MIB::ifDescr"

      ## Name of the field or tag to create.  If not specified, it defaults to
      ## the value of 'oid'. If 'oid' is numeric an attempt to translate the
      ## numeric OID into a textual OID will be made.
      # name = ""

      ## Output this field as a tag.
      # is_tag = false

      ## The OID sub-identifier to strip off so that the index can be matched
      ## against other fields in the table.
      # oid_index_suffix = ""

      ## Specifies the length of the index after the supplied table OID (in OID
      ## path segments). Truncates the index after this point to remove non-fixed
      ## value or length index suffixes.
      # oid_index_length = 0

      ## Specifies if the value of given field should be snmptranslated
      ## by default no field values are translated
      # translate = true

      ## Secondary index table allows to merge data from two tables with
      ## different index that this filed will be used to join them. There can
      ## be only one secondary index table.
      # secondary_index_table = false

      ## This field is using secondary index, and will be later merged with
      ## primary index using SecondaryIndexTable. SecondaryIndexTable and
      ## SecondaryIndexUse are exclusive.
      # secondary_index_use = false

      ## Controls if entries from secondary table should be added or not
      ## if joining index is present or not. I set to true, means that join
      ## is outer, and index is prepended with "Secondary." for missing values
      ## to avoid overlapping indexes from both tables. Can be set per field or
      ## globally with SecondaryIndexTable, global true overrides per field false.
      # secondary_outer_join = false
Two Table Join

Snmp plugin can join two snmp tables that have different indexes. For this to work one table should have translation field that return index of second table as value. Examples of such fields are:

  • Cisco portTable with translation field: CISCO-STACK-MIB::portIfIndex, which value is IfIndex from ifTable
  • Adva entityFacilityTable with translation field: ADVA-FSPR7-MIB::entityFacilityOneIndex, which value is IfIndex from ifTable
  • Cisco cpeExtPsePortTable with translation field: CISCO-POWER-ETHERNET-EXT-MIB::cpeExtPsePortEntPhyIndex, which value is index from entPhysicalTable

Such field can be used to translate index to secondary table with secondary_index_table = true and all fields from secondary table (with index pointed from translation field), should have added option secondary_index_use = true. Telegraf cannot duplicate entries during join so translation must be 1-to-1 (not 1-to-many). To add fields from secondary table with index that is not present in translation table (outer join), there is a second option for translation index secondary_outer_join = true.

Example configuration for table joins

CISCO-POWER-ETHERNET-EXT-MIB table before join:

[[inputs.snmp.table]]
name = "ciscoPower"
index_as_tag = true

[[inputs.snmp.table.field]]
name = "PortPwrConsumption"
oid = "CISCO-POWER-ETHERNET-EXT-MIB::cpeExtPsePortPwrConsumption"

[[inputs.snmp.table.field]]
name = "EntPhyIndex"
oid = "CISCO-POWER-ETHERNET-EXT-MIB::cpeExtPsePortEntPhyIndex"

Partial result (removed agent and host tags from all following outputs in this section):

> ciscoPower,index=1.2 EntPhyIndex=1002i,PortPwrConsumption=6643i 1621460628000000000
> ciscoPower,index=1.6 EntPhyIndex=1006i,PortPwrConsumption=10287i 1621460628000000000
> ciscoPower,index=1.5 EntPhyIndex=1005i,PortPwrConsumption=8358i 1621460628000000000

Note here that EntPhyIndex column carries index from ENTITY-MIB table, config for it:

[[inputs.snmp.table]]
name = "entityTable"
index_as_tag = true

[[inputs.snmp.table.field]]
name = "EntPhysicalName"
oid = "ENTITY-MIB::entPhysicalName"

Partial result:

> entityTable,index=1006 EntPhysicalName="GigabitEthernet1/6" 1621460809000000000
> entityTable,index=1002 EntPhysicalName="GigabitEthernet1/2" 1621460809000000000
> entityTable,index=1005 EntPhysicalName="GigabitEthernet1/5" 1621460809000000000

Now, lets attempt to join these results into one table. EntPhyIndex matches index from second table, and lets convert EntPhysicalName into tag, so second table will only provide tags into result. Configuration:

[[inputs.snmp.table]]
name = "ciscoPowerEntity"
index_as_tag = true

[[inputs.snmp.table.field]]
name = "PortPwrConsumption"
oid = "CISCO-POWER-ETHERNET-EXT-MIB::cpeExtPsePortPwrConsumption"

[[inputs.snmp.table.field]]
name = "EntPhyIndex"
oid = "CISCO-POWER-ETHERNET-EXT-MIB::cpeExtPsePortEntPhyIndex"
secondary_index_table = true    # enables joining

[[inputs.snmp.table.field]]
name = "EntPhysicalName"
oid = "ENTITY-MIB::entPhysicalName"
secondary_index_use = true      # this tag is indexed from secondary table
is_tag = true

Result:

> ciscoPowerEntity,EntPhysicalName=GigabitEthernet1/2,index=1.2 EntPhyIndex=1002i,PortPwrConsumption=6643i 1621461148000000000
> ciscoPowerEntity,EntPhysicalName=GigabitEthernet1/6,index=1.6 EntPhyIndex=1006i,PortPwrConsumption=10287i 1621461148000000000
> ciscoPowerEntity,EntPhysicalName=GigabitEthernet1/5,index=1.5 EntPhyIndex=1005i,PortPwrConsumption=8358i 1621461148000000000

Troubleshooting

Check that a numeric field can be translated to a textual field:

$ snmptranslate .1.3.6.1.2.1.1.3.0
DISMAN-EVENT-MIB::sysUpTimeInstance

Request a top-level field:

snmpget -v2c -c public 127.0.0.1 sysUpTime.0

Request a table:

snmptable -v2c -c public 127.0.0.1 ifTable

To collect a packet capture, run this command in the background while running Telegraf or one of the above commands. Adjust the interface, host and port as needed:

sudo tcpdump -s 0 -i eth0 -w telegraf-snmp.pcap host 127.0.0.1 and port 161

Metrics

The field and tags will depend on the table and fields configured.

  • snmp
    • tags:
      • agent_host (deprecated in 1.29: use source instead)

Example Output

snmp,agent_host=127.0.0.1,sysName=example.org uptime=113319.74 1575509815000000000
interface,agent_host=127.0.0.1,ifDescr=wlan0,ifIndex=3,sysName=example.org ifAdminStatus=1i,ifInDiscards=0i,ifInErrors=0i,ifInNUcastPkts=0i,ifInOctets=3436617431i,ifInUcastPkts=2717778i,ifInUnknownProtos=0i,ifLastChange=0i,ifMtu=1500i,ifOperStatus=1i,ifOutDiscards=0i,ifOutErrors=0i,ifOutNUcastPkts=0i,ifOutOctets=581368041i,ifOutQLen=0i,ifOutUcastPkts=1354338i,ifPhysAddress="c8:5b:76:c9:e6:8c",ifSpecific=".0.0",ifSpeed=0i,ifType=6i 1575509815000000000
interface,agent_host=127.0.0.1,ifDescr=eth0,ifIndex=2,sysName=example.org ifAdminStatus=1i,ifInDiscards=0i,ifInErrors=0i,ifInNUcastPkts=21i,ifInOctets=3852386380i,ifInUcastPkts=3634004i,ifInUnknownProtos=0i,ifLastChange=9088763i,ifMtu=1500i,ifOperStatus=1i,ifOutDiscards=0i,ifOutErrors=0i,ifOutNUcastPkts=0i,ifOutOctets=434865441i,ifOutQLen=0i,ifOutUcastPkts=2110394i,ifPhysAddress="c8:5b:76:c9:e6:8c",ifSpecific=".0.0",ifSpeed=1000000000i,ifType=6i 1575509815000000000
interface,agent_host=127.0.0.1,ifDescr=lo,ifIndex=1,sysName=example.org ifAdminStatus=1i,ifInDiscards=0i,ifInErrors=0i,ifInNUcastPkts=0i,ifInOctets=51555569i,ifInUcastPkts=339097i,ifInUnknownProtos=0i,ifLastChange=0i,ifMtu=65536i,ifOperStatus=1i,ifOutDiscards=0i,ifOutErrors=0i,ifOutNUcastPkts=0i,ifOutOctets=51555569i,ifOutQLen=0i,ifOutUcastPkts=339097i,ifSpecific=".0.0",ifSpeed=10000000i,ifType=24i 1575509815000000000
Telegraf介绍和使用(安装、使用、内部数据结构-InfluxDB行协议、配置、架构、Glob的使用、插件的集成和实现、集合Prometheus) Telegraf是一个基于插件的开源指标采集工具。本身是为InfluxDB(一款时序数据库)量身打造的数据收集器,但是它过于优秀,能够将抓取的数据写到很多地方,尤其在时序数据库领域,很多时序数据库都能够与它配合使用。通常,它每隔一段时间抓取一批指标数据(比如机器的CPU使用情况,磁盘的IO,网络情况,MySQL服务端的的会话数等等)并将他们发送到时序数据库、消息队列中或者自定义导出到某个地方。供下游的应用处理(比如报警)。Telegraf也能够对外提供一个服务,等待客户端推送数据。 阅读详情

相关推荐

gosmi:解析MIB,因此您不必!

高斯米 从v0.2.0开始,该库是本机Go,不再是libsmi的包装器。 目前实施非常接近,但将来可能会改变。 对于本机实现,添加了两个附加组件: 解析器中的SMIv1 / 2 与libsmi兼容的Go实现 用法 在适用于v0.1.0及更低版本的Ubuntu上: $ sudo apt-get install libsmi2-dev 例子 现在可以在以下示例中找到示例:

telegraf+SNMP插件怎样监控交换机内存

哪位大佬能解答一下我的疑惑 telegraf 通过SNMP插件怎样监控交换机CPU和内存指标啊 现在已经研究出监控 端口进出口流量了😭

m0_59586152的博客 968

telegraf-snmp-mikrotik:路由器OS(mikrotik)设备的Telegraf snmp插件配置

telegraf-snmp-mikrotik 此存储库包含用于路由器OS(mikrotik)设备的Telegraf SNMP插件配置,因为我在网上找不到任何好的配置。 用法 配置文件仅包含相关部分,您可能希望将其添加到当前的telegraf配置中。 仅使用了少数mikrotik模型对配置进行了测试,例如: 2011UiAS-2HnD 750GL CCR1009-8G-1S-1S + RB760iGS(Mikrotik hEX S) 并非所有功能都受支持。 去做 创建多个特定于模型的版本,其中仅收集支持的指标。 贡献 欢迎捐款,请创建请求请求。

telegraf获取交换机端口状态已及端口状态报警设置

一. 方法1 32位与64位聚合 介绍: 即能获取64位端口进出口流量又能获取 32位端口状态 缺点: 不易于维护 32位与64位聚合:-------------------------------------------成功-------------------------------- [[inputs.snmp]] agents = [ "" ] version = 2 community = "" agent_host_tag = "ident" fieldpass = ["ifHCInO.

m0_59586152的博客 1182

telegraf-snmp-unifi

具有适用于ubnt设备的Net-SNMP + Unifi mib的Telegraf Docker映像 这是对所做的出色工作的。 此构建添加了3个必需的MIB文件,以便获得工作创建的预构建grafana仪表板。 用法 docker run --name CONTAINER_NAME_HERE \ --restart always \ --detach \ -v /PATH/TO/telegraf.conf:/etc/telegraf/telegraf.conf:ro \ prdonut2k7/telegraf-snmp-unifi 基于:

telegraf.conf

telegraf.conf

telegraf采集交换机cpu/mem

关于oid需要自己查询官方文档telegraf配置:

m0_59586152的博客 962

基于opencv-ANN的水果识别模型训练

本文通过opencv-ann-mlp训练模型,实现对五种水果进行分类识别。本文详细介绍该项目的各个过程,包括数据准备、预处理、样本读取、训练数据集制作、训练标签制作、模型参数设置、模型训练,模型测试验证等,总结该过程需要注意的事项。

qq_15985873的博客 3971

Telegraf-Influxdb-Grafana容器化部署拓展(Https、AD域、告警集成)并监控Cisco设备指标

Telegraf-influxdb-grafana企业级监控方案

tushanpeipei的博客 1986

MID360+fastlio功能笔记

前言。

qq_35598561的博客 5295

无人机航拍图像匹配——SIFT算法实践(含代码)

无人机航拍图像匹配——SIFT算法实践(含代码)

zhangzhao147的博客 6392

Telegraf+SNMP+Grafana构建企业级交换机监控

1、架构功能需求 笔者在最近的项目中遇到了需要将一个大型组织的全部交换机以及N7000核心交换机配置监控架构的需求。该需求主要有如下的条目: N7000配置全端口的详细上下行和监控和报错计数。 普通交换机配置Tel1/0/1和Tel1/0/2的上下行监控和报错计数。 所有交换机配置运行时间uptime和CPU使用情况监控。 在本次项目中所有交换机的型号都是思科C2960系列。 2、思路设计 由...

weixin_33725270的博客 4498

海康工业相机LabVIEW二次开发实战——参数配置优化与图像高效存储

本文详细介绍了海康工业相机在LabVIEW平台上的二次开发实战,重点解析了相机参数配置的优化方法与图像高效存储策略。通过剖析曝光、增益、触发模式等核心参数的设置逻辑,并结合生产者-消费者设计模式,指导开发者构建稳定、高效的图像采集与异步存储流程,有效提升工业视觉项目的开发效率与系统稳定性。

weixin_29306317的博客 219

gosmi:原生Go语言实现SMI解析

gosmi:原生Go语言实现SMI解析 项目介绍 在现代软件开发中,网络协议和标准的管理信息库(MIB)解析是不可或缺的一部分。gosmi 是一个开源项目,它提供了一种原生的 Go 语言实现,用于解析和管理 SMI(Structure of Management Information)文件。自版本 v0.2.0 开始,gosmi 已不再是基于 libsmi 的包装器,而是完全使用 Go 语言重写...

gitblog_00304的博客 913

深度残差网络的无人机多目标识别

深度残差网络的无人机多目标识别 人工智能技术与咨询 来源:《图学学报》。作者翟进有等 摘要:传统目标识别算法中,经典的区域建议网络(RPN)在提取目标候选区域时计算量大,时间复杂度较高,因此提出一种级联区域建议网络(CRPN)的搜索模式对其进行改善。此外,深层次的卷积神经网络训练中易产生退化现象,而引入残差学习的深度残差网络(ResNet),能够有效抑制该现象。对多种不同深度以及不同参数的网络模型进行研究,将两层残差学习模块与三层残差学习模块结合使用,设计出一种占用内存更小、时间复杂度更低的新型多捷.

m0_62870606的博客 3106

DSI3协议介绍

分布式系统接口(DSI)是一种通用且功能强大的总线协议,旨在将多个遥感器和执行器设备互连到中央控制模块。该网络的主要目标应用是汽车安全系统。这种应用的一些特点是需要低成本、高鲁棒性、中速互连,仅限于两根导线。此外,它必须具有故障安全性、确定性和良好的EMC特性。即使具有所有级别的智能和可编程性的设备都可以连接到网络,远程设备也必须能够通过简单的状态机实现。由于模块尺寸非常重要,因此中央模块和远程单元中的最小组件至关重要。

汽车电子软件领域知识分享 1万+

使用Telegraf从工业物联网设备收集数据的完整指南

在当今的工业物联网(IIoT)环境中,从各种设备收集、处理和转发数据是一项关键任务。本文将详细介绍如何使用Telegraf这一强大的数据收集工具,从多种通信协议的IoT设备中收集数据,并将其发送到InfluxDB等数据存储系统。

neweastsun的专栏 2906

【ESP32设备通信】-LoRa通信

在本文中,我们将使用 Arduino IDE 将 ESP32 与 LoRa SX1278 (Ra-02) 模块连接起来。 我们将创建一个真实的示例项目,通过 LoRa 无线打开/关闭 LED 进行演示。

视觉与物联智能 1890

Gogs 安装教程

快速搭建gogs代码仓库

qq_36694732的博客 639

Coze实战:解锁多Bot协同与条件分支工作流的奥秘

本文详细介绍了在字节跳动Coze平台实现多Bot协同与条件分支工作流的方法。首先阐述了Coze平台的功能优势,包括丰富的插件、知识库和工作流功能。随后分步骤讲解了多Bot协同的实现:从准备工作、创建Bot到协同配置,并提供了电商客服的实例演示。在条件分支工作流部分,详细说明了条件节点的作用类型、条件设定方法以及具体配置操作,强调测试优化的重要性。最后通过电商平台综合案例,展示了多Bot协同与条件分支的实际应用效果,并针对常见问题提供解决方案。文章为开发者在Coze平台上构建智能应用提供了实用指导,有助于提升

远程部署调试 运行安装 项目调试 二次开发 项目技术新 持续迭代 部分源码免费分享 449

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

Telegraf监控客户端调研笔记(1)-介绍、安装、初步测试

Telegraf 是 InfluxData 开源的一款采集器,可以采集操作系统、各种中间件的监控指标,采集目标列表:https://github.com/influxdata/telegraf/tree/master/plugins/inputs 看起来是非常丰富,Telegraf是一个大一统的设计,即一个二进制可以采集CPU、内存、mysql、mongodb、redis、snmp等,不像Prometheus的exporter,每个监控对象一个exporter,管理起来略麻烦。一个二进制分发起来确实比较方便

wr_java的博客 2663

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

7大协议全覆盖:Telegraf网络监控实战指南

你是否还在为多协议设备监控焦头烂额?交换机用SNMP、物联网设备用MQTT、消息队列用Kafka——不同协议需要不同工具采集数据?一文带你掌握Telegraf的多协议监控能力,轻松实现全栈网络指标采集。 读完本文你将获得: - 7种主流网络协议的配置示例 - 协议选择决策指南与性能优化技巧 - 跨协议数据聚合实战方案 - 企业级监控平台搭建模板 [![Telegraf架构](https://r

gitblog_00854的博客 1211

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

快速构建SNMP监控原型:无需编码的解决方案

选择Telegraf作为采集器是因为它内置了SNMP插件,InfluxDB的时序数据库特性非常适合存储监控数据,而Grafana则是数据可视化的不二之选。最惊喜的是,平台已经预装了常用监控组件,省去了软件安装的步骤,真正实现了开箱即用。更棒的是可以直接导入现成的网络监控仪表板模板,这些模板已经配置好了常见的流量统计图表、设备状态面板等。系统预留了接收SNMPTRAP的API端点,当设备触发告警时,可以通过Webhook将告警信息写入InfluxDB,并在Grafana中展示告警历史。在实际操作中,我发现。

EmeraldWolf23的博客 103

NET-SNMP基本命令

当环境设置好后,运行snmpd,即snmp代理进程,就可以使用管理工具查询其中的信息了。Net- snmp提供的查询工具有很多,这里只介绍常用的几个,而且大部分查询命令的格式都大同小异。这里以.iso.org.dod.internet.mgmt.mib-2.system为例,其Oid为:.1.3.6.1.2.1.1。结构如下:    ………system                     .

老夫编代码就是一把梭 1万+

telegraf 安装使用说明

使用influxdbstudio连接influxdb,点击地址下载influxdbstudiohttps//github.com/CymaticLabs/InfluxDBStudio/releases/tag/v0.2.0-beta.1启动客户端连接。访问grafanahttp//10.1.253.1083000端口默认是3000,默认账号密码是admin/admin。查看influxdbstudio可以看到cpu和mem表,查询可以看到对应的数据已经存储。............

skystep的博客 3361
上一篇: telegraf + influxdb + grafana 实现交换机流量展示
下一篇: 应用zabbix的实时导出(real-time export)功能
Re_Virtual
博客等级 码龄16年 88粉丝 44原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值