• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Crok
    C
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 21
    • Best 0
    • Controversial 0
    • Groups 0

    Crok

    @Crok

    0
    Reputation
    256
    Profile views
    21
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Location debian 9.12 + fog 1.5.9RC2

    Crok Unfollow Follow

    Latest posts made by Crok

    • RE: [Resolved] How can i use FOG WOL in python3 script

      @Sebastian-Roth
      I have an organizer that define when computers are used.
      Monday -> my computer must be wake up at 10Am
      Next monday -> at 8am
      All wake up are differents for each computers and each days.
      My organizer (calendar) is an .ics file can extract.
      https://fr.wikipedia.org/wiki/ICalendar
      i would like use this ics file to wake up my computers automatically.
      my ics file must be modified, i do extract each hour.
      Sorry my english is so bad.
      i hope that is more clearly.

      posted in General Problems
      C
      Crok
    • RE: [Resolved] How can i use FOG WOL in python3 script

      i see you use a script perl to wol computers
      https://wiki.fogproject.org/wiki/index.php?title=How_to_use_the_wakeonlan_perl_script_instead_of_etherwake.exe

      # Written by Marc Balmer, marc@msys.ch, http://www.msys.ch/
      # This code is free software under the GPL
      
      import struct, socket
      
      def WakeOnLan(ethernet_address):
        # Construct a six-byte hardware address
        addr_byte = ethernet_address.split(':')
        hw_addr = struct.pack('BBBBBB', int(addr_byte[0], 16),
          int(addr_byte[1], 16),
          int(addr_byte[2], 16),
          int(addr_byte[3], 16),
          int(addr_byte[4], 16),
          int(addr_byte[5], 16))
      
        # Build the Wake-On-LAN "Magic Packet"...
      
        msg = b'\xff' * 6 + hw_addr * 16
        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
        s.sendto(msg, ('1.2.3.255', 9))
        s.close()
      
      # saisir l'adresse MAC de la machine
      WakeOnLan('00:11:22:33:44:55')
      
      

      I try with this script.

      posted in General Problems
      C
      Crok
    • RE: [Resolved] How can i use FOG WOL in python3 script

      i can use a ics file with “timetable”.
      At each hour, i want wake up PC in term of ics file.
      My file must be modified, is that reason i download my ics file at each hour and if my computer must wake up, i want use FOG WOL for this or a magic packet in my python3 script.

      posted in General Problems
      C
      Crok
    • RE: [Resolved] Extract hosts.csv with script python3

      my script work \o/

      #-*- coding: UTF-8 -*-
      import requests
      
      
      headers = {'User-Agent': 'Mozilla/5.0'}
      payload = {'uname': 'fog', 'upass' : 'bar', 'ulang' : 'English', 'login': ''}
      
      headers2 = {'User-Agent': 'Mozilla/5.0', 'Referer': 'http://IP/fog/management/index.php?node=host&sub=export'}
      payload2 = {'fogguiuser' : 'fog', 'fogguipass' : 'bar', 'nojson' : ''}
      
      
      s = requests.Session()
      r = s.post("http://IP/fog/management/index.php?node=home", headers=headers, data=payload)
      print ("[+] Connexion OK")
      s.get("http://IP/fog/management/index.php?node=host&sub=export")
      u = s.post("http://IP/fog/management/export.php?type=host", headers=headers2, data=payload2, stream = True)
      
      mon_fichier = open("C:\\my\\Path\\hosts.txt", "w")
      mon_fichier.write(u.text)
      mon_fichier.close()
      
      print ("[+] Enregistrement terminé")
      

      thxs for your help.

      posted in General
      C
      Crok
    • [Resolved] How can i use FOG WOL in python3 script

      Hello,
      i would like to use FOG WOL to wake up computers with my ics file.
      FOG don’t do that and i want script this if it’s possible.
      If you have idea to do that with python3 🙂

      thxs

      posted in General Problems
      C
      Crok
    • RE: [Resolved] Extract hosts.csv with script python3

      Thxs for your response.
      But i’m so bad :"(

      import requests
      import csv
      import shutil
      
      Login = "fog"
      Pass = "bar"
      
      site ="http://IP/fog/management/"
      headers = {'User-Agent': 'Mozilla/5.0'}
      payload = {'uname': 'fog', 'upass' : 'bar', 'ulang' : 'English', 'login': ''}
      payload2 = {'fogguiuser' : 'fog', 'fogguipass' : 'bar', 'nojson' : ''}
      
      
      s = requests.Session()
      r = s.post("http://IP/fog/management/index.php?node=home", headers=headers, data=payload)
      print ("[+] Connexion OK")
      
      
      r = s.post("http://IP/fog/management/index.php?node=host&sub=export", headers=headers, data=payload2)
      with open('host_export.csv', 'wb') as f:
          print ("[+] Récupération du csv")
          f.write(t.content)
          print ("[+] Enregistrement terminé")
      f.close()
      

      Have you another advice ?

      posted in General
      C
      Crok
    • [Resolved] Extract hosts.csv with script python3

      Hello,
      How i do to download hosts.csv in script python3
      I try something like that

      import requests
      import csv
      import shutil
      
      Login = "fog"
      Pass = "bar"
      
      site ="http://IP/fog/management/index.php"
      headers = {'User-Agent': 'Mozilla/5.0'}
      payload = {'uname': 'fog', 'upass' : 'bar', 'ulang' : 'English'}
      payload2 = {'fogguiuser' : 'fog', 'fogguipass' : 'bar', 'nojson' : ''}
      
      
      s = requests.Session()
      r = s.post(site + "?node=home", headers=headers, data=payload)
      t = s.get("http://IP/fog/management/index.php?node=host&sub=export")
      page = t.text
      print ("[+] Connexion OK")
      
      r = s.post(site + "/export.php?type=host", headers=headers, data=payload2)
      with open('test.csv', 'wb') as f:
          print ("[+] Récupération du csv")
          t = s.get("http://IP/fog/management/index.php?node=host&sub=export", stream = True)
          print (t.text)
          print ("[+] Enregistrement terminé")
          f.write(t.content)
      f.close()
      

      Don’t work :"(
      Have you an idea ?
      thxs

      posted in General
      C
      Crok
    • RE: TFTOBOOT folder missing - FOG 1.5.2

      Finally all are ok
      except Download Kernel update:
      Error : Donwload Failed: Failed - filesize.

      posted in FOG Problems
      C
      Crok
    • RE: TFTOBOOT folder missing - FOG 1.5.2

      /etc/environment
      http_proxy=“http://proxy.fr:3128/”
      https_proxy=“http://proxy.fr:3128/”
      ftp_proxy=“http://proxy.fr:3128/”
      no_proxy=“localhost,127.0.0.1,IPSERVERFOG”
      HTTP_PROXY=“http://proxy.fr:3128/”
      HTTPS_PROXY=“http://proxy.fr:3128/”
      FTP_PROXY=“http://proxy.fr:3128/”
      NO_PROXY=“localhost,127.0.0.1,IPSERVERFOG”

      posted in FOG Problems
      C
      Crok
    • RE: TFTOBOOT folder missing - FOG 1.5.2

      Rerun installer (3 times)
      and all folders are ok.

      posted in FOG Problems
      C
      Crok