Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


  Search this Thread
Old 07-31-2008, 04:50 PM   #1
Registered: Mar 2006
Posts: 177

Rep: Reputation: 30
Help with apcupsd


This question isn't directly related to Red hat per say since it is a ESX 3.5 system i'm working on but it uses a light weight red hat enterprise 3 kernal so I hope someone here could help me.

I have a APC Smart UPS 750 hooked up to my server and I am trying to get apcupsd to work. I have it shutting down the host server (ESX 3.5 server) just fine however I need to shut down the Vm's running on the machine first. I have written the following script to shut down the VM's and tested it with success, however apcupsds's apccontrol script will not launch my script or any other commands i enter under the doshutdown) function. Here is the code of the script and the doshutdown) function in apcupsd

Shutdown VM script:

#Shutdown VMs

for vm in `vmware-cmd -l`
echo "Shutting down: " $vm
vmware-cmd "$vm" stop trysoft

I then added this script to the apccontrol script like this:

echo "Shutdown VMs"
${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown

Now here is where it gets wierd. the doshutdown function totaly ignores my first 2 commands the echo and the script to shut down my vms and runs the last 2 commands. To make sure the function is triggering properly i commented out the shutdown command and it would shoot out the echo and then not shut down. So the function is triggering but just choosing to ignore my first few lines of code for some reason. I can't seem to make any sence of this. Any help would be greatly appricated.
Old 07-31-2008, 11:13 PM   #2
Registered: Mar 2004
Location: Indiana, USA
Distribution: Fedora, CentOS, Ubuntu, OS/X, Raspbian
Posts: 90

Rep: Reputation: 18 has a mailing list and the guys there should be most helpful. As for your approach; have you considered using the NIS feature of apcupsd. Basically, its an client/server implementation where you configure the copy of apcupsd that is physically connected to the UPS as normal - but with its NIS server enabled (NIS is a apcupsd feature for broadcasting the true use state of other network based servers). Then install a copy of APCUPSD on every server, using the network as the ups_type, and pointing their device statements to the main copy's ip address. Logically all the client copies treat the main copy as if its the ups, and the main copy passes through significant events; so it makes since for the client copies to shutdown faster than the main. I.E. if the main copy will shutdown when the 3 minute battery left point is reached, then the client should shutdown at the 4 minute point, or at least 60 second sooner.

Last edited by skoona; 07-31-2008 at 11:14 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
apcupsd - apctest eyt Linux - Hardware 10 03-09-2006 02:16 PM
apcupsd logging JSLayton Linux - Software 5 02-23-2006 01:06 PM
apcupsd problem JSLayton Linux - Software 1 01-24-2006 11:38 AM
Trying to install apcupsd. Carpinus Linux - Software 5 08-10-2005 09:19 PM
gui for apcupsd tatwell Linux - Software 2 07-14-2003 03:23 PM > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 08:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration