Data Template → Get SNMP Data (indexed) → Index Value/Type?

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Moderators, Developers

Author
Message
alexs77
Posts: 41
Joined: Tue May 26, 2009 7:31 am
Location: Winterhtur, Switzerland

Data Template → Get SNMP Data (indexed) → Index Value/Type?

#1 Post by alexs77 » Wed Jun 03, 2009 9:39 am

Hello.

When defining a Data Template and having set the Data Input Method to Get SNMP Data (indexed), there are the following fields, which can/have to be filled out:
  • Output Type ID
  • Index Value
  • Index Type
I'm still trying to plot values which I get from a remote host via SNMP and where I hooked scripts in the snmpd.conf configuration via the exec directive.

Code: Select all

--($ ~)-- time snmpwalk -On  -t 60 -v2c -cpublic winds00 .1.3.6.1.4.1.2021.8.1
.1.3.6.1.4.1.2021.8.1.1.1 = INTEGER: 1
.1.3.6.1.4.1.2021.8.1.1.2 = INTEGER: 2
.1.3.6.1.4.1.2021.8.1.1.3 = INTEGER: 3
.1.3.6.1.4.1.2021.8.1.1.4 = INTEGER: 4
.1.3.6.1.4.1.2021.8.1.1.5 = INTEGER: 5
.1.3.6.1.4.1.2021.8.1.1.6 = INTEGER: 6
.1.3.6.1.4.1.2021.8.1.2.1 = STRING: dspstat-augds01
.1.3.6.1.4.1.2021.8.1.2.2 = STRING: dspstat-fhids01
.1.3.6.1.4.1.2021.8.1.2.3 = STRING: dspstat-svnds01
.1.3.6.1.4.1.2021.8.1.2.4 = STRING: dspstat-winaprs01
.1.3.6.1.4.1.2021.8.1.2.5 = STRING: dspstat-winds00
.1.3.6.1.4.1.2021.8.1.2.6 = STRING: dspstat-winds01
.1.3.6.1.4.1.2021.8.1.3.1 = STRING: /bin/bash /opt/apps/Teamcenter/Production/scripts/do-rpc-dspstat.sh augds01 10
.1.3.6.1.4.1.2021.8.1.3.2 = STRING: /bin/bash /opt/apps/Teamcenter/Production/scripts/do-rpc-dspstat.sh fhids01 10
.1.3.6.1.4.1.2021.8.1.3.3 = STRING: /bin/bash /opt/apps/Teamcenter/Production/scripts/do-rpc-dspstat.sh svnds01 10
.1.3.6.1.4.1.2021.8.1.3.4 = STRING: /bin/bash /opt/apps/Teamcenter/Production/scripts/do-rpc-dspstat.sh winaprs01 10
.1.3.6.1.4.1.2021.8.1.3.5 = STRING: /bin/bash /opt/apps/Teamcenter/Production/scripts/do-rpc-dspstat.sh winds00 10
.1.3.6.1.4.1.2021.8.1.3.6 = STRING: /bin/bash /opt/apps/Teamcenter/Production/scripts/do-rpc-dspstat.sh winds01 10
.1.3.6.1.4.1.2021.8.1.100.1 = INTEGER: 0
.1.3.6.1.4.1.2021.8.1.100.2 = INTEGER: 0
.1.3.6.1.4.1.2021.8.1.100.3 = INTEGER: 0
.1.3.6.1.4.1.2021.8.1.100.4 = INTEGER: 0
.1.3.6.1.4.1.2021.8.1.100.5 = INTEGER: 0
.1.3.6.1.4.1.2021.8.1.100.6 = INTEGER: 0
.1.3.6.1.4.1.2021.8.1.101.1 = STRING: 2197
.1.3.6.1.4.1.2021.8.1.101.2 = STRING: 1551
.1.3.6.1.4.1.2021.8.1.101.3 = STRING: 178
.1.3.6.1.4.1.2021.8.1.101.4 = STRING: 3
.1.3.6.1.4.1.2021.8.1.101.5 = STRING: 1
.1.3.6.1.4.1.2021.8.1.101.6 = STRING: 3
.1.3.6.1.4.1.2021.8.1.102.1 = INTEGER: noError(0)
.1.3.6.1.4.1.2021.8.1.102.2 = INTEGER: noError(0)
.1.3.6.1.4.1.2021.8.1.102.3 = INTEGER: noError(0)
.1.3.6.1.4.1.2021.8.1.102.4 = INTEGER: noError(0)
.1.3.6.1.4.1.2021.8.1.102.5 = INTEGER: noError(0)
.1.3.6.1.4.1.2021.8.1.102.6 = INTEGER: noError(0)
.1.3.6.1.4.1.2021.8.1.103.1 = STRING: 
.1.3.6.1.4.1.2021.8.1.103.2 = STRING: 
.1.3.6.1.4.1.2021.8.1.103.3 = STRING: 
.1.3.6.1.4.1.2021.8.1.103.4 = STRING: 
.1.3.6.1.4.1.2021.8.1.103.5 = STRING: 
.1.3.6.1.4.1.2021.8.1.103.6 = STRING: 
The index is at .1.3.6.1.4.1.2021.8.1.1, while the actual values are at .1.3.6.1.4.1.2021.8.1.101.X.

