How can I monitor the status of redis server using PRTG?


Article Comments

Hi Yoyo,

Yes, Redis supports snmp monitoring.

Using PRTG's SNMP Custom Sensor and the OID's below should get you started.

.1.3.6.1.4.1.20267.400.1.1  (redisConnectedClnts)
.1.3.6.1.4.1.20267.400.1.2  (redisConnectedSlavs)
.1.3.6.1.4.1.20267.400.1.3  (redisUsedMemory)
.1.3.6.1.4.1.20267.400.1.4  (redisChangsSncLstSv)
.1.3.6.1.4.1.20267.400.1.5  (redisTotalConnectns)
.1.3.6.1.4.1.20267.400.1.6  (redisCommandsPrcssd)

Regards,


Jan, 2013 - Permalink

Hi unfortunately i cant make it work :

Apples-iMac:~ Apple$ snmpwalk -v 2c -c 209ijvfwer0df92jd -O e 46.4.255.57 .1.3.6.1.4.1.20267.400

SNMPv2-SMI::enterprises.20267.400 = No Such Object available on this agent at this OID

Whats wrong ?

ty


Sep, 2014 - Permalink

Hi! Same error here. We are using Redis Version 2.6.16

Any clues how to get this working?

Thanks in advance!

Matze


Apr, 2015 - Permalink

Hi,

The steps needed for Linux are:

  1. Make sure you have the snmpd running on the server where redis is
  2. Install the snmp-redis from here https://github.com/masterzen/redis-snmp (has perl dependencies)
  3. Put the REDIS-SERVER-MIB.txt to a proper location depending on your distro
  4. Start snmp-redis daemon
  5. Restart snmpd

You should be able to get the data now: # snmpbulkwalk -m 'REDIS-SERVER-MIB' -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.20267.400 REDIS-SERVER-MIB::redisConnectedClients.0 = Gauge32: 1 REDIS-SERVER-MIB::redisConnectedSlaves.0 = Gauge32: 0 REDIS-SERVER-MIB::redisUsedMemory.0 = Counter64: 41466936 Bytes REDIS-SERVER-MIB::redisChangesSinceLastSave.0 = Gauge32: 0 REDIS-SERVER-MIB::redisTotalConnections.0 = Counter64: 766351 REDIS-SERVER-MIB::redisCommandsProcessed.0 = Counter64: 8406408 REDIS-SERVER-MIB::redisCPUSys.0 = Counter32: 86891 REDIS-SERVER-MIB::redisCPUUsr.0 = Counter32: 17685 REDIS-SERVER-MIB::redisBlockedClients.0 = Gauge32: 0 REDIS-SERVER-MIB::redisEvictedKeys.0 = Counter64: 0 REDIS-SERVER-MIB::redisExpiredKeys.0 = Counter64: 75385 REDIS-SERVER-MIB::redisKeyspaceHits.0 = Counter64: 6683851 REDIS-SERVER-MIB::redisKeyspaceMisses.0 = Counter64: 574268 REDIS-SERVER-MIB::redisPubsubChannels.0 = Gauge32: 0 REDIS-SERVER-MIB::redisPubsubPatterns.0 = Gauge32: 0 REDIS-SERVER-MIB::redisUptime.0 = Gauge32: 8845840 Seconds REDIS-SERVER-MIB::redisUsedMemoryRss.0 = Wrong Type (should be Counter64): Gauge32: 20766720

You can use -O n switch to return raw OIDs: # snmpbulkwalk -m 'REDIS-SERVER-MIB' -v 2c -O n -c public 127.0.0.1 .1.3.6.1.4.1.20267.400 .1.3.6.1.4.1.20267.400.1.1.0 = Gauge32: 1 .1.3.6.1.4.1.20267.400.1.2.0 = Gauge32: 0 .1.3.6.1.4.1.20267.400.1.3.0 = Counter64: 41466936 Bytes .1.3.6.1.4.1.20267.400.1.4.0 = Gauge32: 0 .1.3.6.1.4.1.20267.400.1.5.0 = Counter64: 766351 .1.3.6.1.4.1.20267.400.1.6.0 = Counter64: 8406408 .1.3.6.1.4.1.20267.400.1.7.0 = Counter32: 86891 .1.3.6.1.4.1.20267.400.1.8.0 = Counter32: 17685 .1.3.6.1.4.1.20267.400.1.9.0 = Gauge32: 0 .1.3.6.1.4.1.20267.400.1.10.0 = Counter64: 0 .1.3.6.1.4.1.20267.400.1.11.0 = Counter64: 75385 .1.3.6.1.4.1.20267.400.1.12.0 = Counter64: 6683851 .1.3.6.1.4.1.20267.400.1.13.0 = Counter64: 574268 .1.3.6.1.4.1.20267.400.1.14.0 = Gauge32: 0 .1.3.6.1.4.1.20267.400.1.15.0 = Gauge32: 0 .1.3.6.1.4.1.20267.400.1.16.0 = Gauge32: 8845840 Seconds .1.3.6.1.4.1.20267.400.1.17.0 = Wrong Type (should be Counter64): Gauge32: 20766720

