Hoping this helps someone - I ran into a problem on an Ubuntu 13.03 installation with MySQL version 5.5.41, although I suspect this affects some other versions.
The short story is that the snmp_quagga_bgpd_neighbors_queries.xml uses 'index' as a field name which MySQL throws its toys out the cot about, presumably this is a reserved word.
There is a mysql assoc error in the logs which gives a little more info when you run the query manually:
Code: Select all
mysql> use cacti
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> SELECT * FROM (SELECT host_id, snmp_query_id, snmp_index, MAX(CASE WHEN field_name='as_number' THEN field_value ELSE NULL END) AS 'as_number', MAX(CASE WHEN field_name='bgp_router' THEN field_value ELSE NULL END) AS 'bgp_router', MAX(CASE WHEN field_name='ifOperStatus' THEN field_value ELSE NULL END) AS 'ifOperStatus', MAX(CASE WHEN field_name='index' THEN field_value ELSE NULL END) AS 'index', MAX(CASE WHEN field_name='num_of_neighbors' THEN field_value ELSE NULL END) AS 'num_of_neighbors', MAX(CASE WHEN field_name='peer1_desc' THEN field_value ELSE NULL END) AS 'peer1_desc', MAX(CASE WHEN field_name='peer2_desc' THEN field_value ELSE NULL END) AS 'peer2_desc', MAX(CASE WHEN field_name='peer3_desc' THEN field_value ELSE NULL END) AS 'peer3_desc', MAX(CASE WHEN field_name='peer4_desc' THEN field_value ELSE NULL END) AS 'peer4_desc', MAX(CASE WHEN field_name='quagga_ver' THEN field_value ELSE NULL END) AS 'quagga_ver', MAX(CASE WHEN field_name='type_graph' THEN field_value ELSE NULL END) AS 'type_graph' FROM host_snmp_cache WHERE host_id=916 AND snmp_query_id=24 GROUP BY host_id, snmp_query_id, snmp_index ) AS results ORDER BY CAST(index AS unsigned) LIMIT 0,30;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
near 'index AS unsigned) LIMIT 0,30' at line 1
I changed snmp_quagga_bgpd_neighbors_queries.xml to replace 'index' with 'idx' and it solved the problem:
Code: Select all
<interface>
<name>Quagga BGPD Monitoring (Neighbors Info)</name>
<description>Monitoring of BGP session via Quagga daemon in Linux.</description>
<oid_index>.1.3.6.1.4.1.2021.190.1000.3.2.1</oid_index>
<oid_num_indexes>.1.3.6.1.4.1.2021.190.1000.3.2.0</oid_num_indexes>
<index_order>idx</index_order>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
<fields>
<idx>
<name>Group</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.2021.190.1000.3.2.1</oid>
</idx>
I've attached the modified files, as you need to also update the cacti_data_query_rn_-_quagga_-_get_bgp_neighbors_information.xml to get the field carrying through to the graph template correctly.