Thanks to Brad Davis)
Message-ID: <515aa9c9.TmfxLeS1yTAH8QE7%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: fb0804563b6160e23a2d6408eb0f0b7116796188
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fb0804563b6160…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 2 11:06:41 2013 +0200
Added mem section to Mac OSX agent (Thanks to Brad Davis)
---
ChangeLog | 1 +
agents/check_mk_agent.macosx | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b6eab76..cb7d14a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -92,6 +92,7 @@
* FIX: check_mk-mssql_counters.locks: fix computation, was altogether wrong
* FIX: check_mk-mssql_counters.transactions: fix computation also
* check_http: now support the option -L (urlizing the result)
+ * Added mem section to Mac OSX agent (Thanks to Brad Davis)
Multisite:
* FIX: fix localization in non-OMD environment
diff --git a/agents/check_mk_agent.macosx b/agents/check_mk_agent.macosx
index 8056905..6eb8d53 100755
--- a/agents/check_mk_agent.macosx
+++ b/agents/check_mk_agent.macosx
@@ -55,6 +55,12 @@ echo '<<<cpu>>>';
echo `sysctl -n vm.loadavg | tr -d '{}'` `top -l 1 -n 1 | egrep ^Processes: |
awk '{print $4"/"$2;}'` `echo 'echo $$' | bash` `sysctl -n
hw.ncpu`
+echo '<<<mem>>>'
+echo "MemTotal: $(echo $(sysctl -n hw.memsize)/1024 | bc) kB"
+echo "MemFree: $(echo "( $(vm_stat | grep speculative: | awk '{print
$3}') + $(vm_stat | grep inactive: | awk '{print $3}') + $(vm_stat | grep
free: | awk '{print $3}') ) * $(vm_stat | grep Mach | awk '{print $8}') /
1024" | bc) kB"
+echo "SwapTotal: 0 kB"
+echo "SwapFree: 0 kB"
+
echo '<<<uptime>>>';
echo `date +%s` - `sysctl -n kern.boottime | cut -d' ' -f 4,7 | tr ','
'.' |
tr -d ' '` | bc