Although not specific to Neo4j and this knowledge base document is provided as a convenience, if your environment has a Slack implementation, then Slack provides an API to allow you to programmatically send messags to a specific channel. This can be helpful, for example to send a message on success/failure of backup by checking the [https://neo4j.com/docs/operations-manual/3.5/backup/performing/#backup-performing-exit-codes[exit code of backup.

Using the Slack Hello World example as a starting template, one will be guided through the process of creating a Slack app and resultant WEBHOOK_URL to post messsages to.

For example on backup failure

curl -X POST -H 'Content-type: application/json' --data '{"text":"Backup Failure"}' YOUR_WEBHOOK_URL

replacing YOUR_WEBHOOK_URL with its actual value, for example the following code on a linux implementations

host=`uname -n`
time=`date`
msg="{   \"text\":  \"Backup failure on $host at $time\"   }"
curl -X POST -H 'Content-type: application/json' --data "$msg"  https://hooks.slack.com/services/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

will result in a message to your Slack channel similar to

image

Details


Author:
Dana Canzano
Applicable versions:
3.3,3.4,3.5
Keywords:
backuploggingneo4j-3.3neo4j-3.4neo4j-3.5operations