Snmptable was that a table

Snmptable was that a table

Synopsis

snmptable [COMMON OPTIONS] [-Cb] [-CB] [-Ch] [-CH] [-Ci] [-Cf STRING] [-Cw WIDTH] AGENT TABLE-OID

Description

snmptable is an SNMP application that repeatedly uses the SNMP GETNEXT or GETBULK requests to query for information on a network entity. The parameter TABLE-OID must specify an SNMP table.

snmptable is an SNMP application that repeatedly uses the SNMP GETNEXT or GETBULK requests to query for information on a network entity. The parameter TABLE-OID must specify an SNMP table.

AGENT identifies a target SNMP agent, which is instrumented to monitor the gievn objects. At its simplest, the AGENT specification will consist of a hostname or an IPv4 address. In this situation, the command will attempt communication with the agent, using UDP/IPv4 to port 161 of the given target host. See snmpcmd(1) for a full list of the possible formats for AGENT.

Options

COMMON OPTIONS Please see snmpcmd(1) for a list of possible values for COMMON OPTIONS as well as their descriptions. -Cb

Display only a brief heading. Any common prefix of the table field names will be deleted.

Do not use GETBULK requests to retrieve data, only GETNEXT. -Cc CHARS Print table in columns of CHARS characters width. -Cf STRING The string STRING is used to separate table columns. With this option, each table entry will be printed in compact form, just with the string given to separate the columns (useful if you want to import it into a database). Otherwise it is printed in nicely aligned columns. -Ch

Display only the column headings.

Do not display the column headings.

This option prepends the index of the entry to all printed lines.

Left justify the data in each column. -Cr REPEATERS For GETBULK requests, REPEATERS specifies the max-repeaters value to use. For GETNEXT requests, REPEATERS specifies the number of entries to retrieve at a time. -Cw WIDTH Specifies the width of the lines when the table is printed. If the lines will be longer, the table will be printed in sections of at most WIDTH characters. If WIDTH is less than the length of the contents of a single column, then that single column will still be printed.

Examples

SNMP table: at.atTable RFC1213-MIB::atTable

atIfIndex atPhysAddress atNetAddress 1 8:0:20:20:0:ab 130.225.243.33

SNMP table: at.atTable

The test for TABLE-OID actually specifying a table is rather heuristic. Note also that the test requires the defining MIB file to be loaded.

TUT:snmptable

Although snmpwalk can be used to retrieve the contents of a table, it will list the results for each column in turn. This is not how most people would naturally expect to see a table displayed, which is where snmptable comes in.

Contents

Basic Example

The headings for the table columns (and the name of the table itself) can be omitted using the -Ch flag.

Wide Tables

This particular table only has a few columns (and the description strings shown here have been deliberately shortened). In practise, the output for many tables can be too wide to be handled sensibly.

Fortunately, snmptable can apply a maximum width to the output, splitting the table into several chunks if necessary:

Table Indexes

One thing missing from the tables above, is any indication of the index values for each row. The earliest MIB tables (and some more recent, but poorly designed tables) did define the indexes as accessible objects, which would therefore appear in the snmptable output. But current MIB design has recognised that the index values are included in the instance OIDs, so it is not necessary to explicitly retrieve them as a separate column object.

By default, the snmptable command ignores these index values, but it will display them if invoked with the -Ci option:

Note that the index is listed for each block of a width-limited (and hence multi-sectioned) table display.

Holes in Tables

The snmpgetnext tutorial includes a discussion of the idea of «holes» in a table, illustrated by an (artificially) missing value for sysORDescr.4. The snmptable command will handle such holes automatically, filling in any such missing values:

Specifying the Table OID

Unlike the other command line applications (snmpget, snmpgetnext, snmpwalk etc), snmptable can only be used with a MIB table object. If this command is given any other OID (including the tableEntry object, one of the table columns, or a particular instance within a table), then this will be rejected:

Tutorial Sections

About the SNMP Protocol

These tutorial links talk about SNMP generically and how the protocol itself works. They are good introductory reading material and the concepts are important to understand before diving into the later tutorials about Net-SNMP itself.

Net-SNMP Command Line Applications