So far I was successful in getting eg. .1.3.6.1.4.1.2021.8.1.101.1 with using a Get SNMP Data (ie. non-indexed) Data Input Method.

What do I need to enter for the following fields?
  • Output Type ID
  • Index Value
  • Index Type
I have read manual, but either that's not explained there or I haven't found it. I kinda would've expected that this should've been explained in the section "Data Templates", but that's not where it is explained :(

Anyway - I suppose for Output Type ID, I'd set .1.3.6.1.4.1.2021.8.1.1, as that is the OID Number of the OID giving the index? Or would that be the Index Value?

Still confused, but (slowly) getting there,
Alexander

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Data Template → Get SNMP Data (indexed) → Index Value/Ty

#2 Post by BSOD2600 » Wed Jun 03, 2009 1:42 pm

alexs77 wrote:When defining a Data Template and having set the Data Input Method to Get SNMP Data (indexed), there are the following fields, which can/have to be filled out:
  • Output Type ID
  • Index Value
  • Index Type
Those fields are to be automatically filled out by cacti when you use the 'Create Graphs for this Host' screen. All Associated Data Queries must use this method.

alexs77
Posts: 41
Joined: Tue May 26, 2009 7:31 am
Location: Winterhtur, Switzerland

Re: Data Template → Get SNMP Data (indexed) → Index Value/Ty

#3 Post by alexs77 » Wed Jun 03, 2009 1:55 pm

BSOD2600 wrote:
alexs77 wrote:When defining a Data Template and having set the Data Input Method to Get SNMP Data (indexed), there are the following fields, which can/have to be filled out:
  • Output Type ID
  • Index Value
  • Index Type
Those fields are to be automatically filled out by cacti when you use the 'Create Graphs for this Host' screen. All Associated Data Queries must use this method.
I don't get it - somewhere I must specify the OID where the Index is at (ie. .1.3.6.1.4.1.2021.8.1.1 in the example given), mustn't I?

Where would I enter that?

Best regards,
Alexander

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

#4 Post by BSOD2600 » Wed Jun 03, 2009 5:52 pm

I think you're confused. Please read the documentation site on how to create a Data Queries. For it, one typically creates an SNMP XML script, which defines the index and OIDs which cacti is to poll.

Bottom line, one does not define those 3 fields you're asking about when using the Get SNMP Data (indexed) Data Input Method.

User avatar
rony
Developer/Forum Admin
Posts: 6016
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

#5 Post by rony » Wed Jun 03, 2009 7:45 pm

Those field are typically used for Data Query graph creation.

