Creating Templates ... how exactly?

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

Moderators: Developers, Moderators

Post Reply
rsaeks
Posts: 34
Joined: Mon Nov 06, 2006 5:15 pm

Creating Templates ... how exactly?

Post by rsaeks »

I am new to Cacti, and have things up and running. Now I am starting to look at creating templates for graphs and data.

The data that I want to retrieve is all SNMP data of devices. I have used the generic SNMP-OID graph template, and that has worked out.

However, I am now starting to look at doing SNMP queries on two pieces of data, taking the result, dividing by each other to get a percentage.

I guess I should start out small, and work from there.

I want to be able to get the data from wireless access points to reflect the current number of associated clients. I have the OID that I want to use, and I would much rather use a template for that data. Once I have the data, I want to create a graph of that.

How would I go about running the SNMP query of the OID, storing that, then creating a graph template of that data?

I did look at the guide gandalf put together, but the example there deals with scripts, I just want to use the NET-SMTP agent to run the query.

Any help would be appreciated :)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Creating Templates ... how exactly?

Post by gandalf »

rsaeks wrote:I did look at the guide gandalf put together, but the example there deals with scripts, I just want to use the NET-SMTP agent to run the query.

Any help would be appreciated :)
Where exactly did you look? Already tried Loads of cacti HowTos? If you need more, please let me know
Reinhard
rsaeks
Posts: 34
Joined: Mon Nov 06, 2006 5:15 pm

Post by rsaeks »

I went through the guide on using SNMP to query data and then make the graph. Here is what I did:

Named Data Template: Apple - Airport - Associated Clients
Unchecked checkbox on Name field in Data Source entry
Changed Data Source Name to: |host_description| - Associated Clients
Data Source Item Internal name called: assocaitedClients
Max value changed to 0
Data Source Type: Counter
In Custom Data, OID was entered.

Created a Graph Template: Airport - Associated Clients
Title: |host_description| - Associated Clients

Added Graph Template Items: Apple - Airport Associated Clients (associatedClients)
Text Format: Associated Clients

I also created a graph from the Generic OID template with the same OID. When I show the host graph in the Generic OID, I am showing data, and when I go to the template, I show 0 all the time, even though there is data present.

I hope that helps give you an idea of my setup.

Thanks.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

rsaeks wrote:When I show the host graph in the Generic OID, I am showing data, and when I go to the template, I show 0 all the time, even though there is data present.
Sorry, I do not understand. Perhaps a screenshot or two would help
Reinhard
rsaeks
Posts: 34
Joined: Mon Nov 06, 2006 5:15 pm

Post by rsaeks »

I want to make a template to graph OID: .1.3.6.1.4.63.501.3.2.1.0

I went though your SNMP directions (http://docs.cacti.net/node/70)

I put in the OID and made the template. I guess I would want to know how to make a graph from that Data template. I went though what your posted, and just get a graph that is blank, with no errors in graph debug mode. When I use the built-in generic OID templateand plug in the SNMP communitity and OID, I get data on the graph.

I could give you screen shots, but I don't really know what you would want / find helpful.

Screens of the data template? Graph Template? Host template?

One step at a time is my thought, but I am not sure what to give you to help.

Let me know and I'l jump through the hoops to learn :)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Step by step is ok. Lets start with the data template (you've made a copy of the generic OID one?). I suppose the Graph Template is annoying, but a copy of the poller command table (from utilities, filter your host) would be good
Reinhard
rsaeks
Posts: 34
Joined: Mon Nov 06, 2006 5:15 pm

Post by rsaeks »

Well, that sucks .... I posted but apparently the message didn't go through.

I started by duplicating the SNMP - Generic OID Template
I then went and called it Airport - Associated Clients.
In the Data Source, I unchecked the check box for Use Per-Data source.
I then went and called it |host_description| - associated Clients
In the Data Source Item field, I named the Internal Data Source Name associatedClients
I then set the Max Value to 0, and set it to a Gauge.
Finally, I went ad set the OID to .1.3.6.1.4.63.501.3.2.1.0

At that point, I added the host, set the IP and SNMP string.

Does that part seem correct? Is there a way to associate this Data Template with a host to start collecting data?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

rsaeks wrote:Well, that sucks .... I posted but apparently the message didn't go through.

I started by duplicating the SNMP - Generic OID Template
I then went and called it Airport - Associated Clients.
In the Data Source, I unchecked the check box for Use Per-Data source.
I then went and called it |host_description| - associated Clients
In the Data Source Item field, I named the Internal Data Source Name associatedClients
I then set the Max Value to 0, and set it to a Gauge.
Finally, I went ad set the OID to .1.3.6.1.4.63.501.3.2.1.0
Fine, now you should create a Graph template for this data template
At that point, I added the host, set the IP and SNMP string.

Does that part seem correct? Is there a way to associate this Data Template with a host to start collecting data?
You should add the Graph template to the appropriate section of that host and then "Create Graphs for this Host"
Reinhard
rsaeks
Posts: 34
Joined: Mon Nov 06, 2006 5:15 pm

Post by rsaeks »

I created a graph template by adding the graph template item of the data source "Airport - Associated Clients - (associatedClients) I set it to an area graph, and the Text Format was associatedClients.

When I go back to the graph template, I see that I have a Graph Template Item of (assocatedClients): assoicated Clients and a Graph Item input of Data Source [associatedClients]

I wait a few min, but still appears on the graph. I run an snmpget with the community and OID manually, and get data back.

If I look at my Data Sources and turn on debug mode, I see this:

/opt/local/bin/rrdtool create \
/Library/WebServer/Documents/cacti/rra/ma_ap_106_associatedclients_71.rrd \
--step 300 \
DS:associatedClients:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 \


The SNMP verson on the host is set to the same as I am putting in when I run snmpget.

Any other ideas? I could give you the info and create a username / password for you if that would help any.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please try to work my "NaN Debuggung" HowTo. Else send access codes via pm
Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

rsaeks wrote:Finally, I went ad set the OID to .1.3.6.1.4.63.501.3.2.1.0
There's a typo in there. Correct OID is .1.3.6.1.4.1.63.501.3.2.1.0
Reinhard
rsaeks
Posts: 34
Joined: Mon Nov 06, 2006 5:15 pm

Post by rsaeks »

ugh --- thanks for finding that. I feel bad for all the time you spent and it was just a silly typo.

On the plus side, I have created more templates and feel much more comfortable with them :)

Thanks for all your help.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Fine, then. So I'll urge you to try the link of my first post ti this topic. It contains knowledge of several months of work with cacti. This may ease your work defining new resources to cacti and may even help debugging if things go wrong
happy cactiing
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests