Version information
This version is compatible with:
- Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x
- Puppet >= 6.21.0 < 8.0.0
- , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppetfinland-promtotwilio', '1.1.0'
Learn more about managing modules with a PuppetfileDocumentation
promtotwilio
This Puppet module helps manage promtotwilio, which is "a simple and stupid program that will receive webhooks from Prometheus to send them as text message (using Twilio) with the summary of the alert."
Setup
You need a Twilio account and before using this module should test that you can send SMS manually, e.g. with curl.
Usage
Once the prerequisites of this module are taken care of, its usage is fairly straightforward:
class { 'promtotwilio':
sid => 'your-twilio-account-sid',
token => 'your-twilio-auth-token',
sender => 'your-twilio-phone-number',
receiver => 'phone-number-to-send-sms-to',
port => 9191,
}
You can download promtotwilio from a custom URL using the url parameter, or you can place a copy of promtotwilio on your Puppet fileserver. The source parameter defines where the Puppet File resource gets the binary from.
The default listen port, 9090, may conflict with Prometheus. If you're using unpatched version of promtotwilio then port 9090 is your only choice.
To have alerts sent via SMS you need to configure Alertmanager routes in /etc/alertmanager/alertmanager.conf. Here's a simplistic example where alerts of critical severity get routed as SMS; other alerts will use default route (e.g. email).
route:
--- snip ---
routes:
- match:
severity: critical
receiver: sms
receivers:
- name: sms
webhook_configs:
- url: http://127.0.0.1:9191/send
Dependencies
- puppetlabs/stdlib (>= 6.0.0 < 9.0.0)
Copyright 2023 Samuli Seppänen. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.