diff options
author | ndarshan <dnarayan@redhat.com> | 2014-03-17 12:21:42 +0530 |
---|---|---|
committer | Bala.FA <barumuga@redhat.com> | 2014-04-29 10:14:32 +0530 |
commit | 686b574d3c1e55a778088b58a1a2fc75ce72d280 (patch) | |
tree | 89e6335b46c42dcea1c66e80cd7500059856ffd5 | |
parent | fcf78fd752dd24a8bb8b0bf8f62e7ba7ec0aac55 (diff) |
plugins:Fix to handle sadf not accepting time range, test case addition
This patch handles the issue of sadf not accepting time range
when used with -x (xml output) option(seen in version 9.0.4).
Added unit-test for memory, cpu, swap, network plugins and
refactored them.
Change-Id: Ie7c2ecfbb38060f236a6faed606bce0aedd27d7a
Signed-off-by: ndarshan <dnarayan@redhat.com>
Reviewed-on: https://cuckoo.blr.redhat.com:8443/14
Reviewed-by: Bala FA <barumuga@redhat.com>
Tested-by: Bala FA <barumuga@redhat.com>
-rw-r--r-- | gluster-nagios-addons.spec.in | 10 | ||||
-rw-r--r-- | plugins/Makefile.am | 6 | ||||
-rwxr-xr-x | plugins/check_disk_and_inode.py | 12 | ||||
-rwxr-xr-x | plugins/cpu.py | 108 | ||||
-rwxr-xr-x | plugins/memory.py | 100 | ||||
-rwxr-xr-x | plugins/network.py | 86 | ||||
-rwxr-xr-x | plugins/sadf.py | 314 | ||||
-rwxr-xr-x | plugins/swap.py | 94 | ||||
-rw-r--r-- | tests/Makefile.am | 10 | ||||
-rw-r--r-- | tests/getLatestStat_exception.xml | 15 | ||||
-rw-r--r-- | tests/getLatestStat_success.xml | 2147 | ||||
-rw-r--r-- | tests/test_cpu.py | 106 | ||||
-rw-r--r-- | tests/test_cpu_dataFile.py | 217 | ||||
-rw-r--r-- | tests/test_memory.py | 93 | ||||
-rw-r--r-- | tests/test_memory_dataFile.py | 90 | ||||
-rw-r--r-- | tests/test_network.py | 86 | ||||
-rw-r--r-- | tests/test_network_dataFile.py | 162 | ||||
-rw-r--r-- | tests/test_sadf.py | 200 | ||||
-rw-r--r-- | tests/test_swap.py | 93 | ||||
-rw-r--r-- | tests/test_swap_dataFile.py | 81 |
20 files changed, 3590 insertions, 440 deletions
diff --git a/gluster-nagios-addons.spec.in b/gluster-nagios-addons.spec.in index b2775a1..84d0e46 100644 --- a/gluster-nagios-addons.spec.in +++ b/gluster-nagios-addons.spec.in @@ -119,10 +119,10 @@ rm -rf %{buildroot} cat >> %{_sysconfdir}/nagios/nrpe.cfg <<EOF ### gluster nrpe plugins ### command[check_disk_and_inode]=%{_libdir}/nagios/plugins/gluster/check_disk_and_inode.py -w 80 -c 90 -l -i /boot -i /var -i /root -n -command[check_memory]=%{_libdir}/nagios/plugins/gluster/sadf.py -m -w 80 -c 90 -command[check_swap_usage]=%{_libdir}/nagios/plugins/gluster/sadf.py -s -w 80 -c 90 -command[check_cpu_multicore]=%{_libdir}/nagios/plugins/gluster/sadf.py -cp -w 80 -c 90 -command[check_interfaces]=%{_libdir}/nagios/plugins/gluster/sadf.py -n -e lo +command[check_memory]=%{_libdir}/nagios/plugins/gluster/memory.py -w 80 -c 90 +command[check_swap_usage]=%{_libdir}/nagios/plugins/gluster/swap.py -w 80 -c 90 +command[check_cpu_multicore]=%{_libdir}/nagios/plugins/gluster/cpu.py -w 80 -c 90 +command[check_interfaces]=%{_libdir}/nagios/plugins/gluster/network.py -e lo -e ;vdsmdummy; EOF %_init_enable nrpe %_init_restart crond @@ -138,7 +138,7 @@ sed -i '/check_cpu_multicore.py/d' %{_sysconfdir}/nagios/nrpe.cfg %files %defattr(-,root,root,-) -%{_libdir}/nagios/plugins/gluster/* +%attr(0755, -, -) %{_libdir}/nagios/plugins/gluster/* %{_sysconfdir}/cron.d/gluster-sysstat.crontab %files tests diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 2e2c03e..37da1cd 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -5,10 +5,14 @@ crond_DATA = \ dist_glusternagiosplugins_PYTHON = \ check_disk_and_inode.py \ + cpu.py \ + __init__.py \ + memory.py \ + network.py \ sadf.py \ + swap.py \ $(NULL) EXTRA_DIST = \ $(crond_DATA) \ - __init__.py \ $(NULL) diff --git a/plugins/check_disk_and_inode.py b/plugins/check_disk_and_inode.py index 052df3a..02c5cd2 100755 --- a/plugins/check_disk_and_inode.py +++ b/plugins/check_disk_and_inode.py @@ -155,8 +155,16 @@ if __name__ == '__main__': total = (float(used) + float(avail)) / 1000 itot = (float(iused) + float(iavail)) / 1000 disk.append("%s=%.1f;%.1f;%.1f;0;%.1f %s=%.1f;%.1f;%.1f;0;%.1f" % ( - mpath, float(used)/1000, warn*total/100, crit*total/100, total, - ipath, float(iused)/1000, warn*itot/100, crit*itot/100, itot)) + mpath, + float(used) / 1000, + warn * total / 100, + crit * total / 100, + total, + ipath, + float(iused) / 1000, + warn * itot / 100, + crit * itot / 100, + itot)) else: disk.append("%s=%.2f;%s;%s;0;100 %s=%.2f;%s;%s;0;100" % ( mpath, diskUsage, warn, crit, ipath, inodeUsage, warn, crit)) diff --git a/plugins/cpu.py b/plugins/cpu.py new file mode 100755 index 0000000..89e8b57 --- /dev/null +++ b/plugins/cpu.py @@ -0,0 +1,108 @@ +#!/usr/bin/python +# Copyright (C) 2014 Red Hat Inc +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# + +import sys +import argparse +from glusternagios import utils +import sadf + +_sadfCpuCommand = ["sadf", "-x", "--", "-P", "ALL"] + + +def parse_input(): + parser = argparse.ArgumentParser() + parser.add_argument("-w", "--warning", action="store", + required=True, type=int, + help="Warning threshold in percentage") + parser.add_argument("-c", "--critical", action="store", + required=True, type=int, + help="Critical threshold in percentage") + sadf.add_common_args(parser) + args = parser.parse_args() + return args + + +def showCpuStat(warnLevel, critLevel, s): + pl_op = {} + if not s: + pl_op["message"] = ("CPU STATUS UNKNOWN") + pl_op['exit_status'] = utils.PluginStatusCode.UNKNOWN + return pl_op + perfLines = [] + idleCpu = 0 + try: + for cpu in s['cpu-load']['cpu']: + if cpu['number'] == 'all': + idleCpu = cpu['idle'] + perfLines.append( + ("cpu_%s_total=%s%%;%s;%s cpu_%s_system=%s%% " + "cpu_%s_user=%s%% cpu_%s_idle=%s%%" % ( + cpu['number'], 100 - float(cpu['idle']), + warnLevel, critLevel, + cpu['number'], cpu['system'], + cpu['number'], cpu['user'], + cpu['number'], cpu['idle']))) + if len(s['cpu-load']['cpu']) - 1 == 1: + break + except (KeyError, ValueError, TypeError) as e: + pl_op["message"] = "key: %s not found" % str(e) + pl_op["exit_status"] = utils.PluginStatusCode.UNKNOWN + return pl_op + + totalCpuUsage = 100 - float(idleCpu) + if totalCpuUsage > critLevel: + pl_op["message"] = ("CPU Status CRITICAL: Total CPU:" + "%s%% Idle CPU:%s%% " + "| num_of_cpu=%s %s" % ( + totalCpuUsage, idleCpu, + len(s['cpu-load']['cpu']) - 1, + " ".join(perfLines))) + pl_op['exit_status'] = utils.PluginStatusCode.CRITICAL + elif totalCpuUsage > warnLevel: + pl_op["message"] = ("CPU Status WARNING: Total CPU" + ":%s%% Idle CPU:%s%% " + "| num_of_cpu=%s %s" % ( + totalCpuUsage, idleCpu, + len(s['cpu-load']['cpu']) - 1, + " ".join(perfLines))) + pl_op['exit_status'] = utils.PluginStatusCode.WARNING + else: + pl_op["message"] = ("CPU Status OK: Total CPU:%s%% Idle CPU:%s%% " + "| num_of_cpu=%s %s" % ( + totalCpuUsage, idleCpu, + len(s['cpu-load']['cpu']) - 1, + " ".join(perfLines))) + pl_op['exit_status'] = utils.PluginStatusCode.OK + return pl_op + + +if __name__ == '__main__': + args = parse_input() + if args.critical <= args.warning: + print "UNKNOWN:Critical must be greater than Warning." + sys.exit(utils.PluginStatusCode.UNKNOWN) + try: + st = sadf.getLatestStat(sadf.sadfExecCmd(_sadfCpuCommand), + args.interval if args.interval else 1) + except (sadf.SadfCmdExecFailedException, + sadf.SadfXmlErrorException) as e: + print str(e) + exit(utils.PluginStatusCode.UNKNOWN) + d = showCpuStat(args.warning, args.critical, st) + print d["message"] + exit(d['exit_status']) diff --git a/plugins/memory.py b/plugins/memory.py new file mode 100755 index 0000000..c57a269 --- /dev/null +++ b/plugins/memory.py @@ -0,0 +1,100 @@ +#!/usr/bin/python +# Copyright (C) 2014 Red Hat Inc +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# + + +import sys +import argparse +import sadf +from glusternagios import utils + +_sadfMemCommand = ["sadf", "-x", "--", "-r"] + + +def parse_input(): + parser = argparse.ArgumentParser() + parser.add_argument("-w", "--warning", action="store", + required=True, type=int, + help="Warning threshold in percentage") + parser.add_argument("-c", "--critical", action="store", + required=True, type=int, + help="Critical threshold in percentage") + sadf.add_common_args(parser) + args = parser.parse_args() + return args + + +def showMemStat(warning, critical, s): + pl_op = {} + if not s: + pl_op["message"] = ("MEMORY STATUS UNKNOWN") + pl_op['exit_status'] = utils.PluginStatusCode.UNKNOWN + return pl_op + try: + totalMem = int(s['memory']['memfree']) + int(s['memory']['memused']) + except (KeyError, ValueError) as e: + pl_op["message"] = "key: %s not found" % str(e) + pl_op["exit_status"] = utils.PluginStatusCode.UNKNOWN + return pl_op + + crit_value = (totalMem * critical) / 100 + war_value = (totalMem * warning) / 100 + if int(s['memory']['memused']) >= crit_value: + pl_op["message"] = utils.PluginStatus.CRITICAL + pl_op['exit_status'] = utils.PluginStatusCode.CRITICAL + elif int(s['memory']['memused']) >= war_value: + pl_op["message"] = utils.PluginStatus.WARNING + pl_op['exit_status'] = utils.PluginStatusCode.WARNING + else: + pl_op["message"] = utils.PluginStatus.OK + pl_op['exit_status'] = utils.PluginStatusCode.OK + try: + pl_op["message"] += ("- %.2f%% used(%skB out of %skB)|" + "Total=%skB;%s;%s;0;%s" + " Used=%skB Buffered=%skB" + " Cached=%skB" % ( + float(s['memory']['memused-percent']), + s['memory']['memused'], + totalMem, + totalMem, + war_value, + crit_value, + totalMem, + s['memory']['memused'], + s['memory']['buffers'], + s['memory']['cached'])) + except (KeyError, ValueError, TypeError) as e: + pl_op["message"] = "key: %s not found" % str(e) + pl_op["exit_status"] = utils.PluginStatusCode.UNKNOWN + return pl_op + return pl_op + +if __name__ == '__main__': + args = parse_input() + if args.critical <= args.warning: + print "UNKNOWN:Critical must be greater than Warning." + sys.exit(utils.PluginStatusCode.UNKNOWN) + try: + st = sadf.getLatestStat(sadf.sadfExecCmd(_sadfMemCommand), + args.interval if args.interval else 1) + except (sadf.SadfCmdExecFailedException, + sadf.SadfXmlErrorException) as e: + print str(e) + exit(utils.PluginStatusCode.UNKNOWN) + d = showMemStat(args.warning, args.critical, st) + print d["message"] + sys.exit(d['exit_status']) diff --git a/plugins/network.py b/plugins/network.py new file mode 100755 index 0000000..d25c848 --- /dev/null +++ b/plugins/network.py @@ -0,0 +1,86 @@ +#!/usr/bin/python +# Copyright (C) 2014 Red Hat Inc +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# + +import sadf +import argparse +from glusternagios import utils + +_sadfNetCommand = ["sadf", "-x", "--", "-n", "DEV"] + + +def parse_input(): + parser = argparse.ArgumentParser() + group = parser.add_mutually_exclusive_group() + group.add_argument("-e", "--exclude", action="append", + help="Parameters to be excluded") + group.add_argument("-i", "--include", action="append", + help="Parameters to be included") + sadf.add_common_args(parser) + args = parser.parse_args() + return args + + +def showNetStat(s, iface_list=None, list_type=None): + pl_op = {} + if not s: + pl_op["message"] = ("IFACE UNKNOWN") + pl_op['exit_status'] = utils.PluginStatusCode.UNKNOWN + return pl_op + devNames = [] + perfLines = [] + try: + for dev in s['network']['net-dev']: + if list_type == "exclude": + if dev['iface'] in iface_list: + continue + elif list_type == "include": + if dev['iface'] not in iface_list: + continue + devNames.append(dev['iface']) + perfLines.append("%s.rxpck=%s %s.txpck=%s %s.rxkB=%s %s.txkB=%s" + % (dev['iface'], dev['rxpck'], + dev['iface'], dev['txpck'], + dev['iface'], dev['rxkB'], + dev['iface'], dev['txkB'])) + except (KeyError, ValueError, TypeError) as e: + pl_op["message"] = "key: %s not found" % str(e) + pl_op["exit_status"] = utils.PluginStatusCode.UNKNOWN + return pl_op + + pl_op["message"] = ("IFACE OK: %s |%s" % (", ".join(devNames), + " ".join(perfLines))) + pl_op['exit_status'] = utils.PluginStatusCode.OK + return pl_op + +if __name__ == '__main__': + args = parse_input() + try: + st = sadf.getLatestStat(sadf.sadfExecCmd(_sadfNetCommand), + args.interval if args.interval else 1) + except (sadf.SadfCmdExecFailedException, + sadf.SadfXmlErrorException) as e: + print str(e) + exit(utils.PluginStatusCode.UNKNOWN) + if args.exclude: + d = showNetStat(st, args.exclude, "exclude") + elif args.include: + d = showNetStat(st, args.include, "include") + else: + d = showNetStat(st) + print d["message"] + exit(d['exit_status']) diff --git a/plugins/sadf.py b/plugins/sadf.py index 0bafb4a..5ac1ed0 100755 --- a/plugins/sadf.py +++ b/plugins/sadf.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # sadf.py -- nagios plugin uses sadf output for perf data # Copyright (C) 2014 Red Hat Inc # @@ -17,22 +16,18 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # -import sys -import shlex -import subprocess -import datetime -import argparse -import xml.etree.ElementTree as ET -from collections import defaultdict -_twoMinutes = datetime.timedelta(minutes=2) -_sadfCpuCommand = "sadf -x -- -P ALL" -_sadfMemoryCommand = "sadf -x -- -r" -_sadfNetworkCommand = "sadf -x -- -n DEV" -_sadfSwapSpaceCommand = "sadf -x -- -S" +from datetime import datetime, timedelta +from glusternagios import utils +import xml.etree.cElementTree as etree +if hasattr(etree, 'ParseError'): + _etreeExceptions = (etree.ParseError, AttributeError, ValueError) +else: + _etreeExceptions = (SyntaxError, AttributeError, ValueError) -class sadfCmdExecFailedException(Exception): - message = "sadf command failed" + +class SadfException(Exception): + message = "sadf exception" def __init__(self, rc=0, out=(), err=()): self.rc = rc @@ -55,274 +50,53 @@ class sadfCmdExecFailedException(Exception): return s -def execCmd(command): - proc = subprocess.Popen(command, - close_fds=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - (out, err) = proc.communicate() - return (proc.returncode, out, err) - +class SadfCmdExecFailedException(SadfException): + message = "sadf command failed" -def etree_to_dict(t): - d = {t.tag: {} if t.attrib else None} - children = list(t) - if children: - dd = defaultdict(list) - for dc in map(etree_to_dict, children): - for k, v in dc.iteritems(): - dd[k].append(v) - x = {} - for k, v in dd.iteritems(): - x[k] = v[0] if len(v) == 1 else v - d = {t.tag: x} - if t.attrib: - d[t.tag].update((k, v) for k, v in t.attrib.iteritems()) - if t.text: - text = t.text.strip() - if children or t.attrib: - if text: - d[t.tag]['#text'] = text - else: - d[t.tag] = text - return d +class SadfXmlErrorException(SadfException): + message = "XML error" -def _sadfExecCmd(sadfCmd): - now = datetime.datetime.now() - start = (now - _twoMinutes).strftime("%H:%M:%S") - end = now.strftime("%H:%M:%S") - cmd = sadfCmd + " -s %s -e %s" % (start, end) +def sadfExecCmd(sadfCmd): try: - (rc, out, err) = execCmd(shlex.split(cmd)) + (rc, out, err) = utils.execCmd(sadfCmd, raw=True) except (OSError, ValueError) as e: - raise sadfCmdExecFailedException(err=[str(e)]) + raise SadfCmdExecFailedException(err=[str(e)]) if rc != 0: - raise sadfCmdExecFailedException(rc, [out], [err]) - - root = ET.fromstring(out) - d = etree_to_dict(root) - return d['sysstat']['host']['statistics']['timestamp'] - - -def _getLatestStat(stats): - if not stats: - return {} - if not isinstance(stats, list): - return stats - lstat = stats[0] - latestTime = datetime.datetime.strptime(lstat['time'], - "%H:%M:%S") - for s in stats[1:]: - thisTime = datetime.datetime.strptime(s['time'], - "%H:%M:%S") - if latestTime < thisTime: - lstat = s - latestTime = thisTime - - return lstat - - -def getLatestSadfCpuStat(): - return _getLatestStat(_sadfExecCmd(_sadfCpuCommand)) - - -def getLatestSadfMemStat(): - return _getLatestStat(_sadfExecCmd(_sadfMemoryCommand)) - - -def getLatestSadfNetStat(): - return _getLatestStat(_sadfExecCmd(_sadfNetworkCommand)) + raise SadfCmdExecFailedException(rc, out, err) + try: + return etree.fromstring(out) + except _etreeExceptions: + raise SadfXmlErrorException(err=out) -def getLatestSadfSwapStat(): - return _getLatestStat(_sadfExecCmd(_sadfSwapSpaceCommand)) - - -def showCpuStat(warnLevel, critLevel): - s = getLatestSadfCpuStat() - if not s: - sys.stdout.write("CPU UNKNOWN\n") - sys.exit(3) - perfLines = [] - idleCpu = 0 - for cpu in s['cpu-load']['cpu']: - if cpu['number'] == 'all': - idleCpu = cpu['idle'] - perfLines.append( - ("cpu_%s_total=%s%%;%s;%s cpu_%s_system=%s%% " - "cpu_%s_user=%s%% cpu_%s_idle=%s%%" % ( - cpu['number'], 100-float(cpu['idle']), - warnLevel, critLevel, - cpu['number'], cpu['system'], - cpu['number'], cpu['user'], - cpu['number'], cpu['idle']))) - if len(s['cpu-load']['cpu'])-1 == 1: - break - totalCpuUsage = 100 - float(idleCpu) - if totalCpuUsage > critLevel: - sys.stdout.write( - ("CPU Status CRITICAL: Total CPU:%s%% Idle CPU:%s%% " - "| num_of_cpu=%s %s\n" % (totalCpuUsage, idleCpu, - len(s['cpu-load']['cpu'])-1, - " ".join(perfLines)))) - elif totalCpuUsage > warnLevel: - sys.stdout.write( - ("CPU Status WARNING: Total CPU:%s%% Idle CPU:%s%% " - "| num_of_cpu=%s %s\n" % (totalCpuUsage, idleCpu, - len(s['cpu-load']['cpu'])-1, - " ".join(perfLines)))) - else: - sys.stdout.write( - ("CPU Status OK: Total CPU:%s%% Idle CPU:%s%% " - "| num_of_cpu=%s %s\n" % (totalCpuUsage, idleCpu, - len(s['cpu-load']['cpu'])-1, - " ".join(perfLines)))) - - sys.exit(0) - - -def showSwapStat(warning, critical): - s = getLatestSadfSwapStat() - if not s: - sys.stdout.write("IFACE UNKNOWN\n") - sys.exit(3) - totalSwap = int(s['memory']['swpfree']) + int(s['memory']['swpused']) - crit_value = (totalSwap * critical) / 100 - war_value = (totalSwap * warning) / 100 - if int(s['memory']['swpused']) >= crit_value: - sys.stdout.write("CRITICAL") - eStat = 2 - elif int(s['memory']['swpused']) >= war_value: - sys.stdout.write("WARNING") - eStat = 1 - else: - sys.stdout.write("OK") - eStat = 0 - sys.stdout.write("- %.2f%% used(%skB out of %skB)|Used=%skB;%s;" - "%s;0;%s\n" % (float(s['memory']['swpused-percent']), - s['memory']['swpused'], - totalSwap, - s['memory']['swpused'], - war_value, - crit_value, - totalSwap)) - sys.exit(eStat) - - -def showMemStat(warning, critical): - s = getLatestSadfMemStat() - if not s: - sys.stdout.write("IFACE UNKNOWN\n") - sys.exit(3) - totalMem = int(s['memory']['memfree']) + int(s['memory']['memused']) - crit_value = (totalMem * critical) / 100 - war_value = (totalMem * warning) / 100 - if int(s['memory']['memused']) >= crit_value: - sys.stdout.write("CRITICAL") - eStat = 2 - elif int(s['memory']['memused']) >= war_value: - sys.stdout.write("WARNING") - eStat = 1 - else: - sys.stdout.write("OK") - eStat = 0 - sys.stdout.write("- %.2f%% used(%skB out of %skB)|Total=%skB;%s;%s;0;%s" - " Used=%skB Buffered=%skB" - " Cached=%skB\n" % (float(s['memory']['memused-percent']), - s['memory']['memused'], - totalMem, - totalMem, - war_value, - crit_value, - totalMem, - s['memory']['memused'], - s['memory']['buffers'], - s['memory']['cached'])) - sys.exit(eStat) - - -def showNetStat(iface_list=None, list_type=None): - s = getLatestSadfNetStat() - if not s: - sys.stdout.write("IFACE UNKNOWN\n") - sys.exit(3) - - devNames = [] - perfLines = [] - for dev in s['network']['net-dev']: - if list_type == "exclude": - if dev['iface'] in iface_list: - continue - elif list_type == "include": - if dev['iface'] not in iface_list: - continue - devNames.append(dev['iface']) - perfLines.append("%s.rxpck=%s %s.txpck=%s %s.rxkB=%s %s.txkB=%s" - % (dev['iface'], dev['rxpck'], - dev['iface'], dev['txpck'], - dev['iface'], dev['rxkB'], - dev['iface'], dev['txkB'])) - sys.stdout.write("IFACE OK: %s |%s\n" % (", ".join(devNames), - " ".join(perfLines))) - sys.exit(0) +def utcnow(): + return datetime.utcnow() -def parse_input(): - parser = argparse.ArgumentParser(usage='%(prog)s [-h] (\ -\n-m -w <warning> -c <critical> |\n-s -w <warning> -c <critical>\ - |\n-cp -w <warning> -c <critical> |\n-n [-e <exclude>\ - | -i <include>])') - group1 = parser.add_mutually_exclusive_group(required=True) - group1.add_argument('-m', '--memory', action='store_true', - help="Gives details related to memory") - group1.add_argument('-s', '--swap', action='store_true', - help="Gives details related to swap") - group1.add_argument('-cp', '--cpu', action='store_true', - help="Gives details related to cpu") - group1.add_argument('-n', '--network', action='store_true', - help="Gives details related to network") - parser.add_argument("-w", "--warning", action="store", type=int, - help="Warning threshold in percentage") - parser.add_argument("-c", "--critical", action="store", type=int, - help="Critical threshold in percentage") - group2 = parser.add_mutually_exclusive_group() - group2.add_argument("-e", "--exclude", action="append", - help="Parameters to be excluded") - group2.add_argument("-i", "--include", action="append", - help="Parameters to be included") - args = parser.parse_args() - if args.memory or args.swap or args.cpu: - if not args.critical or not args.warning: - print "UNKNOWN:Missing critical/warning threshold value." - sys.exit(3) - if args.exclude or args.include: - print "UNKNOWN:Exclude/Include is not valid for the given option." - sys.exit(3) - if args.critical <= args.warning: - print "UNKNOWN:Critical must be greater than Warning." - sys.exit(3) +def getLatestStat(root, interval=1): + try: + el = root.findall('host/statistics/timestamp')[-1] + except (_etreeExceptions + (IndexError,)): + raise SadfXmlErrorException(err=[etree.tostring(root)]) + + d = utils.xml2dict(el) + statTime = datetime.strptime("%s %s" % (d['timestamp']['date'], + d['timestamp']['time']), + "%Y-%m-%d %H:%M:%S") + minutes = timedelta(minutes=interval) + now = utcnow() + if (now - statTime) <= minutes: + return d['timestamp'] else: - if args.critical or args.warning: - print "UNKNOWN:Warning/Critical is not valid for the given option." - sys.exit(3) - return args + return None -if __name__ == '__main__': - args = parse_input() - if args.memory: - showMemStat(args.warning, args.critical) - if args.swap: - showSwapStat(args.warning, args.critical) - if args.cpu: - showCpuStat(args.warning, args.critical) - if args.network: - if args.exclude: - showNetStat(args.exclude, "exclude") - if args.include: - showNetStat(args.include, "include") - showNetStat() +def add_common_args(parser): + parser.add_argument("-t", "--interval", action="store", + type=int, + help="Interval of time(min) older than" + " which sadf output in considered stale") diff --git a/plugins/swap.py b/plugins/swap.py new file mode 100755 index 0000000..5e44f6e --- /dev/null +++ b/plugins/swap.py @@ -0,0 +1,94 @@ +#!/usr/bin/python +# Copyright (C) 2014 Red Hat Inc +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# + +import sadf +import sys +import argparse +from glusternagios import utils + +_sadfSwapCommand = ["sadf", "-x", "--", "-S"] + + +def parse_input(): + parser = argparse.ArgumentParser() + parser.add_argument("-w", "--warning", action="store", + required=True, type=int, + help="Warning threshold in percentage") + parser.add_argument("-c", "--critical", action="store", + required=True, type=int, + help="Critical threshold in percentage") + sadf.add_common_args(parser) + args = parser.parse_args() + return args + + +def showSwapStat(warning, critical, s): + pl_op = {} + if not s: + pl_op["message"] = ("SWAP STATUS UNKNOWN") + pl_op['exit_status'] = utils.PluginStatusCode.UNKNOWN + return pl_op + try: + totalSwap = int(s['memory']['swpfree']) + int(s['memory']['swpused']) + except (KeyError, ValueError, TypeError) as e: + pl_op["message"] = "key: %s not found" % str(e) + pl_op["exit_status"] = utils.PluginStatusCode.UNKNOWN + return pl_op + + crit_value = (totalSwap * critical) / 100 + war_value = (totalSwap * warning) / 100 + if int(s['memory']['swpused']) >= crit_value: + pl_op["message"] = utils.PluginStatus.CRITICAL + pl_op['exit_status'] = utils.PluginStatusCode.CRITICAL + elif int(s['memory']['swpused']) >= war_value: + pl_op["message"] = utils.PluginStatus.WARNING + pl_op['exit_status'] = utils.PluginStatusCode.WARNING + else: + pl_op["message"] = utils.PluginStatus.OK + pl_op['exit_status'] = utils.PluginStatusCode.OK + try: + pl_op["message"] += ("- %.2f%% used(%skB out of %skB)|Used=%skB;%s;" + "%s;0;%s" % ( + float(s['memory']['swpused-percent']), + s['memory']['swpused'], + totalSwap, + s['memory']['swpused'], + war_value, + crit_value, + totalSwap)) + except (KeyError, ValueError, TypeError) as e: + pl_op["message"] = "key: %s not found" % str(e) + pl_op["exit_status"] = utils.PluginStatusCode.UNKNOWN + return pl_op + return pl_op + +if __name__ == '__main__': + args = parse_input() + if args.critical <= args.warning: + print "UNKNOWN:Critical must be greater than Warning." + sys.exit(utils.PluginStatusCode.UNKNOWN) + try: + st = sadf.getLatestStat(sadf.sadfExecCmd(_sadfSwapCommand), + args.interval if args.interval else 1) + except (sadf.SadfCmdExecFailedException, + sadf.SadfXmlErrorException) as e: + print str(e) + exit(utils.PluginStatusCode.UNKNOWN) + d = showSwapStat(args.warning, args.critical, st) + print d["message"] + exit(d['exit_status']) diff --git a/tests/Makefile.am b/tests/Makefile.am index 211cb5b..5f82370 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -19,10 +19,20 @@ # test_modules = \ + test_cpu.py \ + test_cpu_dataFile.py \ + test_memory.py \ + test_memory_dataFile.py \ + test_network.py \ + test_network_dataFile.py \ test_sadf.py \ + test_swap.py \ + test_swap_dataFile.py \ $(NULL) dist_glusternagiosaddonstests_DATA = \ + getLatestStat_exception.xml \ + getLatestStat_success.xml \ $(NULL) dist_glusternagiosaddonstests_PYTHON = \ diff --git a/tests/getLatestStat_exception.xml b/tests/getLatestStat_exception.xml new file mode 100644 index 0000000..fe96c46 --- /dev/null +++ b/tests/getLatestStat_exception.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE sysstat PUBLIC "DTD v2.16 sysstat //EN" +"http://pagesperso-orange.fr/sebastien.godard/sysstat-2.16.dtd"> +<sysstat> + <sysdata-version>2.16</sysdata-version> + <host nodename="localhost.localdomain"> + <sysname>Linux</sysname> + <release>3.13.6-200.fc20.x86_64</release> + <machine>x86_64</machine> + <number-of-cpus>4</number-of-cpus> + <file-date>2014-03-19</file-date> + <restarts> + </restarts> + </host> +</sysstat> diff --git a/tests/getLatestStat_success.xml b/tests/getLatestStat_success.xml new file mode 100644 index 0000000..7a41d43 --- /dev/null +++ b/tests/getLatestStat_success.xml @@ -0,0 +1,2147 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE sysstat PUBLIC "DTD v2.16 sysstat //EN" +"http://pagesperso-orange.fr/sebastien.godard/sysstat-2.16.dtd"> +<sysstat> + <sysdata-version>2.16</sysdata-version> + <host nodename="localhost.localdomain"> + <sysname>Linux</sysname> + <release>3.13.6-200.fc20.x86_64</release> + <machine>x86_64</machine> + <number-of-cpus>4</number-of-cpus> + <file-date>2014-03-19</file-date> + <statistics> + <timestamp date="2014-03-19" time="00:28:01" utc="1" interval="17"> + <cpu-load> + <cpu number="all" user="0.37" nice="0.00" system="0.28" iowait="0.06" steal="0.00" idle="99.30"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:29:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.79" nice="0.00" system="0.47" iowait="0.50" steal="0.00" idle="98.25"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:30:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.20" nice="0.00" system="0.82" iowait="0.37" steal="0.00" idle="95.61"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:31:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.24" nice="0.00" system="0.63" iowait="0.42" steal="0.00" idle="96.72"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:32:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.77" nice="0.00" system="0.58" iowait="0.15" steal="0.00" idle="97.49"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:33:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.83" nice="0.00" system="1.12" iowait="0.25" steal="0.00" idle="94.80"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:34:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.43" nice="0.00" system="1.13" iowait="0.43" steal="0.00" idle="96.00"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:35:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.45" nice="0.00" system="0.58" iowait="0.13" steal="0.00" idle="97.84"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:36:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.85" nice="0.00" system="0.82" iowait="0.35" steal="0.00" idle="95.98"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:37:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.82" nice="0.00" system="0.43" iowait="0.09" steal="0.00" idle="98.67"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:38:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.31" nice="0.00" system="0.45" iowait="0.20" steal="0.00" idle="98.03"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:39:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.72" nice="0.00" system="0.36" iowait="0.29" steal="0.00" idle="98.63"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:40:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.43" nice="0.00" system="0.49" iowait="0.30" steal="0.00" idle="97.79"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:41:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.20" nice="0.00" system="0.56" iowait="0.10" steal="0.00" idle="98.13"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:42:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.26" nice="0.00" system="0.41" iowait="0.10" steal="0.00" idle="98.22"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:43:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.52" nice="0.00" system="0.51" iowait="0.17" steal="0.00" idle="97.80"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:44:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.75" nice="0.00" system="0.33" iowait="0.12" steal="0.00" idle="98.80"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:45:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.29" nice="0.00" system="0.49" iowait="0.10" steal="0.00" idle="98.11"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:46:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.16" nice="0.00" system="0.52" iowait="0.13" steal="0.00" idle="98.19"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:47:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.31" nice="0.00" system="0.44" iowait="0.46" steal="0.00" idle="97.78"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:48:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="1.78" nice="0.00" system="0.59" iowait="0.44" steal="0.00" idle="97.20"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:49:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.16" nice="0.00" system="0.12" iowait="0.13" steal="0.00" idle="99.59"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:50:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.27" nice="0.00" system="0.10" iowait="0.15" steal="0.00" idle="99.47"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:51:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.15" nice="0.00" system="0.10" iowait="0.27" steal="0.00" idle="99.48"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:52:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.16" nice="0.00" system="0.10" iowait="0.20" steal="0.00" idle="99.54"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:53:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.15" nice="0.00" system="0.12" iowait="0.54" steal="0.00" idle="99.19"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:54:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.08" nice="0.00" system="0.39" iowait="0.18" steal="0.00" idle="98.34"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:55:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.79" nice="0.00" system="0.71" iowait="0.20" steal="0.00" idle="96.29"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:56:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.40" nice="0.00" system="0.29" iowait="0.18" steal="0.00" idle="99.13"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:57:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.34" nice="0.00" system="0.25" iowait="0.49" steal="0.00" idle="98.92"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:58:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.33" nice="0.00" system="0.23" iowait="0.23" steal="0.00" idle="99.22"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="00:59:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.97" nice="0.00" system="0.50" iowait="0.46" steal="0.00" idle="98.06"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:00:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.65" nice="0.85" system="2.22" iowait="0.38" steal="0.00" idle="95.91"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:01:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="5.00" nice="2.26" system="2.87" iowait="1.71" steal="0.00" idle="88.17"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:02:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.71" nice="0.00" system="1.35" iowait="0.45" steal="0.00" idle="96.49"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:03:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.08" nice="0.00" system="0.58" iowait="0.74" steal="0.00" idle="97.60"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:04:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.35" nice="0.00" system="0.55" iowait="0.42" steal="0.00" idle="97.68"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:05:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.03" nice="0.00" system="0.55" iowait="0.34" steal="0.00" idle="98.07"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:06:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.38" nice="0.00" system="0.58" iowait="0.47" steal="0.00" idle="97.57"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:07:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.60" nice="0.00" system="0.41" iowait="0.26" steal="0.00" idle="98.73"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:08:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.10" nice="0.00" system="0.50" iowait="0.26" steal="0.00" idle="98.13"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:09:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.82" nice="0.00" system="0.52" iowait="0.12" steal="0.00" idle="98.54"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:10:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.33" nice="0.00" system="0.52" iowait="0.35" steal="0.00" idle="97.80"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:11:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.68" nice="0.00" system="0.64" iowait="0.29" steal="0.00" idle="98.39"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:12:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.09" nice="0.00" system="0.49" iowait="0.20" steal="0.00" idle="98.21"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:13:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.38" nice="0.00" system="0.86" iowait="0.34" steal="0.00" idle="96.42"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:14:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.26" nice="0.05" system="0.44" iowait="0.40" steal="0.00" idle="97.86"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:15:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.86" nice="0.06" system="0.85" iowait="0.88" steal="0.00" idle="96.34"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:16:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.26" nice="0.00" system="0.61" iowait="0.21" steal="0.00" idle="96.93"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:17:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.25" nice="0.00" system="0.29" iowait="0.29" steal="0.00" idle="99.17"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:18:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="0.45" nice="0.00" system="0.26" iowait="0.29" steal="0.00" idle="99.00"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:19:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.50" nice="0.00" system="0.35" iowait="0.47" steal="0.00" idle="98.67"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:20:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.78" nice="0.00" system="0.68" iowait="0.54" steal="0.00" idle="97.00"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:21:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.91" nice="0.00" system="0.66" iowait="0.28" steal="0.00" idle="97.15"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:22:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.86" nice="0.00" system="0.86" iowait="0.22" steal="0.00" idle="97.06"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:23:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.90" nice="0.00" system="0.76" iowait="0.28" steal="0.00" idle="96.06"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:24:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.31" nice="0.00" system="0.82" iowait="0.46" steal="0.00" idle="96.41"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:25:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.70" nice="0.00" system="0.51" iowait="0.35" steal="0.00" idle="98.44"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:26:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.75" nice="0.00" system="0.50" iowait="0.40" steal="0.00" idle="98.35"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:27:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.68" nice="0.00" system="0.47" iowait="0.14" steal="0.00" idle="98.71"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:28:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.79" nice="0.00" system="0.44" iowait="0.31" steal="0.00" idle="98.46"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:29:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.68" nice="0.00" system="0.45" iowait="0.38" steal="0.00" idle="98.49"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:30:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.79" nice="0.00" system="0.45" iowait="0.46" steal="0.00" idle="98.31"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:31:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.69" nice="0.00" system="0.44" iowait="0.36" steal="0.00" idle="98.51"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:32:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.84" nice="0.00" system="0.47" iowait="0.32" steal="0.00" idle="98.37"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:33:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.66" nice="0.00" system="0.42" iowait="0.20" steal="0.00" idle="98.72"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:34:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.79" nice="0.00" system="0.42" iowait="0.20" steal="0.00" idle="98.60"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:35:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.56" nice="0.00" system="0.35" iowait="0.12" steal="0.00" idle="98.97"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:36:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.56" nice="0.00" system="0.34" iowait="0.08" steal="0.00" idle="99.02"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:37:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.59" nice="0.00" system="0.33" iowait="0.18" steal="0.00" idle="98.90"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:38:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.58" nice="0.00" system="0.33" iowait="0.31" steal="0.00" idle="98.77"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:39:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.59" nice="0.00" system="0.34" iowait="0.25" steal="0.00" idle="98.83"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:40:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.55" nice="0.00" system="0.31" iowait="0.32" steal="0.00" idle="98.82"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:41:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.60" nice="0.00" system="0.34" iowait="0.26" steal="0.00" idle="98.79"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:42:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.60" nice="0.00" system="0.38" iowait="0.36" steal="0.00" idle="98.66"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:43:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.71" nice="0.00" system="0.35" iowait="0.15" steal="0.00" idle="98.79"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:44:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.55" nice="0.00" system="0.34" iowait="0.26" steal="0.00" idle="98.86"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:45:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.68" nice="0.00" system="0.36" iowait="0.37" steal="0.00" idle="98.58"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:46:02" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.54" nice="0.00" system="0.32" iowait="0.30" steal="0.00" idle="98.84"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:47:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="0.69" nice="0.00" system="0.33" iowait="0.40" steal="0.00" idle="98.58"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:48:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.61" nice="0.00" system="0.34" iowait="0.47" steal="0.00" idle="98.57"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:49:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.74" nice="0.00" system="0.38" iowait="0.45" steal="0.00" idle="98.43"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:50:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.52" nice="0.00" system="0.31" iowait="0.50" steal="0.00" idle="98.67"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:51:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.57" nice="0.00" system="0.34" iowait="0.49" steal="0.00" idle="98.60"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:52:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.55" nice="0.00" system="0.33" iowait="0.36" steal="0.00" idle="98.76"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:53:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.54" nice="0.00" system="0.31" iowait="0.28" steal="0.00" idle="98.87"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:54:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.74" nice="0.00" system="0.36" iowait="0.27" steal="0.00" idle="98.63"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:55:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.66" nice="0.00" system="0.32" iowait="0.41" steal="0.00" idle="98.61"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:56:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.71" nice="0.00" system="0.36" iowait="0.52" steal="0.00" idle="98.41"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:57:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.67" nice="0.00" system="0.33" iowait="0.18" steal="0.00" idle="98.82"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:58:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.60" nice="0.00" system="0.32" iowait="0.45" steal="0.00" idle="98.63"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="01:59:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.75" nice="0.00" system="0.38" iowait="0.09" steal="0.00" idle="98.79"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="02:00:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.41" nice="0.00" system="0.96" iowait="0.24" steal="0.00" idle="96.39"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="02:01:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.95" nice="0.05" system="0.66" iowait="0.28" steal="0.00" idle="97.05"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="02:02:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="6.03" nice="0.00" system="1.63" iowait="0.61" steal="0.00" idle="91.73"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="04:49:57" utc="1" interval="10076"> + <cpu-load> + <cpu number="all" user="0.00" nice="0.00" system="0.00" iowait="0.00" steal="0.00" idle="0.00"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="04:50:01" utc="1" interval="4"> + <cpu-load> + <cpu number="all" user="11.86" nice="0.00" system="2.17" iowait="12.86" steal="0.00" idle="73.11"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="04:51:02" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="20.89" nice="0.00" system="1.04" iowait="5.63" steal="0.00" idle="72.44"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="04:52:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="6.79" nice="0.00" system="1.24" iowait="17.55" steal="0.00" idle="74.42"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="04:53:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.05" nice="0.00" system="1.18" iowait="17.95" steal="0.00" idle="78.82"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="04:54:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.80" nice="0.00" system="0.49" iowait="3.09" steal="0.00" idle="95.61"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="04:55:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.84" nice="0.00" system="0.37" iowait="0.69" steal="0.00" idle="98.11"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="04:56:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.89" nice="0.00" system="0.83" iowait="0.61" steal="0.00" idle="95.67"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="04:57:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.92" nice="0.00" system="0.82" iowait="0.44" steal="0.00" idle="95.82"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="04:58:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.13" nice="0.00" system="0.56" iowait="0.31" steal="0.00" idle="97.00"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="04:59:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.09" nice="0.00" system="0.37" iowait="0.21" steal="0.00" idle="98.33"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:00:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.00" nice="0.00" system="0.38" iowait="0.41" steal="0.00" idle="98.21"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:01:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.22" nice="0.00" system="0.35" iowait="0.33" steal="0.00" idle="98.10"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:02:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.20" nice="0.00" system="0.63" iowait="0.34" steal="0.00" idle="96.82"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:03:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.03" nice="0.00" system="0.72" iowait="0.49" steal="0.00" idle="94.77"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:04:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.15" nice="0.00" system="0.36" iowait="0.35" steal="0.00" idle="98.14"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:05:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.36" nice="0.00" system="0.19" iowait="0.50" steal="0.00" idle="98.94"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:06:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.17" nice="0.00" system="0.18" iowait="0.07" steal="0.00" idle="99.58"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:07:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.17" nice="0.00" system="0.16" iowait="0.26" steal="0.00" idle="99.40"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:08:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.18" nice="0.00" system="0.16" iowait="0.06" steal="0.00" idle="99.61"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:09:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.23" nice="0.00" system="0.19" iowait="0.43" steal="0.00" idle="99.15"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:10:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.21" nice="0.00" system="0.21" iowait="0.47" steal="0.00" idle="99.11"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:11:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.19" nice="0.00" system="0.18" iowait="0.15" steal="0.00" idle="99.48"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:12:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.19" nice="0.00" system="0.17" iowait="0.53" steal="0.00" idle="99.11"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:13:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.18" nice="0.00" system="0.17" iowait="0.39" steal="0.00" idle="99.26"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:14:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.24" nice="0.00" system="0.18" iowait="0.67" steal="0.00" idle="98.90"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:15:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.31" nice="0.00" system="0.59" iowait="0.23" steal="0.00" idle="97.88"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:16:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.95" nice="0.00" system="0.63" iowait="0.40" steal="0.00" idle="97.03"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:17:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.75" nice="0.00" system="0.32" iowait="0.24" steal="0.00" idle="98.68"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:18:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.73" nice="0.00" system="0.48" iowait="0.30" steal="0.00" idle="97.48"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:19:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.12" nice="0.00" system="0.71" iowait="0.24" steal="0.00" idle="96.93"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:20:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.26" nice="0.00" system="0.58" iowait="0.57" steal="0.00" idle="97.59"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:21:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.89" nice="0.00" system="0.42" iowait="0.20" steal="0.00" idle="98.49"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:22:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.73" nice="0.00" system="0.67" iowait="0.27" steal="0.00" idle="97.32"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:23:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.44" nice="0.00" system="0.25" iowait="0.50" steal="0.00" idle="98.81"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:24:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.17" nice="0.00" system="0.15" iowait="0.14" steal="0.00" idle="99.54"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:25:02" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.61" nice="0.00" system="0.31" iowait="0.69" steal="0.00" idle="98.39"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:26:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="0.90" nice="0.00" system="0.32" iowait="0.14" steal="0.00" idle="98.64"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:27:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.23" nice="0.00" system="0.40" iowait="0.23" steal="0.00" idle="98.15"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:28:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.90" nice="0.00" system="0.42" iowait="0.13" steal="0.00" idle="98.54"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:29:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.03" nice="0.00" system="0.44" iowait="0.10" steal="0.00" idle="98.43"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:30:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.83" nice="0.00" system="0.36" iowait="0.10" steal="0.00" idle="98.71"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:31:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.91" nice="0.00" system="0.40" iowait="0.44" steal="0.00" idle="98.25"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:32:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.85" nice="0.00" system="0.39" iowait="0.44" steal="0.00" idle="98.33"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:33:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.86" nice="0.00" system="0.40" iowait="0.20" steal="0.00" idle="98.54"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:34:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.64" nice="0.00" system="0.65" iowait="0.61" steal="0.00" idle="97.09"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:35:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.99" nice="0.00" system="0.91" iowait="0.21" steal="0.00" idle="95.89"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:36:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.40" nice="0.00" system="1.06" iowait="0.43" steal="0.00" idle="95.11"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:37:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.65" nice="0.00" system="0.83" iowait="0.43" steal="0.00" idle="96.10"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:38:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.74" nice="0.00" system="0.69" iowait="0.41" steal="0.00" idle="96.16"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:39:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.52" nice="0.00" system="0.28" iowait="0.16" steal="0.00" idle="99.05"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:40:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.57" nice="0.00" system="0.29" iowait="0.49" steal="0.00" idle="98.66"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:41:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.96" nice="0.00" system="0.33" iowait="0.23" steal="0.00" idle="98.48"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:42:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.64" nice="0.00" system="0.29" iowait="0.30" steal="0.00" idle="98.78"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:43:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.52" nice="0.00" system="0.29" iowait="0.35" steal="0.00" idle="98.83"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:44:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.59" nice="0.00" system="0.30" iowait="0.42" steal="0.00" idle="98.69"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:45:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.54" nice="0.00" system="0.29" iowait="0.33" steal="0.00" idle="98.84"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:46:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.74" nice="0.00" system="0.31" iowait="0.27" steal="0.00" idle="98.68"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:47:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.48" nice="0.00" system="0.29" iowait="0.11" steal="0.00" idle="99.12"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:48:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.65" nice="2.45" system="0.73" iowait="0.71" steal="0.00" idle="95.45"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:49:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.49" nice="0.00" system="0.27" iowait="0.15" steal="0.00" idle="99.10"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:50:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.47" nice="0.00" system="0.28" iowait="0.41" steal="0.00" idle="98.84"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:51:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.76" nice="0.00" system="0.30" iowait="0.32" steal="0.00" idle="98.62"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:52:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.51" nice="0.00" system="0.29" iowait="0.28" steal="0.00" idle="98.91"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:53:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.62" nice="0.00" system="0.29" iowait="0.42" steal="0.00" idle="98.67"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:54:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.52" nice="0.00" system="0.29" iowait="0.42" steal="0.00" idle="98.76"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:55:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.58" nice="0.00" system="0.30" iowait="0.55" steal="0.00" idle="98.57"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:56:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.59" nice="0.00" system="0.30" iowait="0.30" steal="0.00" idle="98.81"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:57:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.54" nice="0.00" system="0.30" iowait="0.13" steal="0.00" idle="99.03"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:58:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.54" nice="0.00" system="0.31" iowait="0.53" steal="0.00" idle="98.63"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="05:59:02" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.54" nice="0.00" system="0.29" iowait="0.33" steal="0.00" idle="98.84"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:00:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="0.51" nice="0.00" system="0.31" iowait="0.45" steal="0.00" idle="98.73"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:01:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.64" nice="0.00" system="0.28" iowait="0.27" steal="0.00" idle="98.81"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:02:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.52" nice="0.00" system="0.29" iowait="0.14" steal="0.00" idle="99.04"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:03:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.62" nice="0.00" system="0.30" iowait="0.41" steal="0.00" idle="98.66"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:04:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.50" nice="0.00" system="0.28" iowait="0.26" steal="0.00" idle="98.97"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:05:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.80" nice="0.00" system="0.32" iowait="0.65" steal="0.00" idle="98.23"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:06:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.53" nice="0.00" system="0.28" iowait="0.28" steal="0.00" idle="98.91"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:07:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.56" nice="0.00" system="0.28" iowait="0.10" steal="0.00" idle="99.06"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:08:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.49" nice="0.00" system="0.29" iowait="0.22" steal="0.00" idle="99.00"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:09:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.53" nice="0.00" system="0.29" iowait="0.17" steal="0.00" idle="99.00"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:10:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.48" nice="0.00" system="0.29" iowait="0.47" steal="0.00" idle="98.76"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:11:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.57" nice="0.00" system="0.29" iowait="0.35" steal="0.00" idle="98.79"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:12:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.91" nice="0.00" system="0.47" iowait="0.34" steal="0.00" idle="98.27"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:13:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.33" nice="0.00" system="0.65" iowait="0.39" steal="0.00" idle="96.63"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:14:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.47" nice="0.00" system="0.35" iowait="0.34" steal="0.00" idle="98.84"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:15:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.79" nice="0.00" system="0.21" iowait="0.16" steal="0.00" idle="98.84"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:16:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.17" nice="0.00" system="0.15" iowait="0.31" steal="0.00" idle="99.38"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:17:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.28" nice="0.00" system="0.15" iowait="0.23" steal="0.00" idle="99.34"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:18:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.19" nice="0.00" system="0.15" iowait="0.41" steal="0.00" idle="99.24"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:19:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.56" nice="0.00" system="0.21" iowait="0.18" steal="0.00" idle="99.05"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:20:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.14" nice="0.00" system="0.15" iowait="0.45" steal="0.00" idle="99.26"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:21:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.62" nice="0.00" system="0.65" iowait="0.34" steal="0.00" idle="97.39"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:22:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.94" nice="0.00" system="0.84" iowait="0.39" steal="0.00" idle="96.83"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:23:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.80" nice="0.00" system="0.93" iowait="0.36" steal="0.00" idle="95.91"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:24:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.72" nice="0.00" system="0.28" iowait="0.21" steal="0.00" idle="98.79"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:25:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.17" nice="0.00" system="0.46" iowait="0.48" steal="0.00" idle="97.89"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:26:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.67" nice="0.00" system="0.32" iowait="0.29" steal="0.00" idle="98.72"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:27:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.52" nice="0.00" system="0.23" iowait="0.18" steal="0.00" idle="99.07"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:28:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.44" nice="0.00" system="0.18" iowait="0.31" steal="0.00" idle="99.06"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:29:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.46" nice="0.00" system="0.34" iowait="0.36" steal="0.00" idle="98.84"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:30:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.19" nice="0.00" system="0.16" iowait="0.39" steal="0.00" idle="99.25"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:31:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.48" nice="0.00" system="0.49" iowait="0.37" steal="0.00" idle="97.65"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:32:02" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.73" nice="0.00" system="0.78" iowait="0.75" steal="0.00" idle="95.74"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:33:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="0.32" nice="0.00" system="0.20" iowait="0.11" steal="0.00" idle="99.38"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:34:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.17" nice="0.00" system="0.14" iowait="0.23" steal="0.00" idle="99.46"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:35:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.54" nice="0.00" system="0.17" iowait="0.82" steal="0.00" idle="98.46"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:36:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.47" nice="0.00" system="0.17" iowait="0.38" steal="0.00" idle="98.98"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:37:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.28" nice="0.00" system="0.16" iowait="0.21" steal="0.00" idle="99.36"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:38:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.14" nice="0.00" system="0.41" iowait="0.48" steal="0.00" idle="97.97"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:39:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.44" nice="0.00" system="0.63" iowait="0.33" steal="0.00" idle="96.59"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:40:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.49" nice="0.00" system="0.33" iowait="0.51" steal="0.00" idle="98.68"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:41:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.52" nice="0.00" system="0.46" iowait="0.58" steal="0.00" idle="97.45"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:42:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.14" nice="0.00" system="0.15" iowait="0.25" steal="0.00" idle="99.46"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:43:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.15" nice="0.00" system="0.14" iowait="0.17" steal="0.00" idle="99.54"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:44:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.13" nice="0.00" system="0.15" iowait="0.55" steal="0.00" idle="99.16"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:45:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.20" nice="0.00" system="0.14" iowait="0.54" steal="0.00" idle="99.12"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:46:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.16" nice="0.00" system="0.18" iowait="0.14" steal="0.00" idle="99.52"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:47:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.15" nice="0.00" system="0.15" iowait="0.12" steal="0.00" idle="99.58"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:48:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.17" nice="0.06" system="0.20" iowait="0.51" steal="0.00" idle="99.06"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:49:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.15" nice="0.00" system="0.15" iowait="0.13" steal="0.00" idle="99.57"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:50:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.15" nice="0.00" system="0.15" iowait="0.10" steal="0.00" idle="99.60"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:51:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.96" nice="0.00" system="0.53" iowait="0.46" steal="0.00" idle="98.04"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:52:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.66" nice="0.00" system="0.34" iowait="0.24" steal="0.00" idle="98.77"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:53:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.52" nice="0.00" system="0.31" iowait="0.23" steal="0.00" idle="98.95"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:54:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.49" nice="0.00" system="0.27" iowait="0.15" steal="0.00" idle="99.09"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:55:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.54" nice="0.00" system="0.27" iowait="0.37" steal="0.00" idle="98.81"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:56:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.50" nice="0.00" system="0.27" iowait="0.54" steal="0.00" idle="98.68"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:57:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.50" nice="0.00" system="0.26" iowait="0.15" steal="0.00" idle="99.09"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:58:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.50" nice="0.00" system="0.28" iowait="0.26" steal="0.00" idle="98.97"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="06:59:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.52" nice="0.00" system="0.28" iowait="0.28" steal="0.00" idle="98.93"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:00:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.65" nice="0.00" system="0.38" iowait="0.53" steal="0.00" idle="98.44"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:01:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.52" nice="0.00" system="0.30" iowait="0.11" steal="0.00" idle="99.08"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:02:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.50" nice="0.00" system="0.28" iowait="0.12" steal="0.00" idle="99.10"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:03:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.45" nice="0.00" system="0.52" iowait="0.34" steal="0.00" idle="97.68"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:04:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.80" nice="0.00" system="0.34" iowait="0.49" steal="0.00" idle="98.36"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:05:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.21" nice="0.00" system="0.58" iowait="0.46" steal="0.00" idle="97.75"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:06:02" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.01" nice="0.00" system="0.61" iowait="0.70" steal="0.00" idle="95.69"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:07:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="3.16" nice="0.00" system="0.87" iowait="0.64" steal="0.00" idle="95.33"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:08:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.51" nice="0.00" system="0.80" iowait="0.56" steal="0.00" idle="94.13"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:09:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="5.59" nice="0.00" system="0.54" iowait="0.60" steal="0.00" idle="93.27"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:10:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.49" nice="0.00" system="0.91" iowait="0.57" steal="0.00" idle="96.03"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:11:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.98" nice="0.00" system="0.65" iowait="0.28" steal="0.00" idle="97.09"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:12:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.41" nice="0.00" system="0.56" iowait="0.22" steal="0.00" idle="97.81"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:13:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.12" nice="0.00" system="0.45" iowait="0.21" steal="0.00" idle="98.22"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:14:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.93" nice="0.00" system="0.45" iowait="0.29" steal="0.00" idle="98.33"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:15:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.98" nice="0.00" system="0.48" iowait="0.36" steal="0.00" idle="98.18"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:16:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.14" nice="0.00" system="0.46" iowait="0.23" steal="0.00" idle="98.18"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:17:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.02" nice="0.00" system="0.45" iowait="0.32" steal="0.00" idle="98.21"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:18:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.93" nice="0.00" system="0.45" iowait="0.29" steal="0.00" idle="98.33"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:19:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.92" nice="0.00" system="0.47" iowait="0.29" steal="0.00" idle="98.32"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:20:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.15" nice="0.00" system="0.47" iowait="0.44" steal="0.00" idle="97.94"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:21:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.06" nice="0.00" system="0.45" iowait="0.30" steal="0.00" idle="98.18"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:22:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="0.90" nice="0.00" system="0.44" iowait="0.22" steal="0.00" idle="98.44"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:23:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.03" nice="0.00" system="0.45" iowait="0.33" steal="0.00" idle="98.19"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:24:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.31" nice="0.00" system="0.44" iowait="0.45" steal="0.00" idle="97.80"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:25:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.43" nice="0.00" system="0.49" iowait="0.52" steal="0.00" idle="96.56"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:26:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.48" nice="0.00" system="0.50" iowait="0.23" steal="0.00" idle="96.78"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:27:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.23" nice="0.00" system="0.46" iowait="0.19" steal="0.00" idle="97.12"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:28:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.25" nice="0.00" system="0.47" iowait="0.26" steal="0.00" idle="97.01"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:29:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.13" nice="0.00" system="0.47" iowait="0.41" steal="0.00" idle="96.98"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:30:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.13" nice="0.00" system="0.47" iowait="0.31" steal="0.00" idle="97.09"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:31:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.41" nice="0.00" system="0.49" iowait="0.09" steal="0.00" idle="97.02"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:32:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.19" nice="0.00" system="0.48" iowait="0.52" steal="0.00" idle="96.81"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:33:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.00" nice="0.00" system="0.45" iowait="0.26" steal="0.00" idle="97.30"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:34:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.93" nice="0.00" system="0.46" iowait="0.36" steal="0.00" idle="97.25"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:35:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.03" nice="0.00" system="0.47" iowait="0.55" steal="0.00" idle="96.96"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:36:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.08" nice="0.00" system="0.47" iowait="0.21" steal="0.00" idle="97.23"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:37:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.25" nice="0.00" system="0.49" iowait="0.19" steal="0.00" idle="97.07"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:38:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.89" nice="0.00" system="0.46" iowait="0.10" steal="0.00" idle="97.55"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:39:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.96" nice="0.00" system="0.47" iowait="0.09" steal="0.00" idle="97.48"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:40:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.89" nice="0.00" system="0.45" iowait="0.34" steal="0.00" idle="97.32"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:41:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.21" nice="0.00" system="0.49" iowait="0.35" steal="0.00" idle="96.95"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:42:02" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.09" nice="0.00" system="0.47" iowait="0.21" steal="0.00" idle="97.22"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:43:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="1.97" nice="0.00" system="0.46" iowait="0.21" steal="0.00" idle="97.36"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:44:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.97" nice="0.00" system="0.46" iowait="0.38" steal="0.00" idle="97.19"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:45:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.03" nice="0.00" system="0.46" iowait="0.36" steal="0.00" idle="97.15"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:46:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.05" nice="0.00" system="0.49" iowait="0.39" steal="0.00" idle="97.08"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:47:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.03" nice="0.00" system="0.47" iowait="0.49" steal="0.00" idle="97.00"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:48:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.05" nice="0.06" system="0.49" iowait="0.30" steal="0.00" idle="97.11"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:49:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.97" nice="0.00" system="0.46" iowait="0.18" steal="0.00" idle="97.39"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:50:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.84" nice="0.00" system="0.46" iowait="0.34" steal="0.00" idle="97.37"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:51:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.30" nice="0.00" system="0.76" iowait="0.50" steal="0.00" idle="95.44"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:52:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.51" nice="0.00" system="0.73" iowait="0.31" steal="0.00" idle="95.45"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:53:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.28" nice="0.00" system="0.47" iowait="0.20" steal="0.00" idle="97.06"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:54:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.48" nice="0.00" system="0.51" iowait="0.24" steal="0.00" idle="96.77"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:55:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.15" nice="0.00" system="0.42" iowait="0.41" steal="0.00" idle="97.01"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:56:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.97" nice="0.00" system="0.41" iowait="0.14" steal="0.00" idle="97.48"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:57:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.46" nice="0.00" system="0.44" iowait="0.21" steal="0.00" idle="96.89"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:58:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.35" nice="0.00" system="0.44" iowait="0.15" steal="0.00" idle="97.05"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="07:59:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.64" nice="0.00" system="0.46" iowait="0.29" steal="0.00" idle="96.61"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:00:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.49" nice="0.00" system="0.49" iowait="0.50" steal="0.00" idle="96.53"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:01:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.16" nice="0.00" system="0.49" iowait="0.61" steal="0.00" idle="96.74"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:02:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.54" nice="0.00" system="0.48" iowait="0.25" steal="0.00" idle="96.73"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:03:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.87" nice="0.00" system="0.54" iowait="0.22" steal="0.00" idle="96.36"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:04:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.59" nice="0.00" system="0.48" iowait="0.33" steal="0.00" idle="96.61"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:05:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.50" nice="0.00" system="0.50" iowait="0.35" steal="0.00" idle="96.65"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:06:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.39" nice="0.00" system="0.52" iowait="0.28" steal="0.00" idle="96.81"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:07:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.69" nice="0.00" system="0.47" iowait="0.28" steal="0.00" idle="96.56"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:08:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.22" nice="0.00" system="0.47" iowait="0.14" steal="0.00" idle="97.16"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:09:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.54" nice="0.00" system="0.45" iowait="0.11" steal="0.00" idle="96.89"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:10:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.43" nice="0.00" system="0.48" iowait="0.41" steal="0.00" idle="96.68"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:11:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.23" nice="0.00" system="0.41" iowait="0.34" steal="0.00" idle="97.02"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:12:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.37" nice="0.00" system="0.42" iowait="0.32" steal="0.00" idle="96.89"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:13:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.36" nice="0.00" system="0.42" iowait="0.15" steal="0.00" idle="97.07"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:14:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.84" nice="0.00" system="0.61" iowait="0.36" steal="0.00" idle="96.19"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:15:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.25" nice="0.00" system="0.32" iowait="0.28" steal="0.00" idle="97.15"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:16:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.88" nice="0.00" system="0.26" iowait="0.23" steal="0.00" idle="97.63"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:17:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.88" nice="0.00" system="0.26" iowait="0.44" steal="0.00" idle="97.42"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:18:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.90" nice="0.00" system="0.64" iowait="0.51" steal="0.00" idle="94.95"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:19:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="7.35" nice="0.00" system="1.71" iowait="0.82" steal="0.00" idle="90.13"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:20:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="8.37" nice="0.00" system="1.88" iowait="0.50" steal="0.00" idle="89.25"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:21:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="5.82" nice="0.00" system="1.33" iowait="0.49" steal="0.00" idle="92.36"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:22:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.87" nice="0.00" system="1.16" iowait="0.26" steal="0.00" idle="94.70"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:23:02" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="16.57" nice="0.00" system="1.22" iowait="0.45" steal="0.00" idle="81.76"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:24:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="18.93" nice="0.00" system="1.04" iowait="0.39" steal="0.00" idle="79.63"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:25:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="19.26" nice="0.00" system="1.09" iowait="0.45" steal="0.00" idle="79.21"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:26:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="15.95" nice="0.00" system="1.50" iowait="0.39" steal="0.00" idle="82.15"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:27:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.87" nice="0.00" system="1.26" iowait="0.47" steal="0.00" idle="93.40"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:28:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.57" nice="0.00" system="1.01" iowait="0.37" steal="0.00" idle="97.05"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:29:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.77" nice="0.00" system="1.04" iowait="0.24" steal="0.00" idle="96.95"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:30:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.12" nice="0.00" system="1.23" iowait="0.27" steal="0.00" idle="96.38"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:31:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.69" nice="0.00" system="1.19" iowait="0.41" steal="0.00" idle="96.72"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:32:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.78" nice="0.00" system="1.11" iowait="0.16" steal="0.00" idle="96.94"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:33:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.75" nice="0.00" system="1.28" iowait="0.51" steal="0.00" idle="94.46"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:34:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.79" nice="0.00" system="1.04" iowait="0.27" steal="0.00" idle="96.90"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:35:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.03" nice="0.00" system="1.17" iowait="0.50" steal="0.00" idle="96.30"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:36:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.82" nice="0.00" system="1.08" iowait="0.26" steal="0.00" idle="96.85"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:37:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.80" nice="0.00" system="1.30" iowait="0.39" steal="0.00" idle="94.51"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:38:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.41" nice="0.00" system="1.25" iowait="0.29" steal="0.00" idle="96.06"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:39:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.34" nice="0.00" system="1.00" iowait="0.16" steal="0.00" idle="97.49"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:40:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.52" nice="0.00" system="0.93" iowait="0.17" steal="0.00" idle="97.38"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:41:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.35" nice="0.00" system="0.92" iowait="0.30" steal="0.00" idle="97.44"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:42:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.27" nice="0.00" system="0.91" iowait="0.18" steal="0.00" idle="97.64"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:43:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.08" nice="0.00" system="0.90" iowait="0.25" steal="0.00" idle="97.77"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:44:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.17" nice="0.00" system="0.91" iowait="0.25" steal="0.00" idle="97.67"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:45:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.15" nice="0.00" system="0.93" iowait="0.32" steal="0.00" idle="97.60"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:46:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.16" nice="0.00" system="0.88" iowait="0.21" steal="0.00" idle="97.74"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:47:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.10" nice="0.00" system="0.95" iowait="0.28" steal="0.00" idle="97.66"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:48:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.16" nice="0.24" system="0.95" iowait="0.24" steal="0.00" idle="97.40"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:49:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.15" nice="0.00" system="0.90" iowait="0.18" steal="0.00" idle="97.77"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:50:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.25" nice="0.00" system="0.95" iowait="0.37" steal="0.00" idle="97.42"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:51:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.15" nice="0.00" system="0.87" iowait="0.35" steal="0.00" idle="97.63"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:52:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.28" nice="0.00" system="0.91" iowait="0.28" steal="0.00" idle="97.53"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:53:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.08" nice="0.00" system="0.92" iowait="0.29" steal="0.00" idle="97.71"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:54:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.25" nice="0.00" system="0.92" iowait="0.17" steal="0.00" idle="97.66"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:55:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.11" nice="0.00" system="0.92" iowait="0.37" steal="0.00" idle="97.60"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:56:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.20" nice="0.00" system="0.91" iowait="0.20" steal="0.00" idle="97.70"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:57:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.13" nice="0.00" system="0.94" iowait="0.16" steal="0.00" idle="97.77"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:58:02" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.16" nice="0.00" system="0.95" iowait="0.31" steal="0.00" idle="97.59"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="08:59:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="1.10" nice="0.00" system="0.93" iowait="0.26" steal="0.00" idle="97.71"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:00:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.16" nice="0.00" system="0.91" iowait="0.23" steal="0.00" idle="97.69"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:01:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.19" nice="0.00" system="0.91" iowait="0.13" steal="0.00" idle="97.76"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:02:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.14" nice="0.00" system="0.89" iowait="0.20" steal="0.00" idle="97.77"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:03:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.25" nice="0.00" system="0.90" iowait="0.13" steal="0.00" idle="97.72"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:04:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.25" nice="0.00" system="0.91" iowait="0.28" steal="0.00" idle="97.55"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:05:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.28" nice="0.00" system="0.93" iowait="0.24" steal="0.00" idle="97.56"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:06:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.13" nice="0.00" system="0.91" iowait="0.23" steal="0.00" idle="97.74"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:07:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.23" nice="0.00" system="0.91" iowait="0.12" steal="0.00" idle="97.74"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:08:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.09" nice="0.00" system="0.93" iowait="0.15" steal="0.00" idle="97.83"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:09:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.18" nice="0.00" system="0.93" iowait="0.16" steal="0.00" idle="97.74"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:10:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.11" nice="0.00" system="0.89" iowait="0.33" steal="0.00" idle="97.67"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:11:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.17" nice="0.00" system="0.90" iowait="0.12" steal="0.00" idle="97.81"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:12:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.12" nice="0.00" system="0.91" iowait="0.12" steal="0.00" idle="97.84"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:13:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.13" nice="0.00" system="0.89" iowait="0.29" steal="0.00" idle="97.68"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:14:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.15" nice="0.00" system="0.92" iowait="0.22" steal="0.00" idle="97.71"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:15:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.29" nice="0.00" system="0.90" iowait="0.51" steal="0.00" idle="97.30"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:16:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.15" nice="0.00" system="0.94" iowait="0.11" steal="0.00" idle="97.81"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:17:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.96" nice="0.00" system="1.48" iowait="0.49" steal="0.00" idle="94.07"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:18:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.71" nice="0.00" system="0.99" iowait="0.33" steal="0.00" idle="96.97"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:19:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.89" nice="0.00" system="1.45" iowait="0.37" steal="0.00" idle="93.29"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:20:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.13" nice="0.00" system="1.40" iowait="0.37" steal="0.00" idle="94.10"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:21:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.81" nice="0.00" system="1.39" iowait="0.60" steal="0.00" idle="93.19"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:22:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.85" nice="0.00" system="1.29" iowait="0.53" steal="0.00" idle="94.33"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:23:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.58" nice="0.00" system="1.28" iowait="0.52" steal="0.00" idle="94.62"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:24:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.75" nice="0.00" system="1.46" iowait="0.47" steal="0.00" idle="93.31"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:25:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.35" nice="0.00" system="1.35" iowait="0.62" steal="0.00" idle="93.68"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:26:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.91" nice="0.00" system="1.44" iowait="0.55" steal="0.00" idle="93.10"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:27:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.89" nice="0.00" system="1.45" iowait="0.66" steal="0.00" idle="93.01"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:28:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="5.38" nice="0.00" system="1.42" iowait="0.49" steal="0.00" idle="92.71"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:29:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="13.81" nice="0.00" system="1.79" iowait="0.30" steal="0.00" idle="84.10"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:30:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="6.35" nice="0.00" system="1.63" iowait="0.54" steal="0.00" idle="91.49"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:31:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.36" nice="0.00" system="1.38" iowait="0.42" steal="0.00" idle="93.83"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:32:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.06" nice="0.00" system="1.30" iowait="0.60" steal="0.00" idle="94.04"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:33:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.69" nice="0.00" system="1.48" iowait="0.42" steal="0.00" idle="93.40"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:34:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.54" nice="0.00" system="1.40" iowait="0.56" steal="0.00" idle="93.49"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:35:02" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.71" nice="0.00" system="1.43" iowait="0.46" steal="0.00" idle="93.39"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:36:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="4.34" nice="0.00" system="1.33" iowait="0.43" steal="0.00" idle="93.90"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:37:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.15" nice="0.00" system="1.40" iowait="0.59" steal="0.00" idle="93.85"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:38:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="4.36" nice="0.00" system="1.36" iowait="0.55" steal="0.00" idle="93.73"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:39:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.89" nice="0.00" system="1.24" iowait="0.57" steal="0.00" idle="94.30"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:40:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.93" nice="0.00" system="1.15" iowait="0.34" steal="0.00" idle="96.59"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:41:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.87" nice="0.00" system="1.14" iowait="0.68" steal="0.00" idle="96.32"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:42:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.89" nice="0.00" system="1.15" iowait="0.31" steal="0.00" idle="96.65"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:43:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.97" nice="0.00" system="1.14" iowait="0.24" steal="0.00" idle="96.65"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:44:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.92" nice="0.00" system="1.14" iowait="0.18" steal="0.00" idle="96.76"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:45:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.86" nice="0.00" system="1.17" iowait="0.34" steal="0.00" idle="96.63"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:46:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.23" nice="0.00" system="1.22" iowait="0.19" steal="0.00" idle="96.35"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:47:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.93" nice="0.00" system="1.19" iowait="0.39" steal="0.00" idle="96.50"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:48:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.82" nice="0.06" system="1.14" iowait="0.13" steal="0.00" idle="96.84"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:49:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.15" nice="0.00" system="1.22" iowait="0.21" steal="0.00" idle="96.42"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:50:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.99" nice="0.00" system="1.16" iowait="0.21" steal="0.00" idle="96.63"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:51:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.99" nice="0.00" system="1.22" iowait="0.16" steal="0.00" idle="96.64"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:52:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.97" nice="0.00" system="1.21" iowait="0.22" steal="0.00" idle="96.60"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:53:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.00" nice="0.00" system="1.19" iowait="0.16" steal="0.00" idle="96.66"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:54:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.99" nice="0.00" system="1.23" iowait="0.26" steal="0.00" idle="96.51"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:55:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.79" nice="0.00" system="1.17" iowait="0.32" steal="0.00" idle="96.72"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:56:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.90" nice="0.00" system="1.19" iowait="0.20" steal="0.00" idle="96.70"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:57:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.71" nice="0.00" system="1.17" iowait="0.41" steal="0.00" idle="96.72"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:58:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.11" nice="0.00" system="1.26" iowait="0.26" steal="0.00" idle="96.37"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="09:59:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.00" nice="0.00" system="1.30" iowait="0.64" steal="0.00" idle="95.06"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:00:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="6.48" nice="0.00" system="1.15" iowait="0.43" steal="0.00" idle="91.94"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:01:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="5.61" nice="0.00" system="1.17" iowait="0.58" steal="0.00" idle="92.65"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:02:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="3.33" nice="0.00" system="1.31" iowait="0.54" steal="0.00" idle="94.83"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:03:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.57" nice="0.00" system="1.13" iowait="0.16" steal="0.00" idle="97.13"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:04:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.74" nice="0.00" system="1.17" iowait="0.33" steal="0.00" idle="96.76"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:05:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.41" nice="0.00" system="1.27" iowait="0.33" steal="0.00" idle="95.99"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:06:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.11" nice="0.00" system="1.20" iowait="0.18" steal="0.00" idle="96.51"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:07:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.87" nice="0.00" system="1.14" iowait="0.32" steal="0.00" idle="96.67"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:08:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.99" nice="0.00" system="1.37" iowait="0.37" steal="0.00" idle="96.27"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:09:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.60" nice="0.00" system="1.12" iowait="0.11" steal="0.00" idle="97.17"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:10:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.52" nice="0.00" system="1.10" iowait="0.45" steal="0.00" idle="96.93"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:11:02" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.64" nice="0.00" system="1.11" iowait="0.12" steal="0.00" idle="97.13"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:12:01" utc="1" interval="59"> + <cpu-load> + <cpu number="all" user="1.61" nice="0.00" system="1.12" iowait="0.32" steal="0.00" idle="96.95"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:13:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.47" nice="0.00" system="1.22" iowait="0.44" steal="0.00" idle="95.87"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:14:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.01" nice="0.00" system="1.23" iowait="0.24" steal="0.00" idle="96.53"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:15:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.07" nice="0.00" system="1.20" iowait="0.35" steal="0.00" idle="96.38"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:16:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.86" nice="0.00" system="1.17" iowait="0.19" steal="0.00" idle="96.78"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:17:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.82" nice="0.00" system="1.18" iowait="0.26" steal="0.00" idle="96.74"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:18:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="1.84" nice="0.00" system="1.22" iowait="0.29" steal="0.00" idle="96.65"/> + </cpu-load> + </timestamp> + <timestamp date="2014-03-19" time="10:19:01" utc="1" interval="60"> + <cpu-load> + <cpu number="all" user="2.01" nice="0.00" system="1.20" iowait="0.17" steal="0.00" idle="96.62"/> + </cpu-load> + </timestamp> + </statistics> + <restarts> + </restarts> + </host> +</sysstat> diff --git a/tests/test_cpu.py b/tests/test_cpu.py new file mode 100644 index 0000000..a354427 --- /dev/null +++ b/tests/test_cpu.py @@ -0,0 +1,106 @@ +# +# Copyright 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +from testrunner import PluginsTestCase as TestCaseBase +from plugins import cpu +import test_cpu_dataFile + + +class cpuTests(TestCaseBase): + + def _showCpuStatus_unknown_test(self): + w = 80 + c = 90 + actual = cpu.showCpuStat( + w, c, + test_cpu_dataFile.SHOW_CPU_STATUS_UNKNOWN_IP + ) + self.assertEquals( + actual, + test_cpu_dataFile.SHOW_CPU_STATUS_UNKNOWN_OP + ) + + def _showCpuStatus_ok_test(self): + w = 60 + c = 90 + actual = cpu.showCpuStat( + w, c, + test_cpu_dataFile.SHOW_CPU_STATUS_OK_IP + ) + self.assertEquals( + actual, + test_cpu_dataFile.SHOW_CPU_STATUS_OK_OP + ) + + def _showCpuStatus_warning_test(self): + w = 5 + c = 10 + actual = cpu.showCpuStat( + w, c, + test_cpu_dataFile.SHOW_CPU_STATUS_WARNING_IP + ) + self.assertEquals( + actual, + test_cpu_dataFile.SHOW_CPU_STATUS_WARNING_OP + ) + + def _showCpuStatus_critical_test(self): + w = 3 + c = 4 + actual = cpu.showCpuStat( + w, c, + test_cpu_dataFile.SHOW_CPU_STATUS_CRITICAL_IP + ) + self.assertEquals( + actual, + test_cpu_dataFile.SHOW_CPU_STATUS_CRITICAL_OP + ) + + def _showCpuStatus_exception_test(self): + w = 30 + c = 40 + actual = cpu.showCpuStat( + w, c, + test_cpu_dataFile.SHOW_CPU_STATUS_EXCEPTION_IP + ) + self.assertEquals( + actual, + test_cpu_dataFile.SHOW_CPU_STATUS_EXCEPTION_OP + ) + + def _showCpuStatus_single_core_test(self): + w = 60 + c = 90 + actual = cpu.showCpuStat( + w, c, + test_cpu_dataFile.SHOW_CPU_STATUS_SINGLE_CORE_IP + ) + self.assertEquals( + actual, + test_cpu_dataFile.SHOW_CPU_STATUS_SINGLE_CORE_OP + ) + + def test_showCpuStatus(self): + self._showCpuStatus_unknown_test() + self._showCpuStatus_ok_test() + self._showCpuStatus_warning_test() + self._showCpuStatus_critical_test() + self._showCpuStatus_exception_test() + self._showCpuStatus_single_core_test() diff --git a/tests/test_cpu_dataFile.py b/tests/test_cpu_dataFile.py new file mode 100644 index 0000000..1cea0e9 --- /dev/null +++ b/tests/test_cpu_dataFile.py @@ -0,0 +1,217 @@ +# +# Copyright 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +SHOW_CPU_STATUS_UNKNOWN_IP = {} + +SHOW_CPU_STATUS_UNKNOWN_OP = \ + {'message': "CPU STATUS UNKNOWN", 'exit_status': 3} + +SHOW_CPU_STATUS_OK_IP = \ + {'date': '2014-03-10', 'utc': '1', + 'cpu-load': {'cpu': + [{'iowait': '0.93', + 'system': '0.71', + 'number': 'all', + 'idle': '94.89', + 'user': '3.46', + 'steal': '0.00', + 'nice': '0.00'}, + {'iowait': '0.63', + 'system': '0.58', + 'number': '0', + 'idle': '94.91', + 'user': '3.87', + 'steal': '0.00', + 'nice': '0.00'}, + {'iowait': '2.00', + 'system': '0.85', + 'number': '1', + 'idle': '94.24', + 'user': '2.90', + 'steal': '0.00', + 'nice': '0.00'}, + {'iowait': '0.82', + 'system': '0.73', + 'number': '2', + 'idle': '94.97', + 'user': '3.46', + 'steal': '0.00', + 'nice': '0.02'}, + {'iowait': '0.28', + 'system': '0.67', + 'number': '3', + 'idle': '95.43', + 'user': '3.62', + 'steal': '0.00', + 'nice': '0.00'}]}, + 'time': '13:22:01', + 'interval': '60'} + +SHOW_CPU_STATUS_OK_OP = \ + {'message': "CPU Status OK: Total CPU:5.11% Idle CPU:94.89%" + " | num_of_cpu=4 cpu_all_total=5.11%;60;90 cpu_all_system=" + "0.71% cpu_all_user=3.46% cpu_all_idle=94.89% cpu_0_total=" + "5.09%;60;90 cpu_0_system=0.58% cpu_0_user=3.87% cpu_0_" + "idle=94.91% cpu_1_total=5.76%;60;90 cpu_1_system=0.85% " + "cpu_1_user=2.90% cpu_1_idle=94.24% cpu_2_total=5.03%;60;" + "90 cpu_2_system=0.73% cpu_2_user=3.46% cpu_2_idle=94.97%" + " cpu_3_total=4.57%;60;90 cpu_3_system=0.67% cpu_3_user=" + "3.62% cpu_3_idle=95.43%", 'exit_status': 0} + +SHOW_CPU_STATUS_WARNING_IP = \ + {'date': '2014-03-10', 'utc': '1', + 'cpu-load': {'cpu': + [{'iowait': '0.93', + 'system': '0.71', + 'number': 'all', + 'idle': '94.89', + 'user': '3.46', + 'steal': '0.00', + 'nice': '0.00'}, + {'iowait': '0.63', + 'system': '0.58', + 'number': '0', + 'idle': '94.91', + 'user': '3.87', + 'steal': '0.00', + 'nice': '0.00'}, + {'iowait': '2.00', + 'system': '0.85', + 'number': '1', + 'idle': '94.24', + 'user': '2.90', + 'steal': '0.00', + 'nice': '0.00'}, + {'iowait': '0.82', + 'system': '0.73', + 'number': '2', + 'idle': '94.97', + 'user': '3.46', + 'steal': '0.00', + 'nice': '0.02'}, + {'iowait': '0.28', + 'system': '0.67', + 'number': '3', + 'idle': '95.43', + 'user': '3.62', + 'steal': '0.00', + 'nice': '0.00'}]}, + 'time': '13:22:01', + 'interval': '60'} + +SHOW_CPU_STATUS_WARNING_OP = \ + {'message': "CPU Status WARNING: Total CPU:5.11% Idle" + " CPU:94.89% | num_of_cpu=4 cpu_all_total=5.11%;5;10" + " cpu_all_system=0.71% cpu_all_user=3.46% cpu_all_idle" + "=94.89% cpu_0_total=5.09%;5;10 cpu_0_system=0.58% " + "cpu_0_user=3.87% cpu_0_idle=94.91% cpu_1_total=5.76%" + ";5;10 cpu_1_system=0.85% cpu_1_user=2.90% cpu_1_idle=" + "94.24% cpu_2_total=5.03%;5;10 cpu_2_system=0.73% " + "cpu_2_user=3.46% cpu_2_idle=94.97% cpu_3_total=4.57%" + ";5;10 cpu_3_system=0.67% cpu_3_user=3.62% " + "cpu_3_idle=95.43%", 'exit_status': 1} + +SHOW_CPU_STATUS_CRITICAL_IP = \ + {'date': '2014-03-10', 'utc': '1', + 'cpu-load': {'cpu': + [{'iowait': '0.93', + 'system': '0.71', + 'number': 'all', + 'idle': '94.89', + 'user': '3.46', + 'steal': '0.00', + 'nice': '0.00'}, + {'iowait': '0.63', + 'system': '0.58', + 'number': '0', + 'idle': '94.91', + 'user': '3.87', + 'steal': '0.00', + 'nice': '0.00'}, + {'iowait': '2.00', + 'system': '0.85', + 'number': '1', + 'idle': '94.24', + 'user': '2.90', + 'steal': '0.00', + 'nice': '0.00'}, + {'iowait': '0.82', + 'system': '0.73', + 'number': '2', + 'idle': '94.97', + 'user': '3.46', + 'steal': '0.00', + 'nice': '0.02'}, + {'iowait': '0.28', + 'system': '0.67', + 'number': '3', + 'idle': '95.43', + 'user': '3.62', + 'steal': '0.00', + 'nice': '0.00'}]}, + 'time': '13:22:01', + 'interval': '60'} + +SHOW_CPU_STATUS_CRITICAL_OP = \ + {'message': "CPU Status CRITICAL: Total CPU:5.11% " + "Idle CPU:94.89% | num_of_cpu=4 cpu_all_total=5.11%" + ";3;4 cpu_all_system=0.71% cpu_all_user=3.46% " + "cpu_all_idle=94.89% cpu_0_total=5.09%;3;4 cpu_0_" + "system=0.58% cpu_0_user=3.87% cpu_0_idle=94.91% " + "cpu_1_total=5.76%;3;4 cpu_1_system=0.85% cpu_1_us" + "er=2.90% cpu_1_idle=94.24% cpu_2_total=5.03%;3;4 " + "cpu_2_system=0.73% cpu_2_user=3.46% cpu_2_idle=" + "94.97% cpu_3_total=4.57%;3;4 cpu_3_system=0.67% " + "cpu_3_user=3.62% cpu_3_idle=95.43%", 'exit_status': 2} + +SHOW_CPU_STATUS_EXCEPTION_IP = \ + {'date': '2014-03-10', 'utc': '1', + 'cpu-load': {}, + 'time': '13:22:01', + 'interval': '60'}\ + +SHOW_CPU_STATUS_EXCEPTION_OP = \ + {'message': "key: 'cpu' not found", + 'exit_status': 3} + +SHOW_CPU_STATUS_SINGLE_CORE_IP = \ + {'date': '2014-03-10', 'utc': '1', + 'cpu-load': {'cpu': + [{'iowait': '0.63', + 'system': '0.58', + 'number': 'all', + 'idle': '94.91', + 'user': '3.87', + 'steal': '0.00', + 'nice': '0.00'}, + {'iowait': '0.63', + 'system': '0.58', + 'number': '0', + 'idle': '94.91', + 'user': '3.87', + 'steal': '0.00', + 'nice': '0.00'}]}, + 'time': '13:22:01', + 'interval': '60'} + +SHOW_CPU_STATUS_SINGLE_CORE_OP = \ + {'message': "CPU Status OK: Total CPU:5.09% Idle CPU:94.91%" + " | num_of_cpu=1 cpu_all_total=5.09%;60;90 cpu_all_system=" + "0.58% cpu_all_user=3.87% cpu_all_idle=94.91%", 'exit_status': 0} diff --git a/tests/test_memory.py b/tests/test_memory.py new file mode 100644 index 0000000..fb02b5b --- /dev/null +++ b/tests/test_memory.py @@ -0,0 +1,93 @@ +# +# Copyright 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +from testrunner import PluginsTestCase as TestCaseBase +from plugins import memory +import test_memory_dataFile + + +class memoryTests(TestCaseBase): + + def _showMemStatus_unknown_test(self): + w = 80 + c = 90 + actual = memory.showMemStat( + w, c, + test_memory_dataFile.SHOW_MEMORY_STATUS_UNKNOWN_IP + ) + self.assertEquals( + actual, + test_memory_dataFile.SHOW_MEMORY_STATUS_UNKNOWN_OP + ) + + def _showMemStatus_ok_test(self): + w = 60 + c = 70 + actual = memory.showMemStat( + w, c, + test_memory_dataFile.SHOW_MEMORY_STATUS_OK_IP + ) + self.assertEquals( + actual, + test_memory_dataFile.SHOW_MEMORY_STATUS_OK_OP + ) + + def _showMemStatus_warning_test(self): + w = 40 + c = 60 + actual = memory.showMemStat( + w, c, + test_memory_dataFile.SHOW_MEMORY_STATUS_WARNING_IP + ) + self.assertEquals( + actual, + test_memory_dataFile.SHOW_MEMORY_STATUS_WARNING_OP + ) + + def _showMemStatus_critical_test(self): + w = 30 + c = 40 + actual = memory.showMemStat( + w, c, + test_memory_dataFile.SHOW_MEMORY_STATUS_CRITICAL_IP + ) + self.assertEquals( + actual, + test_memory_dataFile.SHOW_MEMORY_STATUS_CRITICAL_OP + ) + + def _showMemStatus_exception_test(self): + w = 30 + c = 40 + actual = memory.showMemStat( + w, c, + test_memory_dataFile.SHOW_MEMORY_STATUS_EXCEPTION_IP + ) + self.assertEquals( + actual, + test_memory_dataFile.SHOW_MEMORY_STATUS_EXCEPTION_OP + ) + + def test_showMemStatus(self): + self._showMemStatus_unknown_test() + self._showMemStatus_ok_test() + self._showMemStatus_warning_test() + self._showMemStatus_critical_test() + self._showMemStatus_exception_test() diff --git a/tests/test_memory_dataFile.py b/tests/test_memory_dataFile.py new file mode 100644 index 0000000..b58c218 --- /dev/null +++ b/tests/test_memory_dataFile.py @@ -0,0 +1,90 @@ +# +# Copyright 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# +SHOW_MEMORY_STATUS_UNKNOWN_IP = {} + +SHOW_MEMORY_STATUS_UNKNOWN_OP = \ + {'message': "MEMORY STATUS UNKNOWN", 'exit_status': 3} + +SHOW_MEMORY_STATUS_OK_IP = \ + {'date': '2014-03-10', 'utc': '1', + 'interval': '60', + 'time': '12:18:01', + 'memory': {'memused-percent': '46.97', + 'cached': '1519240', + 'unit': 'kB', 'per': 'second', + 'memfree': '4174044', 'inactive': '1495848', + 'commit-percent': '13.20', 'active': '1825260', + 'commit': '3805776', 'memused': '3696340', + 'buffers': '376704', 'dirty': '1696'}} + +SHOW_MEMORY_STATUS_OK_OP = \ + {'message': "OK- 46.97% used(3696340kB out of 7870384kB)|" + "Total=7870384kB;4722230;5509268;0;7870384 Used=3696340kB" + " Buffered=376704kB Cached=1519240kB", 'exit_status': 0} + +SHOW_MEMORY_STATUS_WARNING_IP = \ + {'date': '2014-03-10', 'utc': '1', + 'interval': '60', + 'time': '12:18:01', + 'memory': {'memused-percent': '46.97', + 'cached': '1519240', + 'unit': 'kB', 'per': 'second', + 'memfree': '4174044', 'inactive': '1495848', + 'commit-percent': '13.20', 'active': '1825260', + 'commit': '3805776', 'memused': '3696340', + 'buffers': '376704', 'dirty': '1696'}} + +SHOW_MEMORY_STATUS_WARNING_OP = \ + {'message': "WARNING- 46.97% used(3696340kB out of 7870384" + "kB)|Total=7870384kB;3148153;4722230;0;7870384 Used=36963" + "40kB Buffered=376704kB Cached=1519240kB", 'exit_status': 1} + +SHOW_MEMORY_STATUS_CRITICAL_IP = \ + {'date': '2014-03-10', 'utc': '1', + 'interval': '60', + 'time': '12:18:01', + 'memory': {'memused-percent': '46.97', + 'cached': '1519240', + 'unit': 'kB', 'per': 'second', + 'memfree': '4174044', 'inactive': '1495848', + 'commit-percent': '13.20', 'active': '1825260', + 'commit': '3805776', 'memused': '3696340', + 'buffers': '376704', 'dirty': '1696'}} + +SHOW_MEMORY_STATUS_CRITICAL_OP = \ + {'message': "CRITICAL- 46.97% used(3696340kB out of 7870384" + "kB)|Total=7870384kB;2361115;3148153;0;7870384 Used=369634" + "0kB Buffered=376704kB Cached=1519240kB", 'exit_status': 2} + +SHOW_MEMORY_STATUS_EXCEPTION_IP = \ + {'date': '2014-03-10', 'utc': '1', + 'interval': '60', + 'time': '12:18:01', + 'memory': {'memused-percent': '46.97', + 'cached': '1519240', + 'unit': 'kB', 'per': 'second', + 'memfree': '4174044', 'inactive': '1495848', + 'commit-percent': '13.20', 'active': '1825260', + 'commit': '3805776', + 'buffers': '376704', 'dirty': '1696'}} + +SHOW_MEMORY_STATUS_EXCEPTION_OP = \ + {'message': "key: 'memused' not found", + 'exit_status': 3} diff --git a/tests/test_network.py b/tests/test_network.py new file mode 100644 index 0000000..8cb4552 --- /dev/null +++ b/tests/test_network.py @@ -0,0 +1,86 @@ +# +# Copyright 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +from testrunner import PluginsTestCase as TestCaseBase +from plugins import network +import test_network_dataFile + + +class networkTests(TestCaseBase): + + def _showNetStatus_unknown_test(self): + actual = network.showNetStat( + test_network_dataFile.SHOW_NETWORK_STATUS_UNKNOWN_IP + ) + self.assertEquals( + actual, + test_network_dataFile.SHOW_NETWORK_STATUS_UNKNOWN_OP + ) + + def _showNetStatus_ok_test(self): + actual = network.showNetStat( + test_network_dataFile.SHOW_NETWORK_STATUS_OK_IP + ) + self.assertEquals( + actual, + test_network_dataFile.SHOW_NETWORK_STATUS_OK_OP + ) + + def _showNetStatus_include_test(self): + in_list = ["lo"] + list_type = "include" + actual = network.showNetStat( + test_network_dataFile.SHOW_NETWORK_STATUS_INCLUDE_IP, + in_list, + list_type + ) + self.assertEquals( + actual, + test_network_dataFile.SHOW_NETWORK_STATUS_INCLUDE_OP + ) + + def _showNetStatus_exclude_test(self): + ex_list = ["lo"] + list_type = "exclude" + actual = network.showNetStat( + test_network_dataFile.SHOW_NETWORK_STATUS_EXCLUDE_IP, + ex_list, + list_type + ) + self.assertEquals( + actual, + test_network_dataFile.SHOW_NETWORK_STATUS_EXCLUDE_OP + ) + + def _showNetStatus_exception_test(self): + actual = network.showNetStat( + test_network_dataFile.SHOW_NETWORK_STATUS_EXCEPTION_IP + ) + self.assertEquals( + actual, + test_network_dataFile.SHOW_NETWORK_STATUS_EXCEPTION_OP + ) + + def test_showNetStatus(self): + self._showNetStatus_unknown_test() + self._showNetStatus_ok_test() + self._showNetStatus_include_test() + self._showNetStatus_exclude_test() + self._showNetStatus_exception_test() diff --git a/tests/test_network_dataFile.py b/tests/test_network_dataFile.py new file mode 100644 index 0000000..f74157c --- /dev/null +++ b/tests/test_network_dataFile.py @@ -0,0 +1,162 @@ +# +# Copyright 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +SHOW_NETWORK_STATUS_UNKNOWN_IP = {} + +SHOW_NETWORK_STATUS_UNKNOWN_OP = \ + {'message': "IFACE UNKNOWN", 'exit_status': 3} + +SHOW_NETWORK_STATUS_OK_IP = \ + {'date': '2014-03-11', + 'utc': '1', 'interval': '60', + 'network': + {'net-dev': + [{'rxmcst': '0.00', + 'iface': 'tun0', 'rxkB': '11.44', + 'rxpck': '13.28', 'txpck': '13.51', + 'txkB': '1.28', 'txcmp': '0.00', + 'rxcmp': '0.00'}, + {'rxmcst': '0.00', 'iface': 'wlp3s0', + 'rxkB': '12.60', 'rxpck': '13.73', + 'txpck': '13.60', 'txkB': '2.72', + 'txcmp': '0.00', 'rxcmp': '0.00'}, + {'rxmcst': '0.00', 'iface': 'lo', + 'rxkB': '0.04', 'rxpck': '0.12', + 'txpck': '0.12', 'txkB': '0.04', + 'txcmp': '0.00', 'rxcmp': '0.00'}, + {'rxmcst': '0.00', 'iface': 'virbr0-nic', + 'rxkB': '0.00', 'rxpck': '0.00', + 'txpck': '0.00', 'txkB': '0.00', + 'txcmp': '0.00', 'rxcmp': '0.00'}, + {'rxmcst': '0.00', 'iface': 'virbr0', + 'rxkB': '0.00', 'rxpck': '0.00', + 'txpck': '0.00', 'txkB': '0.00', + 'txcmp': '0.00', 'rxcmp': '0.00'}, + {'rxmcst': '0.02', 'iface': 'em1', + 'rxkB': '0.21', 'rxpck': '2.23', + 'txpck': '0.40', 'txkB': '0.03', + 'txcmp': '0.00', 'rxcmp': '0.00'}], + 'per': 'second'}, + 'time': '07:00:01'} + +SHOW_NETWORK_STATUS_OK_OP = \ + {'message': "IFACE OK: tun0, wlp3s0, lo, " + "virbr0-nic, virbr0, em1 |tun0.rxpck=13.28 " + "tun0.txpck=13.51 tun0.rxkB=11.44 tun0.txkB=" + "1.28 wlp3s0.rxpck=13.73 wlp3s0.txpck=13.60 " + "wlp3s0.rxkB=12.60 wlp3s0.txkB=2.72 lo.rxpck=" + "0.12 lo.txpck=0.12 lo.rxkB=0.04 lo.txkB=0.04" + " virbr0-nic.rxpck=0.00 virbr0-nic.txpck=0.00" + " virbr0-nic.rxkB=0.00 virbr0-nic.txkB=0.00 " + "virbr0.rxpck=0.00 virbr0.txpck=0.00 " + "virbr0.rxkB=0.00 virbr0.txkB=0.00 em1.rxpck=" + "2.23 em1.txpck=0.40 em1.rxkB=0.21 em1.txkB=" + "0.03", 'exit_status': 0} + +SHOW_NETWORK_STATUS_INCLUDE_IP = \ + {'date': '2014-03-11', + 'utc': '1', 'interval': '60', + 'network': + {'net-dev': + [{'rxmcst': '0.00', + 'iface': 'tun0', 'rxkB': '11.44', + 'rxpck': '13.28', 'txpck': '13.51', + 'txkB': '1.28', 'txcmp': '0.00', + 'rxcmp': '0.00'}, + {'rxmcst': '0.00', 'iface': 'wlp3s0', + 'rxkB': '12.60', 'rxpck': '13.73', + 'txpck': '13.60', 'txkB': '2.72', + 'txcmp': '0.00', 'rxcmp': '0.00'}, + {'rxmcst': '0.00', 'iface': 'lo', + 'rxkB': '0.04', 'rxpck': '0.12', + 'txpck': '0.12', 'txkB': '0.04', + 'txcmp': '0.00', 'rxcmp': '0.00'}, + {'rxmcst': '0.00', 'iface': 'virbr0-nic', + 'rxkB': '0.00', 'rxpck': '0.00', + 'txpck': '0.00', 'txkB': '0.00', + 'txcmp': '0.00', 'rxcmp': '0.00'}, + {'rxmcst': '0.00', 'iface': 'virbr0', + 'rxkB': '0.00', 'rxpck': '0.00', + 'txpck': '0.00', 'txkB': '0.00', + 'txcmp': '0.00', 'rxcmp': '0.00'}, + {'rxmcst': '0.02', 'iface': 'em1', + 'rxkB': '0.21', 'rxpck': '2.23', + 'txpck': '0.40', 'txkB': '0.03', + 'txcmp': '0.00', 'rxcmp': '0.00'}], + 'per': 'second'}, + 'time': '07:00:01'} + +SHOW_NETWORK_STATUS_INCLUDE_OP = \ + {'message': "IFACE OK: lo |lo.rxpck=0.12 " + "lo.txpck=0.12 lo.rxkB=0.04 lo.txkB=0.04", + 'exit_status': 0} + +SHOW_NETWORK_STATUS_EXCLUDE_IP = \ + {'date': '2014-03-11', + 'utc': '1', 'interval': '60', + 'network': + {'net-dev': + [{'rxmcst': '0.00', + 'iface': 'tun0', 'rxkB': '11.44', + 'rxpck': '13.28', 'txpck': '13.51', + 'txkB': '1.28', 'txcmp': '0.00', + 'rxcmp': '0.00'}, + {'rxmcst': '0.00', 'iface': 'wlp3s0', + 'rxkB': '12.60', 'rxpck': '13.73', + 'txpck': '13.60', 'txkB': '2.72', + 'txcmp': '0.00', 'rxcmp': '0.00'}, + {'rxmcst': '0.00', 'iface': 'lo', + 'rxkB': '0.04', 'rxpck': '0.12', + 'txpck': '0.12', 'txkB': '0.04', + 'txcmp': '0.00', 'rxcmp': '0.00'}, + {'rxmcst': '0.00', 'iface': 'virbr0-nic', + 'rxkB': '0.00', 'rxpck': '0.00', + 'txpck': '0.00', 'txkB': '0.00', + 'txcmp': '0.00', 'rxcmp': '0.00'}, + {'rxmcst': '0.00', 'iface': 'virbr0', + 'rxkB': '0.00', 'rxpck': '0.00', + 'txpck': '0.00', 'txkB': '0.00', + 'txcmp': '0.00', 'rxcmp': '0.00'}, + {'rxmcst': '0.02', 'iface': 'em1', + 'rxkB': '0.21', 'rxpck': '2.23', + 'txpck': '0.40', 'txkB': '0.03', + 'txcmp': '0.00', 'rxcmp': '0.00'}], + 'per': 'second'}, + 'time': '07:00:01'} + +SHOW_NETWORK_STATUS_EXCLUDE_OP = \ + {'message': "IFACE OK: tun0, wlp3s0, virbr0-nic" + ", virbr0, em1 |tun0.rxpck=13.28 tun0.txpck=13.51" + " tun0.rxkB=11.44 tun0.txkB=1.28 wlp3s0.rxpck=13.73" + " wlp3s0.txpck=13.60 wlp3s0.rxkB=12.60 wlp3s0.txkB=" + "2.72 virbr0-nic.rxpck=0.00 virbr0-nic.txpck=0.00 " + "virbr0-nic.rxkB=0.00 virbr0-nic.txkB=0.00 " + "virbr0.rxpck=0.00 virbr0.txpck=0.00 virbr0.rxkB=" + "0.00 virbr0.txkB=0.00 em1.rxpck=2.23 em1.txpck=" + "0.40 em1.rxkB=0.21 em1.txkB=0.03", 'exit_status': 0} + +SHOW_NETWORK_STATUS_EXCEPTION_IP = \ + {'date': '2014-03-11', + 'utc': '1', 'interval': '60', + 'network': "test"} + +SHOW_NETWORK_STATUS_EXCEPTION_OP = \ + {'message': 'key: string indices must be integers' + ', not str not found', 'exit_status': 3} diff --git a/tests/test_sadf.py b/tests/test_sadf.py index ced037e..73c0d9b 100644 --- a/tests/test_sadf.py +++ b/tests/test_sadf.py @@ -18,173 +18,49 @@ # Refer to the README and COPYING files for full details of the license # +import mock +from datetime import datetime import xml.etree.cElementTree as etree - from testrunner import PluginsTestCase as TestCaseBase -from plugins import sadf - -class sadfTests(TestCaseBase): +import plugins - def _etree_to_dict_arg_test(self): - out = """<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE sysstat PUBLIC "DTD v2.15 sysstat //EN" -"http://pagesperso-orange.fr/sebastien.godard/sysstat-2.15.dtd"> -<sysstat> -<sysdata-version>2.15</sysdata-version> -<host nodename="dhcp-0-171.blr.redhat.com"> -<sysname>Linux</sysname> -<release>3.11.3-201.fc19.x86_64</release> -<machine>x86_64</machine> -<number-of-cpus>4</number-of-cpus> -<file-date>2014-03-07</file-date> -<statistics> -<timestamp date="2014-03-07" time="05:00:01" utc="1" interval="59"> -<memory per="second" unit="kB"> -<memfree>6821428</memfree> -<memused>1049448</memused> -<memused-percent>13.33</memused-percent> -<buffers>49416</buffers> -<cached>536932</cached> -<commit>2127484</commit> -<commit-percent>7.38</commit-percent> -<active>361428</active> -<inactive>487048</inactive> -<dirty>1256</dirty> -</memory> -</timestamp> -</statistics> -<restarts> -<boot date="2014-03-07" time="04:58:08" utc="1"/> -</restarts> -</host> -</sysstat> -""" - tree = etree.fromstring(out) - expected_dict = \ - {'sysstat': {'host': - {'sysname': 'Linux', - 'statistics': {'timestamp': - {'date': '2014-03-07', - 'utc': '1', 'interval': '59', - 'time': '05:00:01', - 'memory': - {'memused-percent': '13.33', - 'cached': '536932', - 'unit': 'kB', - 'per': 'second', - 'memfree': '6821428', - 'inactive': '487048', - 'commit-percent': '7.38', - 'active': '361428', - 'commit': '2127484', - 'memused': '1049448', - 'buffers': '49416', - 'dirty': '1256'}}}, - 'nodename': 'dhcp-0-171.blr.redhat.com', - 'file-date': '2014-03-07', - 'number-of-cpus': '4', - 'restarts': {'boot': - {'date': '2014-03-07', 'utc': '1', - 'time': '04:58:08'}}, - 'machine': 'x86_64', - 'release': '3.11.3-201.fc19.x86_64'}, - 'sysdata-version': '2.15'}} - actual_dict = sadf.etree_to_dict(tree) - self.assertEquals(actual_dict, expected_dict) +class sadfTests(TestCaseBase): + @mock.patch('plugins.sadf.utcnow') + def test_getLatestStat_success(self, utcnow_mock): + expectedDict = {'cpu-load': {'cpu': {'idle': '96.62', + 'iowait': '0.17', + 'nice': '0.00', + 'number': 'all', + 'steal': '0.00', + 'system': '1.20', + 'user': '2.01'}}, + 'date': '2014-03-19', + 'interval': '60', + 'time': '10:19:01', + 'utc': '1'} + utcnow_mock.return_value = datetime(2014, 3, 19, 10, 19, 22, + 164227) + with open("getLatestStat_success.xml") as f: + out = f.read() + tree = etree.fromstring(out) + outDict = plugins.sadf.getLatestStat(tree) + self.assertEquals(expectedDict, outDict) - def _etree_to_dict_string_test(self): - out = """<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE sysstat PUBLIC "DTD v2.15 sysstat //EN" -"http://pagesperso-orange.fr/sebastien.godard/sysstat-2.15.dtd"> -<sysstat> -<sysdata-version>2.15</sysdata-version> -<host nodename="dhcp-0-171.blr.redhat.com"> -<sysname>Linux</sysname> -<release>3.11.3-201.fc19.x86_64</release> -<machine>x86_64</machine> -<number-of-cpus>4</number-of-cpus> -<file-date>2014-03-07</file-date> -<statistics> -<timestamp date="2014-03-07" time="05:00:01" utc="1" interval="59"> -<memory per="second" unit="kB"> -Test string -<memfree>6821428</memfree> -<memused>1049448</memused> -<memused-percent>13.33</memused-percent> -<buffers>49416</buffers> -<cached>536932</cached> -<commit>2127484</commit> -<commit-percent>7.38</commit-percent> -<active>361428</active> -<inactive>487048</inactive> -<dirty>1256</dirty> -</memory> -</timestamp> -</statistics> -<restarts> -<boot date="2014-03-07" time="04:58:08" utc="1"/> -</restarts> -</host> -</sysstat> -""" - tree = etree.fromstring(out) - expected_dict = \ - {'sysstat': {'host': - {'sysname': 'Linux', - 'statistics': {'timestamp': - {'date': '2014-03-07', - 'utc': '1', 'interval': '59', - 'time': '05:00:01', 'memory': - {'#text': 'Test string', - 'memused-percent': '13.33', - 'cached': '536932', 'unit': 'kB', - 'per': 'second', - 'memfree': '6821428', - 'inactive': '487048', - 'commit-percent': '7.38', - 'active': '361428', - 'commit': '2127484', - 'memused': '1049448', - 'buffers': '49416', - 'dirty': '1256'}}}, - 'nodename': 'dhcp-0-171.blr.redhat.com', - 'file-date': '2014-03-07', 'number-of-cpus': '4', - 'restarts': {'boot': {'date': '2014-03-07', - 'utc': '1', - 'time': '04:58:08'}}, - 'machine': 'x86_64', - 'release': '3.11.3-201.fc19.x86_64'}, - 'sysdata-version': '2.15'}} - actual_dict = sadf.etree_to_dict(tree) - #print actual_dict - #exit(0) - self.assertEquals(actual_dict, expected_dict) + def test_getLatestStat_failure(self): + expectedValue = None + with open("getLatestStat_success.xml") as f: + out = f.read() + tree = etree.fromstring(out) + outValue = plugins.sadf.getLatestStat(tree) + self.assertEquals(expectedValue, outValue) - def _etree_to_dict_empty_test(self): - out = """<?xml version="1.0" encoding="UTF-8"?> -<sysstat> -<buffers></buffers> -<cached></cached> -<commit>2127484</commit> -<commit-percent>7.38</commit-percent> -<active>361428</active> -<inactive>487048</inactive> -</sysstat> -""" - tree = etree.fromstring(out) - expected_dict = \ - {'sysstat': {'cached': None, - 'inactive': '487048', - 'commit-percent': '7.38', - 'active': '361428', - 'commit': '2127484', - 'buffers': None}} - actual_dict = sadf.etree_to_dict(tree) - self.assertEquals(actual_dict, expected_dict) + def test_getLatestStat_exception(self): + def _getLatestStat(): + with open("getLatestStat_exception.xml") as f: + out = f.read() + tree = etree.fromstring(out) + plugins.sadf.getLatestStat(tree) - def test_etree_to_dict_test(self): - self._etree_to_dict_arg_test() - self._etree_to_dict_string_test() - self._etree_to_dict_empty_test() + self.assertRaises(plugins.sadf.SadfXmlErrorException, _getLatestStat) diff --git a/tests/test_swap.py b/tests/test_swap.py new file mode 100644 index 0000000..aa23f4f --- /dev/null +++ b/tests/test_swap.py @@ -0,0 +1,93 @@ +# +# Copyright 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +from testrunner import PluginsTestCase as TestCaseBase +from plugins import swap +import test_swap_dataFile + + +class swapTests(TestCaseBase): + + def _showSwapStatus_unknown_test(self): + w = 80 + c = 90 + actual = swap.showSwapStat( + w, c, + test_swap_dataFile.SHOW_SWAP_STATUS_UNKNOWN_IP + ) + self.assertEquals( + actual, + test_swap_dataFile.SHOW_SWAP_STATUS_UNKNOWN_OP + ) + + def _showSwapStatus_ok_test(self): + w = 50 + c = 80 + actual = swap.showSwapStat( + w, c, + test_swap_dataFile.SHOW_SWAP_STATUS_OK_IP + ) + self.assertEquals( + actual, + test_swap_dataFile.SHOW_SWAP_STATUS_OK_OP + ) + + def _showSwapStatus_warning_test(self): + w = 40 + c = 60 + actual = swap.showSwapStat( + w, c, + test_swap_dataFile.SHOW_SWAP_STATUS_WARNING_IP + ) + self.assertEquals( + actual, + test_swap_dataFile.SHOW_SWAP_STATUS_WARNING_OP + ) + + def _showSwapStatus_critical_test(self): + w = 30 + c = 40 + actual = swap.showSwapStat( + w, c, + test_swap_dataFile.SHOW_SWAP_STATUS_CRITICAL_IP + ) + self.assertEquals( + actual, + test_swap_dataFile.SHOW_SWAP_STATUS_CRITICAL_OP + ) + + def _showSwapStatus_exception_test(self): + w = 30 + c = 40 + actual = swap.showSwapStat( + w, c, + test_swap_dataFile.SHOW_SWAP_STATUS_EXCEPTION_IP + ) + self.assertEquals( + actual, + test_swap_dataFile.SHOW_SWAP_STATUS_EXCEPTION_OP + ) + + def test_showSwapStatus(self): + self._showSwapStatus_unknown_test() + self._showSwapStatus_ok_test() + self._showSwapStatus_warning_test() + self._showSwapStatus_critical_test() + self._showSwapStatus_exception_test() diff --git a/tests/test_swap_dataFile.py b/tests/test_swap_dataFile.py new file mode 100644 index 0000000..58ebaf3 --- /dev/null +++ b/tests/test_swap_dataFile.py @@ -0,0 +1,81 @@ +# +# Copyright 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# +SHOW_SWAP_STATUS_UNKNOWN_IP = {} + +SHOW_SWAP_STATUS_UNKNOWN_OP = \ + {'message': "SWAP STATUS UNKNOWN", 'exit_status': 3} + +SHOW_SWAP_STATUS_OK_IP = \ + {'date': '2014-03-10', + 'utc': '1', 'interval': '60', + 'time': '12:40:01', 'memory': { + 'swpused-percent': '0.00', + 'swpused': '0', 'per': 'second', + 'swpcad': '0', 'swpfree': '20971516', + 'swpcad-percent': '0.00', + 'unit': 'kB'}} + +SHOW_SWAP_STATUS_OK_OP = \ + {'message': "OK- 0.00% used(0kB out of 20971516kB)|" + "Used=0kB;10485758;16777212;0;20971516", 'exit_status': 0} + +SHOW_SWAP_STATUS_WARNING_IP = \ + {'date': '2014-03-10', + 'utc': '1', 'interval': '60', + 'time': '12:40:01', 'memory': + {'swpused-percent': '50.00', + 'swpused': '10485758', 'per': 'second', + 'swpcad': '0', 'swpfree': '10485758', + 'swpcad-percent': '0.00', + 'unit': 'kB'}} + +SHOW_SWAP_STATUS_WARNING_OP = \ + {'message': "WARNING- 50.00% used(10485758kB" + " out of 20971516kB)|Used=10485758kB;8388606;" + "12582909;0;20971516", 'exit_status': 1} + +SHOW_SWAP_STATUS_CRITICAL_IP = \ + {'date': '2014-03-10', + 'utc': '1', 'interval': '60', + 'time': '12:40:01', 'memory': + {'swpused-percent': '50.00', + 'swpused': '10485758', 'per': 'second', + 'swpcad': '0', 'swpfree': '10485758', + 'swpcad-percent': '0.00', + 'unit': 'kB'}} + +SHOW_SWAP_STATUS_CRITICAL_OP = \ + {'message': "CRITICAL- 50.00% used(10485758kB out" + " of 20971516kB)|Used=10485758kB;6291454;8388606" + ";0;20971516", 'exit_status': 2} + +SHOW_SWAP_STATUS_EXCEPTION_IP = \ + {'date': '2014-03-10', + 'utc': '1', 'interval': '60', + 'time': '12:40:01', 'memory': + {'swpused-percent': '50.00', + 'swpused': '10485758', 'per': 'second', + 'swpcad': '0', + 'swpcad-percent': '0.00', + 'unit': 'kB'}} + +SHOW_SWAP_STATUS_EXCEPTION_OP = \ + {'message': "key: 'swpfree' not found", + 'exit_status': 3} |