alertnotify, so bitcoind users can get email/sms/whatever of alerts #2385

pull gavinandresen wants to merge 3 commits into bitcoin:master from gavinandresen:alertnotify changing 6 files +221 −4
  1. gavinandresen commented at 6:15 PM on March 19, 2013: contributor

    This gives people running bitcoind a way of getting alerts in a timely manner, instead of needing to poll with "getinfo" and parse the "errors" array.

    Example usage in a bitcoin.conf:

    alertnotify=echo %s | mail -s "URGENT: bitcoind alert" admin@service.com
    

    The command string is passed to the shell, with %s replaced by the alert message enclosed in single quotes.

  2. Some unit tests for CAlert 1472308d67
  3. petertodd commented at 7:04 PM on March 19, 2013: contributor

    We really need a -setalertkey option to use a non-standard alert key for testing, along with tools to create alert messages. Make CAlert::CheckSignature() use a single pszAlertKey and then set that key appropriately at startup, as well as have a contrib/alerts directory with some simple Python scripts to create alerts. It'd let the unit tests include actual alerts with a known testing key too.

  4. -alertnotify=<cmd>
    Runs a shell command when an AppliesToMe() alert is received.
    %s in the <cmd> string is replaced with the alert.strStatusBar
    message.
    e5f163a041
  5. gavinandresen commented at 7:19 PM on March 19, 2013: contributor

    @petertodd : good idea. That can be done in a subsequent pull.

    Reworked/rebased to whitelist the characters in the alert message, as suggested by @jgarzik.

  6. jgarzik commented at 7:21 PM on March 19, 2013: contributor

    ACK, though I wonder about the conditions of when fThread is true or false (and alertnotify will be in a free thread, or not)

  7. gavinandresen commented at 7:48 PM on March 19, 2013: contributor

    fThread == false was implemented just so the unit test doesn't have to Sleep() and keep it's fingers crossed that it waited long enough for the thread to finish.

    Normally fThread is true, so the main event processing loop doesn't wait.

  8. mikehearn commented at 12:51 PM on March 21, 2013: contributor

    You should mention it in the warning that's printed if you don't have a bitcoin.conf (with a username/password). That way people who are setting up Bitcoin for the first time are guaranteed to see it and consider using it.

  9. Recommend alertnotify 3d9d2d423b
  10. BitcoinPullTester commented at 6:58 AM on March 25, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/3d9d2d423bbdf97ef729b8c4a2dddc30a01e1415 for binaries and test log.

  11. laanwj commented at 8:45 AM on March 29, 2013: member

    ACK

  12. jgarzik referenced this in commit 8455310a7b on Mar 29, 2013
  13. jgarzik merged this on Mar 29, 2013
  14. jgarzik closed this on Mar 29, 2013

  15. gavinandresen deleted the branch on Nov 4, 2013
  16. laudney referenced this in commit 7c10da29ba on Mar 19, 2014
  17. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me