script to poweroff when running on UPS


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script to poweroff when running on UPS
# 1  
Old 06-13-2008
script to poweroff when running on UPS

Hi all,

The place where i stay experiences lot of power cuts and my solaris box is almost always on.
It so happens that many times i will not be around to switch it off as soon as there is a power cut..(i also have UPS which provides alternative supply for 15min)
So i wanted to write a script that can actually sense a power cut ,or at least sense that the power is being supplied from UPS and then automatically switch off....

I would like to try and write a script myself ,but dont know where i should start looking for the changes in the parameters when there is a power cut?
So could you please let me know where i can get these informations from and how i can use it in a script to initiate a shutdown?
Just a brief overview is sufficient ,as i would like to try writing a script myself...
If i cannot i will revert back!!!!

Thanks
# 2  
Old 06-14-2008
if the ups is not connected (other than the power cord) with a serial line or via usb to your computer to give you the information that power is down... i also don't know where to start.
if there is a serial line (or usb) to your computer, you have to know how to read the needed information.
# 3  
Old 06-14-2008
# 4  
Old 06-15-2008
That is correct!!
I have the UPS connected only through a power chord.
Then links provided seem to be interesting...
Will revert back with some hopefully good news!!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

The green pop-ups...

Admins... I just lerve the pop-ups that appear whilst replying to someones post. It reminds me of "Paperclip" from my MS Windows days... ;oDD Love it, as it makes me smile, telling me I am creating a thread ATM... ;o) Neat little addition/feature guys... (4 Replies)
Discussion started by: wisecracker
4 Replies

2. Hardware

CyberPower UPS

Is anyone here using this brand, and if so, how satisfied are you with its 'PowerPanel for Linux' software? Any problems? (0 Replies)
Discussion started by: Varsel
0 Replies

3. UNIX for Dummies Questions & Answers

poweroff

I want 2 authorize all the users to use poweroff command. How can I do this ??:o (1 Reply)
Discussion started by: lipun4u
1 Replies

4. What is on Your Mind?

any goof ups like this?

This thread reminded me of a couple of screwups made by an operator in my old job. The ops used to run OS backups through a script which asked for the path to the tape (/dev/rmt/whatnot). We (the sysadmins) would give these to the ops if a new server was added or the h/w path changed. One Sunday... (4 Replies)
Discussion started by: blowtorch
4 Replies

5. Linux

Restricing normal user from poweroff

HI, How can I restrict normal user from doing 'poweroff' ? Regards JAGDISH (1 Reply)
Discussion started by: jagdish.machhi@
1 Replies

6. Solaris

UPS Installation

Dear All, I have installed package ups reillo in solaris but i could not use setup normaly, i could not connection with ttya , i need connect with ups for set system shutdown and another configuration. please i need help for solution thanks. (0 Replies)
Discussion started by: athurbayunata
0 Replies

7. UNIX for Dummies Questions & Answers

sudden poweroff ??

Hi I am using unix for last few days. Here is my problem during boot the machine stop giving video signal and I don't know what's happening. When I ping (during boot) it from another machine it comes alive then goes out. The power on the CPU is on all the time. please help. (9 Replies)
Discussion started by: santosh1981
9 Replies

8. UNIX for Advanced & Expert Users

Automatic PowerOff!!

Hi Guys, I faced a problem in one of our workstations, from five days ago when i come to office i see that this system has been powred off & when i start it up again it goes trough the "System Setup Restoring " & seems that automatic power off is active . For disabling this i went to... (2 Replies)
Discussion started by: nikk
2 Replies

9. UNIX for Advanced & Expert Users

UPS for HP-9000

Hello Everyone I run 4 HP 9000 servers with HP-UX 11.0 on all 4, with an Infomix Database. About 6 months ago one system starting acting real weird it will display the message that it lost power (which did not) and it would shutdown, Then roughly 30 seconds later it would then say power has... (4 Replies)
Discussion started by: JackieRyan26
4 Replies

10. UNIX for Dummies Questions & Answers

Newbie UPS help

I am a newbie and I just got a Sun Ultra 5, and want an UPS. I have been looking at the different models, but I do not know which brand has software that is compatable with Solaris 2.8 for automatic shutdown. I have looked at the power setup options in Solaris, but there doesn't seem to be any... (1 Reply)
Discussion started by: jeremiebarber
1 Replies
Login or Register to Ask a Question