69
68
# Find operating system
70
[ $OPERSYS ] || OPERSYS=`uname` || exit 1
69
[ $OPERSYS ] || OPERSYS=`uname | cut -f 1 -d _` || exit 1
72
71
if [ "$1" = "autoconf" ]; then
73
Linux|SunOS|FreeBSD|OpenBSD|NetBSD|Darwin|CYGWIN)
74
$ps >/dev/null 2>/dev/null
77
echo "no (ps=$ps failed)"
80
echo | $awk '{ print "Hei" }' >/dev/null 2>/dev/null
83
echo "no (awk=$awk failed)"
90
echo "no (unknown OS)"
77
96
. $MUNIN_LIBDIR/plugins/plugin.sh
196
215
echo "sleeping.info The number of processes that are sleeping for less than about 20 seconds."
197
216
print_warning sleeping
198
217
print_critical sleeping
218
elif [ "$OPERSYS" = "Linux" ] || [ "$OPERSYS" = "SunOS" ]; then
200
219
echo "sleeping.label sleeping"
201
220
echo "sleeping.draw AREA"
202
221
echo "sleeping.colour $SLEEPING"
215
234
print_critical uninterruptible
219
echo "zombie.label zombie"
220
echo "zombie.draw STACK"
221
echo "zombie.colour $ZOMBIE"
222
echo "zombie.info The number of defunct ("zombie") processes (process terminated and parent not waiting)."
224
print_critical zombie
226
echo "stopped.label stopped"
227
echo "stopped.draw STACK"
228
echo "stopped.colour $STOPPED"
229
echo "stopped.info The number of stopped or traced processes."
230
print_warning stopped
231
print_critical stopped
233
echo "runnable.label runnable"
234
echo "runnable.draw STACK"
235
echo "runnable.colour $RUNNABLE"
236
echo "runnable.info The number of runnable processes (on the run queue)."
237
print_warning runnable
238
print_critical runnable
237
# Common (non-cygwin) flags
238
if [ "$OPERSYS" != "CYGWIN" ]; then
239
echo "zombie.label zombie"
240
echo "zombie.draw STACK"
241
echo "zombie.colour $ZOMBIE"
242
echo "zombie.info The number of defunct ("zombie") processes (process terminated and parent not waiting)."
244
print_critical zombie
246
echo "stopped.label stopped"
247
echo "stopped.draw STACK"
248
echo "stopped.colour $STOPPED"
249
echo "stopped.info The number of stopped or traced processes."
250
print_warning stopped
251
print_critical stopped
253
echo "runnable.label runnable"
254
echo "runnable.draw STACK"
255
echo "runnable.colour $RUNNABLE"
256
echo "runnable.info The number of runnable processes (on the run queue)."
257
print_warning runnable
258
print_critical runnable
240
261
if [ "$OPERSYS" != "SunOS" ]; then
241
262
# Not using 'graph_total' due to backwards compability. SunOS uses 'total'.
331
352
print "stopped.value " 0+stat["T"];
332
353
print "zombie.value " 0+stat["Z"];
356
elif [ "$OPERSYS" = "CYGWIN" ]; then
357
# First line is header. Remove it. Also remove WINPID duplicates.
358
$ps -aW | sed '1d' | cut -c 30-36 | sort -u | $awk '
361
print "processes.value " 0+processes;