summaryrefslogtreecommitdiffstats
path: root/templates/check_swap_usage.php
diff options
context:
space:
mode:
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\" ";
}