cancel
Showing results for 
Search instead for 
Did you mean: 

Unix Script to get Kernel Parameters

Former Member
0 Kudos

Hi All,

I need to create Unix Script on my SAP HP-Unix box using kctune command to fetch following Unix Kernel Parameters and write output to file:

msgmnb
msgtql            
msgmni            
shmmni            
vx_ninode
vxfs_ifree_timelag
maxdsiz_64bit     
maxssiz_64bit     
pa_maxssiz_64bit  
maxuprc           
nproc
max_thread_proc   

Please suggest me how can I write it, Concept is Script should fetch value of these Parameters and put output in a file on the server.

Regards,

Shivam Mittal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Please provide output of kctune command as it is

then we can work on it because right now I don't have HP-UX access

Former Member
0 Kudos

Hi Ahmad,

Thanks for reply, I am also in phase of getting Unix access for Servers.

As per URL - http://h20000.www2.hp.com/bc/docs/support/SupportManual/c02259653/c02259653.pdf

We only need to put kctune as command to see all parameters. So now We only need to find how to put its output to file, Please tell me do you think below script will work -

#!/bin/csh

kctune > output.log

or what else need to be added.

Shivam

Former Member
0 Kudos

yeah this will work and put all the content in the file.

I would like to append information each time in same file.

#!/bin/csh

date                                         >> /usr/sap/output123.log

/usr/sbin/kctune | grep msgmnb >> /usr/sap/output123.log

/usr/sbin/kctune | grep msgtql    >> /usr/sap/output123.log

/usr/sbin/kctune | grep msgmni  >> /usr/sap/output123.log

.....

like this for each parameter value

Former Member
0 Kudos

Hi Anand,

Thanks, Script is running as expected, Just one Last thing Can I update this script to get swap utilization, memory & CPU utilizations of the server.

Shivam

Former Member
0 Kudos

Hey Shivam,

You can append lines like

/usr/sbin/swapinfo                  >> /usr/sap/output123.log

or other commands you want to use for each of them, its fine too
If you want to use glance for all of the 3 info then you need to use grep, cut to get precise info.

if you want me to do it for you then you need to provide exact output of glance.

Consider assiging points if it helps.

Former Member
0 Kudos

Shivam,

If your glance output is like this screenshot

usr/perf/bin/glance  | grep Glance  >> /usr/sap/output123.log

echo "--------------------------------------------------------------------------------------------------"  >> /usr/sap/output123.log

usr/perf/bin/glance | grep Util        >> /usr/sap/output123.log

~~

By these 3 lines you can get CPU, Disk, Memory and Swap information

Please verify the full path of glance command.

Thanks

Answers (0)