- Community Home
- >
- Servers and Operating Systems
- >
- HPE 9000 and HPE e3000 Servers
- >
- Re: Soucre Code To Get Server Serial Number?
-
-
Forums
- Products
- Servers and Operating Systems
- Storage
- Software
- Services
- HPE GreenLake
- Company
- Events
- Webinars
- Partner Solutions and Certifications
- Local Language
- China - 简体中文
- Japan - 日本語
- Korea - 한국어
- Taiwan - 繁體中文
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Blog, Poland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Forums
-
Blogs
-
Information
-
English
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-08-2003 11:11 AM
05-08-2003 11:11 AM
Soucre Code To Get Server Serial Number?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-08-2003 07:38 PM
05-08-2003 07:38 PM
Re: Soucre Code To Get Server Serial Number?
A note from Harry D. Brown
uname -i is just as potentially inaccurate. If a system board was ever replaced, then this number is most likely to change. At one time HP engineers used to, when they remembered, moved the system number to the newer system board, but then there was a time when they were FORBIDDEN to move the numbers - of course screwing the serial number / system number relationship
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-08-2003 09:33 PM
05-08-2003 09:33 PM
Re: Soucre Code To Get Server Serial Number?
I think you can use Nikle script for this.
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-08-2003 10:24 PM
05-08-2003 10:24 PM
Re: Soucre Code To Get Server Serial Number?
you can read the serial number by using the OnlineDiagnostic Software. Using the STM interface, one can do an 'information' on 'System' and gets it.
The commandline Interface of STM - cstm - can be scripted:
echo "sel d 1\ninfo;wait\nil\ns\n/tmp/cstm.txt\n\n" | /usr/sbin/cstm >/dev/null
grep 'System Serial' /tmp/cstm.txt
By the way, this only applies to the fairly new server types, i.e. L-class, A-class, N-class, and above (all servers, which have the device 'system' in the device map of STM).
Regards.
Tobias
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-09-2003 05:35 AM
05-09-2003 05:35 AM
Re: Soucre Code To Get Server Serial Number?
I want source code, preferably in C so I can code this in a program to gather system information.
I know it can be done as the getsn program from HP does it. But since it's binary it's stand-alone. I want something I can encode into my C program.
I appreciate the fast response of everyone. I think I'm going to call it in directly to HP as some of their OS calls that are supposed to do this doesn't work.
Thanks
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-09-2003 09:50 AM
05-09-2003 09:50 AM
Re: Soucre Code To Get Server Serial Number?
you find out ... I have no
idea how to get a serial
number like USM15343YK
(e.g., as reported by stm)
Ironically, the stm script
posted earlier DOESN'T
show the serial number
reported by uname!
If you can't get the fancy one, the following at least shows how to get the uname -a number from uname().
NOTE: Itanium HP-UX machines
don't seem to have a reportable serial number, as this has reported 0 on every
one we've tried it on! (boo!)
#define _INCLUDE_POSIX_SOURCE
#include
int main()
{
struct utsname uts;
if (uname(&uts) < 0)
perror("uname");
printf ("sysname: %s\n", uts.sysname);
printf ("nodename: %s\n", uts.nodename);
printf ("release: %s\n", uts.release);
printf ("version: %s\n", uts.version);
printf ("machine: %s\n", uts.machine);
printf ("__idnumber: %s\n", uts.__idnumber);
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-09-2003 07:28 PM
05-09-2003 07:28 PM
Re: Soucre Code To Get Server Serial Number?
Early L Class servers all had this problem. It used to drive me up the wall because you can never start a HW ticket without the S/N.
The S/N will also appear on your original shipping manifest, can also be cross referenced by system handle with any software response center technician, or by the sales order number if you use a channel partner.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-12-2003 06:06 AM
05-12-2003 06:06 AM
Re: Soucre Code To Get Server Serial Number?
I???m sorry but the part of code of getsn you are looking for is classified as ???company confidential???. Therefore you will not find the source code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-14-2003 12:04 PM
05-14-2003 12:04 PM
Re: Soucre Code To Get Server Serial Number?
#include
main()
{
char buf[81];
if (confstr(_CS_MACHINE_SERIAL, buf, sizeof(buf)) <= 0) {
perror("confstr");
exit(1);
}
printf(" machine serial number = %s\n", buf);
}
# cc ser.c
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (ser.o) was detected. The linked output may not run on a PA 1.x system.
# ./a.out
machine serial number = USSxxxxxxx
# model
9000/800/L2000-44
#
This does not work on all systems, but clearly works on at least some L-class systems.
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2022 Hewlett Packard Enterprise Development LP