2014年3月7日 星期五

Cacti Data Query via XML

Cacti Data Query via XML

If you want to get data by snmp,but it's not unique value just like Interface Traffic .
How would you do?


1. Create your Data Template



2.Create your Graph Template


3.Prepare your xml file at /<your cacti folder>/resource/snmp_queries/<your xml file>
   It's my example:/var/www/cacti/resource/snmp_queries/SLB-vip_session.xml

<interface>
        <name>Get SNMP Session</name>
        <description>Queries a host for a list of monitorable interfaces</description>
        <oid_index>.1.3.6.1.4.1.1872.2.5.4.2.4.1.1</oid_index>#(index)
        <oid_num_indexes>.1.3.6.1.4.1.1872.2.5.4.2.4.1.1.34</oid_num_indexes>#(total index count)
        <index_order_type>numeric</index_order_type>
        <index_order>ifIndex</index_order>
        <index_title_format>Session#|chosen_order_field|</index_title_format>
        <fields>
             <ifIndex>
             <name>Index</name>
             <method>walk</method>
             <source>value</source>
             <direction>input</direction>
             <oid>.1.3.6.1.4.1.1872.2.5.4.2.4.1.1</oid>#(index display on pannel)
             </ifIndex>
             <ifVip>
             <name>VIP</name>
             <method>walk</method>
             <source>value</source>
             <direction>input</direction>
             <oid>.1.3.6.1.4.1.1872.2.5.4.2.4.1.14</oid>#(index name display on pannel)
             </ifVip>
             <ifSessionIn>
             <name>SessionIn</name>
             <method>walk</method>
             <source>value</source>
             <direction>input</direction>
             <oid>.1.3.6.1.4.1.1872.2.5.4.2.4.1.2</oid>>#(value display on pannel)
             </ifSessionIn>
             <ifSession>
             <name>Session</name>
             <method>walk</method>
             <source>value</source>
             <direction>output</direction>
             <oid>.1.3.6.1.4.1.1872.2.5.4.2.4.1.2</oid>>#(real value output)
             </ifSession>
        </fields>
</interface>

4.Setting Data Queries & Add Associated Graph Templates

Don't forget  chek the Data Source block.

Add Suggested Values

     upper file name : name
     lower file name : title
     other is |host_description| - VIP Session - |query_ifVip|
                                                                     * ifVip is the xml index name display


5.Add Graph template & Data Query to your Device.



5.Create graph what you want to monitor,and you'll find a list about the above SLB-vip config


























沒有留言:

張貼留言