notify-send over the network

Forum regarding Linux Software and Home Automation Domotica.

notify-send over the network

Postby Kroonen » Wed Dec 30, 2009 11:00 pm

Hi,

My heyu engine is running on a small server without X.

Now I let for some actions execute some launch scripts. Tis works ok, but what i want is to receive the the output of a scripts directly on my laptop, so I know what happens.

I;m looking for a tool to do that, I first tried xosd, but with executing remote ssh scripts it's very slow, after about 5 a 10 seconds he shows that for examplethe lamp is on.

I also tried locally notify-send, that is very nice and handy, but the same problem here, how can I send the message over the network.I Did a search on the web but the most scripts are not working.

So what i want, that heyu starts a scripts (notify-send "lamp on") and the result must show in my notify (libnotify?) on my laptop (logged in as richard) on X

Any ideas how to accomplish this?

regards Richard
Kroonen
Member
Member
 
Posts: 302
Joined: October 2007
Location: Netherlands

Re: notify-send over the network

Postby LostDreamer » Sat Jan 02, 2010 4:13 pm

My first try would be:
Run a service on the laptop that listens to a socket connection on a certain port
Have the server then open a socket connection to that port, send the data through (lamp on) and disconnect from the socket.

If you don't want to write your own program for this, or don't want to spend to much time looking for a program that does just that,
you could go for a webservice on the laptop and have the server open a webpage on the laptop ( http://laptop/status.php?device=lamp&status=on )

In the status.php you could do something like:
Code: Select all
<?php
if( isSet($_GET['device']) && isSet($_GET['status'])) {
   exec("/usr/bin/someprogram ". $_GET['device'] ."-". $_GET['status'] ." > /dev/null &");
   }
?>

This would start a program in the background with your device / status as parameters... On the laptop ofcourse.

Hope this gets you on the way.
LostDreamer
Member
Member
 
Posts: 73
Joined: April 2009
Location: Netherlands


Return to Linux Forum

Who is online

Users browsing this forum: No registered users and 1 guest