From the above command I'm getting all the states. I want to count the states and write to a file, like
"Count of ESTABLISHED is: 5"
"Count of TIME_WAIT is : 2"
How to count in awk, other than passing the output to grep and using -c option.
Looks like you managed to print just the state of each server.
Now, try to push each state as the key in an associative array and keep incrementing the value each time you find the same state in the array keys.
This User Gave Thanks to balajesuri For This Post:
I am using HP-UX,KSH
$ jobs -l
+ 19377 Running nohup ksh cat_Duplicate_Records_Removal.ksh </dev/null >/dev/null 2>&1 &
$ ps -p 19377 -fl
F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME COMD
401 S catmgr 19377 19491 ... (1 Reply)
turbostat reports C-states of all CPU cores, and includes entries for each hyper-threaded core as well. Often enough the two logical cores on a single physical core will list different C state percentages. Does that make any sense?
Is this reporting the c-states of the few duplicated parts... (8 Replies)
Hi guys,
Can you help me please to find an appropriate course of UNIX in the United States.
Also, can you provide me some information about the schools or institutes that offer it in the U.S.
Thanks, (0 Replies)
I am trying to write my own Unix compliant (SUSv4) OS - Just a hobby OS, nothing serious. While going through the standard, I couldn't find any explicit information on process states. What I could find was (excluding the real-time considerations)-
From this it can be inferred that the... (2 Replies)
One node in my cluster is using ondemand governor which is specified in the directory
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ..
Scaling_governor allows us to choose the governor of our choice .
But this sub-directory is absent in the other node of the cluster . How do I change... (0 Replies)
Hi Everybody,
As I am new to Sun Clusters, Please help me what is "online but not monitored" state of resources and "online - service is online" in status message. Thank you. (1 Reply)
One of my servers started getting heavily loaded a few weeks ago for a few hours, so I did some studying and wrote a script to use netstat to get the IP addresses connected and the count. I put a new chain in iptables and if an IP is using more than 40 connections, it gets added to that chain which... (3 Replies)
Ok, I've read the manpages on netstat and it gives a good description of the state values such as CLOSE_WAIT, ESTABLISHED, SYN_RECEIVED, etc..
Can someone give me real world situations where you would get these states. LIke for example if I got SYN_RECEIVED what possible situations would be the... (1 Reply)