August 15, 2017

setting custom alerts on any device using pushbullet

pushbullet.com lets you send API based notification/alerts.

Start with creating a Pushbullet account. Install the app on your phone. Go to the pushbullet website, head to "My Account" and then create an access token. Note this token.

The below python code can then be used to send a notification to all your registered devices.

def send_message(title, msg):
    url = "https://api.pushbullet.com/v2/pushes"
    headers = {'Content-Type': 'application/json',
               "Access-Token": access_token}
    data = json.dumps({
        "type": "note",
        "title": title,
        "body": msg
    })
    requests.post(url, data=data, headers=headers)

My use case was this python script that generates buy and sell alerts on my mobile phone based on pre-configred prices in a csv sheet.

But there is no reason this cannot be used to get datacenter alerts. I plan to include this as a library method in Cisco Ucs SDKs soon.

note: You might need to signout and sign back in one time after you install the app for the alerts to start showing up.

  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pinterest
  • Pocket