Home
# I connected Sound House UPS1200LX to Centos6.4 server.
  "Network UPS Tools" (NUT) was not able to set up lowbattery.
  UPS has stopped before a server's shutdown.
  Therefore, I created the script.
  The script is the same function as "UPSilon 2000 for Windows."

# The script is not creating in a setup in the case of a stand-alone.
  It is a setup which uses only the function of "Network UPS Tools" (NUT).
  The demon of "Network UPS Tools" (NUT) detects lowbattery of UPS.
  A demon notifies to uspmon. Shut.
  However, in my UPS1200LX, a shutdown is impossible.

# In a setup in the case of a master, I have prepared the script which performs the following shutdowns.
  If the master side becomes below a predetermined charge rate, it will notify a "shutdown" to the slave side..
  The shut [ the master side ] by receiving the notice of "a shutdown start" from the slave side.
  If a part of script by the side of a master is changed, it will operate also as a stand-alone.

# In a setup in the case of a slave, I have prepared the script which performs the following shutdowns.
  The slave side receives the notice of a "shutdown" from the master side.
  The slave side notifies "a shutdown start" to the master side. Shut.

# The slave side cannot perform an independent shutdown.
  Shut [ with the shutdown indication from the master side ].
  (I have restricted the independent shutdown function about the slave side of the
  "Network UPS Tools" (NUT) main part)


# Detailed explanation of a script

  M1,S1.The master side "upsmon" and slave side "upsmon" is monitoring the master side "upsd."
           At the time of event occurrence of UPS, "upsmon" by the side of a master starts the script
           "upscheck", and the slave side "upsmon" starts the script "upsslave."

  M2."upscheck" is supervising the charge rate of UPS, when UPS changes to the power supply from a battery.
       When a charge rate is less than the beforehand fixed charge rate (STDWCHARGE=), "upscheck" notifies
       "a shutdown of less than the beforehand fixed charge rate" to the slave side, and starts a shutdown
.      "upscheck" supervises the following thing until a charge rate turns into less than the beforehand fixed
       charge rate (STDWCHARGE=).
       "upscheck" supervises whether UPS changed to the power supply from AC line.
       When it changes to the power supply from AC line, "upscheck" notifies the slave side "I changed to the
       power supply from AC line", and ends processing.

  M3."upscheck" starts shutdown processing, also when LOWBATT, FSD, SHUTDOWN, and the notice of
       NOPARENT are received from "upsd."
       "upscheck" does not carry out shutdown processing, when the notice of REPLBATT is received.
       "upscheck" ends processing, when other notices are received.
       (Please check a log periodically)

  S2.When UPS changes to the power supply from a battery, "upsslave" performs the following thing until
       it receives the notice of "a shutdown of less than the beforehand fixed charge rate."
       "upsslave" supervises the notice "which changed to the power supply from AC line", and when the notice
       is received, it ends processing.
       "upsslave" starts shutdown processing, when the notice of "a shutdown of less than the beforehand
       fixed charge rate" is received.

  S3."upsslave" starts shutdown processing, also when LOWBATT, FSD, SHUTDOWN, and the notice of
      NOPARENT are received from "upsd."
      "upsslave" does not carry out shutdown processing, when the notice of REPLBATT is received.
      "upsslave" ends processing, when other notices are received.
      (Please check a log periodically)

  M4."upscheck" notifies "a shutdown start" to the slave side after starting shutdown processing, and supervises
       the notice of "the slave side shutdown start" from the slave side.
       Shut when the notice of "the slave side shutdown start" is received.

  S4."upsslave" supervises the notice of "a shutdown start" from the master side after starting shutdown
       processing.
       The shut by notifying "the slave side shutdown start" to the master side after receiving the notice of
      "a shutdown start."

  ## Since the event of "upsmon" occurs at random, the script of a master slave can operate by multitasking.
      Since "upscheck" and "upsslave" are using the shell variable (internal variable), even when the event of
      "upsmon" occurs at random, they do not have influence of the script on other processes.
      Since "upscheck" and "upsslave" are not operating various notices in the outside processing for a shutdown,
      even when the event of "upsmon" occurs at random, they do not have influence of the script on other
      processes.
      In "upscheck" and "upsslave", one process precedes momentarily and it processes.
      In "upscheck" and "upsslave", when the event of "upsmon" occurs at random in the case of processing
      for a shutdown, the script of a following process is kill(ed).

  ## From the slave side, "upsslave" is the SCP command which uses-less [ password ], a secret key, and
       a public key, and accesses the master side user's specific directory.
      "upsslave" performs the check of a flag (various notices), and a setup by operating the file in the
      master side user's specific directory.
      The master side user is needed one to one slave.
      Refer to other HP(s) for the details of the scp command.

# The script of the master slave is equipped with the recording function of data for the surveillance of debugging
   and UPS.

# If you use UPS of the same specification, you can use this script as it is.

# Although it found out whether I could divert by debian GNU/linux 7.2.0, -D option of upsmon was not able to
   function and I was not able to start the script of the setup to NOTIFYCMD.
   Therefore, in debian GNU/linux 7.2.0, I cannot use it.

# Various configuration files, a script, etc. at the time of installing "Network UPS Tools" (NUT) in yum are below
   in the clause of "being installation to Centos6.4 about Network UPS Tools (NUT)."

# You may use and change a setup and script of a configuration file freely.
   Even if a problem occurs in that case, please understand that I cannot have any responsibility.

# The change of various configuration files should read carefully the "Network UPS Tools" (NUT) manual first.
  (You will do considerable difficulties understanding, in order that there may be no explanation which the contents
   of processing systematize, although someone was said ^^;)

  I am sorry for poor translation. (^_^;)
install Network UPS Tools (NUT) in Centos 6.4.
network ups tools