summaryrefslogtreecommitdiffstats
path: root/templates/check_swap_usage.php
diff options
context:
space:
mode:
authorndarshan <dnarayan@redhat.com>2014-04-21 12:47:14 +0530
committerSahina Bose <sabose@redhat.com>2014-05-08 01:47:40 -0700
commit66d287e44d4278ec65df731dd43c6e8a1f6e423f (patch)
tree988cc203a6fdd06295ce876b324e681fad956750 /templates/check_swap_usage.php
parentf36d2b690b2f8c178b2e27c391b8638908d4985c (diff)
Server-addon:Fix: Modified graph templates for memory and swap.
Modified graph templates for memory and swap to handle the unit change in respective plugins . https://bugzilla.redhat.com/show_bug.cgi?id=1080004 Signed-off-by: ndarshan <dnarayan@redhat.com> Change-Id: Id11dee8992b7a4ba93df0fb107fa73e29035088e Reviewed-on: http://review.gluster.org/7641 Reviewed-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'templates/check_swap_usage.php')
-rw-r--r--templates/check_swap_usage.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/templates/check_swap_usage.php b/templates/check_swap_usage.php
index ef62064..1444f74 100644
--- a/templates/check_swap_usage.php
+++ b/templates/check_swap_usage.php
@@ -17,24 +17,21 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-$upper_limit = round($MAX[1] / (1048576),2);
-$opt[1] = "-X 0 --vertical-label \"$UNIT[1](Total:$upper_limit GB)\" -l 0 -r -u $upper_limit --title \"Swap usage $hostname / $servicedesc\" ";
+$opt[1] = "-X 0 --vertical-label \"$UNIT[1](Total:$MAX[1] GB)\" -l 0 -r -u $MAX[1] --title \"Swap usage $hostname / $servicedesc\" ";
$ds_name[1] = "Swap Usage";
$def[1] = "DEF:used_swap_in=$RRDFILE[1]:$DS[1]:AVERAGE " ;
-$def[1] .= rrd::cdef("used_swap_out","used_swap_in,1048576,/");
+$def[1] .= "CDEF:used_swap_out=used_swap_in ";
$def[1] .= "AREA:used_swap_out#3D1AA8:\"Used \" ";
$def[1] .= "GPRINT:used_swap_out:LAST:\"%3.2lf GB LAST \" ";
$def[1] .= "GPRINT:used_swap_out:MAX:\"%3.2lf GB MAX \" ";
$def[1] .= "GPRINT:used_swap_out" . ':AVERAGE:"%3.2lf GB AVERAGE \j" ';
if ($WARN[1] != ""){
- $WAR = $WARN[1] / 1048576 ;
- $def[1] .= "LINE2:$WAR#FFA500:\"Warning \\n\" ";
+ $def[1] .= "LINE2:$WARN[1]#FFA500:\"Warning \\n\" ";
}
if ($CRIT[1] != "") {
- $CRT = $CRIT[1] / 1048576 ;
- $def[1] .= "LINE2:$CRT#FF0000:\"Critical \\n\" ";
+ $def[1] .= "LINE2:$CRIT[1]#FF0000:\"Critical \\n\" ";
$def[1] .= "COMMENT:\" \\n\" ";
$def[1] .= "COMMENT:\" \\n\" ";
}