Operating System - HP-UX
1825303 Members
3832 Online
109679 Solutions
New Discussion юеВ

Scripts to collect unix configuration parameters

 
SOLVED
Go to solution
Shivkumar
Super Advisor

Scripts to collect unix configuration parameters

Dear Sirs,

I am working on collecting kernel and other configuration parameters on hpux 11/11i.
Can anyone provide me some scripts so that i can run it and get the result quickly ?

Thanks,
Shiv
14 REPLIES 14
Patrick Wallek
Honored Contributor

Re: Scripts to collect unix configuration parameters

The main two that I use are:

CFG2HTML
http://come.to/cfg2html

Nickel
http://unixguide.net/cgi-bin/htsearch?words=nickel

You can also get some information from print_manifest which is included with Ignite.
Devesh Pant_1
Esteemed Contributor

Re: Scripts to collect unix configuration parameters

I like sysinfo a lot
you can get it from
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sysinfo-3.3.1/

It collects most of the important stuff

thanks
DP
Mel Burslan
Honored Contributor

Re: Scripts to collect unix configuration parameters

My choice would be cfg2html as well. See above for the location of download but first check it in /opt/perf/bin/cfg2html.sh. I have seen it included in later version of perf/glance pack installations
________________________________
UNIX because I majored in cryptology...
Joseph Loo
Honored Contributor

Re: Scripts to collect unix configuration parameters

hi shiv,

i would go for print_manifest (if u have Ignite installed) and nickel (cause they give u html report).

regards.
what you do not see does not mean you should not believe
Mahesh Kumar Malik
Honored Contributor

Re: Scripts to collect unix configuration parameters

Hi Shiv

cfg2html is one good utilty to collect kernel and other configuration parameters on hpux 11/11i.

You may download it from freeware,sharware sites

Regards
Mahesh
Muthukumar_5
Honored Contributor

Re: Scripts to collect unix configuration parameters

You can get kernel parameter information as,

kmtune -l

Network Configuration parameters,
ndd -h supported

Network and routing tables.
netstat -in
netstat -rn

General machine information.
uname -a

Use this commands to make shell script.

