• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. ch3i
    3. Posts
    • Profile
    • Following 1
    • Followers 4
    • Topics 37
    • Posts 916
    • Best 169
    • Controversial 0
    • Groups 1

    Posts made by ch3i

    • RE: [SCRIPT] Auto rename debian machine

      Hi,

      I updated the script :

      • no limitation of number of ethernet card
      • update /etc/network/interfaces

      [CODE]#!/bin/bash
      #########################################################

      Rename services with FoG, need mysql-client installed

      #########################################################

      ch3i - 02/05/2015

      #########################################################

      BEGIN INIT INFO

      Provides: rename_host_fog

      Required-Start: $all

      Required-Stop:

      Default-Start: 2 3 4 5

      Default-Stop: 0 1 6

      Short-Description: Rename host at boot

      Description: Rename host using FoG

      END INIT INFO

      #########################################################

      Configuration

      #########################################################
      FOG_SERVER=“xxx.xxx.xxx.xxx”
      FOG_DATABASE_NAME=“fog”
      FOG_USER=“user_with_select_right”
      FOG_PASSWORD=“password”

      #########################################################

      Get interfaces

      #########################################################
      NETWORK_CARDS=($(ls /sys/class/net/))

      #########################################################

      Get host name and domain from FoG database

      #########################################################
      for ETH in ${NETWORK_CARDS[*]}
      do
      if [ “$ETH” != “lo” ]
      then
      MAC=$(cat /sys/class/net/$ETH/address)
      TEMP_HOST_NAME=$(mysql --host=$FOG_SERVER --user=$FOG_USER --password=$FOG_PASSWORD $FOG_DATABASE_NAME -se “SELECT hosts.hostname FROM hosts INNER JOIN hostMAC ON ( hosts.hostID = hostMAC.hmHostID ) WHERE hostMAC.hmMAC = ‘$MAC’”);
      if [ “$TEMP_HOST_NAME” != “” ]
      then
      HOST_NAME=$TEMP_HOST_NAME
      HOST_DOMAIN_NAME=$(mysql --host=$FOG_SERVER --user=$FOG_USER --password=$FOG_PASSWORD $FOG_DATABASE_NAME -se “SELECT hosts.hostADDomain FROM hosts INNER JOIN hostMAC ON ( hosts.hostID = hostMAC.hmHostID ) WHERE hostMAC.hmMAC = ‘$MAC’”);
      fi
      fi
      done

      #########################################################

      Check host configuration

      #########################################################
      ACTUAL_FQDN=$(hostname --fqdn)
      if [ “$HOST_NAME.$HOST_DOMAIN_NAME” != “$ACTUAL_FQDN” ] && [ “$HOST_NAME” != “” ] && [ “$HOST_DOMAIN_NAME” != “” ]
      then
      #########################################################
      # Update hostname file
      #########################################################
      echo $HOST_NAME >/etc/hostname

      #########################################################
      # Update hosts file
      #########################################################
      echo "127.0.0.1      localhost" > /etc/hosts
      echo "127.0.1.1      $HOST_NAME.$HOST_DOMAIN_NAME $HOST_NAME " >> /etc/hosts
      echo "# The following lines are desirable for IPv6 capable hosts
      

      ::1 ip6-localhost ip6-loopback
      fe00::0 ip6-localnet
      ff00::0 ip6-mcastprefix
      ff02::1 ip6-allnodes
      ff02::2 ip6-allrouters
      ff02::3 ip6-allhosts" >> /etc/hosts

      #########################################################
      # Update interfaces file
      #########################################################
      echo "# This file describes the network interfaces available on your system
      

      and how to activate them. For more information, see interfaces(5).

      The loopback network interface

      auto lo
      iface lo inet loopback" > /etc/network/interfaces

      for ETH in ${NETWORK_CARDS[*]}
      do
          if [ "$ETH" != "lo" ]
          then
          echo "# $ETH Interface
      

      allow-hotplug $ETH
      iface $ETH inet dhcp" >> /etc/network/interfaces
      fi
      done

      #########################################################
      # Clear persistent network cards
      #########################################################
      if [ -f /etc/udev/rules.d/70-persistent-net.rules ]
      then
          rm /etc/udev/rules.d/70-persistent-net.rules
      fi
      
      #########################################################
      # Logs and Reboot machine
      #########################################################
      echo "$(date) ::: Update successful with Hostname : $HOST_NAME and Domain : $HOST_DOMAIN_NAME" >> /var/log/rename_host_fog.log
      /sbin/init 6
      

      fi
      if [ “$HOST_NAME” == “” ] && [ “$HOST_DOMAIN_NAME” == “” ]
      then
      echo “$(date) ::: Update failed : Failed to connect to Mysql Server” >> /var/log/rename_host_fog.log
      fi
      if [ “$HOST_NAME” != “” ] && [ “$HOST_DOMAIN_NAME” == “” ]
      then
      echo “$(date) ::: Update failed : Domain name is missing” >> /var/log/rename_host_fog.log
      fi
      [/CODE]

      Regards,
      Ch3i.

      posted in General
      ch3iC
      ch3i
    • RE: Host custom attributes

      Ok thank’s for answers, i’ll use fileds Other Tag.

      posted in Feature Request
      ch3iC
      ch3i
    • RE: Host custom attributes

      [quote=“Tom Elliott, post: 41746, member: 7271”]What are these fields going to be used for? I only ask because there is the three fields on the host hardware that could be used.[/quote]

      These fields ? : [SIZE=13px][FONT=Ubuntu][COLOR=#555555]Primary User, [/COLOR][/FONT][/SIZE][SIZE=13px][FONT=Ubuntu][COLOR=#555555]Other Tag #1, [/COLOR][/FONT][/SIZE][SIZE=13px][FONT=Ubuntu][COLOR=#555555]Other Tag #2[/COLOR][/FONT][/SIZE]

      [SIZE=13px][FONT=Ubuntu][COLOR=#555555]I saw it, but don’t know if there are used in another fog task (like fog client ?), and I didn’t try to use it.[/COLOR][/FONT][/SIZE]

      [FONT=Ubuntu][COLOR=#555555][SIZE=13px]In my case I’ll execute some scripts depends that I set in these attributes.[/SIZE][/COLOR][/FONT]

      posted in Feature Request
      ch3iC
      ch3i
    • Host custom attributes

      Hi,

      I’ll use the fog database to update linux hosts configuration like : [url]http://fogproject.org/forum/threads/script-auto-rename-debian-machine.12346/#post-41611[/url]

      Is it possible to add custom attributes on hosts like that (and mass update of these with groups menu) :

      [IMG]http://img4.hostingpics.net/pics/723972customattributehost.png[/IMG]

      It’ll be very usefull (in my case :p) for some parameters on my hosts !

      posted in Feature Request
      ch3iC
      ch3i
    • RE: Single Disk Multiple Partition works after a sector by sector but not before, partition problems.

      I use this parititon table (dual boot Win/Deb) without problem :

      [CODE] Device Boot Start End Blocks Id System
      /dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
      /dev/sda2 206848 204802047 102297600 7 HPFS/NTFS/exFAT
      /dev/sda3 204802048 409602047 102400000 83 Linux
      /dev/sda4 409604094 625141759 107768833 5 Extended
      /dev/sda5 409604096 425988095 8192000 82 Linux swap / Solaris
      /dev/sda6 425990144 625141759 99575808 7 HPFS/NTFS/exFAT[/CODE]

      posted in Windows Problems
      ch3iC
      ch3i
    • RE: Single Disk Multiple Partition works after a sector by sector but not before, partition problems.

      [quote=“raymondub, post: 41616, member: 28342”]I ve now Version: 2961
      Is it good ?[/quote]
      Hi,

      The latest SVN is 2966.

      Regards,
      Ch3i.

      posted in Windows Problems
      ch3iC
      ch3i
    • RE: [SCRIPT] Auto rename debian machine

      I solve my problem changing the required start.

      [CODE]### BEGIN INIT INFO

      Provides: rename_host_fog

      Required-Start: $all

      Required-Stop:

      Default-Start: 2 3 4 5

      Default-Stop: 0 1 6

      Short-Description: Rename host at boot

      Description: Rename host using FoG

      END INIT INFO[/CODE]

      I improve the script by check if the FoG server respond.

      [CODE]if [ “$HOST_NAME.$HOST_DOMAIN_NAME” != “$ACTUAL_FQDN” ] && [ “$HOST_NAME” != “” ] && [ “$HOST_DOMAIN_NAME” != “” ][/CODE]

      Now the service check the name at boot and at shutdown.

      Below the new version :

      rename_host_fog

      [CODE]#!/bin/bash
      #########################################################

      Rename services with FoG, need mysql-client installed

      #########################################################

      ch3i - 02/03/2015

      #########################################################

      BEGIN INIT INFO

      Provides: rename_host_fog

      Required-Start: $all

      Required-Stop:

      Default-Start: 2 3 4 5

      Default-Stop: 0 1 6

      Short-Description: Rename host at boot

      Description: Rename host using FoG

      END INIT INFO

      #########################################################

      Configuration

      #########################################################
      FOG_SERVER=“xxx.xxx.xxx.xxx”
      FOG_DATABASE_NAME=“fog”
      FOG_USER=“user_with_select_right”
      FOG_PASSWORD=“password”

      #########################################################

      Get MAC address (3 cards max)

      #########################################################
      if [ -f /sys/class/net/eth0/address ]
      then
      MAC0=$(cat /sys/class/net/eth0/address)
      fi
      if [ -f /sys/class/net/eth1/address ]
      then
      MAC1=$(cat /sys/class/net/eth1/address)
      fi
      if [ -f /sys/class/net/eth2/address ]
      then
      MAC2=$(cat /sys/class/net/eth2/address)
      fi

      #########################################################

      Get machine name from FoG database

      #########################################################
      HOST_NAME=$(mysql --host=$FOG_SERVER --user=$FOG_USER --password=$FOG_PASSWORD $FOG_DATABASE_NAME -se “SELECT hosts.hostname FROM hosts INNER JOIN hostMAC ON ( hosts.hostID = hostMAC.hmHostID ) WHERE hostMAC.hmMAC = ‘$MAC0’ OR hostMAC.hmMAC = ‘$MAC1’ OR hostMAC.hmMAC = ‘$MAC2’”);
      HOST_DOMAIN_NAME=$(mysql --host=$FOG_SERVER --user=$FOG_USER --password=$FOG_PASSWORD $FOG_DATABASE_NAME -se “SELECT hosts.hostADDomain FROM hosts INNER JOIN hostMAC ON ( hosts.hostID = hostMAC.hmHostID ) WHERE hostMAC.hmMAC = ‘$MAC0’ OR hostMAC.hmMAC = ‘$MAC1’ OR hostMAC.hmMAC = ‘$MAC2’”);

      #########################################################

      Check machine configuration

      #########################################################
      ACTUAL_FQDN=$(hostname --fqdn)
      if [ “$HOST_NAME.$HOST_DOMAIN_NAME” != “$ACTUAL_FQDN” ] && [ “$HOST_NAME” != “” ] && [ “$HOST_DOMAIN_NAME” != “” ]
      then
      echo “update”
      #########################################################

      Update hostname file

      #########################################################
      echo $HOST_NAME >/etc/hostname

      #########################################################

      Update hosts file

      #########################################################
      echo “127.0.0.1 localhost” > /etc/hosts
      echo "127.0.1.1 $HOST_NAME.$HOST_DOMAIN_NAME $HOST_NAME " >> /etc/hosts
      echo "# The following lines are desirable for IPv6 capable hosts
      ::1 ip6-localhost ip6-loopback
      fe00::0 ip6-localnet
      ff00::0 ip6-mcastprefix
      ff02::1 ip6-allnodes
      ff02::2 ip6-allrouters
      ff02::3 ip6-allhosts " >> /etc/hosts

      #########################################################

      Update dhclient file

      #########################################################
      cp /etc/dhcp/dhclient.conf /tmp
      sed s/<hostname>/$HOST_NAME/ /tmp/dhclient.conf > /etc/dhcp/dhclient.conf

      #########################################################

      Clear persistent network cards

      #########################################################
      if [ -f /etc/udev/rules.d/70-persistent-net.rules ]
      then
      rm /etc/udev/rules.d/70-persistent-net.rules
      fi

      #########################################################

      Reboot machine

      #########################################################
      echo “$(date) ::: Update successful with Hostname : $HOST_NAME and Domain : $HOST_DOMAIN_NAME” >> /var/log/rename_host_fog.log
      /sbin/init 6
      fi
      if [ “$HOST_NAME” == “” ] && [ “$HOST_DOMAIN_NAME” == “” ]
      then
      echo “$(date) ::: Update failed : Failed to connect to Mysql Server” >> /var/log/rename_host_fog.log
      fi
      if [ “$HOST_NAME” != “” ] && [ “$HOST_DOMAIN_NAME” == “” ]
      then
      echo “$(date) ::: Update failed : Domain name is missing” >> /var/log/rename_host_fog.log
      fi
      [/CODE]

      sysprep_fog

      [CODE]#!/bin/bash
      #########################################################

      Sysprep to enable rename_host_fog service

      #########################################################

      ch3i - 02/03/2015

      #########################################################

      #########################################################

      Install/update mysql-client

      #########################################################
      apt-get -y install mysql-client

      #########################################################

      Copy/update rename_host_fog script in init.d

      #########################################################
      if [ -f /etc/init.d/rename_host_fog ]
      then
      rm /etc/init.d/rename_host_fog
      fi
      cp rename_host_fog /etc/init.d/rename_host_fog

      #########################################################

      Update rename_host_fog rights

      #########################################################
      chmod 755 /etc/init.d/rename_host_fog

      #########################################################

      Enable rename_host_fog service at startup

      #########################################################
      insserv rename_host_fog

      #########################################################

      Reboot machine

      #########################################################
      /sbin/init 6[/CODE]

      To use it, you have to :

      create two files in the same folder :

      • rename_host_fog
      • sysprep_fog

      change sysprep_fog rights : chmod 755 sysprep_fog.
      enable service with : ./sysprep.fog

      You can check log in : /var/log/rename_host_fog.log

      posted in General
      ch3iC
      ch3i
    • [SCRIPT] Auto rename debian machine

      Hi,

      I made a script launch as a service to update debian machine informations :

      • /etc/hostname
      • /etc/hosts
      • /etc/dhcp/dhclient.conf

      My rename_host_fog file

      [CODE]#!/bin/bash
      #########################################################

      Rename services with FoG, need mysql-client installed

      #########################################################

      ch3i - 02/03/2015

      #########################################################

      BEGIN INIT INFO

      Provides: rename_host

      Required-Start: $remote_fs $syslog $network

      Required-Stop: $remote_fs $syslog $network

      Default-Start: 2 3 4 5

      Default-Stop: 0 1 6

      Short-Description: Rename host at boot

      Description: Rename host using FoG

      END INIT INFO

      #########################################################

      Configuration

      #########################################################
      FOG_SERVER=“xxx.xxx.xxx.xxx”
      FOG_DATABASE_NAME=“fog”
      FOG_USER=“user_with_select_right”
      FOG_PASSWORD=“password”

      #########################################################

      Get MAC address (3 cards max)

      #########################################################
      if [ -f /sys/class/net/eth0/address ]
      then
      MAC0=$(cat /sys/class/net/eth0/address)
      fi
      if [ -f /sys/class/net/eth1/address ]
      then
      MAC1=$(cat /sys/class/net/eth1/address)
      fi
      if [ -f /sys/class/net/eth2/address ]
      then
      MAC2=$(cat /sys/class/net/eth2/address)
      fi

      #########################################################

      Get machine name and domain from FoG database

      #########################################################
      HOST_NAME=$(mysql --host=$FOG_SERVER --user=$FOG_USER --password=$FOG_PASSWORD $FOG_DATABASE_NAME -se “SELECT hosts.hostname FROM hosts INNER JOIN hostMAC ON ( hosts.hostID = hostMAC.hmHostID ) WHERE hostMAC.hmMAC = ‘$MAC0’ OR hostMAC.hmMAC = ‘$MAC1’ OR hostMAC.hmMAC = ‘$MAC2’”);
      HOST_DOMAIN_NAME=$(mysql --host=$FOG_SERVER --user=$FOG_USER --password=$FOG_PASSWORD $FOG_DATABASE_NAME -se “SELECT hosts.hostADDomain FROM hosts INNER JOIN hostMAC ON ( hosts.hostID = hostMAC.hmHostID ) WHERE hostMAC.hmMAC = ‘$MAC0’ OR hostMAC.hmMAC = ‘$MAC1’ OR hostMAC.hmMAC = ‘$MAC2’”);

      #########################################################

      Check machine configuration

      #########################################################
      ACTUAL_FQDN=$(hostname --fqdn)
      if [ “$HOST_NAME.$HOST_DOMAIN_NAME” != “$ACTUAL_FQDN” ]
      then
      #########################################################

      Update hostname file

      #########################################################
      echo $HOST_NAME >/etc/hostname

      #########################################################

      Update hosts file

      #########################################################
      echo “127.0.0.1 localhost” > /etc/hosts
      echo "127.0.1.1 $HOST_NAME.$HOST_DOMAIN_NAME $HOST_NAME " >> /etc/hosts
      echo "# The following lines are desirable for IPv6 capable hosts
      ::1 ip6-localhost ip6-loopback
      fe00::0 ip6-localnet
      ff00::0 ip6-mcastprefix
      ff02::1 ip6-allnodes
      ff02::2 ip6-allrouters
      ff02::3 ip6-allhosts " >> /etc/hosts

      #########################################################

      Update dhclient file

      #########################################################
      cp /etc/dhcp/dhclient.conf /tmp
      sed s/<hostname>/$HOST_NAME/ /tmp/dhclient.conf > /etc/dhcp/dhclient.conf

      #########################################################

      Clear persistent network cards

      #########################################################
      if [ -f /etc/udev/rules.d/70-persistent-net.rules ]
      then
      rm /etc/udev/rules.d/70-persistent-net.rules
      fi

      #########################################################

      Reboot machine

      #########################################################
      init 6
      fi
      [/CODE]

      My sysprep_fog file used to enable rename_host_fog services

      [CODE]#!/bin/bash
      #########################################################

      Sysprep to enable rename_host_fog service

      #########################################################

      ch3i - 02/03/2015

      #########################################################

      #########################################################

      Install/update mysql-client

      #########################################################
      apt-get -y install mysql-client

      #########################################################

      Copy/update rename_host_fog script in init.d

      #########################################################
      if [ -f /etc/init.d/rename_host_fog ]
      then
      rm /etc/init.d/rename_host_fog
      fi
      cp rename_host_fog /etc/init.d/rename_host_fog

      #########################################################

      Update rename_host_fog rights

      #########################################################
      chmod 755 /etc/init.d/rename_host_fog

      #########################################################

      Enable rename_host_fog service at startup

      #########################################################
      insserv rename_host_fog

      #########################################################

      Reboot machine

      #########################################################
      init 6
      [/CODE]

      The service is OK and update automatically my machine at boot if I modified information into FoG server, but won’t reboot 😕

      Does anyone can help me ?

      Regards,
      Ch3i.

      posted in General
      ch3iC
      ch3i
    • RE: Three wishes

      [quote=“Heiko, post: 41545, member: 28252”]
      2. Webinterface
      two Checkbox on top of List.
      The first mark all, the second invert the marked rows.
      [/quote]

      Hi,

      Available in SVN versions : [url]http://fogproject.org/forum/threads/latest-development-fog.10556/page-19#post-40734[/url]

      regards,

      Ch3i.

      posted in Feature Request
      ch3iC
      ch3i
    • RE: Debian netowrk manager

      Hi,

      If you have only a network card (in the example eth0), it’s :

      [CODE]auto eth0
      iface eth0 inet static
      address 192.168.2.1
      netmask 255.255.255.0
      gateway 0.0.0.0 << No gateway ???[/CODE]

      Regards,
      Ch3i.

      posted in Linux Problems
      ch3iC
      ch3i
    • RE: /images on a nfs share into a Nas ...

      [quote=“Loops, post: 40878, member: 28164”]Thank’s a lot for your help ! but this is a little bit hard for me !
      My Fog server is now running with a local image storage ! :/[/quote]

      NP

      posted in General
      ch3iC
      ch3i
    • RE: /images on a nfs share into a Nas ...

      [quote=“Tom Elliott, post: 40871, member: 7271”]An NFS mounted share, cannot be re-shared through NFS. It will not work.

      Your best option is to make the NAS it’s own “node” to link to the images, but the problem in lies that the FTP service must be enabled, but also if you can configure it so the user’s home path is not specified for FTP connections.

      NFS doesn’t use any accounts to handle sharing. What this means, is you can mount the share through whatever path you need.

      For example, a NFS share on a nas might be located at /master/images. You can NFS mount the share using IP.Goes.Here:/master/images and things will generally work.

      When it comes to FTP (how fog checks if the image actually exists during a deploy task and moves the image from images/dev to images) though a defined home folder will make the root (/) location in the root of the place. Many NAS’s make the /master the home location for the FTP user meaning trying to mount, or move data from /master/images won’t work because it’s actually looking for /master/images in the home folder (/master/master/images).[/quote]

      And you must have the same UUID on the user fog : on NAS and fog Server.

      posted in General
      ch3iC
      ch3i
    • RE: /images on a nfs share into a Nas ...

      Try to create a user fog on your NAS with the same password of the fog server, and set the right on your share with the user fog.

      posted in General
      ch3iC
      ch3i
    • RE: /images on a nfs share into a Nas ...

      [quote=“Loops, post: 40865, member: 28164”]Thank’s for your help but, i can’t use iscsi !
      My Fog server is virtual and the Nas is not near the server they are in 2 different building ![/quote]

      Virtual is not a problem, NAS in different building is a problem 😛

      posted in General
      ch3iC
      ch3i
    • RE: /images on a nfs share into a Nas ...

      Hi,

      Each time I’ll try this configuration I have this error.

      If you can, use iSCSI directly on the server.

      Regards,
      Ch3i.

      posted in General
      ch3iC
      ch3i
    • RE: Scheduled tasks are not starting in FOG 1.2.0

      [quote=“Axel, post: 40814, member: 686”]What is SVN? How do you update ?[/quote]

      [url]http://www.fogproject.org/wiki/index.php/SVN[/url]

      posted in FOG Problems
      ch3iC
      ch3i
    • RE: Host not found with windows service fog

      The hostname change is based on the hostname set in your host :

      [URL=http://www.hostingpics.net/viewer.php?id=917247Capture1.png][IMG]http://img11.hostingpics.net/thumbs/mini_917247Capture1.png[/IMG][/URL]

      The AD integration is based on the settings set in your host to :

      [URL=‘http://www.hostingpics.net/viewer.php?id=324753Capture2.png’][IMG]http://img11.hostingpics.net/thumbs/mini_324753Capture2.png[/IMG][/URL]

      For the password you need to use fogcrypt, you can download it at : [url]http://yourserver/fog/management/index.php?node=client[/url] .

      Wiki :
      Fogcrypt : [url]http://www.fogproject.org/wiki/index.php/FOGCrypt[/url]
      AD : [url]http://www.fogproject.org/wiki/index.php/Active_Directory_-_FOG_Setting[/url]

      posted in FOG Problems
      ch3iC
      ch3i
    • RE: Hp pro x2 612 g1 windows 8.1 image issues

      [quote=“Tim Brown, post: 40800, member: 23073”]Sorry, I am new to all of this, coming from the Windows world (don’t judge me). Any more suggestions? Would upgrading to 1.2 help me?[/quote]

      Hi,

      Could you post a screenshot of your error ?
      For the version of FoG, it’s sure that a 1.2 or more is better.

      Regards,
      Ch3i.

      posted in FOG Problems
      ch3iC
      ch3i
    • 1 / 1