Module: check_mk
Branch: master
Commit: 1270a651efef0bc1a69debdf7b2624eb22762045
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1270a651efef0b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 4 13:58:20 2014 +0100
#1645 Added basic kernel section to FreeBSD agent
Thanks to Andreas Pflug for providing the patch.
---
.werks/1645 | 9 +++++++++
ChangeLog | 1 +
agents/check_mk_agent.freebsd | 15 ++++++++++-----
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/.werks/1645 b/.werks/1645
new file mode 100644
index 0000000..318bc74
--- /dev/null
+++ b/.werks/1645
@@ -0,0 +1,9 @@
+Title: Added basic kernel section to FreeBSD agent
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417697860
+Class: feature
+
+Thanks to Andreas Pflug for providing the patch.
diff --git a/ChangeLog b/ChangeLog
index 6cafb47..0cc98f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -51,6 +51,7 @@
* 1629 check_mk_agent.freebsd: several new features and improvements, now only use
statgrab...
* 1630 smart: update in plugin that also outputs information about disks attached to
a MegaRAID controller...
* 1631 juniper_bgp_state: check now detects and supports more differen device
models...
+ * 1645 Added basic kernel section to FreeBSD agent...
* 1478 FIX: kernel.util, statgrab_cpu: fix computation of utilization...
* 1480 FIX: brocade_vdx_status: disable check on some devices that do not support
it...
* 1485 FIX: dell_om_disks, dell_om_esmlog, dell_om_mem, dell_om_processors,
dell_om_sensors: detect more devices...
diff --git a/agents/check_mk_agent.freebsd b/agents/check_mk_agent.freebsd
index 2249431..5ce92aa 100755
--- a/agents/check_mk_agent.freebsd
+++ b/agents/check_mk_agent.freebsd
@@ -203,13 +203,18 @@ fi
# Soft-RAID
echo '<<<freebsd_geom_mirrors>>>'
- gmirror status | grep -v ^Name
-
+gmirror status | grep -v ^Name
# Performancecounter Kernel
-#echo '<<<kernel>>>'
-#date +%s
-#cat /proc/vmstat /proc/stat
+echo "<<<kernel>>>"
+date +%s
+forks=`sysctl -n vm.stats.vm.v_forks`
+vforks=`sysctl -n vm.stats.vm.v_vforks`
+rforks=`sysctl -n vm.stats.vm.v_rforks`
+kthreads=`sysctl -n vm.stats.vm.v_kthreads`
+echo "cpu" `sysctl -n kern.cp_time | awk ' { print $1" "$2"
"$3" "$5" "$4 } '`
+echo "ctxt" `sysctl -n vm.stats.sys.v_swtch`
+echo "processes" `expr $forks + $vforks + $rforks + $kthreads`
# Network device statistics (Packets, Collisions, etc)
# only the "Link/Num" interface has all counters.