I try to create a new data query based on "Get snmp data (Indexed)". I want to graph number of mails delivered and bounced for each main ISP (hotmail, google, ...).
Here is the 'mib' representation of my data (I've limited it to only 2 ISP, but I have 8 ISP normally):
Code: Select all
$ snmpwalk -v2c -c XXXX localhost .1.3.6.1.4.1.23925.101
iso.3.6.1.4.1.23925.101.20.1.0 = Counter32: 2
iso.3.6.1.4.1.23925.101.20.2.103.111.111.103.108.101 = STRING: "google"
iso.3.6.1.4.1.23925.101.20.2.104.111.116.109.97.105.108 = STRING: "hotmail"
iso.3.6.1.4.1.23925.101.20.3.103.111.111.103.108.101 = STRING: "Google"
iso.3.6.1.4.1.23925.101.20.3.104.111.116.109.97.105.108 = STRING: "Hotmail"
iso.3.6.1.4.1.23925.101.20.4.103.111.111.103.108.101 = STRING: "gmail.com"
iso.3.6.1.4.1.23925.101.20.4.104.111.116.109.97.105.108 = STRING: "hotmail.fr,hotmail.com,live.fr"
iso.3.6.1.4.1.23925.101.20.11.103.111.111.103.108.101 = Counter32: 5579
iso.3.6.1.4.1.23925.101.20.11.104.111.116.109.97.105.108 = Counter32: 5614
iso.3.6.1.4.1.23925.101.20.12.103.111.111.103.108.101 = Counter32: 0
iso.3.6.1.4.1.23925.101.20.12.104.111.116.109.97.105.108 = Counter32: 0
The indexes are in this OID : iso.3.6.1.4.1.23925.101.20.2
In this OID are we have the full name of the ISP : iso.3.6.1.4.1.23925.101.20.3
The list of domains handled by the ISP are in the OID : iso.3.6.1.4.1.23925.101.20.4
Then, the delivered and bounced are in : iso.3.6.1.4.1.23925.101.20.11 and iso.3.6.1.4.1.23925.101.20.12
Here is the xml file I've created to handle this kind of snmp data :
Code: Select all
<interface>
<name>per status mails</name>
<description>Get number of mails per status d,b</description>
<oid_index>.1.3.6.1.4.1.23925.101.20.2</oid_index>
<oid_num_indexes>.1.3.6.1.4.1.23925.101.20.1.0</oid_num_indexes>
<index_order>ispIndex</index_order>
<index_order_type>alphabetic</index_order_type>
<oid_index_parse>OID/REGEXP:^.*\.23925\.101\.20\.2\.(.*)$</oid_index_parse>
<index_title_format>|chosen_order_field|</index_title_format>
<fields>
<ispIndex>
<name>Index</name>
<source>index</source>
<direction>input</direction>
</ispIndex>
<ispName>
<name>ISP Name</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.23925.101.20.3</oid>
</ispName>
<ispDomains>
<name>ISP managed domains</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.23925.101.20.4</oid>
</ispDomains>
<ispDelivered>
<name>Delivered</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.23925.101.20.11</oid>
</ispDelivered>
<ispBounced>
<name>Bounced</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.23925.101.20.12</oid>
</ispBounced>
</fields>
</interface>
Code: Select all
+ Running data query [16].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/opt/cacti/resource/snmp_queries/pmta_per_status_mails.xml'
+ XML file parsed ok.
+ Executing SNMP get for num of indexes @ '.1.3.6.1.4.1.23925.101.20.1.0' Index Count: 2
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.23925.101.20.2' Index Count: 2
+ Index found at OID: '.1.3.6.1.4.1.23925.101.20.2.103.111.111.103.108.101' value: 'google'
+ Index found at OID: '.1.3.6.1.4.1.23925.101.20.2.104.111.116.109.97.105.108' value: 'hotmail'
+ index_parse at OID: '.1.3.6.1.4.1.23925.101.20.2.103.111.111.103.108.101' results: '103.111.111.103.108.101'
+ index_parse at OID: '.1.3.6.1.4.1.23925.101.20.2.104.111.116.109.97.105.108' results: '104.111.116.109.97.105.108'
+ Inserting index data for field 'ispIndex' [value='103.111.111.103.108.101']
+ Inserting index data for field 'ispIndex' [value='104.111.116.109.97.105.108']
+ Located input field 'ispName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.23925.101.20.3'
+ Found item [ispName='Google'] index: .1.3.6.1.4.1.23925.101.20.3.103.111.111.103.108.101 [from value]
+ Found item [ispName='Hotmail'] index: .1.3.6.1.4.1.23925.101.20.3.104.111.116.109.97.105.108 [from value]
+ Located input field 'ispDomains' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.23925.101.20.4'
+ Found item [ispDomains='gmail.com'] index: .1.3.6.1.4.1.23925.101.20.4.103.111.111.103.108.101 [from value]
+ Found item [ispDomains='hotmail.fr,hotmail.com,live.fr'] index: .1.3.6.1.4.1.23925.101.20.4.104.111.116.109.97.105.108 [from value]
I've read these articles to help me in creating the xml file :
http://docs.cacti.net/howto:data_query_ ... s_a_string
http://devcentral.f5.com/Tutorials/Tech ... -Data.aspx
http://docs.cacti.net/manual:087:3a_adv ... alkthrough
http://www.cacti.net/downloads/docs/htm ... y_xml.html
Thank you for your help.