LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   apcupsd logging (https://www.linuxquestions.org/questions/linux-software-2/apcupsd-logging-418722/)

JSLayton 02-23-2006 09:08 AM

apcupsd logging
 
I'm using apcupsd to manage an APC SmartUPS 700. Is there a way that I can setup a log to where it will log when the power blinks, goes out, etc., but keep the log file small, to where it will only get so large before it starts trimming the beginning of the file back off?

Thanks in advance.

theNbomr 02-23-2006 10:32 AM

You can manage logfiles independently of the application using 'logrotate'. See the man page for details.

--- rod.

HappyTux 02-23-2006 10:39 AM

Quote:

Originally Posted by JSLayton
I'm using apcupsd to manage an APC SmartUPS 700. Is there a way that I can setup a log to where it will log when the power blinks, goes out, etc., but keep the log file small, to where it will only get so large before it starts trimming the beginning of the file back off?

Thanks in advance.

Don't know how they do it in Slackware but in Debian I get a mail to my user account each time it goes on UPS and when the power comes back also it automatically logs to /var/log/apcupsd.events which does not seem overly big you may want to check for similar options for your package.

Code:


>$ ls -l /var/log/apcupsd.events
-rw-r--r--  1 root root 8.4K 2006-02-23 12:09 /var/log/apcupsd.events


JSLayton 02-23-2006 11:15 AM

What about power spikes, brownouts, etc.??? Are these automatically logged in the apcupsd.events file as well??

HappyTux 02-23-2006 11:48 AM

Quote:

Originally Posted by JSLayton
What about power spikes, brownouts, etc.??? Are these automatically logged in the apcupsd.events file as well??

Looks like it does the brownouts if the 1 second outages in my log are any indication I don't see anything for spikes though.

Code:

>$ grep -i power /var/log/apcupsd.events
Thu Jan 05 02:57:37 AST 2006  Power failure.
Thu Jan 05 02:57:39 AST 2006  Power is back. UPS running on mains.
Wed Jan 18 01:39:49 AST 2006  Power failure.
Wed Jan 18 01:39:50 AST 2006  Power is back. UPS running on mains.
Wed Jan 18 20:05:05 AST 2006  Power failure.
Wed Jan 18 20:05:17 AST 2006  Power is back. UPS running on mains.
Wed Feb 01 06:13:28 AST 2006  Power failure.
Wed Feb 01 06:13:29 AST 2006  Power is back. UPS running on mains.
Fri Feb 10 09:54:18 AST 2006  Power failure.
Fri Feb 10 09:54:19 AST 2006  Power is back. UPS running on mains.
Wed Feb 15 07:49:34 AST 2006  Power failure.
Wed Feb 15 07:49:35 AST 2006  Power is back. UPS running on mains.
Sat Feb 18 05:54:03 AST 2006  Power failure.
Sat Feb 18 05:54:04 AST 2006  Power is back. UPS running on mains.
Tue Feb 21 05:25:24 AST 2006  Power failure.
Tue Feb 21 05:25:24 AST 2006  Power is back. UPS running on mains.
Wed Feb 22 17:28:20 AST 2006  Power failure.
Wed Feb 22 17:28:21 AST 2006  Power is back. UPS running on mains.


JSLayton 02-23-2006 12:06 PM

Excellent, that is all I needed to know. Thank you.


All times are GMT -5. The time now is 05:08 PM.