Performance monitoring has always been an issue that every website must seriously consider. For a large system, if you do not know the running status of each module, it is an accident, I don't even know how to cancel it. I think many software developers have noticed this. Therefore, various monitoring data, such as the number of web connections, request concurrency, and database connections, are added to the corresponding web and database products, for your use. In addition, when the system is distributed on multiple machines, the distributed monitoring problem is highlighted, so cacti came into being. Through the SNMP protocol, cacti can easily read SNMP data from multiple machines at the same time to achieve distributed monitoring.
If you are new to cacti, it is recommended that you go to the cacti official website to learn about this product (http://www.cacti.net /).
However, sometimes the predefined monitoring values provided by systems, web, and databases are insufficient. In many cases, we need to define specific monitoring values to monitor our systems. You may first think of performance counters. performance counters can be easily defined through custom category and counter to implement and monitor specific values. For a solution for customizing performance counters, see:
Http://it.dianping.com/using_attribute_wrapping_performance_counter.htm
However, if you want to view the performance counters, you must log on to the used machine and use the system's performance components. Wouldn't it be perfect to achieve remote monitoring by combining cacti and performance counters?
After the help of the major search engines, found a library to achieve similar functions: http://erwan.l.free.fr/snmptools, and broke through the firewall restrictions, through the proxy finally came to this precious stuff .. To facilitate the download, this tool is available for reference in this article.
The basic implementation of snmptools is simple. The performance counters-> SNMP-> cacti are further subdivided. This solution involves two steps. The first step is to counter to SNMP, and the second step is to SNMP to cacti.
The first step is to counter SNMP. snmptools provides an extension agent DLL for the SNMP service, which is integrated with the SNMP service that comes with windows. The main function of this agent DLL is to use a configuration file to customize the OID and corresponding counter ing.
<Counter. ini>
[1.3.6.1.4.1.15.1]
Counter = physicaldisk "avg. Disk queue length" _ total
[1.3.6.1.4.1.15.2]
Counter = logicaldisk "Free megabytes" _ total
The preceding is an example of the configuration file. The MIB root node used by this DLL is 1.3.6.1.4.15. You can define the corresponding OID of the counter on this node.
Once the snmptools installation and configuration are complete, run the Linux Command on the machine where cacti is located to test it: (cacti is generally installed on Linux. Although cacti is available in windows, some functions are unavailable)
Snmpwalk-V1-C public [monitor_ip] 1.3.6.1.4.1.15
This command traverses all the oId values used on this node. If all values are obtained, the first step is successful.
The next step is the second step. This step is much simpler. snmptools provides a cacti template that encapsulates the query method for retrieving SNMP values. After importing this method, you can use it.
The monitoring result is obtained by running the preceding configuration file. Well, it looks nice, so try it.
ArticleSource: http://it.dianping.com/using_cacti_performance_counter_to_implement_customized_remote_monitoring.htm
Snmptools: http://it.dianping.com/using_cacti_performance_counter_to_implement_customized_remote_monitoring.htm