Please review the following concerning data queries and SNMP tables:
http://docs.cacti.net/manual:087:3a_adv ... ta_queries

Basically, you have a table of data, and a data query will get you all the data from the table dynamically. This will allow you to create graphs for each index and use things like the process name in the graph title.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]

alexs77
Posts: 41
Joined: Tue May 26, 2009 7:31 am
Location: Winterhtur, Switzerland

#6 Post by alexs77 » Thu Jun 04, 2009 2:39 am

Good morning!
BSOD2600 wrote:I think you're confused.
No doubt about it - hence I wrote "Still confused..." in my initial post :lol:

But, honestly, how can one not be confused? I mean, you've got to admit that the documentation "has a lot of room for improvement", hasn't it? :P (Yes, I know, it's a wiki and everyone can improve it - but for me, to be able to improve it, I first would have to understand it. And I'm not quite there yet...)
Please read the documentation site on how to create a Data Queries.
You're also refering to "SNMP Data Queries", aren't you?

See, that's what I find confusing - I'm defining a Data Template and while defining it, those fields are shown. How's one to guess, that the explanation of those 3 fields isn't in the documentation about "Data Templates", but at some seemingly unrelated place? :o
For it, one typically creates an SNMP XML script, which defines the index and OIDs which cacti is to poll.
Aha. When defining a Graph Template and then adding Graph Template Items to it, one can/has to chose a Data Source. In this drop down list, also the just defined Data Template using Get SNMP Data (indexed) is shown. Do I understand it right, that one isn't to select such a Data Template as a Data Source for a Graph Template Item?
Bottom line, one does not define those 3 fields you're asking about when using the Get SNMP Data (indexed) Data Input Method.
Hm.

I went ahead and did like you guys told me - I checked the 3 checkboxes in front of those items, created a Graph Template which makes use of this Data Template as a Data Source, assigned this Graph Template to a (newly created) Device and tried to make Cacti create a graph using this Graph Template. It then prompts me for those 3 fields - which "kinda" :wink: leads me back to my initial question:

