Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

First, you'll want to head to Monitor Scripts in Settings so we can define the commands we'll send to Redis.

 

Image Removed

 




Click Add New Monitor Type, and give it a name to use as an identifier when we set up the monitor later on. In this example, we're sending the following commands: Image Removed


Commands:

Send single line (with \\n): AUTH password

Match Regular Expression: ^\\+OK$

These commands send and confirm that the authentication is confirmed properly (if necessary). The password can be customized on a per-monitor basis, since the script is loaded 

 


Send single line (with \\n): PING

Match Regular Expression: ^\\+PONG$

These commands confirm that the Redis server is up and running on the host. 


Send single line (with \\n): DBSIZE

Match Regular Expression: ^\\:([0-9]|[1-9][0-9]|[1-9][0-9][0-9])$

These commands will ensure that the database contains a certain amount of keys, and can be used to confirm that a background process is moving keys from Redis to less volatile storage on disk by ensuring the stored keys stay below a certain number. In this example, we are using regex to confirm that the number of keys stored is less than 1000.

 


End of Script

...


Save this script and name it accordingly, then head over to the Device Manager to set up the monitor on a device.

...

Select a device, and click the Monitors tab, then use the Add Monitor link.

 

Image Removed

...


Select TCP for the protocol, and select or enter in the IP address that you're looking to monitor. Make sure you also specify the port Redis is listening on (default being 6379). Include your notify address and desired delays and intervals.

 


The config tab will automatically load the Redis script presets. This is where you can set the password if necessary, or remove commands that are not necessary for the particular host.

 

Image Removed

...

Once done with any script customization, click the save button, and your monitor will be set up. You'll probably want to test it to ensure it's reaching Redis correctly, and if so, the test will return success for each command. You can do so by using the test link on the monitor list.