summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xminimunin25
1 files changed, 23 insertions, 2 deletions
diff --git a/minimunin b/minimunin
index cc173c9..561e12a 100755
--- a/minimunin
+++ b/minimunin
@@ -8,7 +8,7 @@
8 8
9PLUGIN_DIR=/usr/local/etc/minimunin-plugins 9PLUGIN_DIR=/usr/local/etc/minimunin-plugins
10CONFIG_DIR=/usr/local/etc/minimunin-configs 10CONFIG_DIR=/usr/local/etc/minimunin-configs
11BUILTIN="cpu processes load swap systat iostat uptime memory open_files" 11BUILTIN="cpu processes load swap systat df iostat uptime memory open_files"
12SYSCTL=/sbin/sysctl 12SYSCTL=/sbin/sysctl
13[ -f ${SYSCTL} ] || SYSCTL=/usr/sbin/sysctl 13[ -f ${SYSCTL} ] || SYSCTL=/usr/sbin/sysctl
14 14
@@ -101,6 +101,13 @@ systat)
101 set -- `get_sys vm.stats.sys.v_soft vm.stats.sys.v_intr vm.stats.sys.v_syscall vm.stats.sys.v_swtch vm.stats.vm.v_forks vm.stats.vm.v_rforks vm.stats.vm.v_vforks` 101 set -- `get_sys vm.stats.sys.v_soft vm.stats.sys.v_intr vm.stats.sys.v_syscall vm.stats.sys.v_swtch vm.stats.vm.v_forks vm.stats.vm.v_rforks vm.stats.vm.v_vforks`
102 printf "softint.value %d\nhardint.value %d\nsyscall.value %d\ncs.value %d\nforks.value %d\n" "$1" "$2" "$3" "$4" $(( ${5}+${6}+${7} )) 102 printf "softint.value %d\nhardint.value %d\nsyscall.value %d\ncs.value %d\nforks.value %d\n" "$1" "$2" "$3" "$4" $(( ${5}+${6}+${7} ))
103 ;; 103 ;;
104df)
105 /bin/df -P -t noprocfs,devfs,fdescfs,linprocfs,linsysfs,nfs,nullfs | /usr/bin/tail -n +2 |
106 while read fs blocks used avail cap mount; do
107 fs=`printf "%s" ${fs} | /usr/bin/tr -c '[:alnum:]' _`
108 printf "%s %d" ${fs}.value $(( used * 512 ))
109 done
110 ;;
104*) 111*)
105 printf "# Unknown plugin ${_plugin}.\n" 112 printf "# Unknown plugin ${_plugin}.\n"
106 ;; 113 ;;
@@ -305,7 +312,7 @@ EOF
305;; 312;;
306processes) 313processes)
307cat <<-EOF 314cat <<-EOF
308graph_title Process Statistics 315 graph_title Process Statistics
309 graph_args --base 1000 -l 0 316 graph_args --base 1000 -l 0
310 graph_vlabel number of processes 317 graph_vlabel number of processes
311 graph_category system 318 graph_category system
@@ -317,6 +324,20 @@ graph_title Process Statistics
317 processes.critical $(( `get_sys kern.maxproc` * 98 / 100 )) 324 processes.critical $(( `get_sys kern.maxproc` * 98 / 100 ))
318EOF 325EOF
319;; 326;;
327df)
328cat <<-EOF
329 graph_title Filesystem usage (in bytes)
330 graph_args --base 1024 --lower-limit 0
331 graph_vlabel bytes
332 graph_category disk
333 graph_total Total
334EOF
335/bin/df -P -t noprocfs,devfs,fdescfs,linprocfs,linsysfs,nfs,nullfs | /usr/bin/tail -n +2 |
336while read fs blocks used avail cap mount; do
337 fs=`printf "%s" ${fs} | /usr/bin/tr -c '[:alnum:]' _`
338 printf "%s %s" ${fs}.label ${mount}
339done
340;;
320*) 341*)
321 printf "# Unknown plugin ${_plugin}.\n" 342 printf "# Unknown plugin ${_plugin}.\n"
322 ;; 343 ;;