Module: check_mk
Branch: master
Commit: 2b8b15cddc0bea448486939e9829ac354f6f7c3c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2b8b15cddc0bea…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 13 11:22:15 2015 +0200
#2458 FIX FreeBSD-Agent: Fixed uptime calculation
---
.werks/2458 | 10 ++++++++++
ChangeLog | 1 +
agents/check_mk_agent.freebsd | 7 ++-----
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/.werks/2458 b/.werks/2458
new file mode 100644
index 0000000..4e8df57
--- /dev/null
+++ b/.werks/2458
@@ -0,0 +1,10 @@
+Title: FreeBSD-Agent: Fixed uptime calculation
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1436779297
+
+
diff --git a/ChangeLog b/ChangeLog
index 47d7f52..adfc796 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -46,6 +46,7 @@
NOTE: Please refer to the migration notes!
* 2400 FIX: windows_if.ps1: fixed exception in plugin when an interface team had no
members
* 2374 FIX: md: Fix exception for certain outputs of certain special MD
configurations...
+ * 2458 FIX: FreeBSD-Agent: Fixed uptime calculation
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/agents/check_mk_agent.freebsd b/agents/check_mk_agent.freebsd
index 24f90b8..e35aded 100755
--- a/agents/check_mk_agent.freebsd
+++ b/agents/check_mk_agent.freebsd
@@ -180,12 +180,9 @@ echo `sysctl -n vm.loadavg | tr -d '{}'` `top -b -n 1 | grep
-E '^[0-9]+ process
# Calculate the uptime in seconds since epoch compatible to /proc/uptime in linux
echo '<<<uptime>>>'
- up_seconds=$(( `date +%s` - `sysctl -n kern.boottime | cut -f1 -d\, | awk '{print
$4}'`))
+up_seconds=$(( `date +%s` - `sysctl -n kern.boottime | cut -f1 -d\, | awk '{print
$4}'`))
idle_seconds=$(ps axw | grep idle | grep -v grep | awk '{print $4}' | cut -f1
-d\: )
-
-# second value can be grabbed from "idle" process cpu time / num_cores
-echo "$idle_seconds $up_seconds"
-
+echo "$up_seconds $idle_seconds"
# Platten- und RAID-Status von LSI-Controlleren, falls vorhanden
#if which cfggen > /dev/null ; then