From OpenNMS
HOWTO: Notification using Prowl
If you´re a lucky user of an iPhone or an iPod Touch you can configure notifications with Prowl. The result for notification looks like this:
Thank you to Michaels Blog and Alex.
To configure this kind of notification the following steps are necessary:
- Create Prowl account
- Generate API Key
- Buy the Prowl App from iTunes AppStore and install it on your iPhone or iPod Touch
- Download the Prowl Perlscript and save it in /usr/bin/prowl.pl
- Create an OpenNMS wrapper script in /usr/bin/opennms-prowl.pl
- You need Perl SSL encryption package to send notifications with HTTPS, on an Ubuntu Box use apt-get install libcrypt-ssleay-perl
- Create an OpenNMS Notification Command in $OPENNMS_HOME/etc/notificationCommands.xml
- Use the new notification command in your destination path
- Add your Prowl mail address in your opennms user field Pager Email
OpenNMS wrapper script
file:/usr/bin/opennms-prowl.pl
#!/usr/bin/perl -w
my $prowl = "/usr/bin/prowl.pl";
my $apikey = "<your-api-key>";
my $application = "OpenNMS";
my $priority = 1;
my $event = "Alert";
my $msg = "";
foreach (@ARGV) {
$msg .= $_." ";
}
my $cmd = $prowl." -apikey ".$apikey.
" -application=\"".$application."\" -priority=".
$priority." -event=\"".$event."\" -notification=\"".$msg."\"";
my $return = qx( $cmd );
print $return;
Notification command
Add this new notification command in $OPENNMS_HOME/etc/notificationCommands.xml
<command binary="true">
<name>notifyProwl</name>
<execute>/usr/bin/opennms-prowl.pl</execute>
<comment>send Prowl notifications</comment>
<argument streamed="false">
<switch>-pemail</switch>
</argument>
<argument streamed="false">
<switch>-subject</switch>
</argument>
</command>
Restart OpenNMS and have fun with your new notification method.








