<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[pulling model, serial number, netgate device ID from CLI]]></title><description><![CDATA[<p dir="auto">When I initially SSH in, the very first line before it shows the menu is:</p>
<p dir="auto">Netgate 3100 - Serial: XXXXXXXXXXX - Netgate Device ID: yyyyyyyyyyyyyyyyy</p>
<p dir="auto">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.</p>
]]></description><link>https://forum.netgate.com/topic/180328/pulling-model-serial-number-netgate-device-id-from-cli</link><generator>RSS for Node</generator><lastBuildDate>Wed, 17 Jun 2026 19:50:41 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/180328.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 24 May 2023 15:09:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to pulling model, serial number, netgate device ID from CLI on Thu, 25 May 2023 03:44:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jimp">@<bdi>jimp</bdi></a> 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:</p>
<pre><code>$hardwareModelRaw = &amp; "$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 = &amp; "$env:ProgramFiles\putty\plink.exe" admin@$pfSenseIP -pw $pfSensePW -batch -hostkey $pfSenseHostKey  '/bin/kenv -q uboot.boardsn'

</code></pre>
]]></description><link>https://forum.netgate.com/post/1106699</link><guid isPermaLink="true">https://forum.netgate.com/post/1106699</guid><dc:creator><![CDATA[brandilton]]></dc:creator><pubDate>Thu, 25 May 2023 03:44:06 GMT</pubDate></item><item><title><![CDATA[Reply to pulling model, serial number, netgate device ID from CLI on Wed, 24 May 2023 18:10:20 GMT]]></title><description><![CDATA[<p dir="auto">On 23.05, you can get some info out of the nodes under <code>sysctl dev.netgate</code> for example <code>dev.netgate.model</code></p>
<p dir="auto">But if you look at the source of <code>/etc/rc.banner</code> which draws the top lines of the menu, you can find the functions which fetch the other info. Some of it comes from <code>kenv</code>.</p>
]]></description><link>https://forum.netgate.com/post/1106588</link><guid isPermaLink="true">https://forum.netgate.com/post/1106588</guid><dc:creator><![CDATA[jimp]]></dc:creator><pubDate>Wed, 24 May 2023 18:10:20 GMT</pubDate></item></channel></rss>