Operating System - HP-UX
1833758 Members
3269 Online
110063 Solutions
New Discussion

I need to know how to get specific information from HP-UX OS

 
SOLVED
Go to solution
Samir Bittar
Occasional Contributor

I need to know how to get specific information from HP-UX OS

I need to write a script that shows specific information from the server using HP-UX that I'm connected on, but I don't know what commands can show me the info I need.
Can anyone help me out? Here's the information I need:
- The patch level installed on the system
- If the system is running on 32-bit or 64-bit mode
- Host ID Number
- Location of the PageFile
- How much RAM the system has
- The CPU's TYPE, SPEED and how many CPUs are there (COUNT)
- The server's IP Address
- IP Gateway
- IP Subnet Mask
- MAC Address
- Primary / Secondary DNS
- The name of the interface that has that information
Thanks for the help
23 REPLIES 23
Fabio Ettore
Honored Contributor
Solution

Re: I need to know how to get specific information from HP-UX OS

Hi Samir,

from Ignite-UX utilities you will find /opt/ignite/bin/print_manifest that gains many info on the system (probably all of them you are requesting).

Here you obtain Ignite-UX:

http://www.docs.hp.com/en/IUX/download.html

Good luck.

Best regards,
Fabio
WISH? IMPROVEMENT!
Joseph Loo
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

hi,

u may like to download nickel which will have most of the info needed in web pages:

http://h20331.www2.hp.com/hpsub/cache/286022-0-0-225-121.html

also, sysinfo will gather some of the info needed

regards.
what you do not see does not mean you should not believe
Arunvijai_4
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

Hello Samir,

Q1) - The patch level installed on the system

# /usr/contrib/bin/show_patches

Q2) If the system is running on 32-bit or 64-bit mode

# getconf KERNEL_BITS
# file /stand/vmunix

Q3) Host ID Number
/usr/sbin/lanscan | grep 0x | cut -c12-23

Q4) Location of the PageFile
swapinfo

Q5) How much RAM the system has

# top and then look at memory or SAM

Q6) The CPU's TYPE, SPEED and how many CPUs are there (COUNT)

# getconf CPU_CHIP_TYPE
# getconf HW_CPU_SUPP_BITS
# getconf MACHINE_MODEL
# grep $(printf "0x%x" $(getconf _SC_CPU_VERSION)) /usr/include/sys/unistd.h

Q7) The server's IP Address/Gateway/Subnet mask/MAC

# ifconfig lan0

Q8) Primary/Secondary DNS

# grep -i "nameserver" /etc/resolv.conf

-Arun


"A ship in the harbor is safe, but that is not what ships are built for"
Pete Randall
Outstanding Contributor

Re: I need to know how to get specific information from HP-UX OS

My normal response to this type of question should cover most of your requirements:

If you have Ignite installed, you can use the print_manifest command.

You can also use SAM to display system properties (Sam -> Performance
Monitors -> System Properties).

