Custom Monitoring MySQL and SNMP with BixData - Page 2
Example 3: Collecting SNMP DataOverviewBasically all SNMP devices have an interface table that gives you basic statistics on bytes sent and received link status (up/down), link speed, etc. You get snmp values from a device by issuing a command like snmpget -v1 -c public hostname OID Where hostname is the name of the snmp device and OID is the special SNMP string. First let's make a script that can query SNMP devices for Interface statistics (bytes in and out). I will be using snmpget from Net-SNMP and python. But you could use perl and other SNMP modules. You can get the latest script from http://bixdata.com/addons. It is BSD license which means you are free to use and expand it. At the top of the script there is a list of hosts and Interface IDs that you can replace with your own. To find out what interface IDs your host has, issue the following command: snmpwalk -v 1 -c public hostname interfaces.ifTable.ifEntry.ifDescr Here is the section in bixsnmp.py: hostIntf = { "192.168.1.11" : 19, "192.168.1.12" : 18415 } As you can see I am getting stats on interface 19 on 192.168.11 and interface 18415 on 192.168.1.12. You can add as many hosts and interfaces as you want. The rest of the script simply executes the snmpget command to get the data and outputs it in this format:
host : 192.168.1.12 Download the bixsnmp.py script from http://www.bixdata.com/addons and copy it to bixagent/data/scripts. SNMP Step 2Do an snmpwalk on your SNMP devices to determine their interface IDs. snmpwalk -v 1 -c public hostname interfaces.ifTable.ifEntry.ifDescr The output will look like this: IF-MIB::ifDescr.1 = STRING: Switch Port 1 Here the '.1' and '.200' are the IDs. So edit bixsnmp.py and add those ids: hostIntf = { "hostname" : 1, "hostname" : 200 } SNMP Step 3Next run the script to make sure it works. cd bixagent/data/scripts Add the script to bixagent/data/xml/dp-import.xml.
<Script> This tells BixData what fields to expect. SNMP Step 5In BixDesktop connect to your BixAgent and under real-time graph choose 'Custom'. Navigate to the BixSNMP namespace and add the counters you want to see.
All other components in BixData such as Service Checks and Notifications will now work with SNMP. SNMP Step 6Next we want to create graphs. You can download the graph used in this example and copy it to bixserver/data/reporting/templates/, or you can follow these steps to create a graph. Connect to your BixServer and then:
|






print: 
Recent comments
12 hours 12 min ago
14 hours 3 min ago
19 hours 20 min ago
19 hours 27 min ago
20 hours 57 min ago
21 hours 14 min ago
22 hours 33 min ago
1 day 28 min ago
1 day 1 hour ago
1 day 4 hours ago