Last but not least - make sure that the PRTG can access the SNMP port on the redis machine, check you firewall settings.

Use the PRTG custom sensor with the OIDs provided to get the data you want.

Good luck!

Arek


May, 2015 - Permalink

Old post I know but if you wanted to use PRTGs library just add this as a .oidlib to your snmplibs folder.

<?xml version="1.0" encoding="UTF-8"?>
<oidlist>
	<system>
		<version>2</version>
	</system>
	<list>
		<entry>
		<name>REDIS-SERVER-MIB|redis status|redis connected clients</name>
		<lookupname/>
		<oid>1.3.6.1.4.1.20267.400.1.1.0</oid>
		<type>vmAbsolute</type<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis connected clients</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>no</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>The number of clients connected to this server</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis connected slaves</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.2.0</oid>
			<type>vmAbsolute</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis connected slaves</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>no</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>The number of slaves connected to this server</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis used memory</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.3.0</oid>
			<type>vmAbsolute</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis used memory</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>no</is64bit>
			<isunsigned>no</isunsigned>
			<isfloat>no</isfloat>
			<description>The number of bytes allocated by redis</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis changes since last save</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.4.0</oid>
			<type>vmAbsolute</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis changes since last save</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>no</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>The number of changes since last BGSAVE</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis total connections</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.5.0</oid>
			<type>vmDiff</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis total connections</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>yes</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>The number of connections since server start</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis commands processed</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.6.0</oid>
			<type>vmDiff</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis commands processed</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>yes</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>The number of commands served since server start</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis cpu sys</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.7.0</oid>
			<type>vmDiff</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis cpu sys</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>no</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>The number of 1/100 s spent running redis sys code on the CPU</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis cpu usr</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.8.0</oid>
			<type>vmDiff</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis cpu usr</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>no</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>The number of 1/100 s spent running redis user code on the CPU</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis blocked clients</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.9.0</oid>
			<type>vmAbsolute</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis blocked clients</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>no</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>The number of clients pending on a blocking call (BLPOP, BRPOP, BRPOPLPUSH).</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis evicted keys</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.10.0</oid>
			<type>vmDiff</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis evicted keys</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>yes</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>Number of evicted keys due to maxmemory limit.</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis expired keys</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.11.0</oid>
			<type>vmDiff</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis expired keys</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>yes</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>Total number of key expiration events.</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis keyspace hits</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.12.0</oid>
			<type>vmDiff</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis keyspace hits</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>yes</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>Number of successful lookup of keys in the main dictionary.</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis keyspace misses</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.13.0</oid>
			<type>vmDiff</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis keyspace misses</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>yes</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>Number of failed lookup of keys in the main dictionary.</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis pubsub channels</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.14.0</oid>
			<type>vmAbsolute</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis pubsub channels</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>no</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>Global number of pub/sub channels with client subscriptions.</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis pubsub patterns</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.15.0</oid>
			<type>vmAbsolute</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis pubsub patterns</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>no</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>Global number of pub/sub patterns with client subscriptions.</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis uptime</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.16.0</oid>
			<type>vmAbsolute</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis uptime</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>no</is64bit>
			<isunsigned>yes</isunsigned>
			<isfloat>no</isfloat>
			<description>Uptime of the redis server, in seconds.</description>
		</entry>
		<entry>
			<name>REDIS-SERVER-MIB|redis status|redis used memory rss</name>
			<lookupname/>
			<oid>1.3.6.1.4.1.20267.400.1.17.0</oid>
			<type>vmAbsolute</type>
			<kind>mkDirect</kind>
			<unittype>sutCustom</unittype>
			<units>#</units>
			<indicator>redis used memory rss</indicator>
			<scale>1</scale>
			<multiply>no</multiply>
			<max>0</max>
			<usegetnext>no</usegetnext>
			<is64bit>no</is64bit>
			<isunsigned>no</isunsigned>
			<isfloat>no</isfloat>
			<description>Number of bytes that Redis allocated as seen by the operating system (a.k.a resident set size). This is the number reported by tools such as top and ps.</description>
		</entry>
		</list>
		<lookups/>
	</oidlist>

May, 2016 - Permalink

For people that are reading this thread. In the mean while someone made a custom sensor that can be used, much easier too:

Also it doesn't depend on the redis-snmp which doesn't seem to be maintained anymore (source is 6 years old).


Jan, 2018 - Permalink

Hello GuiltyNL,

Many thanks for your reply and for sharing the custom sensor!

Best Regards,
Luciano Lingnau [Paessler Support]


Jan, 2018 - Permalink

Hello there,
thank you for your KB-Post.

There are basically two approaches to monitor Redis using PRTG:

Using SNMP

While it is possible to use SNMP, keep in mind however that as mentioned by GuiltyNL, redis-snmp is no longer maintained and over 6 years old. Alternatively, it's possible to use the custom-script alternative below.

Custom Script

Best Regards,
Luciano Lingnau [Paessler Support]


Jan, 2018 - Permalink