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
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
2. UNIX for Advanced & Expert Users
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
3. UNIX for Advanced & Expert Users
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
4. UNIX for Dummies Questions & Answers
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
5. Solaris
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
6. Linux
HI,
How can I restrict normal user from doing 'poweroff' ?
Regards
JAGDISH (1 Reply)
Discussion started by: jagdish.machhi@
1 Replies
7. What is on Your Mind?
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
8. UNIX for Dummies Questions & Answers
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
9. Hardware
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
10. What is on Your Mind?
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
LEARN ABOUT OPENSOLARIS
safenet
SAFENET(8) NUT Manual SAFENET(8)
NAME
safenet - Driver for SafeNet compatible UPS equipment
NOTE
This man page only documents the hardware-specific features of the safenet driver. For information about the core driver, see nutupsdrv(8).
SUPPORTED HARDWARE
This driver supports UPS equipment which can be controlled via SafeNet v1.0 for Windows (serial interface only).
EXTRA ARGUMENTS
This driver supports the following optional settings in the ups.conf(5) file:
manufacturer=value
Autodetection of this parameter is not possible yet (and it probably never will be). Therefore, this user-defined string accepts any
name. The default is unknown.
modelname=value
Like manufacturer above. The default is unknown.
serialnumber=value
Like manufacturer above. The default is unknown.
ondelay=value
Time to wait before switching on the UPS (minutes). Defaults to 1 minute.
offdelay=value
Time to wait before shutting down the UPS (seconds). Defaults to 30 seconds.
UPSCMD
This driver supports some instant commands (see upscmd(8)):
test.battery.start
Start UPS self test
test.battery.stop
Cancel UPS self test
test.failure.start
Start simulated power failure
test.failure.stop
Cancel simulated power failure
beeper.enable
Enable the UPS beeper
beeper.mute
Temporarily mute the UPS beeper
beeper.toggle
Toggle the UPS beeper
shutdown.return
Turn off the load and wait for the power to return. Uses the timer defined by offdelay.
shutdown.reboot
Turn off the load and return. Uses the timers defined by offdelay and ondelay.
KNOWN PROBLEMS
If you run the shutdown.return command with mains present, the output may stay on or switch off and not back on again. The shutdown.reboot
command will unconditionally switch on the load again (with or without mains present).
If the driver is called with the -k option (or through upsdrvctl shutdown) it tries to detect which command should be used in an attempt to
stay off until mains is present again or to cycle the output if the power returned in the mean time. This isn't bullet-proof, and you
should be prepared that the power will either not be shutdown, or that it doesn't return when the power comes back.
AUTHOR
Arjen de Korte <adkorte-guest at alioth.debian.org>
SEE ALSO
The core driver:
nutupsdrv(8)
Internet resources:
The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
Network UPS Tools 05/21/2012 SAFENET(8)