title: Redis Sentinel: Master name in notifications
body: <p>When Redis Sentinel notifies about events, it does not provide the name of the Redis master. </p>
  
  <p>An excerpt from the config:</p>
  
  <pre><code># sentinel notification-script &lt;master-name&gt; &lt;script-path&gt;
  #
  # Call the specified notification script for any sentinel event that is
  # generated in the WARNING level (for instance -sdown, -odown, and so forth).
  # This script should notify the system administrator via email, SMS, or any
  # other messaging system, that there is something wrong with the monitored
  # Redis systems.
  #
  # The script is called with just two arguments: the first is the event type
  # and the second the event description.
  </code></pre>
  
  <p>So there only is the event type (e.g. <code>+odown</code>) and the event description, which in case of <code>+odown</code> simply is <code>master</code>. Somehow I feel this is lacking important information. We do not only want to notify users that something has changed but <strong>where</strong> it changed.</p>
  
  <p>You can't register a script with additional parameters, e.g. </p>
  
  <pre><code>sentinel notification-script &lt;master-name&gt; "&lt;script-path&gt; &lt;master-name&gt;"
  </code></pre>
  
  <p>Redis will use the value as a whole and check if it exists and is executable.</p>
  
  <p>We solved this by creating small wrapper scripts, one for each master instance.</p>
  
  <pre><code>$ cat /some/path/notify-master42.sh
  #!/bin/sh
  /some/path/notify.sh master42 $1 $2
  </code></pre>
  
  <p>This wrapper script then is attached to the master:</p>
  
  <pre><code>sentinel notification-script &lt;master-name&gt; notification-script /some/path/notify-&lt;master-name&gt;.sh
  </code></pre>
  
  <p>That's a bit uncomfortable but not too bad, as long as you have a fixed number of masters and do not create them on the fly over the net.</p>
  
  <p>You can register new masters by simply interacting with the sentinel over the net. (<code>redis-cli -h &lt;host&gt; -p &lt;port&gt; sentinel whatever...</code>) But creating those wrapper scripts is more complicated. Not that this is impossible, but it feels like jumping through burning hoops for nothing.</p>
  
  <p>Is there a way to notify including master names:</p>
  
  <ul>
  <li>without patching redis</li>
  <li>without having wrapper scripts</li>
  </ul>
  
  <p>?</p>