26 lines
962 B
Bash
Executable File
26 lines
962 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ "$1" == "config" ];then
|
|
echo "graph_title Interrupts & context switches
|
|
graph_args --base 1000 -l 0
|
|
graph_vlabel interrupts & ctx switches / \${graph_period}
|
|
graph_category system
|
|
graph_info This graph shows the number of interrupts and context switches on the system. These are typically high on a busy system.
|
|
intr.info Interrupts are events that alter sequence of instructions executed by a processor. They can come from either hardware (exceptions, NMI, IRQ) or software.
|
|
ctx.info A context switch occurs when a multitasking operatings system suspends the currently running process, and starts executing another.
|
|
intr.label interrupts
|
|
ctx.label context switches
|
|
intr.type DERIVE
|
|
ctx.type DERIVE
|
|
intr.max 100000
|
|
ctx.max 100000
|
|
intr.min 0
|
|
ctx.min 0"
|
|
exit 0
|
|
fi
|
|
|
|
# ugh
|
|
IINFO=`/bin/cat /proc/stat`
|
|
echo "ctx.value `echo "$IINFO"|/bin/grep '^ctxt'|/usr/bin/cut -d\ -f2`"
|
|
echo "intr.value `echo "$IINFO"|/bin/grep '^intr'|/usr/bin/cut -d\ -f2`"
|