Configuring OpenNMS notifications

This is a quick howto that explains how to add NotifyMyAndroid push notifications on your OpenNMS.

It is based on the original Prowl guide available here .

Before we start, you will need:

  • Notify My Android Account (So you can get an API Key). You can register here .
  • Generate your API key on your My Account page. To get one, login with your account then go to "My Account". If you don't see an API key on the right side of the page, click on the "Generate New Key" Button and one should appear on your list.
  • Notify My Android installed on your Android device. You can get it on the Marketplace .
  • Download NMA Perl script and save it to /usr/bin/
  • You need Perl SSL encryption package to send notifications with HTTPS. The required lib names are: Crypt::SSLeay and LWP::UserAgent On Ubuntu: apt-get install libcrypt-ssleay-perl liblwp-useragent-determined-perl. On CentOS/Fedora: yum install openssl-perl.
  • Create a script named /usr/bin/ with the following content: (Remember to replace <your-api-key> with your api key)
#!/usr/bin/perl -w

my $nma = "/usr/bin/nma.html";
my $apikey = "<your-api-key>";
my $application = "OpenNMS";
my $priority = 1;
my $event = "Alert";
my $msg = "";
foreach (@ARGV) {
        $msg .= $_." ";
my $cmd = $nma." -apikey ".$apikey.
" -application=\"".$application."\" -priority=".
$priority." -event=\"".$event."\" -notification=\"".$msg."\"";
my $return = qx( $cmd );
print $return;
  • Add the following content in $OPENNMS_HOME/etc/notificationCommands.xml :
  • <command binary="true">
      <comment>send NotifyMyAndroid notifications</comment>
      <argument streamed="false">
  • Use the new notification command in your destination path