04-24-2008
Just run kstat. Without args it prints everything.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I am looking for a cpu usage data (%usr, %iowait, %idle, %kernel) using kstat. The output of kstat is below. How do I interpret those numeric values? In other words, how do I calculate the percentage value using the values below?
Thanks a lot!
Ozvena
module: cpu_stat ... (4 Replies)
Discussion started by: ozvena
4 Replies
2. Shell Programming and Scripting
Can I use search & replace in any variable?
Suppose I have one variable named var1 which holds value "abcabc" I need to search 'a' in var1 and want to replace with 'x' like 'xbcxbc'. Is it possible? Can you provide me an example?
Malay (3 Replies)
Discussion started by: malaymaru
3 Replies
3. Shell Programming and Scripting
hi all,
i'm looking for a bash or tcsh script that will clone an empty dir tree 'over' another tree ...
specifically, i'd like to:
(1) specify a src directory
(2) list the directory tree/hiearchy beneath that src dir, w/o files -- just the dirs
(3) clone that same, empty dir hierarchy to... (2 Replies)
Discussion started by: OpenMacNews
2 Replies
4. Solaris
We used kstat on netra240/440 to check if the link is full duplex. So we do something like:
bash-3.00# kstat -pc net bge:1::/'link_duplex'/ | cut -f2
2
The output 2 indicates the link is full duplex. This kind of check worked all right for Netra 240/440 systems.
However, the nxge... (2 Replies)
Discussion started by: illcar
2 Replies
5. Solaris
I have a server on Solaris 8 who had a sudden reboot once and now the messages log is filled with these errors:
Mar 23 02:14:42 srt-hlr-b unix: NOTICE: kstat_create('unix', 0, 'icmp_minor_1'): cannot create kstat before kstat_init()
Mar 23 02:14:42 srt-hlr-b unix: NOTICE: kstat_create('vmem',... (10 Replies)
Discussion started by: StarSol
10 Replies
6. Shell Programming and Scripting
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies
7. Shell Programming and Scripting
I have tried everything I can think of to get sed to change line N of a file to the contents of a variable. I have Googled the Internet, and I find lots of people telling how to use variables with the "Substitute" command, but no one telling how to use variables with the "Change" command.
I... (4 Replies)
Discussion started by: Mr.Lauren
4 Replies
8. Solaris
I'm having a little trouble understanding the output I'm seeing from kstat for the "net" class. I'm seeing a lot of entries with "mac" as the name, like this.
module: bge instance: 3
name: mac class: net
... (3 Replies)
Discussion started by: Midcain
3 Replies
9. UNIX for Dummies Questions & Answers
I am using this code:
for e in {1..14}
do
awk '{gsub(/^.*GGGGGG|TTTTT.*$/,"",$0)} 1' $e.1 > ${e}.2
done
However, in the second loop instead of GGGGGG|TTTTT, I should use AAAAAA|CCCCCC.
For third loop CCAAAA|CCCCAA, so on and so forth. Is there any way to accomplish this without writing... (20 Replies)
Discussion started by: Xterra
20 Replies
10. UNIX for Advanced & Expert Users
I have a below syntax its working fine...
var12=$(ps -ef | grep apache | awk '{print $2,$4}')
Im getting expected output as below:
printf "%b\n" "${VAR12}"
dell 123
dell 456
dell 457
Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
LEARN ABOUT OPENSOLARIS
kstat_data_lookup
kstat_lookup(3KSTAT) Kernel Statistics Library Functions kstat_lookup(3KSTAT)
NAME
kstat_lookup, kstat_data_lookup - find a kstat by name
SYNOPSIS
cc [ flag... ] file... -lkstat [ library...]
#include <kstat.h>
kstat_t *kstat_lookup(kstat_ctl_t *kc, char *ks_module, int ks_instance,
char *ks_name);
void *kstat_data_lookup(kstat_t *ksp, char *name);
DESCRIPTION
The kstat_lookup() function traverses the kstat chain, kc->kc_chain, searching for a kstat with the same ks_module, ks_instance, and
ks_name fields; this triplet uniquely identifies a kstat. If ks_module is NULL, ks_instance is -1, or ks_name is NULL, those fields will
be ignored in the search. For example, kstat_lookup(kc, NULL, -1, "foo") will find the first kstat with name "foo".
The kstat_data_lookup() function searches the kstat's data section for the record with the specified name. This operation is valid only for
those kstat types that have named data records: KSTAT_TYPE_NAMED and KSTAT_TYPE_TIMER.
RETURN VALUES
The kstat_lookup() function returns a pointer to the requested kstat if it is found. Otherwise it returns NULL and sets errno to indicate
the error.
The kstat_data_lookup() function returns a pointer to the requested data record if it is found. Otherwise it returns NULL and sets errno to
indicate the error .
ERRORS
The kstat_lookup() and kstat_data_lookup() functions will fail if:
EINVAL An attempt was made to look up data for a kstat that was not of type KSTAT_TYPE_NAMED or KSTAT_TYPE_TIMER.
ENOENT The requested kstat could not be found.
FILES
/dev/kstat kernel statistics driver
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Stable |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO
kstat(3KSTAT), kstat_chain_update(3KSTAT), kstat_open(3KSTAT), kstat_read(3KSTAT), attributes(5)
SunOS 5.11 3 Aug 2004 kstat_lookup(3KSTAT)