; ; Configuration file for "upseyecl.pl" (PERL UpsEye Client) ; you can change it to suit your needs. ; After changing the configuration, you can start "upseyecl.pl" by hand with ; the following command: ; ; perl upseyecl.pl ; ; the PERL script will be loaded as a daemon (a program running without any user input/output) ; and you will return to the command prompt. ; ; If you want to check the correct working of the upseyecl.pl daemon, you can run upscheck.pl: ; ; perl upscheck.pl ; ; you will get a screen showing some of the ups parameters like: ; ; #------------------------------------------------------------------------# ; # Connected to 192.168.1.111, Press Ctrl-C to exit program ; #------------------------------------------------------------------------# ; UPS model: ENT20 , 00002161 ; ; UPS Status: UPS on Line ; ; Measures ; ; 13 Vin:223.6 Vout:225.7 Vbat:55.5 Temp:33.7 Load: 525VA LoadP: 35% ; ; ; ---------------------- ; ; if you want to see the valid parameters of "upseyecl.pl" (print an help message), ; you can show them using the following command: ; ; perl upseyecl.pl -h ; ; if, after running by hand (parameter '-i'), you want to stop "upseyecl.pl", ; you must generate a 'break' signal: IN GENERAL you have to press: ; ; Ctrl-C ; ; since "upseyecl.pl" will work on almost every systems running PERL, please refer ; to your system documentation on how to interrupt the execution of a program. ; ;===== automatic start of the script "upseyecl.pl" ===== ; ; since "upseyecl.pl" was made to run on almost any system running PERL, please ; refer to your system documentation on how to load "upseyecl.pl" at system startup ; ; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ; ============================================================================== ; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ; ; ; Example of an enterprise.ini file ; Requirements: ; 1. The connection must be done on a UPS TCP/IP module at address 192.168.1.111 ; 2. If this computer is sending the shutdown command to the UPS, we must be in "MASTER" mode, ; otherwise we are working in "SLAVE" (Master=0) mode ; - in "MASTER" the 'TcpIpPort' must be 18881 ; - in "SLAVE" the 'TcpIpPort' must be 18882 ; 3. After 5 minutes (300 sec) the shutdown is started, AND the UPS is in battery mode, the UPS will be shut off ; 4. when upseyecl.pl starts the shutdown procedure [E_SYSSD], will wait for 10 seconds and will run the command '/sbin/shutdown -h now' ; 5. if the UPS goes in Battery LOW [E_BLOW], shutdown IMMEDIATELY. ; 6. when the UPS is battery mode [E_BAT]: ; a. after 50 seconds run the script file /usr/scripts/WarnUsers ; b. if on battery for more than 4 minutes (240 sec), shut down the system ; ; [UpsParams] ; --------------------------------------------------------------------- ; ; UpsEye server IP address: set it correspondely to your UpsEye server. ; ; the address can be even non-numeric (e.g.: ups.myserver.com) ; TcpIpAddress=192.168.1.111 ; --------------------------------------------------------------------- ; If you want to send a shutdown command to the UPS, this program must be set in MASTER=1 mode. ; Please remember that there will be ONLY one MASTER which is able to send commands to the UPS: ; other clients must be set in MASTER=0 mode. ; Master=1 ; --------------------------------------------------------------------- ; TcpIpPort can be set to 18881 or 18882 ; If your client is set to MASTER=1 set 'TcpIpPort=18881' ; otherwise (MASTER=0) set 'TcpIpPort=18882' ; TcpIpPort=18881 ; --------------------------------------------------------------------- ; ; ; [Schedule] ; ... - other parameters not shown... ; SDDelay=300 - After starting the system shutdown (ShutdownCmd), the UPS will SHUT OFF in 300 seconds (ONLY if the UPS is in battery mode) ;; ; [E_BAT] - UPS in battery mode ; ... - other parameters not shown... ; CmdFile=/usr/scripts/WarnUsers ; CmdFileDelay=50 ; ShutdownDelay=240 ; ; ; [E_BLOW] - UPS in Battery LOW ; ... - other parameters not shown... ; ShutdownDelay=1 - Immediate shutdown (after 1 second) ; ; ; [E_SYSSD] - System Shutdown ; ... - other parameters not shown... ; ShutdownDelay=10 ; ShutdownCmd=/sbin/shutdown -h now ; ; --------------------------------------------------------------------- ; ########### End of example - configuration file follows ############ ; --------------------------------------------------------------------- [UpsMDW] EventLog=EVENTLOG.DAT DataLog=DATALOG.DAT IndexEL=1 HeadEL=0 NVisEL=40 IndexDL=1 HeadDL=0 ELMaxSize=1000 DLMaxSize=50000 DelayReg=4 TempScale=C MsgFile=/tmp/UpseyeMsg MsgCmd=wall [UpsParams] ; --------------------------------------------------------------------- ; UpsEye server IP address: set it correspondely to your UpsEye server. ; the address can be even non-numeric (e.g.: ups.myserver.com) TcpIpAddress=192.168.0.3 ; ; --------------------------------------------------------------------- ; If you want to send a shutdown command to the UPS, this program must be set in MASTER=1 mode. ; Please remember that there will be ONLY one MASTER which is able to send commands to the UPS: ; other clients must be set in MASTER=0 mode. Master=0 ; ; --------------------------------------------------------------------- ; TcpIpPort can be set to 18881 or 18882 ; If your client is set to MASTER=1 set 'TcpIpPort=18881' ; otherwise (MASTER=0) set 'TcpIpPort=18882' TcpIpPort=18881 ; ; --------------------------------------------------------------------- ; Language=I UpsType=3 TcpTimeout=10 RetryTimeout=10 [Schedule] ; each schedule structure stores the following informations: ; ,,,,,,, Schedule0=0,0,0,0,0,0,0,1 Schedule1=0,0,0,0,0,0,0,1 Schedule2=0,0,0,0,0,0,0,1 Schedule3=0,0,0,0,0,0,0,1 Schedule4=0,0,0,0,0,0,0,1 Schedule5=0,0,0,0,0,0,0,1 SDDelay=180 #---------------------------------------------------------------------------------------------- # The upseye program handles 16 types of main events; each event can be associated to an action # of the system (e.g. the system shutdowm). # Follows down a short descriprion of each event: # - upseye started (E_START): it is activated once the program starts # - upseye stopped (E_STOP): it is activated once the program is finished # - unable to communicate with the UPS (E_NOC) # - UPS communication started (E_COMSTART) # - UPS communication lost (E_COMLOST) # - UPS on battery (E_BAT): it is activated when the UPS switches to battery mode # - UPS low battery condition (E_BLOW) # - UPS mains power restored (E_POWON): the mains is on after a battery mode functioning # - UPS output overload (E_OVERLOAD) # - UPS internal temperature limit exceeded (E_HTEMP) # - UPS self test failed (E_TESTKO) # - UPS generic fault (E_FAULT) # - Ten minutes to scheduled shutdown (E_10TOSD) # - One minute to scheduled shutdown (E_1TOSD) # - System shutdown not scheduled (E_SYSSD): this event is activated when the system # must be turned off due to limit UPS functioning conditions (e.g. overload and/or # battery low, ...) # - System scheduled shutdown started (E_SCHESD) #---------------------------------------------------------------------------------------------- # The actions and the settings of the events are defined in the corresponding section. # Each event can be associated to 5 types of actions: # - system logging: the event is stored in the system log # - network message: a message descripting the event is forwarded to all the clients # - command file execute: executes an external command file # - e-mail message: (not currently available) # - system shutdown # Follows a short descriptiìon of one section: # [E_BAT] ; event section name # EventID=5 ; event id (reserved don't change) # Enabled=1 ; 1: the event is enebled, 0: the event is not handled by the program) # Settings=11111 ; this is a bit field value; reading from left to right indicates if # ; an event action is enabled (value=1) or disabled (value=0) # ; (field values 2 or 3 are reserved, don't change) # ; 1 1 1 1 1 # ; | | | | system shutdown # ; | | | e-mail message # ; | | command file execute # ; | network messages # ; system logging # MsgDelay=5 ; the event message is forwarded after MsgDelay seconds # MsgRepeat=1 ; if MsgRepeat=1, the event message is forwarded every # MsgInterval=10 ; MsgInterval seconds. # MsgUsers= ; (not currently used) # CmdFile= ; the command file CmdFile will be executed after CmdFileDelay the # CmdFileDelay=30 ; event is fired. # EmailDelay=40 ; (not currently used) # EmailUsers= ; (not currently used) # EmailMsg= ; (not currently used) # ShutdownDelay=120 ; defines the amount of time (in seconds) aftew which the system will be turned off # ShutdownCmd= ; defines the command file to execute before the system shutdown # BlockingMode=0 ; indicates if the command file of the event will be executed in # ; blocking mode (value = 1) #---------------------------------------------------------------------------------------------- [E_START] EventID=0 Enabled=1 Settings=10002 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=20 EmailUsers= EmailMsg= ShutdownDelay=0 BlockingMode=0 [E_STOP] EventID=1 Enabled=1 Settings=12222 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=20 EmailMsg= EmailUsers= ShutdownDelay=0 BlockingMode=0 [E_NOC] EventID=2 Enabled=1 Settings=11000 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= CmdBlocking= EmailDelay=20 EmailUsers= EmailMsg= ShutdownDelay=120 BlockingMode=0 [E_COMSTART] EventID=3 Enabled=1 Settings=10002 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=20 EmailUsers= EmailMsg= ShutdownDelay=0 BlockingMode=0 [E_COMLOST] EventID=4 Enabled=1 Settings=11000 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=20 EmailUsers= EmailMsg= ShutdownDelay=120 BlockingMode=0 [E_BAT] EventID=5 Enabled=1 Settings=11001 MsgRepeat=1 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=20 CmdFile= EmailDelay=40 EmailUsers= EmailMsg= ShutdownDelay=120 BlockingMode=0 [E_BLOW] EventID=6 Enabled=1 Settings=11003 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=20 EmailUsers= EmailMsg= ShutdownDelay=30 BlockingMode=0 [E_POWON] EventID=7 Enabled=1 Settings=11002 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=20 EmailUsers= EmailMsg= ShutdownDelay=0 BlockingMode=0 [E_OVERLOAD] EventID=8 Enabled=1 Settings=11003 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=10 EmailUsers= EmailMsg= ShutdownDelay=10 BlockingMode=0 [E_HTEMP] EventID=9 Enabled=1 Settings=11003 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= CmdBlocking= EmailDelay=10 EmailUsers= EmailMsg= ShutdownDelay=10 BlockingMode=0 [E_TESTKO] EventID=10 Enabled=1 Settings=11003 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=10 EmailUsers= EmailMsg= ShutdownDelay=10 BlockingMode=0 [E_FAULT] EventID=11 Enabled=1 Settings=11003 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=10 EmailUsers= EmailMsg= ShutdownDelay=10 BlockingMode=0 [E_10TOSD] EventID=12 Enabled=1 Settings=11002 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=20 EmailUsers= EmailMsg= ShutdownDelay=0 BlockingMode=0 [E_1TOSD] EventID=13 Enabled=1 Settings=11002 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=20 EmailUsers= EmailMsg= ShutdownDelay=0 BlockingMode=0 [E_SYSSD] EventID=14 Enabled=1 Settings=11003 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=20 EmailUsers= EmailMsg= ShutdownDelay=15 ShutdownCmd=/sbin/shutdown -h now BlockingMode=0 [E_SCHESD] EventID=15 Enabled=1 Settings=11003 MsgRepeat=0 MsgDelay=5 MsgInterval=30 MsgUsers= CmdFileDelay=5 CmdFile= EmailDelay=20 EmailUsers= EmailMsg= ShutdownDelay=60 ShutdownCmd=/sbin/shutdown -h now BlockingMode=0 [Email] SMTPHost= ServerEmail= UserList= ShowEmailer=0