• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

WOL and Task doesn't work

Scheduled Pinned Locked Moved
FOG Problems
4
32
67.8k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    theleftfoot
    last edited by May 19, 2014, 3:29 PM

    guys need your help,

    after a busy weekend with upload our whole it infrastruktur and image upload i foud out that “wake on lan” and the task function didn’t work! :eek:

    i’m shocked…

    i tried almost all WOL work arrounds but still no clue! i changed the switch, disable spanning tree, new installation and configuration of etherwake and so on and on…

    wol.php
    [CODE]
    <?php
    // Require FOG Base
    require(‘…/commons/base.inc.php’);
    try
    {
    $MACAddress = new MACAddress($REQUEST[‘wakeonlan’]);
    if ($MACAddress->isValid())
    {
    $wol = new WakeOnLan($MACAddress->getMACWithColon());
    $wol->send();
    }
    else
    throw new Exception(
    (‘Invalid MAC Address!’));
    }
    catch (Exception $e){print $e->getMessage();}
    [/CODE]

    can someone help out to indentifiy the problem?

    thanks raffa

    FOG 1.1.2
    Ubuntu 12.10
    VMWare 5.5 Up1

    1 Reply Last reply Reply Quote 0
    • J
      Junkhacker Developer
      last edited by May 19, 2014, 4:48 PM

      does WOL work if you run it from a different computer on your lan? i suspect the network is the issue, not fog.
      you can use this to test [url]http://www.nirsoft.net/utils/wake_on_lan.html[/url]

      signature:
      Junkhacker
      We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

      1 Reply Last reply Reply Quote 0
      • T
        theleftfoot
        last edited by May 20, 2014, 8:03 AM

        i will test all your opinion and come back…thanks

        btw; did i see the command that WOL send on the apache.log?

        cheers raffa

        FOG 1.1.2
        Ubuntu 12.10
        VMWare 5.5 Up1

        1 Reply Last reply Reply Quote 0
        • R
          Raff
          last edited by May 20, 2014, 9:02 AM

          Some things to check:

          1. Check WOL is enabled in BIOS
          2. Check WOL is enabled for the network card in windows.

          If the computer is Windows 8. WOL from S4 or S5 is unsupported, see [url]http://support.microsoft.com/kb/2776718[/url]

          1 Reply Last reply Reply Quote 0
          • T
            theleftfoot
            last edited by May 20, 2014, 9:03 AM

            i tested WOL with the nirsoft tool and it worked!

            @raff; these are the basic things, that i done befror…

            now, where to start the troubleshoothing?

            raffa

            FOG 1.1.2
            Ubuntu 12.10
            VMWare 5.5 Up1

            1 Reply Last reply Reply Quote 0
            • R
              Raff
              last edited by May 20, 2014, 9:09 AM

              Is the fog server on same VLAN as the clients?

              1 Reply Last reply Reply Quote 0
              • T
                theleftfoot
                last edited by May 20, 2014, 9:18 AM

                yes, default vlan 1 --> all access ports.

                FOG 1.1.2
                Ubuntu 12.10
                VMWare 5.5 Up1

                1 Reply Last reply Reply Quote 0
                • R
                  Raff
                  last edited by May 20, 2014, 9:26 AM

                  Put Wireshark on a client and start monitoring, send the packet from fog server to check if it receives it.

                  1 Reply Last reply Reply Quote 0
                  • T
                    theleftfoot
                    last edited by May 20, 2014, 10:01 AM

                    i dind’t receive any WOL Magic packets on wireshark.

                    i send a wake up call to a notebook in the same network and this worked great.
                    the protocol WOL was visible on wireshark…

                    can you show me a working WOL.php? i leave the wol.php as it is out of the box…should i configure something?

                    thanks raffa

                    FOG 1.1.2
                    Ubuntu 12.10
                    VMWare 5.5 Up1

                    1 Reply Last reply Reply Quote 0
                    • T
                      Tom Elliott
                      last edited by May 20, 2014, 10:26 AM

                      The very one in your FOG server IS a working wol.php file.

                      I just tested, across VLAN’s even and all worked perfectly. I started a LAB of 32 systems with no issues.

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                      1 Reply Last reply Reply Quote 0
                      • T
                        theleftfoot
                        last edited by May 20, 2014, 10:29 AM

                        thanks tom, but the server doesn’t send any WOL packets! i don’t know where to start with trouble shooting…i think my network, is correct…

                        maybe something with DNS, cause i have still the problem with the unresolved host names…

                        FOG 1.1.2
                        Ubuntu 12.10
                        VMWare 5.5 Up1

                        1 Reply Last reply Reply Quote 0
                        • T
                          Tom Elliott
                          last edited by May 20, 2014, 11:02 AM

                          If you need to see things, remember WOL packets are magic like. There’s not really a DNS setup for them as it WOL assumes the systems is either up or down based on the MAC Address. FOG uses Port UDP 9 if it’s of any help to you.

                          There are three files dealing with WOL in general with fog.

                          First: fog/wol/wol.php
                          [php]<?php
                          // Require FOG Base
                          require(‘…/commons/base.inc.php’);
                          try
                          {
                          $MACAddress = new MACAddress($REQUEST[‘wakeonlan’]);
                          if ($MACAddress->isValid())
                          {
                          $wol = new WakeOnLan($MACAddress->getMACWithColon());
                          $wol->send();
                          }
                          else
                          throw new Exception(
                          (‘Invalid MAC Address!’));
                          }
                          catch (Exception $e){print $e->getMessage();}[/php]
                          Second: fog/lib/fog/FOGCore.class.php Lines: 264-268
                          [php] public function wakeOnLAN($mac)
                          {
                          // HTTP request to WOL script
                          $this->fetchURL(sprintf(‘http://%s%s?wakeonlan=%s’, $this->getSetting(‘FOG_WOL_HOST’), $this->getSetting(‘FOG_WOL_PATH’), ($mac instanceof MACAddress ? $mac->getMACWithColon() : $mac)));
                          }
                          [/php]
                          Third (the important one) is the WakeOnLan.class.php in lib/fog.
                          [php]<?php
                          /** \class WakeOnLan
                          Builds the magic packet needed for waking systems from LAN.
                          */
                          class WakeOnLan
                          {
                          private $strMac;

                          /** __construct($mac)
                              Stores the MAC of which to system to wake.
                          */
                          public function __construct( $mac )
                          {   
                              $this->strMac = $mac;
                          }   
                          
                          /** send()
                              Creates the packet and sends it to wake up the machine.
                          */
                          public function send()
                          {   
                              if ( $this->strMac != null )
                              {   
                                  $arByte = explode(':', $this->strMac);
                          
                                  $strAddr = null;
                          
                                  for ($i=0; $i<count( $arByte); $i++) 
                                      $strAddr .= chr(hexdec($arByte[$i]));
                          
                                  $strRaw = null;
                                  for ($i=0; $i<6; $i++) 
                                      $strRaw .= chr(255);
                          
                                  for ($i=0; $i<16; $i++) 
                                      $strRaw .= $strAddr;
                          
                                  $soc = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
                                  if ( $soc !== FALSE )
                                  {   
                                      if(socket_set_option($soc, SOL_SOCKET, SO_BROADCAST, TRUE)) 
                                      {   
                                          if( socket_sendto($soc, $strRaw, strlen($strRaw), 0, "255.255.255.255", 9) ) 
                                          {   
                                              socket_close($soc);
                                              return true;
                                          }   
                                          else 
                                              return false;    
                                      }   
                                      else
                                          new Exception( "Failed to set option!");    
                                  }   
                                  else
                                  {   
                                      $errCd = socket_last_error();
                                      $errMsg = socket_strerror($errCd);
                                      throw new Exception( "Socket Error: $errCd :: $errMsg" );
                                  }
                              }
                              return false;
                          }
                          

                          }[/php]

                          Hopefully this makes sense, but I assure you, it does work.

                          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                          1 Reply Last reply Reply Quote 0
                          • T
                            theleftfoot
                            last edited by May 20, 2014, 1:06 PM

                            yepp, have the same files…i don’t know whats wrong…apart from mine WOL problem the “active task” didn’t work aswell…:-(

                            [CODE][Tue May 20 10:47:29 2014] [error] [client 192.168.17.51] PHP Fatal error: Call to a member function mainMenu() on a non-object in /var/www/fog/management/index.php on line 72, referer: http://192.168.17.20/fog/management/
                            [Tue May 20 10:54:52 2014] [error] [client 192.168.1.12] PHP Fatal error: Call to a member function get() on a non-object in /var/www/fog/lib/pages/DashboardPage.class.php on line 30, referer: http://192.168.1.1/fog/management/index.php?node=tasks&sub=active
                            [Tue May 20 11:38:40 2014] [error] [client 192.168.17.51] PHP Warning: current() expects parameter 1 to be array, string given in /var/www/fog/lib/pages/HostManagementPage.class.php on line 312, referer: http://192.168.17.20/fog/management/index.php?node=host&sub=add
                            [Tue May 20 11:40:30 2014] [error] [client 192.168.17.51] PHP Warning: current() expects parameter 1 to be array, string given in /var/www/fog/lib/pages/HostManagementPage.class.php on line 312, referer: http://192.168.17.20/fog/management/index.php?node=host&sub=list
                            [Tue May 20 11:44:57 2014] [error] [client 192.168.17.51] PHP Warning: current() expects parameter 1 to be array, string given in /var/www/fog/lib/pages/HostManagementPage.class.php on line 312, referer: http://192.168.17.20/fog/management/index.php?node=host&sub=list
                            [Tue May 20 14:20:22 2014] [error] [client 192.168.17.51] PHP Fatal error: Call to a member function get() on a non-object in /var/www/fog/lib/pages/DashboardPage.class.php on line 30
                            [Tue May 20 14:34:32 2014] [error] [client 192.168.1.15] PHP Warning: mysql_query() expects parameter 2 to be resource, boolean given in /var/www/fog/lib/db/MySQL.class.php on line 95
                            [Tue May 20 14:34:32 2014] [error] [client 192.168.1.15] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/fog/lib/db/MySQL.class.php on line 156
                            [Tue May 20 14:34:33 2014] [notice] caught SIGTERM, shutting down
                            [Tue May 20 15:18:53 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.6-1ubuntu1.8 configured – resuming normal operations
                            [/CODE]

                            raffa

                            FOG 1.1.2
                            Ubuntu 12.10
                            VMWare 5.5 Up1

                            1 Reply Last reply Reply Quote 0
                            • J
                              Junkhacker Developer
                              last edited by May 20, 2014, 1:30 PM

                              does a wol packet sent manually from the server work?

                              signature:
                              Junkhacker
                              We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

                              1 Reply Last reply Reply Quote 0
                              • T
                                theleftfoot
                                last edited by May 20, 2014, 1:32 PM

                                how can i test this? sorry for my lack of knowledge…:-/

                                FOG 1.1.2
                                Ubuntu 12.10
                                VMWare 5.5 Up1

                                1 Reply Last reply Reply Quote 0
                                • T
                                  Tom Elliott
                                  last edited by May 20, 2014, 1:37 PM

                                  Easiest method.

                                  Create a file in wol called testwol.php

                                  Place these commands:

                                  [php]<?php
                                  require_once(‘…/commons/base.inc.php’);
                                  $mac = ‘XX:XX:XX:XX:XX:XX’;
                                  $WOLtest = new WakeOnLan($mac);
                                  if ($WOLtest->send())
                                  print 'WOL Packet <b>SENT</b> to '.$mac;
                                  else
                                  print 'WOL Packet <b>NOT SENT</b> to '.$mac;
                                  ?>[/php]

                                  Replace the XX’s with that of one of the MAC’s you want to wake up.

                                  In your browser, go to [url]http://<FOGSERVERIP>/fog/wol/testwol.php[/url]
                                  You should see the output:
                                  [code]WOL Packet SENT to XX:XX:XX:XX:XX:XX[/code]

                                  With any luck, this actually wakes the system up too!

                                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                                  Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                  Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                  1 Reply Last reply Reply Quote 0
                                  • J
                                    Junkhacker Developer
                                    last edited by May 20, 2014, 1:43 PM

                                    or to test independently of anything fog related, use etherwake. [url]http://manpages.ubuntu.com/manpages/quantal/man8/etherwake.8.html[/url]
                                    i think you will find that if fog fails to do it, so will this. because the problem is not in fog.

                                    signature:
                                    Junkhacker
                                    We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

                                    1 Reply Last reply Reply Quote 0
                                    • T
                                      theleftfoot
                                      last edited by May 22, 2014, 7:37 AM

                                      thanks guys, will checked right now!

                                      raffa

                                      FOG 1.1.2
                                      Ubuntu 12.10
                                      VMWare 5.5 Up1

                                      1 Reply Last reply Reply Quote 0
                                      • T
                                        theleftfoot
                                        last edited by May 22, 2014, 8:36 AM

                                        okay, try the testwol.php script…but the notebook still sleeps!

                                        i made a arp-scan on eth1 and the mac adress is not visible, because the node sleeps and is not on.

                                        the fog wol stettings are attached and the network schema…
                                        [ATTACH]804[/ATTACH][ATTACH]805[/ATTACH]

                                        it might be due to the 2 network interface card? miss configuration?

                                        damm…raffa

                                        [url=“/_imported_xf_attachments/0/804_wol_settings.jpg?:”]wol_settings.jpg[/url][url=“/_imported_xf_attachments/0/805_ict_labor_FOG_image.jpg?:”]ict_labor_FOG_image.jpg[/url]

                                        FOG 1.1.2
                                        Ubuntu 12.10
                                        VMWare 5.5 Up1

                                        1 Reply Last reply Reply Quote 0
                                        • R
                                          Raff
                                          last edited by May 23, 2014, 12:12 PM

                                          Change Settings FOG_WOL_INTERFACE to eth1.

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          1 / 2
                                          • First post
                                            1/32
                                            Last post

                                          257

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project