Xymon Mailing List Archive search

get server serial no in xymon

7 messages in this thread

list Yadvendra Kushwaha · Fri, 24 May 2019 17:34:02 -0400 ·
Hi Guys
Is there any way to pull out server serial no under info section in xymon?

Thanks
list Richard L. Hamilton · Fri, 24 May 2019 18:14:48 -0400 ·
Not consistently; depends on that system's make, model, and OS.  For instance, on my Sun SPARC systems, I can do it on the T5240 (using ipmitool to talk to its system controller; on x86 Sun systems, smbios might be used instead), but not the Sun Blade 100 or Sun Blade 2000 (although if you google solaris sneep, you'll find a tool that will let you manually store it in the eeprom, where it's easily enough retrievable). On PCs, and esp. with the convoluted (to my mind) nature of Windows, to say "your results may vary" is understating it - I looked up a trick for doing that (at command prompt, wmic bios getserialnumber) and it failed.  Some systems may not even make the serial number visible to software at all.
quoted from Yadvendra Kushwaha
On May 24, 2019, at 17:34, Yadvendra kushwaha <user-c1aa0b7f48b5@xymon.invalid> wrote:

Hi Guys Is there any way to pull out server serial no under info section in xymon?

Thanks

list David Boyer · Fri, 24 May 2019 19:42:50 -0400 ·
Yea, what he said! ;-)

Dave

On Fri, May 24, 2019 at 6:15 PM Richard L. Hamilton <user-af55987f6d56@xymon.invalid>
quoted from Richard L. Hamilton
wrote:
Not consistently; depends on that system's make, model, and OS.  For
instance, on my Sun SPARC systems, I can do it on the T5240 (using ipmitool
to talk to its system controller; on x86 Sun systems, smbios might be used
instead), but not the Sun Blade 100 or Sun Blade 2000 (although if you
google solaris sneep, you'll find a tool that will let you manually store
it in the eeprom, where it's easily enough retrievable). On PCs, and esp.
with the convoluted (to my mind) nature of Windows, to say "your results
may vary" is understating it - I looked up a trick for doing that (at
command prompt, wmic bios getserialnumber) and it failed.  Some systems may
not even make the serial number visible to software at all.
On May 24, 2019, at 17:34, Yadvendra kushwaha <user-c1aa0b7f48b5@xymon.invalid>
wrote:

Hi Guys
Is there any way to pull out server serial no under info section in
xymon?

Thanks

list Richard L. Hamilton · Fri, 24 May 2019 21:14:53 -0400 ·
Having been provoked by the question, I dug further...which still doesn't mean it's always possible!  Here's my notes to date:

MacOS (at least 10.6 and later, Intel):
    /usr/sbin/ioreg -l|sed -n -e 's/.*IOPlatformSerialNumber" = "\([^"]\{1,\}\)"$/\1/p'

Solaris on T5240 (probably most sun4v, maybe even genuine Sun x86 hardware, that has a system controller
that responds to ipmitool):
    ipmitool -H _system_controller_hostname_ -U _user_ -P _password_  sunoem getval /SYS/product_serial_number|sed -e 's/.*alue: *//'
    (substitute for the _tokens_ above the actual values described)
    note: this requires a version of ipmitool that supports "sunoem"

