# Install:
#   This requires the python plugin.  It is sometimes installed with collectd
#   but not always.  You can install it with:
#
#     apt-get install collectd-python
#
#   Install the redis collect plugin now
#     git clone https://github.com/powdahound/redis-collectd-plugin.git /opt/redis-collectd-plugin

# Documentation:
#   https://github.com/powdahound/redis-collectd-plugin/blob/master/README.md

# System modifications:
#   None

# Config file modifications:
#   Change the Host/Port/Auth to settings that allow you to connect
#   to the redis instance. Each redis instance gets it's own module. 
#   Included is one sample slave config.

<LoadPlugin python>
  Globals true
</LoadPlugin>

<Plugin python>
  ModulePath "/opt/redis-collectd-plugin"
  Import "redis_info"

  <Module redis_info>
    Host "localhost"
    Port 9999
    # Un-comment to use AUTH
    #Auth "1234"
    Verbose false
    # Catch Redis metrics (prefix with Redis_)
    Redis_uptime_in_seconds "gauge"
    Redis_used_cpu_sys "counter"
    Redis_used_cpu_user "counter"
    Redis_used_cpu_sys_children "counter"
    Redis_used_cpu_user_children "counter"
    Redis_uptime_in_days "gauge"
    Redis_lru_clock "counter"
    Redis_connected_clients "gauge"
    Redis_connected_slaves "gauge"
    Redis_client_longest_output_list "gauge"
    Redis_client_biggest_input_buf "gauge"
    Redis_blocked_clients "gauge"
    Redis_expired_keys "counter"
    Redis_evicted_keys "counter"
    Redis_rejected_connections "counter"
    Redis_used_memory "bytes"
    Redis_used_memory_rss "bytes"
    Redis_used_memory_peak "bytes"
    Redis_used_memory_lua "bytes"
    Redis_mem_fragmentation_ratio "gauge"
    Redis_changes_since_last_save "gauge"
    Redis_instantaneous_ops_per_sec "gauge"
    Redis_rdb_bgsave_in_progress "gauge"
    Redis_total_connections_received "counter"
    Redis_total_commands_processed "counter"
    Redis_total_net_input_bytes "counter"
    Redis_total_net_output_bytes "counter"
    Redis_keyspace_hits "derive"
    Redis_keyspace_misses "derive"
    Redis_latest_fork_usec "gauge"
    Redis_connected_slaves "gauge"
    Redis_repl_backlog_first_byte_offset "gauge"
    Redis_master_repl_offset "gauge"
    #Slave-Only
    Redis_master_last_io_seconds_ago "gauge"
    Redis_slave_repl_offset "gauge"
  </Module>
</Plugin>
