Monitor process states totals
[khatus.git] / bin / khatus_parse_ps
CommitLineData
b9d5cfd4
SK
1#! /usr/bin/awk -f
2
3BEGIN {
4 OFS = "|"
5 Kfs = ":"
6}
7
8{
9 pid = $1
10 state = $2
11 rss = $3
12 command_i = index($0, $4)
13 command = substr($0, command_i, length($0) - (command_i - 1))
14
15 Pids[pid] = 1
16 Total_Per_State[state]++
17 print("state" Kfs pid, state)
18 print("rss" Kfs pid, rss)
19 print("command" Kfs pid, command)
20}
21
22END {
23 print("total_procs", length(Pids))
24 for (state in Total_Per_State) {
25 print("total_per_state" Kfs state, Total_Per_State[state])
26 }
27}
This page took 0.020172 seconds and 4 git commands to generate.