Closed insidefuture closed 6 years ago
[root@redis bin]# zbx_redis_discovery.sh general debug
'[' -e /tmp/redis-cli ']' ++ cat /tmp/redis-cli
REDIS_CLI=/usr/bin/redis-cli
'[' -a /tmp/stdbuf ']' ++ cat /tmp/stdbuf
STDBUF=/usr/bin/stdbuf
'[' general '!=' general ']'
echo -n '{"data":[' {"data":[+ for s in '$LIST'
sed -e 's:},$:}:' ++ sed 's/*/127.0.0.1/g' ++ cut -d: -f3 ++ echo redis:/usr/bin/redis-server:127.0.0.1:6379
HOST=127.0.0.1 ++ echo redis:/usr/bin/redis-server:127.0.0.1:6379 ++ sed 's/*/127.0.0.1/g' ++ cut -d: -f4
PORT=6379
[[ 1 -ne 0 ]]
(( i=0 ))
(( i<1 ))
PASSWORD=debug ++ discover_redis_instance 127.0.0.1 6379 debug ++ HOST=127.0.0.1 ++ PORT=6379 ++ PASSWORD=debug +++ /usr/bin/redis-cli -h 127.0.0.1 -p 6379 -a debug ping ++ ALIVE='NOAUTH Authentication required.' ++ [[ NOAUTH Authentication required. != \P\O\N\G ]] ++ return 1
INSTANCE= ++ discover_redis_rdb_database 127.0.0.1 6379 debug ++ HOST=127.0.0.1 ++ PORT=6379 ++ PASSWORD=debug +++ /usr/bin/redis-cli -h 127.0.0.1 -p 6379 -a debug ping ++ ALIVE='NOAUTH Authentication required.' ++ [[ NOAUTH Authentication required. != \P\O\N\G ]] ++ return 1
RDB_PATH= ++ discover_redis_avalable_commands 127.0.0.1 6379 debug ++ HOST=127.0.0.1 ++ PORT=6379 ++ PASSWORD=debug +++ /usr/bin/redis-cli -h 127.0.0.1 -p 6379 -a debug ping ++ ALIVE='NOAUTH Authentication required.' ++ [[ NOAUTH Authentication required. != \P\O\N\G ]] ++ return 1
COMMANDS= ++ discover_redis_avalable_slaves 127.0.0.1 6379 debug ++ HOST=127.0.0.1 ++ PORT=6379 ++ PASSWORD=debug +++ /usr/bin/redis-cli -h 127.0.0.1 -p 6379 -a debug ping ++ ALIVE='NOAUTH Authentication required.' ++ [[ NOAUTH Authentication required. != \P\O\N\G ]] ++ return 1
SLAVES=
[[ -n '' ]]
(( i++ ))
unset
echo -n ']}' ]}+ echo ''
unset IFS
Can u please specify redis version ?
I tested with redis 2.8.19 and 3.2.9
Any update? Consider as resolved.
[root@redis bin]# zbx_redis_discovery.sh general debug
'[' -e /tmp/redis-cli ']' ++ cat /tmp/redis-cli
REDIS_CLI=/usr/bin/redis-cli
'[' -a /tmp/stdbuf ']' ++ cat /tmp/stdbuf
STDBUF=/usr/bin/stdbuf
'[' general '!=' general ']'
echo -n '{"data":[' {"data":[+ for s in '$LIST'
sed -e 's:},$:}:' ++ sed 's/*/127.0.0.1/g' ++ cut -d: -f3 ++ echo redis:/usr/bin/redis-server:127.0.0.1:6379
HOST=127.0.0.1 ++ echo redis:/usr/bin/redis-server:127.0.0.1:6379 ++ sed 's/*/127.0.0.1/g' ++ cut -d: -f4
PORT=6379
[[ 1 -ne 0 ]]
(( i=0 ))
(( i<1 ))
PASSWORD=debug ++ discover_redis_instance 127.0.0.1 6379 debug ++ HOST=127.0.0.1 ++ PORT=6379 ++ PASSWORD=debug +++ /usr/bin/redis-cli -h 127.0.0.1 -p 6379 -a debug ping ++ ALIVE='NOAUTH Authentication required.' ++ [[ NOAUTH Authentication required. != \P\O\N\G ]] ++ return 1
INSTANCE= ++ discover_redis_rdb_database 127.0.0.1 6379 debug ++ HOST=127.0.0.1 ++ PORT=6379 ++ PASSWORD=debug +++ /usr/bin/redis-cli -h 127.0.0.1 -p 6379 -a debug ping ++ ALIVE='NOAUTH Authentication required.' ++ [[ NOAUTH Authentication required. != \P\O\N\G ]] ++ return 1
RDB_PATH= ++ discover_redis_avalable_commands 127.0.0.1 6379 debug ++ HOST=127.0.0.1 ++ PORT=6379 ++ PASSWORD=debug +++ /usr/bin/redis-cli -h 127.0.0.1 -p 6379 -a debug ping ++ ALIVE='NOAUTH Authentication required.' ++ [[ NOAUTH Authentication required. != \P\O\N\G ]] ++ return 1
COMMANDS= ++ discover_redis_avalable_slaves 127.0.0.1 6379 debug ++ HOST=127.0.0.1 ++ PORT=6379 ++ PASSWORD=debug +++ /usr/bin/redis-cli -h 127.0.0.1 -p 6379 -a debug ping ++ ALIVE='NOAUTH Authentication required.' ++ [[ NOAUTH Authentication required. != \P\O\N\G ]] ++ return 1
SLAVES=
[[ -n '' ]]
(( i++ ))
(( i<1 ))
unset
echo -n ']}' ]}+ echo ''
unset IFS