[HOWTO] Add new MIB Variables to Cacti

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Developers, Moderators

ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

wierd i just saved the file and renamed it, works fine then... strange.

thanks for the offer though
aboyz

No graph ??

Post by aboyz »

After doing the following below to creat one OID, there is no graph. I mean don't we have to enter a data in there? I follow the instruction below but I don't see any DATA.. I see the GRAPH but no data is being collected, what am i doing wrong??

Also. ANyone know how to graph two data on one graph.? I was thinking to do current connection & max connection on one graph. how would i go about doing that??

thanks in advance.. for all your great help!!
monachus wrote:Data Template

1. Create a Data template for proxyStatsConnectActiveConnections. Call it "Proxy DT - Active Connections"
2. Set the Name to "|host_description| - Active Connections"
3. Set the Data Input Method to "Get SNMP Data"
4. Set the Internal Data Source Name to "num_conns"
5. Give it a Max of 200000 (or whatever)
6. Make it a Gauge
7. Save
8. After saving, you'll have new options. Enter your OID into the OID field
9. Click Save

Graph Template

1. Create a Graph Template. Call it "Proxy GT - Active Connections"
2. Set the Name to "|host_description| - Active Connections"
3. Save
4. In the screen that follows, select "Add" from Graph Template Items in the top right.
5. In the next screen, choose your DT from above.
6. Add some colors and stuff for the graph output
7. Save

If you have a Host Template for this type of device, you can add the GT you just created to the Host Template and it will always appear. Alternatively, just go to your device and add the GT to the Device Information screen. When you go to "Create Graphs for this Host," you should have the Graph Template there. Check it and save.

Ta Da!

It should be noted that I'm _not_ a Cacti expert. I get my information from looking at the scripts that have been provided and figuring out the rest. It's not that difficult, and I encourage everyone to spend a few hours looking over what already works. It helps to name your templates with a name that says what they are (GT, DT, HT), so that it clarifies which your adding to what.
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Post by monachus »

Not sure what you mean by "adding a data" to the graph. The data is retrieved from the host based on the OID you tell it to query. You should be able to query that OID manually using snmpget or snmpwalk and get data. If you don't, then Cacti won't be able to get the data either.

It is possible to graph more than one data point on a graph. For an example of this, look at the Data Template for "Unix - Load Average" where you'll find multiple data sources.

For your application, if you add multiple items to the Data Template you create, then those items will be available in the Graph Template for you to use when creating your graphs.
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
aboyz

thank you

Post by aboyz »

thank you for your help. Best thing to do is to create a .xml file and just create everything that associate with it. that worked!!.

One problems


When I go to graph i see the following items.

Index Port Server
37 80 parking
38 65535 admin00
39 80 admin00
36 65535 parking
35 25 www-clstr06
34 443 www-clstr06
33 80 www-clstr06
32 65535 www-clstr06
31 25 www-clstr05

I tried using Current Sessions - |ifNames| |query_ifNames| Nothing show up. should i try like |port| |Server| like that? or |query_Server| or |query_port| anyone know the right syntax for this??

But when I graph it and set it up. the name doesn't come out like that? any reason for it?
Is this the right.

the naming for this when graphed showed up like this

ServerIron Current Sessions - |query_ifNames|

How do i make it to disply their name and port?
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Re: thank you

Post by monachus »

aboyz wrote: I tried using Current Sessions - |ifNames| |query_ifNames| Nothing show up. should i try like |port| |Server| like that? or |query_Server| or |query_port| anyone know the right syntax for this??
If you created an XML file, you created tags for the various fields that you're querying, with a Name and an OID for each. You want to put in the tag name. For example, if your XML SNMP Query has a tag called "port" then you would put "|query_port|" in the Graph Template.
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
aboyz

Here is my xml file

Post by aboyz »

<interface>
<name>Get Current Port Connections</name>
<description>Queries a host for a list of monitorable ports</description>
<oid_index>.1.3.6.1.4.1.1991.1.1.4.9.1.1.1</oid_index>

<fields>
<ifIndex>
<name>Index</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.1991.1.1.4.9.1.1.1</oid>
</ifIndex>
<ifPort>
<name>Port</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.1991.1.1.4.9.1.1.2</oid>
</ifPort>
<ifName>
<name>Server</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.1991.1.1.4.9.1.1.3</oid>
</ifName>
<ifConns>
<name>Current Connections</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.1991.1.1.4.9.1.1.4</oid>
</ifConns>
<ifConns2>
<name>Current Connections</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.1991.1.1.4.9.1.1.5</oid>
</ifConns2>
</fields>
</interface>

what query do i need?
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Post by monachus »

if you're looking for port, you want |query_ifPort|
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
aboyz

thanks for the reply1!

Post by aboyz »

thanks for the reply..

but i'm looking for names.. so it should be
|query_ifName|

Where do i change that at? can you point me to the right direction..

thanks
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Re: thanks for the reply1!

Post by monachus »

aboyz wrote: but i'm looking for names.. so it should be
|query_ifName|

Where do i change that at? can you point me to the right direction..
Name field on your Data Template.
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
aboyz

I did that..

Post by aboyz »

Hi,

I did that.

under data template. i choose the template then i edit this.

|host_description| - |query_ifPort| - |query_ifName|

That should do it.

then i go to graph management and click on the one i want then hit reapply name and hit ok.

the name doesn't change it still show this

|host_description| - |Names| - |query_ifNames|

Why doesn't it change any reason for this??
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Post by monachus »

in your .xml file above, you start it with <interface>. why? what exactly are you querying, and if you query the OID manually with snmpget/snmpwalk, do you get data back?
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
aboyz

yup

Post by aboyz »

ofcourse i get databack..

I decided to redo everything and now it worked!!! thanks alot.. this howto is GREAT!!! now i can setup any MIB file.. this is sooo cool. thank you very much!!
tafirol
Posts: 15
Joined: Sun May 22, 2005 9:43 am

Post by tafirol »

Hi;
Pardon by my English, is very poor :) .I need to know what is the way to put two indexes into a SNMP XML script.The OID to graph is .1.3.6.........10.4 ,and the necesary instance to put is ".10.4" Any Ideas??

thanks a lot !!!

The fantastic Manu Ginobili
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Post by monachus »

i'm unsure what you're asking us to clarify. if you look at the XML data provided by the cacti installation, as well as the information in the HOWTOs in this topic, you should find all of the instructions you need.
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
tafirol
Posts: 15
Joined: Sun May 22, 2005 9:43 am

Post by tafirol »

I will try to clarify what I´m looking for ; )
the thing is that I have an script running and I can use only one index by script, no problem there. But, now I have get information from 2 indexes, and I have no idea of what I have to write into the script. I hope that you understand my point.

thanks in advance,

Tafi ROL
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest