Jump to content
Paul

Notification Bridge

Recommended Posts

Hi everyone,

Use this plugin to open up a local WCF using net pipes so that a console application can use it to sent notifications to Pulseway. Using this solution you can easily send Pulseway notifications from your scripts.

Version 1.2

=Installation=

  1. Add the NotificationBridgePlugin.dll plugin into Pulseway Manager -> Plugins.
  2. Configure your scripts to call NotificationBridge console application.

=Usage=

NotificationBridge.exe -p 1 -t "message"

or

NotificationBridge.exe -p 2 -f "C:\log.txt" 

Exit Codes:

  • 0 - Notification was successfully forwarded to Pulseway
  • 1 - Notification was rejected by Pulseway (Maintenance mode, Old notification was not deleted, Pulseway is stopped.

As always my plugin is open-source bound by no license. You may claim it your own.

Source Code: https://bitbucket.org/paulcsiki/notification-bridge-plugin/src

Download Link: Click

Paul.

Share this post


Link to post
Share on other sites

Great plugin Paul!

 

It would be perfect if you can add in one of the next versions the options   <message priority>, <message subject> <message text> optional <message file>   like:

 

NotificationBridge.exe -p 1 -s "Backupjob Success" -t "1248 MB saved"

or

NotificationBridge.exe -p 3 -s "Backupjob Error" -f "c:\batch\backup.log"

(-p 0=Low, 1=Normal, 2=Elevated, 3= Critical). Repeating notifications should be possible.

 

This Syntax will give script or batchfiles in combination with variables a optimal notification System!

 

I do this currently via EventCreate command and PCM Event Log notification but your NotificationBridge plugin would be more sexy ;-)

 

Lg. Sepp

Share this post


Link to post
Share on other sites

Great plugin Paul!

 

It would be perfect if you can add in one of the next versions the options   <message priority>, <message subject> <message text> optional <message file>   like:

NotificationBridge.exe -p 1 -s "Backupjob Success" -t "1248 MB saved"

or

NotificationBridge.exe -p 3 -s "Backupjob Error" -f "c:\batch\backup.log"

(-p 0=Low, 1=Normal, 2=Elevated, 3= Critical). Repeating notifications should be possible.

 

This Syntax will give script or batchfiles in combination with variables a optimal notification System!

 

I do this currently via EventCreate command and PCM Event Log notification but your NotificationBridge plugin would be more sexy ;-)

 

Lg. Sepp

 

Sorry about the late reply. What do you mean about the message file. Would you like me to open the file and append it's contents to the notification?

Share this post


Link to post
Share on other sites

correct,, eg. to send the result of a command in a script to the notification queue like

 

netstat > c:\temp\netstat.log

notificationbridge.exe -p 0 -s "Netstat resut" -f "c:\temp\netstat.log"

 

(date, time, computer and group should be includet in the notification)  

Share this post


Link to post
Share on other sites

Just stumpled upon this plugin.

It has great potentials!

 

I would be nice it were possible to set the notifigation level, so it could be anything else than normal.

If I send an notification, all other notifications are ignores until the first notification has been removed. It would be better if it was possible to group them, so it was only the same notifications that was ignored.

 

Br, Martin.

Share this post


Link to post
Share on other sites

What an awesome idea Paul. Being able to have applications that aren't natively supported by Pulseway send notifications through it is a great idea to keep all monitoring consolidated in the one app.

I've given it a try and it hasn't worked for me. I just get the message "Pulseway refused the notification". The command I ran was 'notifictionbridge.exe -p 1 -t "message"', and Windows version is Server 2008 (6.0.6002).

Any tips for fixing this would be appreciated.

Share this post


Link to post
Share on other sites

Hi,

Thank you for using my plugin. I think that the plugin worked once and then it stopped working because you didn't delete the first notification you've triggered. When I wrote the plugin I didn't mark the notification as repeatable to prevent scripts from spamming the Pulseway service.

One could always modify the following line:

https://bitbucket.org/paulcsiki/notification-bridge-plugin/src/860e9fb9c857a0b7f7164062e72c3c9f323b8356/Source/NotificationBridgePlugin/NotificationBridgeService.cs?at=master&fileviewer=file-view-default#NotificationBridgeService.cs-45

Here is the full method signature that Pulseway exposes for plugins:

bool SendNotificationToAllDevices(string message, NotificationPriority priority, bool allowMultipleNotifications = false)

As you may have guessed, the last parameter if set to true, Pulseway will allow repeated notifications for the NotificationBridge plugin.

Paul

Share this post


Link to post
Share on other sites

I'm getting an error when trying to invoke this plugin.

 

C:\Program Files\Pulseway>NotificationBridge.exe -p 1 -t "test"
There was no endpoint listening at net.pipe://localhost/NotificationBridge that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

Share this post


Link to post
Share on other sites

Hi,

Have you installed the plugin in Pulseway Manager -> Plugins ? Is the Pulseway service started? Try restarting the Pulseway service.

Paul

Share this post


Link to post
Share on other sites

Hi, the plugin is installed, yet same problem!

The service would not let me restart it, but I did restart the whole computer, same problem.

Also, could you release the file with the multiple notifications allowed to be sent?

bool allowMultipleNotifications = false

 Recompiling the code with those changes is beyond my skills

 

Thanks

Share this post


Link to post
Share on other sites

Hi,

I still believe that the plugin is not correctly installed. I will update the plugin tonight to support repeating notifications.

Edit: I've updated the first post with a new version of the plugin that supports repeating notifications, try again with the version 1.2 and see if you still get connection errors.

Paul

Edited by Paul

Share this post


Link to post
Share on other sites

Hi Paul,

Any chance of a Linux version of this excellent plugin ?

I'm working with more and more Linux based systems now and find the Linux agent lacking when compared to the Windows version. There are a number of ways we could create custom notifications on Windows but cannot find any way to do it on Linux systems.

Thanks.

Kelvin

Share this post


Link to post
Share on other sites

Hi Kelvin,

Thank you for your feedback. We do plan on having support for sending notifications from the command line on Linux too.

Chris

Share this post


Link to post
Share on other sites

Hi Chris,

Thanks for the reply. Any timeline on this ? Might save me the effort of looking at alternatives in the interim because realistically, the current limitation is a big issue for us.

Regards,

Kelvin

Share this post


Link to post
Share on other sites

Hi Kelvin,

Unfortunately we don't have any ETA for the Linux port of the notification bridge plugin. We apologize for the inconvenience.

Chris

Share this post


Link to post
Share on other sites

Hello Paul, i know it's been a while but I tried to use your notification plugin but it sends multiple notifications. So I've jumped into the code and modified it with "false" and tried to use "notification id" so that it's always the same ... and it still allows multiple notifications. I've added -m  -i parameters to your notifications.exe to support this and added nessecary changes to plugin itself but fort some reason it just displays all that is coming. Did something change? Could you update your code to support "choice"? it used to be do not allow multiple notifications but now it's different. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×