|
Re:Wake On Lan? 2 Years, 6 Months ago
|
|
|
Hi all!
Have problem with WakeOnLan.
I have latest release of ClearOS with all updates.
I was doing step-by-step.
All setup fine, now on webconfig/system there is a Wake On Lan.
But if my computer is on sleep mode, then i cant wake it up.
Because there is a list of available computers, not list of all computers.
Even a refresh wont show me sleeping computers.
I made a little test. Wake up sleeping computer, then made refresh on webconfig page,
now this computer is in the list.
I put it back to sleep, now the computer is gone from list...
I think its a useless if i cant see sleeping computers
Maybe someone have answer, whats wrong.
Thanks for your help!
/ClearOS
PS! Sorry about my bad english
|
|
|
|
Last Edit: 2011/09/02 08:12 By heigo.
|
|
|
Re:Wake On Lan? 2 Years, 5 Months ago
|
|
|
ahorli wrote:
Hi everybody, Good news.
CC-Wakeonlan4.1 MOSTLY still works for COS51.
I'm not sure if the arp-scan works correctly but at least the information from DHCP will be found.
Any chance this add-on will be updated to work with ClearOS natively?
|
|
|
|
|
|
|
Re:Wake On Lan? 2 Years, 3 Months ago
|
|
|
ahorli wrote:
Hi everybody, Good news.
CC-Wakeonlan4.1 MOSTLY still works for COS51.
I'm not sure if the arp-scan works correctly but at least the information from DHCP will be found.
arp-scan doesn't appear to work, so devices which haven't got a DHCP assigned address won't show up. It would be a nice addition to ClearOS though if something like this was integrated into the GUI at install time.
|
|
Steve
Junior Boarder
Posts: 36
|
|
|
|
|
Re:Wake On Lan? 2 Years, 3 Months ago
|
|
Hello,
you should be aware that the original code only scans on eth0.
But you can make it scan the NICs you want.
You should know that the arp-scan routine resides in the file "/var/webconfig/apiWakeOnLan.class.php".
In line 88 can add the NIC you want to scan.
If you change line 88 to:
| Code: |
if ($shell->Execute(self::CMD_ARP_SCAN, "-ql --retry=1 -I eth1", true) == 0){
|
It will scan eth1.
For me I changed the function ScanLocalNet() in the file to the following, in order to scan eth1 and eth2:
| Code: |
public function ScanLocalNet()
{
$errno = $errstr = '';
try{
$shell = new ShellExec();
if ($shell->Execute(self::CMD_ARP_SCAN, "-ql --retry=1 -I eth1", true) == 0){
$output = $shell->GetOutput();
$lines = preg_grep("/(\d+\.\d+\.\d+\.\d+)/", $output);
foreach($lines as $line){
list($ip, $mac) = preg_split('/[\s]+/',$line);
$fp = fsockopen($ip, 80, $errno, $errstr, 1);
if ($fp) {
fclose($fp);
}
}
}
} catch (Exception $e) {
throw new EngineException($e->GetMessage(), COMMON_ERROR);
}
$results = '';
foreach($output as $line){
$results .= htmlentities($line)."\n";
}
/* comment out next line: Do not return yet scan second NIC first */
/* return nl2br($results); */
/**/
/*******Scan second NIC*****************/
$errno = $errstr = '';
try{
$shell = new ShellExec();
if ($shell->Execute(self::CMD_ARP_SCAN, "-ql --retry=1 -I eth2", true) == 0){
$output = $shell->GetOutput();
$lines = preg_grep("/(\d+\.\d+\.\d+\.\d+)/", $output);
foreach($lines as $line){
list($ip, $mac) = preg_split('/[\s]+/',$line);
$fp = fsockopen($ip, 80, $errno, $errstr, 1);
if ($fp) {
fclose($fp);
}
}
}
} catch (Exception $e) {
throw new EngineException($e->GetMessage(), COMMON_ERROR);
}
/* comment out next line it would remove the results of the first NIC scan */
/* $results = ''; */
foreach($output as $line){
$results .= htmlentities($line)."\n";
}
return nl2br($results);
}
|
Greetings
Axel
|
|
ahorli
Junior Boarder
Posts: 28
|
|
Last Edit: 2011/02/17 16:23 By ahorli.
|
|
|
Re:Wake On Lan? 2 Years, 3 Months ago
|
|
|
Thanks Axel. I'll give that a go! I have a second ClearOS machine on my network to perform backups, and it would be great if it could be woken up through the GUI as the ideal time to backup is Fridays whilst I'm at work.
|
|
Steve
Junior Boarder
Posts: 36
|
|
|
|
|
Re:Wake On Lan? 2 Years, 3 Months ago
|
|
|
Hmm still no luck. I use eth1 as my internal network (eth2 is hot lan), so modified /var/webconfig/apiWakeOnLan.class.php to add in eth1, but the backup machine disappears after it gets shut down.
Actually, I don't seem to be able to wake up any of the devices on my network from the gui, however, WOL definitely works as I can wake them up from a Windows PC. Does anything need to be done to get the magic packet sent on eth1, or is this selected automatically?
|
|
Steve
Junior Boarder
Posts: 36
|
|
|
|
|
Re:Wake On Lan? 2 Years, 3 Months ago
|
|
|
You could try if waking up works from the command line.
Use this program "/usr/bin/wakeonlan"
use wakeonlan -i IPaddress xx:xx:xx:xx:xx (=MacAddress)
Axel
|
|
ahorli
Junior Boarder
Posts: 28
|
|
|
|
|
Re:Wake On Lan? 2 Years, 3 Months ago
|
|
I have it working now, but it wouldn't work until the main ClearOS box was allowed to set the IP by DHCP. I've set it up now with a static lease and all is good 
|
|
Steve
Junior Boarder
Posts: 36
|
|
|
|
|
Re:Wake On Lan? 11 Months, 2 Weeks ago
|
|
WORKS LIKE A CHARM  )))) THX ALOT.
|
|
Makc
Senior Boarder
Posts: 46
|
|
|
|
|