These tutorial pages discuss the command line tools provided in the Net-SNMP suite of tools. Nearly all the example commands in these tutorials works if you try it yourself, as they’re all examples that talk to our online Net-SNMP test agent. Given them a shot!

Application Configuration

All of our applications support configuration to allow you to customize how they behave.

Net-SNMP Daemons

Net-SNMP comes with two long-running daemons: a SNMP agent (snmpd) for responding to management requests and a notification receiver (snmptrapd) for receiving SNMP notifications.

Coding Tutorials

Net-SNMP comes with a highly flexible and extensible API. The API allows you to create your own commands, add extensions to the agent to support your own MIBs and perform specialized processing of notifications.

Debugging SNMP Applications and Agents

All our tools and applications have extensive debugging output. These tutorials talk about how the debugging system works and how you can add your own debugging statements to you code:

TUT:snmptable

Although snmpwalk can be used to retrieve the contents of a table, it will list the results for each column in turn. This is not how most people would naturally expect to see a table displayed, which is where snmptable comes in.

Contents

Basic Example

The headings for the table columns (and the name of the table itself) can be omitted using the -Ch flag.

Wide Tables

This particular table only has a few columns (and the description strings shown here have been deliberately shortened). In practise, the output for many tables can be too wide to be handled sensibly.

Fortunately, snmptable can apply a maximum width to the output, splitting the table into several chunks if necessary:

Table Indexes

One thing missing from the tables above, is any indication of the index values for each row. The earliest MIB tables (and some more recent, but poorly designed tables) did define the indexes as accessible objects, which would therefore appear in the snmptable output. But current MIB design has recognised that the index values are included in the instance OIDs, so it is not necessary to explicitly retrieve them as a separate column object.

By default, the snmptable command ignores these index values, but it will display them if invoked with the -Ci option:

Note that the index is listed for each block of a width-limited (and hence multi-sectioned) table display.

Holes in Tables

The snmpgetnext tutorial includes a discussion of the idea of «holes» in a table, illustrated by an (artificially) missing value for sysORDescr.4. The snmptable command will handle such holes automatically, filling in any such missing values:

Specifying the Table OID

Unlike the other command line applications (snmpget, snmpgetnext, snmpwalk etc), snmptable can only be used with a MIB table object. If this command is given any other OID (including the tableEntry object, one of the table columns, or a particular instance within a table), then this will be rejected:

Tutorial Sections

About the SNMP Protocol

These tutorial links talk about SNMP generically and how the protocol itself works. They are good introductory reading material and the concepts are important to understand before diving into the later tutorials about Net-SNMP itself.

Net-SNMP Command Line Applications

These tutorial pages discuss the command line tools provided in the Net-SNMP suite of tools. Nearly all the example commands in these tutorials works if you try it yourself, as they’re all examples that talk to our online Net-SNMP test agent. Given them a shot!

Application Configuration

All of our applications support configuration to allow you to customize how they behave.

Net-SNMP Daemons

Net-SNMP comes with two long-running daemons: a SNMP agent (snmpd) for responding to management requests and a notification receiver (snmptrapd) for receiving SNMP notifications.

Coding Tutorials

Net-SNMP comes with a highly flexible and extensible API. The API allows you to create your own commands, add extensions to the agent to support your own MIBs and perform specialized processing of notifications.

Debugging SNMP Applications and Agents

All our tools and applications have extensive debugging output. These tutorials talk about how the debugging system works and how you can add your own debugging statements to you code:

Snmptable was that a table

retrieve an SNMP table and display it in tabular form

Command

snmptable [ COMMON_OPTIONS ] [ ] [ ] [ ] [ ] [ ] [ CHARS ] [ STRING ] [ WIDTH ] AGENT TABLE-OID

The snmptable utility is an SNMP application that repeatedly uses the SNMP GETNEXT or GETBULK requests to query for information on a network entity. The parameter TABLE-OID must specify an SNMP table.

AGENT identifies a target SNMP agent, which is instrumented to monitor the gievn objects. At its simplest, the AGENT specification will consist of a hostname or an IPv4 address. In this situation, the command will attempt communication with the agent, using UDP/IPv4 to port 161 of the given target host. See snmpcmd for a full list of the possible formats for AGENT.

