Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    pulling model, serial number, netgate device ID from CLI

    Scheduled Pinned Locked Moved Development
    3 Posts 2 Posters 777 Views
    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.
    • B
      brandilton
      last edited by

      When I initially SSH in, the very first line before it shows the menu is:

      Netgate 3100 - Serial: XXXXXXXXXXX - Netgate Device ID: yyyyyyyyyyyyyyyyy

      I can grab that and parse it, but I'm wondering if there's a better way to descretely grab those 3 pieces of information to store as variables for an asset inventory project I'm working on. We also have some non-netgate devices I'd like to be able to capture model/serial information on if possible.

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        On 23.05, you can get some info out of the nodes under sysctl dev.netgate for example dev.netgate.model

        But if you look at the source of /etc/rc.banner which draws the top lines of the menu, you can find the functions which fetch the other info. Some of it comes from kenv.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        B 1 Reply Last reply Reply Quote 0
        • B
          brandilton @jimp
          last edited by

          @jimp super helpful - just what I needed! I'm a powershell guy and here's where I landed on this in case anyone else is in the same boat:

          $hardwareModelRaw = & "$env:ProgramFiles\putty\plink.exe" admin@$pfSenseIP -pw $pfSensePW -batch -hostkey $pfSenseHostKey 'sysctl dev.netgate.desc'
          $pos = $hardwareModelRaw.indexof(": ")
          $hardwareModel = $hardwareModelRaw.substring($pos+2)
          $pfSerialNumber = & "$env:ProgramFiles\putty\plink.exe" admin@$pfSenseIP -pw $pfSensePW -batch -hostkey $pfSenseHostKey  '/bin/kenv -q uboot.boardsn'
          
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.