<%! from baruwa.lib.filters import totals %>

${_("Todays stats")}

  ${_("Processed")} ${c.status['total']|totals}
${_("Clean")} ${c.status['clean_mail']|totals}
${_("High scoring spam")} ${c.status['high_spam']|totals}
${_("Low scoring spam")} ${c.status['spam_mail']|totals}
${_("Virus infected")} ${c.status['virii']|totals}
${_("Policy blocked")} ${c.status['otherinfected']|totals}
  ${_("Inbound queues")} ${h.link_to(c.status['inq'], url('server-status-mq-in', serverid=c.server.id))}
  ${_("Outbound queues")} ${h.link_to(c.status['outq'], url('server-status-mq-out', serverid=c.server.id))}

${_("Hardware status")}

% if not c.status['cpu'] is None:
${_('CPU')}
${"%d%%" % c.status['cpu']}
% else:
${_('Error reading CPU status')}
% endif
% if c.status['mem']['total']:
${_('Memory')}
${"%d%%" % c.status['mem']['percent']}
${_('Total: %s') % h.format_byte_size(c.status['mem']['total'])}
${_('Used: %s') % h.format_byte_size(c.status['mem']['used'])}
${_('Free: %s') % h.format_byte_size(c.status['mem']['free'])}
% else:
${_('Error reading memory status.')}
% endif

${_('Hard disks')}

% for disk in c.status['partitions']:
${disk['device']}
${disk['mountpoint']}
${"%d%%" % disk['percent']}
${_('Total: %s') % h.format_byte_size(disk['total'])}
${_('Used: %s') % h.format_byte_size(disk['used'])}
${_('Free: %s') % h.format_byte_size(disk['free'])}
% endfor % if not c.status['partitions']:
${_('Error reading disk information')}
% endif

${_('Network')}

% if c.status['net']:
${_('Nic')}
${_('Sent')}
${_('Received')}
% endif % for card in c.status['net']: % if c.status['net'][card]['bytes_sent'] and c.status['net'][card]['bytes_recv']:
${card}
${h.format_byte_size(c.status['net'][card]['bytes_sent'])}
${h.format_byte_size(c.status['net'][card]['bytes_recv'])}
% endif % endfor % if not c.status['net']:
${_('Error reading network interface information')}
% endif

${_('Mail Graph')}

% if c.status['total']:
graph
% else:
${_('Not enough data available to generate graph.')}
% endif

${_("System Status")}

${_('Scanners')} ${h.portable_img('imgs/status_ok.png', alt='x') if c.status['scanners'] else h.portable_img('imgs/caution.png', alt='x')}  ${ungettext('%(s)d process', '%(s)d processes', c.status['scanners']) % dict(s=c.status['scanners'])}
${_('MTA')} ${h.portable_img('imgs/status_ok.png', alt='x') if c.status['mta'] else h.portable_img('imgs/caution.png', alt='x')}  ${ungettext('%(mta)d process', '%(mta)d processes', c.status['mta']) % dict(mta=c.status['mta'])}
${_('Anti-Virus')} ${h.portable_img('imgs/status_ok.png', alt='x') if c.status['av'] else h.portable_img('imgs/caution.png', alt='x')}  ${ungettext('%(a)d process', '%(a)d processes', c.status['av']) % dict(a=c.status['av'])}
${_('CPU Load (1 / 5 / 15 mins)')} ${h.portable_img('imgs/status_ok.png', alt='x') if c.status['load'][0] <= 15 else h.portable_img('imgs/caution.png', alt='x')}  ${"%.2f / %.2f / %.2f" % c.status['load'] }
${_('System Uptime')} ${c.status['uptime']}
${_('System Time')} ${c.status['time']}
<%def name="title()">\ ${_('Status :: Node status :: %(server)s') % dict(server=c.server.hostname)} <%def name="heading()">\ ${_('Status :: Node status :: %(server)s') % dict(server=c.server.hostname)} <%def name="headers()">\ <%def name="localscripts()">\ <%inherit file="/base.html"/>