- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- HPE 9000 and HPE e3000 Servers
- >
- Re: Soucre Code To Get Server Serial Number?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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.