Displays only a brief heading. Any common prefix of the table field names will be deleted.

Does not use GETBULK requests to retrieve data, only GETNEXT.

Print table in columns of CHARS characters width.

Uses the string STRING to separate table columns. With this option, each table entry will be printed in compact form, just with the string given to separate the columns (useful if you want to import it into a database). Otherwise it is printed in nicely aligned columns.

Displays only the column headings.

Does not display the column headings.

Prepends the index of the entry to all printed lines.

For GETBULK requests, REPEATERS specifies the max-repeaters value to use. For GETNEXT requests, REPEATERS specifies the number of entries to retrieve at a time.

Specifies the width of the lines when the table is printed. If the lines will be longer, the table will be printed in sections of at most WIDTH characters.

In addition to these options, snmptable takes the common options described in the snmpcmd reference page.

Note that snmptable REQUIRES an argument specifying the agent to query and exactly one OID argument, as described in the snmpcmd manual page. This OID must be that of a MIB table object.

The test for TABLE-OID actually specifying a table is rather heuristic. Note also that the test requires the defining MIB file to be loaded.

All UNIX systems. Windows Server 2012. Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019.

PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition

PTC MKS Toolkit 10.3 Documentation Build 39.

Telegraf SNMP Error for Multiple Cisco MIBs #5647

Comments

js-mode commented Mar 29, 2019

Using Telegraf snmp plugin to send metrics to wavefront-proxy with SNMPv3. Got it working for the Interface Stats, but can’t get the SNMPv2-SMI::enterprises to work properly.

GOAL: Get these 5 OIDs configured in Telegraf so I can send these metrics to wavefront:

SNMPv2-SMI::enterprises.9.9.305.1.1.1
enterprises OBJECT-TYPE
— FROM SNMPv2-SMI, RFC1155-SMI
::=

SNMPv2-SMI::enterprises.9.9.117.1.1.2
enterprises OBJECT-TYPE
— FROM SNMPv2-SMI, RFC1155-SMI
::=

If I run a single snmpget command against these OIDs, I get the following error:

SNMPv2-SMI::enterprises.9.9.305.1.1.2 = No Such Instance currently exists at this OID

(note: I only turned on snmpv2c to see if authentication was an issue, but this happened with v2c & v3)

Attached is my config file (everything from line 60 down works fine), but the section with the above OIDs will not work.

The instructions are not clear on how to get these configured properly. I can receive some response when I run snmpwalk on these OIDs, but not with snmpget.

After creating a new config file with just these OIDs and it gave us this error:

2019-03-28T23:30:00Z E! [inputs.snmp]: Error in plugin: initializing table powerStatus: initializing field ucdDemoMIB: translating: exit status 2: SNMPv2-SMI::ucdDemoMIB: Unknown Object Identifier

ucdDemoMIB ucdInternal ucdExperimental ucdSnmpAgent memory version snmperrs systemStats ucdTraps logMatch
SNMPv2-SMI::enterprises: No entries

Was that a table? SNMPv2-SMI::enterprises.9.9.305.1.1

SNMPv2-SMI::enterprises.9.9.305.1.1.2 = No Such Instance currently exists at this OID

I think a deeper issue is understanding how the MIBs versus the OIDs work exactly? Is there a numeric value that signifies the table versus the field? I read on one of the issues that [[inputs.snmp.table]] runs the snmpwalk command. If that is the case, why can I run the OID in snmpwalk and get a response, but get an error when I put that OID in [[inputs.snmp.table]]? It is probably something super obvious that I am missing, but would like to be able to customize the different metrics I want to monitor, regardless of what MIB it is apart of.

Also there was a mention in the documentation that states you need to install the MIBs. What does this refer to exactly? Is this installing it on the actually switch? The telegraf agent? I am running Telegraf within a docker container, so is there an additional build command I have to pass to it for installing MIBs?

I have tried looking up as much documentation and seeing if I could get it working, but hopefully other people that get the No Such Instance currently exists at this OID error or have similar issues can benefit from me trying to get this sorted out.

@danielnelson any advice on how to troubleshoot?

The text was updated successfully, but these errors were encountered:

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *