[SOLVED] create new data query

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

User avatar
cyrill
Cacti User
Posts: 271
Joined: Fri Jan 25, 2008 8:43 am
Location: California - USA

[SOLVED] create new data query

Post by cyrill »

Hello !

Can you say me how I must proceed for create a new data query for an OID of a printers ????

info: I know how to get MIB of this host.

thanks for your help
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) Search! many people have created these

2) read in the documentation site on how to create the script/templates.
User avatar
cyrill
Cacti User
Posts: 271
Joined: Fri Jan 25, 2008 8:43 am
Location: California - USA

Post by cyrill »

I've a problem when I try to associate a graph template.
Attachments
untitled.JPG
untitled.JPG (65.52 KiB) Viewed 6944 times
User avatar
cyrill
Cacti User
Posts: 271
Joined: Fri Jan 25, 2008 8:43 am
Location: California - USA

Post by cyrill »

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

Post by gandalf »

Please post screenshots of Data Input Method, data Template and Graph Template
Reinhard
User avatar
cyrill
Cacti User
Posts: 271
Joined: Fri Jan 25, 2008 8:43 am
Location: California - USA

Post by cyrill »

ok. thanks for your help

I tryed to change the associated graph template but with each graph template, I've the same error...

thanks
Attachments
asso.JPG
asso.JPG (25.21 KiB) Viewed 6804 times
dataQuery.JPG
dataQuery.JPG (49.62 KiB) Viewed 6804 times
graphTemplate.JPG
graphTemplate.JPG (73.37 KiB) Viewed 6804 times
User avatar
cyrill
Cacti User
Posts: 271
Joined: Fri Jan 25, 2008 8:43 am
Location: California - USA

Post by cyrill »

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

Post by gandalf »

I fear you've got the concept of data queries wrong. It seems, as if you want to create a data query for a "simple SNMP value". That's nogo. Please see walkthroughs of my first sig link to get the idea.
Reinhard
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

I fully agree with Reinhard.

If you want to graph a single OID (or even several), you can use the "SNMP Generic OID" templates.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
User avatar
cyrill
Cacti User
Posts: 271
Joined: Fri Jan 25, 2008 8:43 am
Location: California - USA

Post by cyrill »

I've always the same problem. I don't know why
Attachments
withSimpleOID.JPG
withSimpleOID.JPG (45.42 KiB) Viewed 6712 times
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Can you :
  • go to data sources
  • click add
  • select the "SNMP - Generic OID template"
  • fill the "Name' and 'OID' fields, and adjust the maximum value
  • save
  • go to graph manament
  • click add
  • select the "SNMP - Generic OID template"
  • fill the "Legend" and "Title" fields
  • point to the data source previously created
That should work :)
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

There's even a document for that : http://docs.cacti.net/node/495
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
User avatar
cyrill
Cacti User
Posts: 271
Joined: Fri Jan 25, 2008 8:43 am
Location: California - USA

Post by cyrill »

I'm not sure that I understand the difference between data query and data source...
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

From http://docs.cacti.net/node/225
What is a Data Query? Here's the text from cacti's website (Chapter 10. Data Queries):

Data queries are not a replacement for data input methods in Cacti. Instead they provide an easy way to query, or list data based upon an index, making the data easier to graph. The most common use of a data query within Cacti is to retrieve a list of network interfaces via SNMP. .... While listing network interfaces is a common use for data queries, they also have other uses such as listing partitions, processors, or even cards in a router.

One requirement for any data query in Cacti, is that it has some unique value that defines each row in the list. This concept follows that of a 'primary key' in SQL, and makes sure that each row in the list can be uniquely referenced. Examples of these index values are 'ifIndex' for SNMP network interfaces or the device name for partitions.
There are two types of data queries that you will see referred to throughout Cacti. They are script queries and SNMP queries. Script and SNMP queries are virtually identical in their functionality and only differ in how they obtain their information. A script query will call an external command or script and an SNMP query will make an SNMP call to retrieve a list of data.

All data queries have two parts, the XML file and the definition within Cacti. An XML file must be created for each query, that defines where each piece of information is and how to retrieve it. This could be thought of as the actual query. The second part is a definition within Cacti, which tells Cacti where to find the XML file and associates the data query with one or more graph templates.
You don't need to create a data query to graph only a few OIDs...
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

cyrill wrote:I'm not sure that I understand the difference between data query and data source...
Here's something that can help :

Image
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest