From a45bbf67b5e8f12539c9df77564600726f2b3fc8 Mon Sep 17 00:00:00 2001 From: buddhinipun Date: Wed, 8 Jun 2016 18:40:01 +0530 Subject: [PATCH] add fix for bashrunner --- .../org/wso2/agent/resourcemonitor/systembridge/BashRunner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/samples/connectedlap/component/laptopagent/src/main/java/org/wso2/agent/resourcemonitor/systembridge/BashRunner.java b/modules/samples/connectedlap/component/laptopagent/src/main/java/org/wso2/agent/resourcemonitor/systembridge/BashRunner.java index 8efd4b8c..d7eb716b 100644 --- a/modules/samples/connectedlap/component/laptopagent/src/main/java/org/wso2/agent/resourcemonitor/systembridge/BashRunner.java +++ b/modules/samples/connectedlap/component/laptopagent/src/main/java/org/wso2/agent/resourcemonitor/systembridge/BashRunner.java @@ -75,7 +75,7 @@ public class BashRunner { if (scriptid == 2)//cores script = new String[]{"/bin/sh", "-c", "sysctl -n hw.ncpu" + " | tr '\n' ' '"}; if (scriptid == 3)//ram size - script = new String[]{"/bin/sh", "-c", "sysctl -n hw.memsize | awk '{print $1 / 1048576}'" + " | tr '\n' ' '"}; + script = new String[]{"/bin/sh", "-c", "sysctl -n hw.memsize | awk '{print $1 / 1073741824}'" + " | tr '\n' ' '"}; if (scriptid == 4)//storage // script = new String[]{ "/bin/sh", "-c", "echo Amilapwd1 | sudo -S hdparm -I /dev/sda |grep 'device size with M = 1000\\*1000' | awk '{print substr($0, index($0,$9))}' | awk -F'[\t(]' '{print $2}' | awk '{print substr($1,0)}'"+" | tr '\n' ' '"}; script = new String[]{"/bin/sh", "-c", "diskutil list | grep 'GUID_partition_scheme' | awk '{ print $3}' | sed 's/*//g' | awk '{s+=$0} END {print s}'" + " | tr '\n' ' '"};