On 05.06.20 at 15:28 wrote Giacomo Gorgellino: > Hi, > > it would be highly appreciated if bareos could send notifications via > webhooks or web API. AFAIK "Messages" directive only supports email. > Can "Mail Command" be customized to use eg cURL?
Yes, this can work. Alternatively you can use after job RunScripts. If more advanced features are required, plugins can be used/created. There are already similar plugins, like https://github.com/bareos/bareos-contrib/tree/master/dir-plugins/nagios_icinga (sending a notification to Icinga after the job), ... > > Let say.. something similar to: > > Messages { > Name = webhook_ERM > Mail Command = "curl -vs -H \"Content-Type: application/json\" -X POST > -d '{\"JobName\": \"%n\", \"JobId\": \"%i\", \"ExitStatus\": \"%e\", > \"Message\": \"Job %n - id %i is ended with Exit code %e\"}' > \"http://mywebhookserver/invoke?token=supertokenhere\"" > > mail on error = [email protected] = all, !skipped, !audit > console = all, !skipped, !saved, !audit > append = "/var/log/bareos/bareos.log" = all, !skipped, !saved, !audit > catalog = all, !skipped, !saved, !audit > > } > > Can it work? > > -- > You received this message because you are subscribed to the Google > Groups "bareos-users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/bareos-users/916b2acb-c0b6-f0a3-2d00-65b0582641f6%40risorsa.com > <https://groups.google.com/d/msgid/bareos-users/916b2acb-c0b6-f0a3-2d00-65b0582641f6%40risorsa.com?utm_medium=email&utm_source=footer>. -- Jörg Steffens [email protected] Bareos GmbH & Co. KG Phone: +49 221 630693-91 http://www.bareos.com Fax: +49 221 630693-10 Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646 Komplementär: Bareos Verwaltungs-GmbH Geschäftsführer: S. Dühr, M. Außendorf, Jörg Steffens, P. Storz -- You received this message because you are subscribed to the Google Groups "bareos-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/rblq2m%241k8n%241%40ciao.gmane.io.
