FOG Project

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

    Solved SVN 3080: NIC Registration

    Bug Reports
    5
    33
    6990
    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.
    • cspence
      cspence Developer last edited by

      Registration registers eth0 regardless of connection state.

      Version: SVN 3080
      Server OS: Debian
      NIC Not Used: eth0
      NIC Used: eth1

      PXE works fine on eth1 for me. Once the quick registration option is selected, it registers eth0 and carries on. Of course, it won’t recognize the machine on boot for imaging tasks until the MAC address is manually changed. Upon changing the MAC address to the eth1 adapter, the imaging process works fine.

      This may be related to the [URL=‘http://fogproject.org/forum/threads/multiple-nic-hosts.12511/’]other bug I reported earlier[/URL] regarding multiple NIC hosts having trouble with any tasks.

      1 Reply Last reply Reply Quote 0
      • cspence
        cspence Developer last edited by

        [quote=“Tom Elliott, post: 43684, member: 7271”]inventory.php doesn’t do the registering, only auto.register.php handles this. 3102 should work, but I don’t have multiple macs to test against either.[/quote]

        Still figuring out where everything is going. 🙂

        I was looking at fog.register, not fog.auto.reg. That would make sense! I’ll see if I can figure out what it is doing for you.

        1 Reply Last reply Reply Quote 0
        • Tom Elliott
          Tom Elliott last edited by

          inventory.php doesn’t do the registering, only auto.register.php handles this. 3102 should work, but I don’t have multiple macs to test against either.

          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
          • cspence
            cspence Developer last edited by

            I just gave SVN 3102 a shot. The new code does what it should, but only the first MAC is registered (no additional MACs are registered). I lucked out and had it register eth1 instead of eth0. That’s good for me, but maybe not for someone else.

            I don’t fully understand the inventory.php execution yet, but it must be only grabbing the first MAC and discards the rest.

            1 Reply Last reply Reply Quote 0
            • ch3i
              ch3i Moderator last edited by

              [quote=“Uncle Frank, post: 43632, member: 28116”]sed, grep, tr and all the rest are very nice but we don’t really need them here, do we?
              [CODE]… cat /sys/class/net/[^l][^o]*/address …[/CODE]

              And still wondering about if ‘IFS’ is needed here. Sorry goto go now.[/quote]

              Very usefull, I’ll use in my script !

              1 Reply Last reply Reply Quote 0
              • S
                Sebastian Roth Moderator last edited by

                [quote=“Tom Elliott, post: 43634, member: 7271”]Uncle Frank, cspence’s means no loops either![/quote]
                Ohhhhh yes, now I see! Shouldn’t work till very late as I seem to overlook things too often then…

                I’d vote for bash string manipulation…
                [CODE]# Get All Active MAC Addresses
                getMACAddresses()
                {
                macs=$(cat /sys/class/net/[^l][^o]*/address | tr ‘\n’ ‘|’)
                echo -n ${macs%$‘|’}
                }[/CODE]
                Just make sure we use BASH (not SH) because the terrorist style (lol) shell glob does not work with SH…

                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
                • Tom Elliott
                  Tom Elliott last edited by

                  lol
                  it means to cat all directories EXCEPT those with l, then o (or in this case lo)

                  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
                  • Wayne Workman
                    Wayne Workman last edited by

                    [quote=“Uncle Frank, post: 43632, member: 28116”]
                    [CODE]… cat /sys/class/net/[^l][^o]*/address …[/CODE]
                    [/quote]

                    What does that even mean?
                    I know DOS and VB, some Oracle… That stuff is so foreign I feel like it’s terrorist related lol

                    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!
                    Daily Clean Installation Results:
                    https://fogtesting.fogproject.us/
                    FOG Reporting:
                    https://fog-external-reporting-results.fogproject.us/

                    1 Reply Last reply Reply Quote 0
                    • cspence
                      cspence Developer last edited by

                      [quote=“Tom Elliott, post: 43634, member: 7271”]Uncle Frank, cspence’s means no loops either![/quote]

                      Moments like these are why I love collaborating with others on code. Just a few suggestions and the code collapses to nothing.

                      1 Reply Last reply Reply Quote 0
                      • Tom Elliott
                        Tom Elliott last edited by

                        Uncle Frank, cspence’s means no loops either!

                        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
                        • Tom Elliott
                          Tom Elliott last edited by

                          I like it

                          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
                          • S
                            Sebastian Roth Moderator last edited by

                            sed, grep, tr and all the rest are very nice but we don’t really need them here, do we?
                            [CODE]… cat /sys/class/net/[^l][^o]*/address …[/CODE]

                            And still wondering about if ‘IFS’ is needed here. Sorry goto go now.

                            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
                            • cspence
                              cspence Developer last edited by

                              How low can we go?

                              [CODE]# Get All Active MAC Addresses
                              getMACAddresses()
                              {
                              lomac=00:00:00:00:00:00
                              cat /sys/class/net/*/address | grep -v $lomac | tr ‘\n’ ‘|’ | sed s/.$//g
                              }[/CODE]

                              1 Reply Last reply Reply Quote 0
                              • S
                                Sebastian Roth Moderator last edited by

                                [CODE]… cat /sys/class/net/???*/address …[/CODE] kind of hackish but…

                                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
                                • cspence
                                  cspence Developer last edited by

                                  [quote=“Uncle Frank, post: 43627, member: 28116”]I don’t think so…
                                  [CODE]# Get All Active MAC Addresses
                                  getMACAddresses()
                                  {
                                  IFS=$‘\n’
                                  # Create a pipe-separated MAC List
                                  for macline in $(cat /sys/class/net/*/address); do
                                  # Add a pipe before adding more MACs
                                  if [ -n “$mac” ]; then
                                  mac=$mac|
                                  fi
                                  mac=${mac}${macline};
                                  done
                                  IFS=
                                  echo $mac
                                  }[/CODE]
                                  No ip, no awk, no grep…[/quote]

                                  It grabs lo’s MAC. But I like where this is going…

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    Sebastian Roth Moderator last edited by

                                    And I still wonder, why do we need the IFS here??

                                    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
                                    • S
                                      Sebastian Roth Moderator last edited by

                                      [quote=“Tom Elliott, post: 43626, member: 7271”]We have to know the exact path name, so it’s simpler to just use the tools that get that for us I think.[/quote]
                                      I don’t think so…
                                      [CODE]# Get All Active MAC Addresses
                                      getMACAddresses()
                                      {
                                      IFS=$‘\n’
                                      # Create a pipe-separated MAC List
                                      for macline in $(cat /sys/class/net/*/address); do
                                      # Add a pipe before adding more MACs
                                      if [ -n “$mac” ]; then
                                      mac=$mac|
                                      fi
                                      mac=${mac}${macline};
                                      done
                                      IFS=
                                      echo $mac
                                      }[/CODE]
                                      No ip, no awk, no grep…

                                      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
                                      • Tom Elliott
                                        Tom Elliott last edited by

                                        [quote=“Uncle Frank, post: 43623, member: 28116”]Not using any extra ip tools … /sys/class/net/*/address …[/quote]

                                        We have to know the exact path name, so it’s simpler to just use the tools that get that for us I think.

                                        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
                                        • Tom Elliott
                                          Tom Elliott last edited by

                                          yeah I saw and edited. The echo needs to occur there. and I am using just ip addr

                                          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
                                          • cspence
                                            cspence Developer last edited by

                                            [code]# Get All Active MAC Addresses
                                            getMACAddresses()
                                            {
                                            IFS=$‘\n’
                                            # Create a pipe-separated MAC List
                                            for macline in $(ip addr | grep link/ether | awk ‘{print $2}’); do
                                            # Add a pipe before adding more MACs
                                            if [ -n “$mac” ]; then
                                            mac=$mac|
                                            fi
                                            mac=${mac}${macline};
                                            done
                                            IFS=
                                            echo $mac
                                            }[/code]

                                            Caught a bug with your final mac= statement. Also, “ip addr” is fine by itself.

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

                                            189
                                            Online

                                            10.2k
                                            Users

                                            16.3k
                                            Topics

                                            149.9k
                                            Posts

                                            Copyright © 2012-2020 FOG Project