Linux (no guarantees, since not all PCs can provide software-readable hardware serial number, and Linux runs on lots of systems that aren't PCs):
    see https://www.2daygeek.com/how-to-check-system-hardware-manufacturer-model-and-serial-number-in-linux/
    (for VMs, the results will depend on the VM hosting software, and may not be obviously meaningful)

Windows:
    see https://www.howtogeek.com/294712/how-to-find-your-windows-pcs-serial-number/

Various:
    see http://kb.mit.edu/confluence/pages/viewpage.action?pageId=152578725

Solaris x86 on Sun hardware (haven't tried):
    see https://www.linuxquestions.org/questions/solaris-opensolaris-20/how-to-find-machine-serial-number-of-solaris-machine-642552/

Comment:
The Macs, which in some respects aren't that amenable to large-scale management (nothing quite equivalent to Windows policies in Active Directory, for example), are by far the best about this, IMO. Probably that's because anyone placing a trouble call will need that info, and with Macs, that might be done by an end user themselves...who would doubtless just use Apple Menu -> About This Mac to do it with the GUI, rather than using the command line at all. Of course, having the serial in the Xymon history is nice if the system is down and won't respond to queries, and your other records are too unreliable to find it easily.  But given the difficulty of getting it into Xymon for that or similar purposes on enough physical platforms, I don't see that there's a lot of hope in it for that purpose.
quoted from David Boyer

On May 24, 2019, at 19:42, David Boyer <user-a6c09f28d9d2@xymon.invalid> wrote:

Yea, what he said! ;-)

Dave

On Fri, May 24, 2019 at 6:15 PM Richard L. Hamilton <user-af55987f6d56@xymon.invalid <mailto:user-af55987f6d56@xymon.invalid>> wrote:
Not consistently; depends on that system's make, model, and OS.  For instance, on my Sun SPARC systems, I can do it on the T5240 (using ipmitool to talk to its system controller; on x86 Sun systems, smbios might be used instead), but not the Sun Blade 100 or Sun Blade 2000 (although if you google solaris sneep, you'll find a tool that will let you manually store it in the eeprom, where it's easily enough retrievable). On PCs, and esp. with the convoluted (to my mind) nature of Windows, to say "your results may vary" is understating it - I looked up a trick for doing that (at command prompt, wmic bios getserialnumber) and it failed.  Some systems may not even make the serial number visible to software at all.
On May 24, 2019, at 17:34, Yadvendra kushwaha <user-c1aa0b7f48b5@xymon.invalid <mailto:user-c1aa0b7f48b5@xymon.invalid>> wrote:

Hi Guys 
Is there any way to pull out server serial no under info section in xymon?

Thanks


Xymon at xymon.com <

Xymon at xymon.com <
list Bruce Ferrell · Fri, 24 May 2019 18:40:53 -0700 ·
On Linux systems (even VMs) dmidecode is a good bet.  It works on Macs too, if it's installed and the output is VERY regular and standardized
quoted from Richard L. Hamilton


On 5/24/19 6:14 PM, Richard L. Hamilton wrote:
Having been provoked by the question, I dug further...which still doesn't mean it's always possible!  Here's my notes to date:

MacOS (at least 10.6 and later, Intel):
    /usr/sbin/ioreg -l|sed -n -e 's/.*IOPlatformSerialNumber" = "\([^"]\{1,\}\)"$/\1/p'

Solaris on T5240 (probably most sun4v, maybe even genuine Sun x86 hardware, that has a system controller
that responds to ipmitool):
    ipmitool -H _system_controller_hostname_ -U _user_ -P _password_  sunoem getval /SYS/product_serial_number|sed -e 's/.*alue: *//'
    (substitute for the _tokens_ above the actual values described)
    note: this requires a version of ipmitool that supports "sunoem"

Linux (no guarantees, since not all PCs can provide software-readable hardware serial number, and Linux runs on lots of systems that aren't PCs):
    see https://www.2daygeek.com/how-to-check-system-hardware-manufacturer-model-and-serial-number-in-linux/
    (for VMs, the results will depend on the VM hosting software, and may not be obviously meaningful)

Windows:
    see https://www.howtogeek.com/294712/how-to-find-your-windows-pcs-serial-number/

Various:
    see http://kb.mit.edu/confluence/pages/viewpage.action?pageId=152578725

Solaris x86 on Sun hardware (haven't tried):
    see https://www.linuxquestions.org/questions/solaris-opensolaris-20/how-to-find-machine-serial-number-of-solaris-machine-642552/

Comment:
The Macs, which in some respects aren't that amenable to large-scale management (nothing quite equivalent to Windows policies in Active Directory, for example), are by far the 
best about this, IMO. Probably that's because anyone placing a trouble call will need that info, and with Macs, that might be done by an end user themselves...who would doubtless 
just use Apple Menu -> About This Mac to do it with the GUI, rather than using the command line at all. Of course, having the serial in the Xymon history is nice if the system is 
down and won't respond to queries, and your other records are too unreliable to find it easily.  But given the difficulty of getting it into Xymon for that or similar purposes on 
enough physical platforms, I don't see that there's a lot of hope in it for that purpose.

On May 24, 2019, at 19:42, David Boyer <user-a6c09f28d9d2@xymon.invalid <mailto:user-a6c09f28d9d2@xymon.invalid>> wrote:

Yea, what he said! ;-)

Dave

On Fri, May 24, 2019 at 6:15 PM Richard L. Hamilton <user-af55987f6d56@xymon.invalid <mailto:user-af55987f6d56@xymon.invalid>> wrote:

    Not consistently; depends on that system's make, model, and OS.  For instance, on my Sun SPARC systems, I can do it on the T5240 (using ipmitool to talk to its system
    controller; on x86 Sun systems, smbios might be used instead), but not the Sun Blade 100 or Sun Blade 2000 (although if you google solaris sneep, you'll find a tool that
    will let you manually store it in the eeprom, where it's easily enough retrievable). On PCs, and esp. with the convoluted (to my mind) nature of Windows, to say "your
    results may vary" is understating it - I looked up a trick for doing that (at command prompt, wmic bios getserialnumber) and it failed.  Some systems may not even make the
    serial number visible to software at all.
On May 24, 2019, at 17:34, Yadvendra kushwaha <user-c1aa0b7f48b5@xymon.invalid <mailto:user-c1aa0b7f48b5@xymon.invalid>> wrote:

Hi Guys
Is there any way to pull out server serial no under info section in xymon?

Thanks

list Richard L. Hamilton · Fri, 24 May 2019 22:31:45 -0400 ·
Hmm.  MacPorts has it (I think homebrew might too, not sure about fink).  This worked for me:
dmidecode -t system 2>/dev/null | awk '/Serial Number:/ {print $NF}'

The 2>/dev/null was because it kept spitting out a "Bad address" message, although it otherwise worked fine.

Oh, and the Windows command did work for me once I figured out that the examples I saw were missing a space.  It should be

wmic bios get SerialNumber

(although SerialNumber isn't case-sensitive)
quoted from Bruce Ferrell
On May 24, 2019, at 21:40, Bruce Ferrell <user-24fbf1912cfe@xymon.invalid> wrote:


On Linux systems (even VMs) dmidecode is a good bet.  It works on Macs too, if it's installed and the output is VERY regular and standardized


On 5/24/19 6:14 PM, Richard L. Hamilton wrote:
Having been provoked by the question, I dug further...which still doesn't mean it's always possible!  Here's my notes to date:

MacOS (at least 10.6 and later, Intel):
    /usr/sbin/ioreg -l|sed -n -e 's/.*IOPlatformSerialNumber" = "\([^"]\{1,\}\)"$/\1/p'

Solaris on T5240 (probably most sun4v, maybe even genuine Sun x86 hardware, that has a system controller
that responds to ipmitool):
    ipmitool -H _system_controller_hostname_ -U _user_ -P _password_  sunoem getval /SYS/product_serial_number|sed -e 's/.*alue: *//'
    (substitute for the _tokens_ above the actual values described)
    note: this requires a version of ipmitool that supports "sunoem"

Linux (no guarantees, since not all PCs can provide software-readable hardware serial number, and Linux runs on lots of systems that aren't PCs):
    see https://www.2daygeek.com/how-to-check-system-hardware-manufacturer-model-and-serial-number-in-linux/
    (for VMs, the results will depend on the VM hosting software, and may not be obviously meaningful)

Windows:
    see https://www.howtogeek.com/294712/how-to-find-your-windows-pcs-serial-number/

Various:
    see http://kb.mit.edu/confluence/pages/viewpage.action?pageId=152578725

Solaris x86 on Sun hardware (haven't tried):
    see https://www.linuxquestions.org/questions/solaris-opensolaris-20/how-to-find-machine-serial-number-of-solaris-machine-642552/

Comment:
The Macs, which in some respects aren't that amenable to large-scale management (nothing quite equivalent to Windows policies in Active Directory, for example), are by far the best about this, IMO. Probably that's because anyone placing a trouble call will need that info, and with Macs, that might be done by an end user themselves...who would doubtless just use Apple Menu -> About This Mac to do it with the GUI, rather than using the command line at all. Of course, having the serial in the Xymon history is nice if the system is down and won't respond to queries, and your other records are too unreliable to find it easily.  But given the difficulty of getting it into Xymon for that or similar purposes on enough physical platforms, I don't see that there's a lot of hope in it for that purpose.

On May 24, 2019, at 19:42, David Boyer <user-a6c09f28d9d2@xymon.invalid <mailto:user-a6c09f28d9d2@xymon.invalid>> wrote:

Yea, what he said! ;-)

Dave

On Fri, May 24, 2019 at 6:15 PM Richard L. Hamilton <user-af55987f6d56@xymon.invalid <mailto:user-af55987f6d56@xymon.invalid>> wrote:

   Not consistently; depends on that system's make, model, and OS.  For instance, on my Sun SPARC systems, I can do it on the T5240 (using ipmitool to talk to its system
   controller; on x86 Sun systems, smbios might be used instead), but not the Sun Blade 100 or Sun Blade 2000 (although if you google solaris sneep, you'll find a tool that
   will let you manually store it in the eeprom, where it's easily enough retrievable). On PCs, and esp. with the convoluted (to my mind) nature of Windows, to say "your
   results may vary" is understating it - I looked up a trick for doing that (at command prompt, wmic bios getserialnumber) and it failed.  Some systems may not even make the
   serial number visible to software at all.
On May 24, 2019, at 17:34, Yadvendra kushwaha <user-c1aa0b7f48b5@xymon.invalid <mailto:user-c1aa0b7f48b5@xymon.invalid>> wrote:

Hi Guys
Is there any way to pull out server serial no under info section in xymon?

Thanks
list Richard L. Hamilton · Fri, 24 May 2019 22:48:58 -0400 ·
quoted from Richard L. Hamilton
On May 24, 2019, at 22:31, Richard L. Hamilton <user-af55987f6d56@xymon.invalid> wrote:

Hmm.  MacPorts has it (I think homebrew might too, not sure about fink).  This worked for me:
dmidecode -t system 2>/dev/null | awk '/Serial Number:/ {print $NF}'

The 2>/dev/null was because it kept spitting out a "Bad address" message, although it otherwise worked fine.
This works better in case there are spaces in the serial number (there were in my Linux VM's under Parallels on my Macs), and still works on MacOS itself:
dmidecode -t 1 2>/dev/null | sed -n -e 's/.*Serial Number: *//p'