Subject: | Info hash is erroneous |
To begin with, my apologies if I sound like a n00b. This is my first time with perl.
My sysadmin was trying to use the check_redis plugin for Nagios (https://github.com/willixix/WL-NagiosPlugins/blob/master/check_redis.pl) and was using libredis-perl from Ubuntu repo (http://manpages.ubuntu.com/manpages/karmic/man3/Redis.3pm.html) but was unable to get it going as it said used_memory_rss was not found. I then installed Redis from cpan directly and got it working correctly.
I wrote a script to dump the info hash and I saw that the values and keys were swapped in many places, ie instead of key => val it had val => key. Also, some other issues were there as well like used_memory_human and used used_memory_rss values were also swapped. I've pasted the dump of the info hash below for your reference :
# CPU => used_cpu_sys
# Memory => used_memory
# Server => redis_version
# Stats => total_connections_received
0 => latest_fork_usec
0.00 => # Keyspace
0.01 => used_cpu_user_children
00000000 => redis_git_dirty
1.00M => used_memory_rss
10 => lru_clock
1048736 => used_memory_human
1203844 => # Clients
14.56 => used_cpu_sys_children
1539 => run_id
2.04 => mem_allocator
2.6.11 => redis_git_sha1
2138112 => used_memory_peak
21504 => mem_fragmentation_ratio
217 => pubsub_channels
27486 => uptime_in_days
32 => multiplexing_api
4.6.3 => process_id
436 => keyspace_misses
499.60M => used_memory_lua
523866528 => used_memory_peak_human
6379 => uptime_in_seconds
685 => total_commands_processed
7.26 => used_cpu_user
742 => instantaneous_ops_per_sec
969 => # Replication
Linux 3.2.0-49-generic-pae i686 => arch_bits
aof_base_size => 616218494
aof_buffer_length => 0
aof_current_rewrite_time_sec => -1
aof_current_size => 616290361
aof_delayed_fsync => 0
aof_enabled => 1
aof_last_bgrewrite_status => ok
aof_last_rewrite_time_sec => -1
aof_pending_bio_fsync => 0
aof_pending_rewrite => 0
aof_rewrite_buffer_length => 0
aof_rewrite_in_progress => 0
aof_rewrite_scheduled => 0
blocked_clients => 0
client_biggest_input_buf => 0
client_longest_output_list => 0
connected_clients => 1
connected_slaves => 0
d6f9369eb1a4ba773eb7e25b7b4f823b456d79c4 => tcp_port
db0 => keys=31,expires=31
epoll => gcc_version
jemalloc-3.2.0 => # Persistence
loading => 0
rdb_bgsave_in_progress => 0
rdb_changes_since_last_save => 0
rdb_current_bgsave_time_sec => -1
rdb_last_bgsave_status => ok
rdb_last_bgsave_time_sec => 0
rdb_last_save_time => 1375182815
role => master
standalone => os