Sending Veeam One Alarm Notifications using Prowl

Sending Veeam One Alarm Notifications using Prowl

I received a question from a customer last week if it was possible to send “Prowl” notifications or text messages using Veeam One by default. Now by default there is no Prowl or text message option but we support 3 things you can do with an alarm:

  • Send email notification
  • Send SNMP trap
  • Run script

It is with the last option “Run script” that we will push the Veeam One alarms using Prowl!

What do you need?

  1. Veeam One server
  2. PHP deployed on the server (explained below)
  3. Prowl script (provided below)
  4. Prowl API key configured
  5. Visual C++ Redistributable for Visual Studio 2012 Update 4

PHP installation

First you will need to install PHP 5.3 (or higher) on your Veeam One server.
There are 2 options:

  1. You can download the setup file for PHP 5.3 using PHP.net. Make sure you download the “Installer” version. The install is mostly hitting next.
    Make sure you remember the installation directory!
  2. Download PHP 5.4 (or higher) and extract the zip somewhere (eg: c:\PHP).
    Make sure you rename the default php.ini-production to php.ini. Also make sure that you enable SSL support by adding “extension=ext/php_openssl.dll” in the configuration.

Prowl PHP script

Create a file called “prowl.php” under the PHP installation directory (eg: c:\PHP) with the following code.

<?php
/* 
 * Prowl script for calling Prowl API
 */

// Change this to your API key
$apikey = "CHANGEME";

// Variabeles
$app = "Veeam One";
$title = strtoupper($argv[1]);
$priority = "2";

// Generate the event 
for ($i = 2; $i <= count($argv); $i++) {
	$event = $event . ' ' . $argv[$i];
}

$event = $title . " " . strip_tags(str_replace("'", "", trim($event)));

fopen("https://prowl.weks.net/publicapi/add?apikey=".$apikey."&application=".str_replace(" ", "%20", $app)."&title=".$title."&priority=".$priority."&event=".str_replace(" ", "%20", $event), "r");
?>

In the above code/file you will have to change 1 thing to your API key:

  • $apikey = “CHANGEME”;

You can also download the file in zip format.

If you don’t have an API key yet, go to prowlapp.com website and configure it.

Next step configuring the alarms!

Veeam One Alarm Configuration

Now open up a Veeam ONE Monitor client and head to the alarm management. Select the alarm you want to push and Edit it (double-click or right-click -> Edit) it.
Veeam ONE alarm

In this example I have used the default “VM CPU ready” alarm. Navigate to the “Actions” tab and select “Run script” underneath action. Configure it with the following configuration value:

"c:\PHP\php.exe" "c:\PHP\prowl.php" %5 %4 %2 %3

As you can see there are a few parameters defined:

  • %1 — alarm name
  • %2 — fired node name
  • %3 — triggering summary
  • %4 — time
  • %5 — alarm status
  • %6 — old alarm status

More information about this can be found in our helpcenter.

KEEP IN MIND THAT THE PHP SCRIPT USES %5 – alarm status BY DEFAULT AS TITLE!

Whenever the alarm/trigger is hit you will get an announcement via Prowl from your Veeam One server.

Prowl alerts

And that is it, you are done for this alarm. You can configure more alarms with the same action or use Powershell and configure more alarms at once. 🙂

13 thoughts on “Sending Veeam One Alarm Notifications using Prowl

Comments are closed.

Comments are closed.