Integrating with external tools

When thinking about monitoring in general, most people instantly think of some monitoring tool such as Nagios, Zabbix, or the like. While monitoring tools are an important thing, I hope this chapter has proven that there is more to monitoring than just monitoring tools and pretty graphs.

Still, in this section, the goal is to guide you through some modules commonly used for monitoring with the help of tools. This is not meant to be an introduction to Nagios and other tools but a guideline to what can be used along with which tool.

Using Nagios plugins

The most widely used plugin that can be used in combination with Nagios is the plugin provided by the developers of the Burcado project at:

http://bucardo.org/wiki/Check_postgres

It is also possible to use those plugins with Shinken and Tanto.

It offers a variety of checks suitable for monitoring different types of instances. The beauty of this plugin is that it can produce not only monitoring data for Nagios but also the output needed for MRTG (The Multi Router Traffic Grapher: http://oss.oetiker.ch/mrtg/doc/mrtg.en.html.) as well as Cacti (http://www.cacti.net/). Cacti is a nice and simple graphical tool people can use to display what is going on in the system. If you are not willing to dive into Nagios, Cacti is a nice alternative, providing you with what you need in a simple way.

Which checks are provided by the Nagios plugins depends a little on the type of server you are running. Here are some of my favorite checks, which can be applied to pretty much any type of setup:

  • backends: This tells you about the number of open database connections
  • commitratio: This checks the commit ratio of all databases and complains when they are too low
  • custom_query: This is the most powerful check because it allows you to run a generic query capable of returning any output needed
  • database_size: This returns the database size
  • dbstats: This returns high-level information about database activity
  • locks: This checks the total number of locks on one or more databases
  • query_time: This checks the length of running queries on one or more databases
  • wal_files: This checks how many WAL files exist in the pg_xlog directory

Of course, depending on your application, different or additional checks might be necessary. However, this selection is a good foundation to get started with.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.19.243