summaryrefslogtreecommitdiffstats
path: root/Completion/Linux/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Linux/Command')
-rw-r--r--Completion/Linux/Command/_sysstat150
1 files changed, 150 insertions, 0 deletions
diff --git a/Completion/Linux/Command/_sysstat b/Completion/Linux/Command/_sysstat
new file mode 100644
index 000000000..60de9d899
--- /dev/null
+++ b/Completion/Linux/Command/_sysstat
@@ -0,0 +1,150 @@
+#compdef -P mpstat (|cifs)iostat isag sadf sar pidstat
+# -V can appear with other options, so (- *) isn't needed.
+#TODO:
+# sysstat-nfsiostat - there seems to be two nfsiostat(1)s. one from oracle and one by redhat.
+
+_mpstat() {
+ local ret=1
+ _arguments : \
+ '-A[equivalent to -u -I ALL -P ALL]' \
+ '-I[report interrupt statistics]:interrupts:(SUM CPU SCPU ALL)' \
+ '-P[specify processor number]:processor: _values -s "," processor ON ALL' \
+ '-u[report CPU utilization]' \
+ '-V[print version number]' \
+ '1:interval:_guard "[0-9]#" "interval"' \
+ '2:count:_guard "[0-9]#" "count"' && ret=0
+ return ret
+}
+
+_iostat() {
+ local ret=1
+ _arguments : \
+ '-c[display CPU utilization report]' \
+ '-d[display device utilization report]' \
+ '-T[only display global statistics for group_name]' \
+ '-g[display statistics for a group of devices]:group name: _message "group name"' \
+ '-h[human readable device utilization report]' \
+ '-j[display persistent device name]' \
+ '(-m)-k[display statistics in kB/s]' \
+ '(-k)-m[display statistics in MB/s]' \
+ '-N[display registered device mapper names]' \
+ '1:interval:_guard "[0-9]#" "interval"' \
+ '2:count:_guard "[0-9]#" "count"' && ret=0
+ return ret
+}
+
+_cifsiostat() {
+ local ret=1
+ _arguments : \
+ '-h[human readable]' \
+ '(-m)-k[display statistics in kB/s]' \
+ '(-k)-m[display statistics in MB/s]' \
+ '-t[print timestamp for each report]' \
+ '-V[print version number]' \
+ '1:interval:_guard "[0-9]#" "interval"' \
+ '2:count:_guard "[0-9]#" "count"' && ret=0
+ return ret
+}
+
+_isag() {
+ local ret=1
+ _arguments : \
+ '-p[Pathname to daily data files]:data files: _files -/' \
+ '-c[Specify configuration file]:configuration file: _files' \
+ '-ght[Specify height of the chart]:height: _message "height"' \
+ '-gwd[Specify width of the chart]:width: _message "width"' && ret=0
+ return ret
+}
+
+_sadf() {
+ local ret=1 line state context expl
+ typeset -A opt_args
+ # any options after `--' are for sar(1)
+ if ! (( CURRENT > $words[(i)--] )); then
+ _arguments : \
+ '-C[display comments in file]' \
+ '(-j -p -x)-d[output file in SQL format]' \
+ '-e[set ending time of report]:ending time: _message "ending time in localtime(HH\:MM\:SS 24-hour format)"' \
+ '-H[display only the header of the report]' \
+ '(-j -p -x)-h[print on a single line when used with -d]' \
+ '(-d -p -x)-j[output file in JSON]' \
+ '-P[restrict processor dependant statistics]:processor number(zero indexed) or ALL:(ALL)' \
+ '(-j -x -d)-p[print in format parsable by tools like awk]' \
+ '-s[set starting time of report]:starting time: _message "starting time in localtime(HH\:MM\:SS 24-hour format)"' \
+ '(-t -U)-T[display timestamp in local time]' \
+ '(-T -U)-t[display timestamp in file\''s original localtime]' \
+ '(-t -T)-U[display in seconds from epoch(UTC)]' \
+ '-V[print version number]' \