]>
git.ipfire.org Git - collecty.git/blob - src/collecty/plugins/loadavg.py
8ac398ad9bcdd0e3900412d1a8f71b079c753a77
2 ###############################################################################
4 # collecty - A system statistics collection daemon for IPFire #
5 # Copyright (C) 2012 IPFire development team #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
28 class GraphTemplateLoadAvg(base
.GraphTemplate
):
33 _
= self
.locale
.translate
36 "AREA:load1#ff0000:%s" % _("Load average 1m"),
37 "GPRINT:load1_max:%12s\:" % _("Maximum") + " %6.2lf",
38 "GPRINT:load1_min:%12s\:" % _("Minimum") + " %6.2lf",
39 "GPRINT:load1_avg:%12s\:" % _("Average") + " %6.2lf\\n",
41 "AREA:load5#ff9900:%s" % _("Load average 5m"),
42 "GPRINT:load5_max:%12s\:" % _("Maximum") + " %6.2lf",
43 "GPRINT:load5_min:%12s\:" % _("Minimum") + " %6.2lf",
44 "GPRINT:load5_avg:%12s\:" % _("Average") + " %6.2lf\\n",
46 "AREA:load15#ffff00:%s" % _("Load average 15m"),
47 "GPRINT:load15_max:%12s\:" % _("Maximum") + " %6.2lf",
48 "GPRINT:load15_min:%12s\:" % _("Minimum") + " %6.2lf",
49 "GPRINT:load15_avg:%12s\:" % _("Average") + " %6.2lf\\n",
58 def graph_title(self
):
59 _
= self
.locale
.translate
60 return _("Load average")
63 def graph_vertical_label(self
):
64 _
= self
.locale
.translate
68 class LoadAvgObject(base
.Object
):
72 "DS:load15:GAUGE:0:U",
80 return os
.getloadavg()
83 class LoadAvgPlugin(base
.Plugin
):
85 description
= "Load Average Plugin"
87 templates
= [GraphTemplateLoadAvg
]
91 return [LoadAvgObject(self
)]