What's one supposed to enter for Output Type ID, Index Value and Index Type, when using a Data Template which is set to use the Data Input Method Get SNMP data (indexed)? And what's the meaning of those 3 fields (Output Type ID, I can grasp - it's the OID - but which OID? The one of the Index?)?

I just have read the "SNMP Data Queries" documentation again - but where does it explain what Input Type and Input Value are supposed to mean?
I also read SNMP Data Query Walkthrough, but just like the SNMP Data Queries, it doesn't explain the meaning of those 3 fields - or rather, it doesn't explain it in a way, that I can understand. If it does explain it, could you please tell me, where it does so?

Really, I can't make heads nor tails of what I'm supposed to enter or do there.

Even more confused,
Alexander

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: ‽

#7 Post by BSOD2600 » Thu Jun 04, 2009 1:16 pm

alexs77 wrote:What's one supposed to enter for Output Type ID, Index Value and Index Type, when using a Data Template which is set to use the Data Input Method Get SNMP data (indexed)? And what's the meaning of those 3 fields (Output Type ID, I can grasp - it's the OID - but which OID? The one of the Index?)?
Nothing.

Cacti fills these fields in for you based off the snmp table. A good functional example of this type of script is the 'SNMP - Interface Statistics' data query. Look over its script and all the templates in cact. This should hopefully give you a better idea how it all works together. Notice the SNMP - Interface Statistics Data Template has those 3 fields checked as Use Per-Data Source Value? Notice that in Data Sources (after you've told cacti to create a graph for an interface), the Custom Data section has those 3 fields -- automatically populated with data?

Agreed the documentation isn't perfect, but once you have a better grasp on things, please feel free to suggest/implement changes so it's more clear for others who are learning.

joelv
Posts: 1
Joined: Wed Apr 20, 2011 9:11 am

Re: Data Template → Get SNMP Data (indexed) → Index Value/Ty

#8 Post by joelv » Wed Apr 20, 2011 9:30 am

Hello,
I think I've understood what to put on the cacti server's side, but I also feel confused. It is still not clear how to define/provide the snmp data with actual indexed data, on the remote server side.

I found out how to provide single values, by declaring my script in /etc/snmp/snmp.conf
(pass .1.3.6.1.4.1.x.x.x.x.x /bin/sh /usr/local/bin/snmp-myscript), but I still haven't figured out how to accomplish the same task with indexed values. Could you provide me with
- a short explanation on how to update snmp.conf on the remote server in this case
- a tiny commented script that retrieves a couple of indexed values on that server
?

Thanks for your help,
Joël

dalpha
Posts: 22
Joined: Wed Oct 12, 2011 11:54 am

Re: Data Template → Get SNMP Data (indexed) → Index Value/Ty

#9 Post by dalpha » Wed Oct 12, 2011 12:21 pm

I'm also confused by this. I've searched the documentation and I can't quite seem to grasp my head around this. I'm trying to create a graph of the bandwidth information relating to a BigIP F5 Trunk.

My query is this:

Code: Select all

<query>
  <name>F5 Trunk Bandwidth Information</name>
  <description>Queries a F5 for information related to a trunk's bandwidth</description>
  <oid_index>.1.3.6.1.4.1.3375.2.1.2.12.1.2.1</oid_index>
  <index_order>ifDescr:ifName:ifIndex</index_order>
  <index_order_type>numeric</index_order_type>
  <index_title_format>|chosen_order_field|</index_title_format>

  <fields>
    <TrunkOperBw>
      <name>Index</name>
      <method>walk</method>
      <source>value</source>
      <direction>output</direction>
      <oid>.1.3.6.1.4.1.3375.2.1.2.12.1.2.1.5</oid>
    </TrunkOperBw>
  </fields>
</query>
I know that cacti is fetching the right information for this when I tested the direction as input (cacti pulled 4000).

Once I've created all of the necessary templates, I attempt to create the graph. At this point of time, I'm asked to enter the Output Type ID, Index Value, and Index Type. See attachment create_graph.png.
create_graph.png
Picture that shows cacti requesting the Output Type ID, Index Value, and Index Type.
create_graph.png (22.11 KiB) Viewed 14766 times
It appears that the data query is pulling the correct information. I've attached another screenshot that contains the information on that page (data_query.png).
data_query.png
Picture that shows the information on the data query page.
data_query.png (42.48 KiB) Viewed 14766 times
I also don't see anything wrong with the data templete.
data_template.png
Picture that shows the main information on the data template page.
data_template.png (65.29 KiB) Viewed 14766 times
data_template_2.png
Picture that shows the Output Type ID, Index Value, and Index Type being overridden in the data template page.
data_template_2.png (7.86 KiB) Viewed 14766 times

noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Data Template → Get SNMP Data (indexed) → Index Value/Ty

#10 Post by noname » Wed Oct 12, 2011 9:14 pm

dalpha wrote: My query is this:

Code: Select all

<query>
  <name>F5 Trunk Bandwidth Information</name>
  <description>Queries a F5 for information related to a trunk's bandwidth</description>
  <oid_index>.1.3.6.1.4.1.3375.2.1.2.12.1.2.1</oid_index>
  <index_order>ifDescr:ifName:ifIndex</index_order>
  <index_order_type>numeric</index_order_type>
  <index_title_format>|chosen_order_field|</index_title_format>

  <fields>
    <TrunkOperBw>
      <name>Index</name>
      <method>walk</method>
      <source>value</source>
      <direction>output</direction>
      <oid>.1.3.6.1.4.1.3375.2.1.2.12.1.2.1.5</oid>
    </TrunkOperBw>
  </fields>
</query>
I know that cacti is fetching the right information for this when I tested the direction as input (cacti pulled 4000).

Once I've created all of the necessary templates, I attempt to create the graph. At this point of time, I'm asked to enter the Output Type ID, Index Value, and Index Type. Image
I guess..
1) You need to define the index field as "<direction>input</direction>".
2) Fields in "<index_order>...</index_order>" should be defined in the same XML.

- SNMP Data Query Walkthrough - Cacti Docs

Though I'm not sure about that device, for example:

Code: Select all

<query>
  <name>F5 Trunk Bandwidth Information</name>
  <description>Queries a F5 for information related to a trunk's bandwidth</description>
  <oid_index>.1.3.6.1.4.1.3375.2.1.2.12.1.2.1.1</oid_index>
  <oid_index_parse>OID/REGEXP:.*\.([0-9]+)$</oid_index_parse>
  <index_order>Index</index_order>
  <index_order_type>numeric</index_order_type>
  <index_title_format>|chosen_order_field|</index_title_format>

  <fields>
    <Index>
      <name>Index</name>
      <source>index</source>
      <direction>input</direction>
    </Index>
    <TrunkName>
      <name>Trunk Name</name>
      <method>walk</method>
      <source>value</source>
      <direction>input</direction>
      <oid>.1.3.6.1.4.1.3375.2.1.2.12.1.2.1.1</oid>
    </TrunkName>
    <TrunkOperBw>
      <name>Trunk Bandwidth</name>
      <method>walk</method>
      <source>value</source>
      <direction>output</direction>
      <oid>.1.3.6.1.4.1.3375.2.1.2.12.1.2.1.5</oid>
    </TrunkOperBw>
  </fields>
</query>
If not worked, please post results of Verbose Query and output of "snmpwalk -v1 -c <community> <host> .1.3.6.1.4.1.3375.2.1.2.12.1.2.1".

dalpha
Posts: 22
Joined: Wed Oct 12, 2011 11:54 am

Re: Data Template → Get SNMP Data (indexed) → Index Value/Ty

#11 Post by dalpha » Thu Oct 13, 2011 10:58 am

Thanks for the suggestion, however, it did not work. It still requested that I enter those three pieces of data. I've gone ahead and made an additional screenshot that contains the information outputted within the verbose query:
verbose_query.png
Picture that shows the results of the verbose query of the SNMP.
verbose_query.png (21.16 KiB) Viewed 14757 times
Here is the results of running the snmpwalk command:

F5-BIGIP-SYSTEM-MIB::sysTrunkName."master" = STRING: master
F5-BIGIP-SYSTEM-MIB::sysTrunkStatus."master" = INTEGER: up(0)
F5-BIGIP-SYSTEM-MIB::sysTrunkAggAddr."master" = STRING: 0:1:d7:60:9b:92
F5-BIGIP-SYSTEM-MIB::sysTrunkCfgMbrCount."master" = INTEGER: 4
F5-BIGIP-SYSTEM-MIB::sysTrunkOperBw."master" = INTEGER: 4000
F5-BIGIP-SYSTEM-MIB::sysTrunkStpEnable."master" = INTEGER: true(1)
F5-BIGIP-SYSTEM-MIB::sysTrunkStpReset."master" = INTEGER: false(0)
F5-BIGIP-SYSTEM-MIB::sysTrunkLacpEnabled."master" = INTEGER: true(1)
F5-BIGIP-SYSTEM-MIB::sysTrunkActiveLacp."master" = INTEGER: true(1)
F5-BIGIP-SYSTEM-MIB::sysTrunkShortTimeout."master" = INTEGER: true(1)

Thanks for your help!

noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Data Template → Get SNMP Data (indexed) → Index Value/Ty

#12 Post by noname » Thu Oct 13, 2011 8:18 pm

dalpha wrote:Here is the results of running the snmpwalk command:

F5-BIGIP-SYSTEM-MIB::sysTrunkName."master" = STRING: master
F5-BIGIP-SYSTEM-MIB::sysTrunkStatus."master" = INTEGER: up(0)
F5-BIGIP-SYSTEM-MIB::sysTrunkAggAddr."master" = STRING: 0:1:d7:60:9b:92
F5-BIGIP-SYSTEM-MIB::sysTrunkCfgMbrCount."master" = INTEGER: 4
F5-BIGIP-SYSTEM-MIB::sysTrunkOperBw."master" = INTEGER: 4000
F5-BIGIP-SYSTEM-MIB::sysTrunkStpEnable."master" = INTEGER: true(1)
F5-BIGIP-SYSTEM-MIB::sysTrunkStpReset."master" = INTEGER: false(0)
F5-BIGIP-SYSTEM-MIB::sysTrunkLacpEnabled."master" = INTEGER: true(1)
F5-BIGIP-SYSTEM-MIB::sysTrunkActiveLacp."master" = INTEGER: true(1)
F5-BIGIP-SYSTEM-MIB::sysTrunkShortTimeout."master" = INTEGER: true(1)
Ah, that's this case..
- Data Query Templates : SNMP Index is a STRING

Then, replace <oid_index_parse> as follows:

Code: Select all

  <oid_index_parse>OID/REGEXP:^.{35}(.*)</oid_index_parse>
        - or -
  <oid_index_parse>OID/REGEXP:^\.1\.3\.6\.1\.4\.1\.3375\.2\.1\.2\.12\.1\.2\.1\.1\.(.*)</oid_index_parse>
and for <index_order_type>:

Code: Select all

  <index_order_type>alphabetic</index_order_type>

dalpha
Posts: 22
Joined: Wed Oct 12, 2011 11:54 am

Re: Data Template → Get SNMP Data (indexed) → Index Value/Ty

#13 Post by dalpha » Thu Oct 13, 2011 10:57 pm

Thank you! I can't believe I totally missed that alphabetical section... :-?

I've modified these lines of my query:

Code: Select all

<oid_index>.1.3.6.1.4.1.3375.2.1.2.12.1.2.1</oid_index>
<oid_index_parse>OID/REGEXP:^.{32}(.*)</oid_index_parse>
<index_order_type>alphabetic</index_order_type>
When I removed that last .1 I was able to successfully pull all of the input data. I've attached the verbose query for the SNMP as well as a screenshot of the Create Graphs for this Host. Unfortunately… I still run into the issue when I attempt to create a graph for the F5 - Bandwidth I'm still requested to enter the Output Type ID, Index Value, and Index Type (as seen in create_graph.png in my first post). Please ignore the F5 - Testing portions.
verbose_query2.png
Picture that shows the new verbose query output.
verbose_query2.png (56.22 KiB) Viewed 14745 times
graph_screen.png
Picture that shows the main graphs to create.
graph_screen.png (52.59 KiB) Viewed 14745 times

noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Data Template → Get SNMP Data (indexed) → Index Value/Ty

#14 Post by noname » Thu Oct 13, 2011 11:02 pm

dalpha wrote: I've modified these lines of my query:

Code: Select all

<oid_index>.1.3.6.1.4.1.3375.2.1.2.12.1.2.1</oid_index>
<oid_index_parse>OID/REGEXP:^.{32}(.*)</oid_index_parse>
<index_order_type>alphabetic</index_order_type>
It should not be "... .1.2.1" for <oid_index>, use "... .1.2.1.1".
dalpha wrote:When I removed that last .1 I was able to successfully pull all of the input data.
You don't have to pull all types of data, and it seems that your device has only 1 set ("master") of trunk data.

dalpha
Posts: 22
Joined: Wed Oct 12, 2011 11:54 am

Re: Data Template → Get SNMP Data (indexed) → Index Value/Ty

#15 Post by dalpha » Thu Oct 13, 2011 11:17 pm

Okay, I've added the last .1. That is accurate, this unit will only have 1 trunk. I'm still seeing the issue with the Output Type ID, Index Value, and Index Type when I attempt to create my graph.

Post Reply