Comments (15)
I'm not certain about Growl on Linux but do you have a copy of Growl running?
I know there is a Growl for Linux project ( http://mattn.github.io/growl-for-linux/ ) but I have never used it so I do not know how well it is supported. I think most people who are using this library, are running it to send messages to the OSX Growl ( http://growl.info/ ) or Growl for Windows ( http://www.growlforwindows.com/gfw/ )
This library by itself does not create the messages on your desktop, but it talks to a Growl application to display those messages.
from gntp.
Actually I do not have a copy of Growl running. My first attempt to get growl notification was following the tutorial at http://masnun.com/2013/08/18/python-sending-growl-notifications.html. Do you think that having Grow installed is a prerequisite to make gntp work?
I would like to use growl notification triggered from my ubuntu localhost targeting a windows virtual machine.
from gntp.
To send a Growl message to a different computer, you need to specify the hostname
argument, which the default "run as module" quite reasonably does not do -- it tries to send to localhost, so if you don't have a local Growl client running, it will fail.
I've tested sending Growl messages going the other way (sending a message from Linux virtual machine to Windows host), and it works:
import gntp.notifier
import logging
# enable display of debug messages
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)-10s - %(message)s')
# send a test (use IP address or hostname)
gntp.notifier.mini('foo', hostname="192.168.1.3") # target host IP address
The Windows growl settings under the Security tab need to have "Allow network notifications" on, and if the "require password" options are enabled, a password needs to be assigned in the growl "password manager", and password
must be passed as a parameter in addition to hostname
.
from gntp.
I think onionradish covered most of it. The default "run as a module" is meant as a simple check to see if it's installed correctly, but perhaps I should make the error messages more clear and add a bit of a better note in the documentation.
This library ships with a "gntp" command that you can use to send a message and check to see if it is hitting your VM correctly.
gntp -m test -H 127.0.0.1 -P password
from gntp.
@onionradish and @kfdm Thank you for your support, that helps. However I am still fighting to make it work. I guess the problem is I am not able to install growl on my windows VM, i.e. when I run the GrowlInstaller.exe it asks me for .NET version 2.0.50727 which is weird because .NET is already installed on my VM. Thus, if I try to run the example suggested by @onionradish at first seems to work but then I get a growl error:
2016-03-03 09:15:15,839 - INFO - Sending registration to 192.168.122.123:23053
2016-03-03 09:15:15,844 - DEBUG - To : 192.168.122.123:23053 <<class 'gntp.core.GNTPRegister'>>
GNTP/1.0 REGISTER NONE
Application-Name: PythonMini
Origin-Platform-Version: Linux-4.2.0-30-generic-x86_64-with-Ubuntu-15.10-wily
Origin-Software-Version: 1.0.2
Origin-Machine-Name: HP-EliteBook-Folio-9470m
Origin-Software-Name: gntp.py
Origin-Platform-Name: Linux
Notifications-Count: 1
Notification-Enabled: True
Notification-Name: Message
2016-03-03 09:15:18,847 - ERROR - Growl error
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gntp/notifier.py", line 242, in mini
result = growl.register()
File "/usr/local/lib/python2.7/dist-packages/gntp/notifier.py", line 97, in register
return self._send('register', register)
File "/usr/local/lib/python2.7/dist-packages/gntp/notifier.py", line 204, in _send
raise errors.NetworkError(exc)
NetworkError: timed out
from gntp.
So I managed to install Growl on windows10 VM. The .NET required was problematic because I had updates disabled. After re-enable them I could install .NET and Growl.
Now, I get a growl icon on my desktop and if I click on it a desktop message shows up saying: "Growl is running". However no Growl Screen appears...Is this normal? Is there another way I can access the Growl screen in order to "Allow network notifications" and "password" options? I will keep trying
from gntp.
You should address these questions to the GfW Google group - make sure that Growl for windows is running as it should first! https://groups.google.com/forum/#!forum/growl-for-windows
(try double-click on the Growl icon in the try to get settings, and then test it using the installed growlnotify tool on the windows machine... !)
from gntp.
I navigate to the folder GrowlforWindows in my cmd and then run the growlnotify.exe. After that I can write messages that appear on my desktop. So the growlnotify works. I addressed my original question the GrowlGooglegroup.
from gntp.
If you have Growl working on your Windows VM, then I suppose the next step is to make sure you can send a message from Linux. Make sure the Windows firewall is allowing messages on the Growl port (default is 23053) and that Growl is listening.
from gntp.
I managed to send desktop notification from my linux host through Ansible executing a Powershell script. But when using python I have again an error:
gntp.error.NetworkError: [Errno 104] Connection reset by peer
I changed the advanced setting for the Windows Firewall allowing port 23053 to be opened but that does not improve the situation. The main problem is that I cannot access to the Growl Screen where I can change the settings. For example I would like also to set Growl to start automatically when I log into Windows VM but I am unable to do that. Is there an alternative way to change settings (so that I can follow the tutorial at http://www.growlforwindows.com/gfw/help/#notifications) when you do not have access to Growl Screen?
from gntp.
You may be able to manipulate the growl settings directly
/Users//AppData/Local/Growl/2.0.0.0/user.config I think
Something like this
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="userSettings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<userSettings>
<setting name="AutoStart" serializeAs="String">
<value>True</value>
</setting>
<setting name="AllowNetworkNotifications" serializeAs="String">
<value>True</value>
</setting>
</userSettings>
</configuration>
from gntp.
On my windows 10 VM the file you are referring to is called Growl.exe.config
and it is under C:\Program
Files (x86)\Growl for Windows/`. I edited this file and changed to true the values:
Autostart = True
AllowNetworkNotification = True
EnableLoggin = True
I restarted the VM but I still need to click on Growl icon to start growl, and still gntp from linux host does not work...something else to change that you are aware of?
from gntp.
I'm not sure. At this point you may need to wait for a response on the GfW forum. I don't use Windows as my primary environment (and I'm still running Win7) so I'm not aware of all the nuances of Windows 10.
from gntp.
Thanks for your help..
from gntp.
If it's alright with you, I'm going to close this ticket for now while you wait to hear back from the GfW forum. If they get back to you and think it's a problem with this library, please feel free to re-open this thread :)
from gntp.
Related Issues (20)
- Disable captured logging HOT 1
- simple one liner example error HOT 4
- Cannot send notification icon HOT 7
- Logging for the gntp script is confused if ~/.gntp does not exist
- Tests failing HOT 3
- Notifying to Growl for Linux fails HOT 3
- Internal logging is invisible: suggestion to fix
- ERROR:gntp.notifier:Invalid response
- Icons on local filesystem HOT 7
- Support incoming password hashing other than MD5 HOT 3
- Timeout while loading icon HOT 3
- Some intermittent connection errors on 10.9 Mavericks (multiple errors) HOT 2
- gntp fails intermittently on OS X 10.9.0 HOT 2
- gntp fails on OS X 10.9.1 HOT 3
- ImportError: No module named gntp.notifier HOT 9
- problem when running growlnotifier HOT 3
- Seemingly unable to install with pipsi
- gntp.errors.NetworkError: [Errno 61] Connection refused HOT 1
- The message Prowl received just show one line and the newline part is gone HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gntp.