Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Serial number exceeds length supported by System widget

    Scheduled Pinned Locked Moved webGUI
    3 Posts 2 Posters 197 Views 4 Watching
    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.
    • M Offline
      marcg
      last edited by marcg

      Recently set a serial number on my third-party box to accommodate Nexus. The serial number is the 19 character alphanumeric serial number printed on the box. The serial number displays in the Nexus System Widget equivalent, but not in the PHP System Widget.

      e2c3d5ae-dcc9-4b04-b8bf-f2a0420d9772-image.png

      The PHP widget gets the serial number from system_get_serial() in /etc/inc/system.inc, in particular from /bin/kenv -q smbios.system.serial at line 3451 for this box. Increasing the upper length limits to 19 on lines 3454 and 3464 causes the serial number to appear in the widget (26.07 version of system.inc). Not sure whether this might break other functions using system_get_serial()?

      60296b2f-3148-4552-a700-64fb4fb29308-image.png

      Minor nit, but thought I'd mention it since the new Nexus serial number requirement may result in longer serial numbers than seen in the past.

         3448         } else {
         3449                 foreach (array('system', 'planar', 'chassis') as $key) {
         3450                         unset($output);
         3451                         $_gb = exec("/bin/kenv -q smbios.{$key}.serial",
         3452                             $output);
         3453                         if (!empty($output[0]) && $output[0] != "0123456789" &&
         3454                             preg_match('/^[\w\d]{10,16}$/', $output[0]) === 1) {
         3455                                 $serial = $output[0];
         3456                                 break;
         3457                         }
         3458                 }
         3459         }
         3460
         3461         $vm_guest = get_single_sysctl('kern.vm_guest');
         3462
         3463         $serial = chop($serial);
         3464         if (strlen($serial) >= 10 && strlen($serial) <= 18 &&
         3465             $vm_guest == 'none') {
         3466                 return $serial;
         3467         }
      
      
      1 Reply Last reply Reply Quote 1
      • M Offline
        marcosm Netgate
        last edited by

        The PHP widget is only meant to show the serial for Netgate hardware.

        M 1 Reply Last reply Reply Quote 0
        • M Offline
          marcg @marcosm
          last edited by marcg

          @marcosm said in Serial number exceeds length supported by System widget:

          The PHP widget is only meant to show the serial for Netgate hardware.

          I didn't know the intended use, but seems like the serial number might be useful info on all platforms now that it's required for Nexus.

          And it does currently display for non-Netgate hardware if the serial number is from 10-16 alphanumeric characters. I had no idea the widget was even capable of displaying a serial number until I saw this post showing the serial number on a Protectli box.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
          Privacy Policy · Cookie Policy