Creating my first Data query
Moderators: Developers, Moderators
- adrianmarsh
- Cacti User
- Posts: 437
- Joined: Wed Aug 17, 2005 8:51 am
- Location: UK
Creating my first Data query
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.
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.
- adrianmarsh
- Cacti User
- Posts: 437
- Joined: Wed Aug 17, 2005 8:51 am
- Location: UK
Tried using |APNname| ?
That simular thing worked for a SNMP script I created (win32 - running processes).
That simular thing worked for a SNMP script I created (win32 - running processes).
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
- adrianmarsh
- Cacti User
- Posts: 437
- Joined: Wed Aug 17, 2005 8:51 am
- Location: UK
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!!
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
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
Reinhard
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
Reinhard
- adrianmarsh
- Cacti User
- Posts: 437
- Joined: Wed Aug 17, 2005 8:51 am
- Location: UK
Regex syntax error...
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:
... the closing bracket was missing.
Should have been:
(just in case someone else has this kind of prob )
Found the one here too:
Code: Select all
<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3}$</oid_index_parse>
Should have been:
Code: Select all
<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3})$</oid_index_parse>
Who is online
Users browsing this forum: No registered users and 0 guests