LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

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

Rep: Reputation: 30
Help with apcupsd


Hello,

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:

#!bin/sh
#
#Shutdown VMs

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

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

doshutdown)
echo "Shutdown VMs"
/etc/apcupsd/vmshutdown
echo "UPS ${2} INITATED sHUTDOWN sEQUENCE" | $WALL}
${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
skoona
Member
 
Registered: Mar 2004
Location: Indiana, USA
Distribution: Fedora, CentOS, Ubuntu, OS/X Lion
Posts: 80

Rep: Reputation: 16
APCUPSD.com 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.
 
  


Reply


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


All times are GMT -5. The time now is 07:38 AM.

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