Notifier is a Python messaging gateway, that can be used as a Python module or standalone CLI script. Messages can be sent to either SMTP email server or the notification service PushOver
Download and unpack notifier.py to the /usr/local/bin
folder.
cp notifier.py /usr/local/bin
chmod 755 /usr/local/bin/notifier.py
Copy etc/notifier.conf to the /etc/
directory
cp notifier.conf /etc
Edit the /etc/notifier.conf file and add your SMTP Email and notification service settings.
You can send a message to both email and push notification via the CLI by using the following format
python notifier.py -s Subject -m Message to send
To use within Python simple place notifier.py within your project and use the following code example
# Notifier
import notifier
# Config
import ConfigParser
# Use your own application based config file
config_file = '/etc/myApp.conf'
# Create your message
message = "This is the message I wish to send \n"
# Set the Config
notifier.setConfig(config)
# Set the Message
notifier.setMessage(message)
# Send the Message to email and notification service
notifier.sendMessage()