Package: apcupsd
Version: 3.12.4-2
Severity: normal

When diagnosing an unrelated (and now solved) logging issue with apcupsd
I had cause to look at the code and found that the syslog priorities in
action.c seem inconsistent.  Some more important (IMO) messages have
lower priorities than some routine messages with higher priorities.

action.c (lines 66 to 89):

   UPSCMDMSG event_msg[] = {
      {LOG_CRIT,    N_("Power failure.")},
      {LOG_CRIT,    N_("Running on UPS batteries.")},
      {LOG_ALERT,   N_("Battery power exhausted.")},
      {LOG_ALERT,   N_("Reached run time limit on batteries.")},
      {LOG_ALERT,   N_("Battery charge below low limit.")},
      {LOG_ALERT,   N_("Reached remaining time percentage limit on 
batteries.")},
      {LOG_ALERT,   N_("Failed to kill the power! Attempting a REBOOT!")},
      {LOG_ALERT,   N_("Initiating system shutdown!")},
      {LOG_ALERT,   N_("Power is back. UPS running on mains.")},
      {LOG_ALERT,   N_("Users requested to logoff.")},
      {LOG_ALERT,   N_("Battery failure. Emergency.")},
      {LOG_CRIT,    N_("UPS battery must be replaced.")},
      {LOG_CRIT,    N_("Remote shutdown requested")},
      {LOG_WARNING, N_("Communications with UPS lost.")},
      {LOG_WARNING, N_("Communications with UPS restored.")},
      {LOG_ALERT,   N_("UPS Self Test switch to battery.")},
      {LOG_ALERT,   N_("UPS Self Test completed.")},
      {LOG_CRIT,    N_("Master not responding.")},
      {LOG_WARNING, N_("Connect from master.")},
      {LOG_CRIT,    N_("Mains returned. No longer on UPS batteries.")},
      {LOG_CRIT,    N_("Battery disconnected.")},
      {LOG_CRIT,    N_("Battery reattached.")}
   };

First of all note that LOG_ALERT is more severe than LOG_CRIT.  It
therefore seems wrong that the UPS self test messages, for example, have
a higher priority (LOG_ALERT) than "Power failure", which is only
LOG_CRIT.  The former is part of the routine operation of a UPS, yet the
latter is a failure condition.

I'm not really in a position to suggest appropriate priorities here, but
it does look as if there is some inconsistency.

If I've missed the reasoning behind the given priorities, it would be
useful to know why; this will be educational :-)


-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.22-4-amd64
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

Versions of packages apcupsd depends on:
ii  libc6                  2.3.6.ds1-13etch7 GNU C Library: Shared libraries
ii  libncurses5            5.5-5             Shared libraries for terminal hand
ii  libsnmp9               5.2.3-7etch2      NET SNMP (Simple Network Managemen
ii  libssl0.9.8            0.9.8c-4etch3     SSL shared libraries
ii  libwrap0               7.6.dbs-13        Wietse Venema's TCP wrappers libra

apcupsd recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to