hth.
Easy to suggest when don't know about the problem!
H.Merijn Brand (procura
Honored Contributor
Solution

Re: Scripts to collect unix configuration parameters

In http://forums2.itrc.hp.com/service/forums/questionanswer.do?threadId=65781 I attached kmtune.pl, a perl wrapper over kmtune that will show the kernel parameters in dec and hex, but also the default values and the formulas

http://forums2.itrc.hp.com/service/forums/getattachment.do?attachmentId=4902&ext=.txt

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Yogeeraj_1
Honored Contributor

Re: Scripts to collect unix configuration parameters

hi,

also try the Oracle RDA script for hp-ux.

hope this helps too!

regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Cem Tugrul
Esteemed Contributor

Re: Scripts to collect unix configuration parameters

Shiv,

i sometimes use "kmtune" command for my kernel parameters.
see also man kmtune with other options,
Good Luck,
Our greatest duty in this life is to help others. And please, if you can't
Doug Burton
Respected Contributor

Re: Scripts to collect unix configuration parameters

I like cfg2html as well. It can be found at: http://groups.yahoo.com/group/cfg2html.

You can then cron it:
# Gather system data once a week (on Monday @ 12:00am).
0 0 * * 1 /opt/cfg2html/cfg2html_hpux.sh &

Also........

The html, text and error info by default are created in the /opt/cfg2html directory. To save these files someplace else, modify the OUTDIR variable found in the /opt/cfg2html/cfg2html_hpux.sh file.

NOTE:
You may want to comment/remove the "script" code found in the
/opt/cfg2html/plugins/head01.html and head02.html files. This
code will fire off advertising garbage when the finished
cfg2html web page is viewed.

rmueller58
Valued Contributor

Re: Scripts to collect unix configuration parameters

Shiv,

I've attached a couple of items I received from HP a while ago to do just that.

Also
Below is a list of commands to run on a system to pull certain parameters, if you are more specific about what you WANT to collect perhaps someone can give you better info.

here are the things I use when trying to determine a variety of things - I redirect info to a file or parse data from the output of a command to pull into a spreadsheet for graphing purposes such as as system performance.

#Kernel Parameters
kmtune -l

#Hardware
ioscan -v

#Raid Configuration
/sbin/irdiag -v

System Resources
sar -b
Example1:
sar -b 5 100
this will pull interations of sar activity showing information useful in tuning your kernel depending on what particular bit of the kernel you are concerned with you will want to check this thread for info as I recently went through a kernel tune with the help of some of the kernel gurus.

http://forums2.itrc.hp.com/service/forums/questionanswer.do?threadId=915316



08:16:54 bread/s lread/s %rcache bwrit/s lwrit/s %wcache pread/s pwrit/s
08:16:55 0 51 100 0 16 100 2 0

1

Example2

#sar -v 1 1
08:17:34 text-sz ov proc-sz ov inod-sz ov file-sz ov
08:17:35 N/A N/A 337/1834 0 1518/2048 0 2290/29568 0


I wrote a script to collect sar information and port a flat file. I would modify it based on your # of CPUs. I have dual, in order to capture multiple CPUs you would have to play with the tail/head commands to parse the correct output

sarmon.sh
#!/bin/sh
export line1=`sar -uM 1 1|tail -2|head -1|awk '{print $1,$2,$3,$4,$5}'`
export line2=`sar -uM 1 1|tail -3|head -1|awk '{print $2,$3,$4,$5,$6}'`
export time1=`sar -uM 1 1|tail -4|head -1| awk '{print $1}'`

echo "$time1" "$line2" >> /restore/sar`date +%m%d%Y`.log
echo "$time1" "$line1" >> /restore/sar`date +%m%d%Y`.log

I do something similar with vmstat

export line=`vmstat 1 1 |tail -1`
export dt=`date "+DATE: %m/%d/%y TIME: %H:%M:%S"`
echo "$dt" "$line" >> /restore/vmstat`date +%m%d%Y`.log

I have placed both of these commands in the root crontab to check my system (1 Interation, 1 time) croned every 5 minutes
5,10,15,20,25,30,35,40,45,50,55 6-18 * * 1-5 /pei/peitools/bin/vmmon.sh
5,10,15,20,25,30,35,40,45,50,55 6-18 * * 1-5 /pei/peitools/bin/sarmon.sh



#!/usr/bin/sh
# @(#)infocollect 01.01 December 22, 2004
#
# unsupported utility to collect ***system information***
#
# last modified
# 12/22/04 ekh correction
# 10/27/03 ekh

NAME=`uname -n |awk -F\. '{print $1}'`
OS=`uname -r |awk -F\. '{print $2}'`
TAG=`date +%m%d_%H%M`
INFO=/tmp/HP_info.$NAME.$TAG.txt
if [ $OS -eq 11 ]; then
CURRENT_KERNEL_SETTINGS=/usr/sbin/kmtune
else
CURRENT_KERNEL_SETTINGS=/usr/sbin/sysdef
fi

if [ "`whoami`" != "root" ]; then
echo must be root run this
exit 1
fi

echo "Collecting system information."
echo " Be patient as this may take a minue or two to run...\\c"

(echo date;echo "----" ) > $INFO
date >> $INFO
(echo ""; echo uname; echo "------" ) >> $INFO
uname -a >> $INFO
(echo ""; echo model; echo "------" ) >> $INFO
model >> $INFO
if [ $OS -eq 11 ]; then
(echo ""; echo '32-bit or 64-bit?'; echo "-----------------") >> $INFO
getconf KERNEL_BITS >> $INFO
fi
(echo ""; echo "uptime"; echo "------") >> $INFO
uptime >> $INFO
(echo ""; echo "dmesg"; echo "-----") >> $INFO
dmesg >> $INFO
(echo ""; echo "ll /stand"; echo "---------") >> $INFO
ll /stand >> $INFO
(echo ""; echo "ls -ltr /var/adm/sw/products"; echo "----------------------------") >> $INFO
ls -ltr /var/adm/sw/products >> $INFO
(echo ""; echo "lanscan"; echo "-------") >> $INFO
echo .\\c
lanscan >> $INFO
(echo ""; echo "bdf"; echo "---") >> $INFO
bdf >> $INFO
(echo ""; echo "/etc/fstab"; echo "----------") >> $INFO
cat /etc/fstab >> $INFO
(echo ""; echo "strings /etc/lvmtab"; echo "-------------------") >> $INFO
strings /etc/lvmtab >> $INFO
(echo ""; echo "swapinfo -tm"; echo "------------") >> $INFO
swapinfo -tm >> $INFO
(echo ""; echo "current value of buffer cache (in bytes)"; echo "----------------------------------------") >> $INFO
echo "" ;echo "bufpages/D" | adb /stand/vmunix /dev/kmem | awk '{if (NF == 2) printf("%d\n", $2*4096) }' >> $INFO
(echo ""; echo "ioscan -fn"; echo "----------") >> $INFO
ioscan -fn >> $INFO
(echo ""; echo "lnvlboot -v"; echo "-----------") >> $INFO
lvlnboot -v >> $INFO
(echo ""; echo "vgdisplay -v"; echo "------------") >> $INFO
vgdisplay -v >> $INFO
echo .\\c
(echo ""; echo "/etc/inittab"; echo "------------") >> $INFO
cat /etc/inittab >> $INFO
(echo ""; echo "crontab -l"; echo "----------") >> $INFO
crontab -l >> $INFO
(echo ""; echo "swlist"; echo "------") >> $INFO
swlist >> $INFO
echo .\\c
(echo ""; echo "swlist -l bundle"; echo "----------------") >> $INFO
swlist -l bundle >> $INFO
(echo ""; echo "swlist -l fileset"; echo "-----------------") >> $INFO
swlist -l fileset >> $INFO
echo .\\c
if [ $OS -eq 11 -a -f /usr/contrib/bin/show_patches ]; then
(echo ""; echo 'show_patches'; echo "------------") >> $INFO
show_patches >> $INFO
else
(echo ""; echo 'patches'; echo "-------") >> $INFO
swlist -l fileset |grep PH |grep -v '#' | \
awk -F\. '{print $1}'| sort -u >> $INFO
fi

echo "Done."
echo "$INFO file has been created."

rmueller58
Valued Contributor

Re: Scripts to collect unix configuration parameters

Perfdata collection utility from HP

Place both files in /usr/lbin

run, an output file will be place in /tmp

open or print that file for review. I do not recall the output file name
Geoff Wild
Honored Contributor

Re: Scripts to collect unix configuration parameters

And here's the sysinfo from HP.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
rmueller58
Valued Contributor

Re: Scripts to collect unix configuration parameters

Shiv,
on both the attached file you may need to run dos2ux against them, as I found carriage returns as I pulled them across..
example
dos2ux perfdata > perfdata2

chmod 700 perfdata2
./perfdata2
Collecting Performance related information/statistics.
Be patient as this will take about 40 minutes to run...