Operating System - HP-UX
1832927 Members
3229 Online
110048 Solutions
New Discussion

Re: Common user access to system info?

 
jmb
Regular Advisor

Common user access to system info?

It appears there are not too many commands available to non-privileged users to provide info about: number of CPUs & speed, model number, amount of memory and disk size.

Glance provides some of that, buried in an avalanche of other detail. The fully qualified 'ioscan' returns disk info, and 'model' returns some generally non-descriptive info.

Root access of course can show everything, but apart from a custom script, I don't know of any way for an average user to see the above info in a tidy little display....

Any suggestions? Thanks.
8 REPLIES 8
Sanjay_6
Honored Contributor

Re: Common user access to system info?

Hi,

As far as we are concened, an average user to not supposed to know these stuff.

If he needs some info, he should be contacting the sysadmin of the server to get the details.

Access to utilities like top, glance etc is availabe to everyone so that they can check on the performance etc of the system. There is not need for the average user to know the model number or understand the ioscan output. You don't need a sysadmin if an average user could understand all that.

Hope this helps.

Regds
Pete Randall
Outstanding Contributor

Re: Common user access to system info?

Perhaps it's a security feature. You probably really don't want the average user having direct access to the kernel. Your basic commands like model and ioscan can be executed but anything requiring access to the kernel needs root authority.

Your only alternative is to implement sudo and allow restricted root access to specific commands or, as root, gather all the information into a file that is available to common users.


Pete

Pete
jmb
Regular Advisor

Re: Common user access to system info?

Sanjay, that does not answer my question. If HP-UX does not have a way to provide this info simply, then it doesn't. I'm simply asking whether it does.
Steven E. Protter
Exalted Contributor

Re: Common user access to system info?

Yes.

Command by command you can provide functionality to users.

You risk compromising security and failing a security audit.

Lets say you want to give your users ping

as root
whence ping

gives you the full path to ping

chmod a+x /usr/sbin/ping

Security compromised.

If you are judicious about what commands you touch, you won't compromise security too much.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Geoff Wild
Honored Contributor

Re: Common user access to system info?

Command line - no.

But, you could install cfg2html

http://come.to/cfg2html

Then make the web pages available to your users.

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.
Sanjay_6
Honored Contributor

Re: Common user access to system info?

Hi,

We all build custom scripts to make sense out of the output of various system commands. I do not think there is any way to get everything you want the way you want.

A choice of what we want and how we want it also varies from person to person. A tidy little info of everything on the system is sure on everyone wish list, but do we expect to get it by default from the system without our own custom scripts. do not think we would get this wish fulfilled.

Hope this helps.

Regds
Geoff Wild
Honored Contributor

Re: Common user access to system info?

As Sanjay is alluding to, you caould write a script that gathers the info, puts it in a file that is accessable to your users, then they run a command that does a say "cat /mount/yourfile"

Example - use hpmem to create a file:

# cat /usr/local/bin/hpmem

#!/bin/ksh
#
# Taken from the HP/UniGraphics FAQ
# You must be ROOT to execute this since it uses adb to
# examine the running kernel
#
GetKernelSymbol()
{
echo "$1/D" | \
adb -k $hpux /dev/kmem | \
tr "\012" " " | \
read junk junk2 kval
}
hpux=/hp-ux
rev=$(uname -r | cut -d. -f2)
if ((rev > 9)); then hpux=/stand/vmunix ;fi
/bin/uname -a
GetKernelSymbol "processor_count"
print CPU Count: $kval
GetKernelSymbol "itick_per_tick"
let speed=kval/10000
print CPU Speed: $speed MHz
if ((rev > 10)); then
print CPU HW Support: `getconf HW_CPU_SUPP_BITS`-bit
print Kernel Support: `getconf KERNEL_BITS`-bit
GetKernelSymbol "memory_installed_in_machine"
else
GetKernelSymbol "physmem"
fi
let mb=kval*4/1024 # convert pages to MB
print RAM Size: $mb MB
GetKernelSymbol "bufpages"
let mb=kval*4/1024 # convert pages to MB
print bufpages: $mb MB
GetKernelSymbol "maxuprc"
print maxuprc: $kval
GetKernelSymbol "maxvgs"
print maxvgs: $kval
GetKernelSymbol "maxfiles"
print maxfiles: $kval
GetKernelSymbol "max_thread_proc"
print max_thread_proc: $kval
GetKernelSymbol "nfile"
print nfile: $kval
GetKernelSymbol "nflocks"
print nflock: $kval
GetKernelSymbol "nproc"
print nproc: $kval
GetKernelSymbol "ninode"
print ninode: $kval
GetKernelSymbol "vfd_cw"
print shmmax: $kval
GetKernelSymbol "shmmni"
print shmmni: $kval
GetKernelSymbol "dbc_max_pct"
print dbc_max_pct: $kval

In root's cron:
# run hpmem script to generate file for users
0 0 * * * /usr/local/bin/hpmem > /tmp/hpmem.txt

Users run say:

mysys

cat /usr/local/bin/mysys

#!/bin/sh
cat /tmp/hpmem.txt


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.
Alzhy
Honored Contributor

Re: Common user access to system info?

Or you ask your friendly and cordial HP Rep a copy of HP Sysinfo that you canput in cron and regulary generate HTML/Webpage of the server's configuration.

Or come up with your own..

Hakuna Matata.