Creating my first Data query

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

Moderators: Developers, Moderators

Post Reply
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Creating my first Data query

Post by adrianmarsh »

I'm trying to Poll a Cisco 7609, for a gauge that will give me number of active users per APN (Access Point Name). I'm really close, but when I try to add the Data Source to the device, it goes wrong. Hopefully someone can tell me where. I'm posting all the details I've got and hopefully someone can help (apologies now for the long text).

Heres the two OIDs of interest:

1.3.6.1.4.1.9.9.183.1.1.1.1.3 - A walk of this provides the list of APN names
.1.3.6.1.4.1.9.9.183.1.1.1.1.18 - Provides the # active users per APN.

Each APN is identified with a sub-set OID, so I've built my XML file as below. I think I've understood the OID/REGEXP expression. But I believe this may be where I've gone wrong.

<interface>
<name>Get SNMP APN stats</name>
<description>Queries a host for a list of monitorable APNs and the stats</description>
<oid_index>.1.3.6.1.4.1.9.9.183.1.1.1.1.3</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3}$</oid_index_parse>
<index_order>APNname</index_order>
<index_order_type>alphabetic</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>

<fields>
<APNname>
<name>Name (APN)</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.9.9.183.1.1.1.1.3</oid>
</APNname>
<APNactcnt>
<name>Active APN Count</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9.9.183.1.1.1.1.18</oid>
</APNactcnt>
</fields>
</interface>



Next I've created the data query. I had a simple graph template from before where I polled one data-item and graphed it, so I've used that for the Graph Template. I'm only interested in showing the APN Count, so thats the only output (but I'm not clear on how to get the APN name later on)...

I've set the DQ Data Input Method to SNMP/Indexed, and under the graph template I've matched the APNactcnt to the Graph Template data source (cisco_counter_ds).

But when I try to add the Data Query to the Cisco Device, I get a warning output :

Warning: ereg_replace(): REG_EPAREN in C:\inetpub\wwwroot\cacti\lib\data_query.php on line 175
(repeated lots of times)

Warning: ereg_replace(): REG_EPAREN in C:\inetpub\wwwroot\cacti\lib\data_query.php on line 218

Warning: ereg_replace(): REG_EPAREN in C:\inetpub\wwwroot\cacti\lib\data_query.php on line 218

(repeated lots of times)


Warning: Cannot modify header information - headers already sent by (output started at C:\inetpub\wwwroot\cacti\lib\data_query.php:175) in C:\inetpub\wwwroot\cacti\host.php on line 110


Going back to the device list, it tells me it only retrieved 1 item, 1 row, but I was expecting a few more (8 "rows").

I suspect its my XML file, but can't see where I've gone astray.
jef
Posts: 17
Joined: Thu Aug 25, 2005 3:27 pm
Location: ./

Post by jef »

i remember getting header warnings until i figured that i didn't need the OID/REGEXP line in the xml..

Jef
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

Ok, I got a lot further.... Taking out the REG expression seems to of made it work.. I can query and select the Items and even graph them. All I need to do now is to get APNname to show in the graph titles
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Tried using |APNname| ?

That simular thing worked for a SNMP script I created (win32 - running processes).
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

Yeah... But I've figured it out. You have to associate the variables (in my case |query_APNname| to "name" and "title" against the DS and GT. I've not been able to find much documentation about what else can be done, but I've got mine up and running. I used the network interface stats as an example. I've got my stats!!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

adrianmarsh,
the use of |query_<field_name>| is documented in http://www.cacti.net/downloads/docs/htm ... _VARIABLES. Ok, took a time for me to find that place, but the online docs are not too bad
:o
Reinhard
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

Yeah, what I meant was theres not much on "name" "title" etc to match it to. Only reason I saw it was due to the examples already installed. There may be others but I don't know them.
Ezzlar
Posts: 1
Joined: Fri Aug 03, 2007 9:00 am
Location: Glasgow

Regex syntax error...

Post by Ezzlar »

I know this thread is ages old, however I just had a similar problem and the cause was a syntax error in the Regex.

Found the one here too:

Code: Select all

<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3}$</oid_index_parse> 
... the closing bracket was missing.

Should have been:

Code: Select all

<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3})$</oid_index_parse> 
(just in case someone else has this kind of prob :P )
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests