Setup vCenter Alarm Action Script To Send Push Notifications

I recently came across this useful app, It’s a service that allows you to send and receive real-time alerts as push notifications on your iOS and Android device. I was impressed with how simple it was to set up and use, and it’s free for up to 100 notifications per day. I figured this could be useful to integrate with vCenter alarms, so I’ll guide you through setting this up in this post.

Step 1

First, you will need to download on your mobile device, which can be found here and sign up for a free account. Once you are signed in, you will need to take note of your Account key, you will need that in Step 2.

Step 2

Next you will need to download the following script and upload it to your VCSA Appliance, (I stored script it in /root). Alternatively you can run this wget command from your VCSA to download the script directly to the /root directory.

wget -P /root

At the minimum, you will need to update line 7 with your Alertzy account key. You can also change the title and folder name if you wish. The folder name is just a way to organise and group the alerts within the Alertzy app.

From lines 11-15, you can see I have added 5 alarm environmental variables, you can modify this to your desired state, check out this VMware document Environment Variables for Scripts to view all the other available environmental variables you can use in your scripts and this document on running a script or a Command as an Alarm Action.

Sample of the script below
# Author: Nicholas Mangraviti
# Website:
# Description: Sends vCenter Alarm Push notifications using
# Reference:

key="b40i57zzzzzzwq9" # Update this with your own Alertzy Account Key
title="vCenter Alarm"


curl -s \
    --form-string "accountKey=$key" \
    --form-string "title=$title" \
    --form-string "message=$text" \
    --form-string "group=$folder" \

Note: I’m not great with bash scripts so feel free to improve it šŸ™‚

Now set the script to be executable by running the following command.

chmod +x

At this point, you could execute the script via SSH to confirm it works and that you receive a push notification on your mobile device. Run the following command from within the /root directory to do this.


If everything works as it should, you should see a success response and instantly receive a push notification on your mobile device.

Step 3

You now need to add an alarm action to run the script. In this example, I will modify one of the default alarms, “Host connection and power state” I will then simulate a host failure on one of my Nested ESXi hosts to see if it works. Select the alarm and press EDIT.

Toggle the switch “Run script” and paste the following code, then press next until you review and save. I haven’t tested this, but you should be able to configure the same script for the reset rule.


Step 4

Now it’s time to simulate a host failure by suspending the ESXi VM; when the host went into a “Not responding” state, an event triggered, stating it ran the script.

I instantly received the following push notification on my phone and my Apple Watch.

And this is what the alert looks like from within the app.

So as you can see, it’s pretty simple to set up, and there are many other use cases; I’m also using Alertzy to monitor my internet connection. Alertzy has stated to contact them if you need a higher quoter than 100 notifications per day.

Another app I found is, which offer 10 free notifications per day with a cost-effective premium option offering unlimited notifications.

Thank you for reading; as always, feel free to comment below šŸ™‚

2 comments Add yours
  1. This is a great source of information on how to set up an alarm action script to send push notifications. Source information includes installing the vCenter server, configuring the notification channel, configuring the notification message template, configuring the notification channel, configuring alarms and the notification event type, and configuring operational level for notifications.

Leave a Reply