There are also utilities like "cfg2html" ( http://come.to/cfg2html ),
"nickel" ( ftp://ftp.hp.com/pub/catia/Utils/nickel.shar ) and "sysinfo"
( http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sysinfo-3.3.1/ ).

Finally, you can also obtain this information from the command line with a
series of little scripts like these:

CPU

HPUX=/stand/vmunix

MODEL=$(grep -i $(model | tr "/" " " \
| awk '{print $NF}') \
/usr/sam/lib/mo/sched.models \
| awk '{print $NF}')

MHZ=$(echo itick_per_tick/D \
| adb -k $HPUX /dev/kmem \
| tail -1 \
| awk '{print $2/10000}')
echo `hostname` has `ioscan -k |grep -n processor \
|wc -l` $MODEL $MHZ "Mhz processor(s)"


Number of CPUs

ioscan -k |grep -n processor |wc -l




RAM

HPUX=/stand/vmunix
MAJORREV=$(uname -r | cut -f2 -d .)
if [ $MAJORREV -ge "11.0" ]
then
MYSYMBOL="phys_mem_pages"
else
MYSYMBOL="physmem"
fi

MYMEM=$(echo "${MYSYMBOL}/D" \
| adb $HPUX /dev/kmem \
| grep "${MYSYMBOL}: *." \
| awk '{printf "%.0f MB\n",$2/256}')
echo $MYMEM



And, even more finally, you can obtain CPU speed and RAM without CSTM or root ac
cess as described by Nancy Rippey here:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=851889


Pete

Pete
Samir Bittar
Occasional Contributor

Re: I need to know how to get specific information from HP-UX OS

Thanks, however I don't have permission to install anything on these machines... Are there any other ways?
Devender Khatana
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

Hi,

Most of this information requires super user privlages. Many of these information can be get by running a single command from a super user

#/opt/ignite/bin/print_manifest

HTH,
Devender
Impossible itself mentions "I m possible"
Arunvijai_4
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

Hi,

You can use the commands given by me and SEP.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Samir Bittar
Occasional Contributor

Re: I need to know how to get specific information from HP-UX OS

Thanks everyone for the ultra fast help!
Arunvijai_4
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

Hello, Looking at these threads may also help you,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=962014
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=778883


-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Samir Bittar
Occasional Contributor

Re: I need to know how to get specific information from HP-UX OS

if I go to:
SAM --> Performance Monitors --> System Properties
There is a field that says Machine Identification
That's the number I need for Host Number.. However, is there a way of getting that number with commands so I can put it on a script?
Thanks
Arunvijai_4
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

Hi Samir,

# /usr/sbin/lanscan | grep 0x | cut -c12-23

It will display HostID.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Arunvijai_4
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

There is a typo in my post,It should be Pete not SEP. Sorry Pete.

Please assign 0 points to this.

With regrets,
Arun
"A ship in the harbor is safe, but that is not what ships are built for"

Re: I need to know how to get specific information from HP-UX OS

Host ID : uname -i
MAc Address: /usr/sbin/lanscan | grep 0x | cut -c12-23
Muthukumar_5
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

You can use sysinfo script for hp-ux platforms.

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/sysinfo-3.3.1/

--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

Q) The patch level installed on the system

swlist -l patch or show_patches

Q) If the system is running on 32-bit or 64-bit mode

getconf KERNEL_BITS

Q) Host ID Number

uname -i

Q) Location of the PageFile
Q) How much RAM the system has
Q) The CPU's TYPE, SPEED and how many CPUs are there (COUNT)

You can get this from sam as,

sam -> performance monitor -> system properties

Q) The server's IP Address

netstat -ivn

Q) IP Gateway
Q) IP Subnet Mask

netstat -rvn


Q) MAC Address (Station Address)

lanscan

Q) Primary / Secondary DNS

cat /etc/resolv.conf

Q) The name of the interface that has that information

netstat -ivn

It will give those informations.

--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

refer this more:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=706790

--
Muthu
Easy to suggest when don't know about the problem!
Cem Tugrul
Esteemed Contributor

Re: I need to know how to get specific information from HP-UX OS

Hi Samir,

My favourites are cfg2html and print_manifest
.As others mentioned these are for to get deeep information about your system.For to get quick information such as model,cpu,ram,serial etc i always use print_manifest but for to get brief report
i run cfg2html monthly and it generates an html file.

Good Luck,
Our greatest duty in this life is to help others. And please, if you can't
Samir Bittar
Occasional Contributor

Re: I need to know how to get specific information from HP-UX OS

Thanks everyone for all the help!
Just one last thing:
When I run the following command:
/opt/ignite/bin/print_manifest \
| grep "Model:" | awk '{print $2}'
it prints out the CPU Model that comes out of print_manifest, for example: 9000/800/L3000-6x
however, print_manifest is something that takes a while to execute...
Does anyone know another command that may return this same information for me? Thanks.
Arunvijai_4
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

Hi Samir,

# uname -m
9000/800

and
# model
9000/800/rp3410

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Arunvijai_4
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

Hi Again,

# cat /usr/sam/lib/mo/sched.models will list all model information.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Arunvijai_4
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

Hi Samir, a very good thread to look at,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=939417
[Overview of system model strings]

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Ted Buis
Honored Contributor

Re: I need to know how to get specific information from HP-UX OS

If you have the support tools loaded you could run "SysInfo -a".
Mom 6
Charles Holland
Trusted Contributor

Re: I need to know how to get specific information from HP-UX OS

Samir,

Take a look at the script that is attached. We run it on a monthly basis.

Regards
"Not everything that can be counted counts, and not everything that counts can be counted" A. Einstein