Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,21 @@ env.password secret-password

and/or

[redis_*]
env.REDISCLI_AUTH password1234

and/or

[redis_remoteserverip_remoteserverport]
env.password another-secret-password

and/or

[redis_socket_socketpath]
env.password another-secret-password

If redis-cli is not in the default PATH, you can set the location of the
redis-cli binary in the config file ala /etc/munin/plugin-conf.d/redis:

[redis_*]
env.redis_cli /opt/rh/rh-redis5/root/usr/bin/redis-cli
11 changes: 7 additions & 4 deletions redis_
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#%# family=auto
#%# capabilities=autoconf suggest

# location of redis-cli - defaults to redis-cli found in $PATH
redis_cli=${redis_cli:-redis-cli}

ip_socket=$(echo $0 | awk -F_ '{ print $2 }')
if [[ $ip_socket = "socket" ]]; then
tmp_var=$(echo $0 | awk -F_ '{ s = ""; for (i = 3; i <= NF; i++) s = s $i "/"; print s }')
Expand Down Expand Up @@ -39,13 +42,13 @@ else
fi

if [ "$1" = "autoconf" ]; then
redis-cli $ip_socket $port_path $passwd info >/dev/null 2>&1 && echo yes && exit 0
$redis_cli $ip_socket $port_path $passwd info >/dev/null 2>&1 && echo yes && exit 0
echo no
exit 0
fi

if [ "$1" = "suggest" ]; then
redis-cli $ip_socket $port_path $passwd info >/dev/null 2>&1 && echo ${ip_socket}_${port_path}
$redis_cli $ip_socket $port_path $passwd info >/dev/null 2>&1 && echo ${ip_socket}_${port_path}
exit 0
fi

Expand All @@ -58,7 +61,7 @@ fi

if [ "$1" = "config" ]; then
# Expose all possibles graphes according to server's capabilities
redis-cli $ip_socket $port_path $passwd info | awk -v port=${muninport} -F: '
$redis_cli $ip_socket $port_path $passwd info | awk -v port=${muninport} -F: '

/^changes_since_last_save:|^rdb_changes_since_last_save:/ {
print "multigraph redis_changes_since_last_save_"port;
Expand Down Expand Up @@ -209,7 +212,7 @@ if [ "$1" = "config" ]; then
exit $?
fi

redis-cli $ip_socket $port_path $passwd info | awk -v port=${muninport} -F: '
$redis_cli $ip_socket $port_path $passwd info | awk -v port=${muninport} -F: '

/^changes_since_last_save:|^rdb_changes_since_last_save:/ {
print "multigraph redis_changes_since_last_save_"port;
Expand Down