How to do it...

To send the collectd data to Graphite, follow these steps only on the server monitoring our PostgreSQL nodes:

  1. Add the following section to the top of the storage-schemas.conf file in the /opt/graphite/conf directory:
        [collectd] 
        pattern = ^collectd\. 
        retentions = 10s:1d,1m:7d,5m:30d,10m:90d,1h:1y 
  1. Restart the carbon daemon with the following commands:
        sudo /opt/graphite/bin/carbon-cache.py stop
        sudo /opt/graphite/bin/carbon-cache.py start

 

  1. Replace the contents of the local.conf file in /etc/collectd with the following contents:
        LoadPlugin write_graphite 
 
        <Plugin write_graphite> 
         <Node "mon1"> 
          LogSendErrors true 
          Prefix "collectd." 
          StoreRates true 
          SeparateInstances true 
         </Node> 
        </Plugin> 
  1. Restart the collectd daemon ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.