Ajout de nut
darcs-hash:20080323014514-fbba6-1ae38898a532a99f58e3284b86a2f7db1a0a9418.gz
This commit is contained in:
parent
e6b3d43696
commit
f4601387e1
15 changed files with 228 additions and 0 deletions
10
Cfg/etc/default/nut/nut
Normal file
10
Cfg/etc/default/nut/nut
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Fichier gere par Bcfg2 (plugin Cfg)
|
||||
#
|
||||
# A ne modifier que sur vert
|
||||
#
|
||||
|
||||
# start upsd
|
||||
START_UPSD=no
|
||||
|
||||
# start upsmon
|
||||
START_UPSMON=yes
|
9
Cfg/etc/default/nut/nut.G50_ups-server
Normal file
9
Cfg/etc/default/nut/nut.G50_ups-server
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Fichier gere par Bcfg2 (plugin Cfg)
|
||||
#
|
||||
# A ne modifier que sur vert
|
||||
|
||||
# start upsd
|
||||
START_UPSD=yes
|
||||
|
||||
# start upsmon
|
||||
START_UPSMON=yes
|
3
Cfg/etc/nut/mail.sh/info.xml
Normal file
3
Cfg/etc/nut/mail.sh/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
|||
<FileInfo>
|
||||
<Info owner='root' group='nut' perms='0644' encoding='unicode'/>
|
||||
</FileInfo>
|
7
Cfg/etc/nut/mail.sh/mail.sh
Executable file
7
Cfg/etc/nut/mail.sh/mail.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#! /bin/sh
|
||||
# Fichier gere par Bcfg2 (plugin Cfg)
|
||||
#
|
||||
# A ne modifier que sur vert
|
||||
|
||||
echo -e "To: roots@crans.org\nSubject: [Onduleur] $NOTIFYTYPE\n\n$*" | sendmail -F"Vert" roots@crans.org
|
||||
|
3
Cfg/etc/nut/ups.conf/info.xml
Normal file
3
Cfg/etc/nut/ups.conf/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
|||
<FileInfo>
|
||||
<Info owner='root' group='nut' perms='0640' encoding='unicode'/>
|
||||
</FileInfo>
|
4
Cfg/etc/nut/ups.conf/ups.conf
Normal file
4
Cfg/etc/nut/ups.conf/ups.conf
Normal file
|
@ -0,0 +1,4 @@
|
|||
[pulsar]
|
||||
driver = mge-shut
|
||||
port = /dev/ttyS1
|
||||
lowbatt = 10
|
3
Cfg/etc/nut/upsd.conf/info.xml
Normal file
3
Cfg/etc/nut/upsd.conf/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
|||
<FileInfo>
|
||||
<Info owner='root' group='nut' perms='0640' encoding='unicode'/>
|
||||
</FileInfo>
|
14
Cfg/etc/nut/upsd.conf/upsd.conf
Normal file
14
Cfg/etc/nut/upsd.conf/upsd.conf
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Fichier gere par Bcfg2 (plugin Cfg)
|
||||
#
|
||||
# A ne modifier que sur vert
|
||||
|
||||
|
||||
# Acces depuis localhost et le vlan adm uniquement
|
||||
|
||||
ACL all 0.0.0.0/0
|
||||
ACL localhost 127.0.0.1/32
|
||||
ACL adm 10.231.136.0/24
|
||||
|
||||
ACCEPT localhost
|
||||
ACCEPT adm
|
||||
REJECT all
|
3
Cfg/etc/nut/upsd.users/info.xml
Normal file
3
Cfg/etc/nut/upsd.users/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
|||
<FileInfo>
|
||||
<Info owner='root' group='nut' perms='0640' encoding='unicode'/>
|
||||
</FileInfo>
|
23
Cfg/etc/nut/upsd.users/upsd.users
Normal file
23
Cfg/etc/nut/upsd.users/upsd.users
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Fichier gere par Bcfg2 (plugin Cfg)
|
||||
#
|
||||
# A ne modifier que sur vert
|
||||
#
|
||||
|
||||
# Adminitrateur pour l'onduleur
|
||||
[admin]
|
||||
password = Pdc6E8gY28Vh
|
||||
allowfrom = localhost
|
||||
actions = SET
|
||||
instcmds = ALL
|
||||
|
||||
# Utilisateur pour upsmon
|
||||
[upsmon_master]
|
||||
password = iQ9C4jdaqmfp
|
||||
allowfrom = localhost
|
||||
upsmon master
|
||||
|
||||
# Utilisateur pour upsmon
|
||||
[updmon_slave]
|
||||
password = iQ9C4jdaqmfp
|
||||
allowfrom = adm
|
||||
upsmon slave
|
3
Cfg/etc/nut/upsmon.conf/info.xml
Normal file
3
Cfg/etc/nut/upsmon.conf/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
|||
<FileInfo>
|
||||
<Info owner='root' group='nut' perms='0640' encoding='unicode'/>
|
||||
</FileInfo>
|
59
Cfg/etc/nut/upsmon.conf/upsmon.conf
Normal file
59
Cfg/etc/nut/upsmon.conf/upsmon.conf
Normal file
|
@ -0,0 +1,59 @@
|
|||
# Fichier gere par Bcfg2 (plugin Cfg)
|
||||
#
|
||||
# A ne modifier que sur vert
|
||||
#
|
||||
|
||||
# C'est vert qui monitore l'onduleur, il y a un seul onduleur
|
||||
MONITOR pulsar@vert.adm.crans.org 1 upsmon_slave iQ9C4jdaqmfp slave
|
||||
|
||||
# Commande d'arret
|
||||
SHUTDOWNCMD "/sbin/shutdown -h +0"
|
||||
|
||||
# Avec ce truc on devrai pouvoir s'envoyer des mails en cas de coupue
|
||||
# voir pager.txt dans la doc
|
||||
# Seul le maitre envoie un mail de notification
|
||||
# NOTIFYCMD /etc/nut/mail.sh
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# NOTIFYMSG - change messages sent by upsmon when certain events occur
|
||||
#
|
||||
# You can change the stock messages to something else if you like.
|
||||
#
|
||||
# NOTIFYMSG <notify type> "message"
|
||||
#
|
||||
# NOTIFYMSG ONLINE "UPS %s is getting line power"
|
||||
# NOTIFYMSG ONBATT "Someone pulled the plug on %s"
|
||||
#
|
||||
# Note that %s is replaced with the identifier of the UPS in question.
|
||||
#
|
||||
# Possible values for <notify type>:
|
||||
#
|
||||
# ONLINE : UPS is back online
|
||||
# ONBATT : UPS is on battery
|
||||
# LOWBATT : UPS has a low battery (if also on battery, it's "critical")
|
||||
# FSD : UPS is being shutdown by the master (FSD = "Forced Shutdown")
|
||||
# COMMOK : Communications established with the UPS
|
||||
# COMMBAD : Communications lost to the UPS
|
||||
# SHUTDOWN : The system is being shutdown
|
||||
# REPLBATT : The UPS battery is bad and needs to be replaced
|
||||
# NOCOMM : A UPS is unavailable (can't be contacted for monitoring)
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# NOTIFYFLAG - change behavior of upsmon when NOTIFY events occur
|
||||
#
|
||||
# By default, upsmon sends walls (global messages to all logged in users)
|
||||
# and writes to the syslog when things happen. You can change this.
|
||||
#
|
||||
# NOTIFYFLAG <notify type> <flag>[+<flag>][+<flag>] ...
|
||||
#
|
||||
#NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC
|
||||
NOTIFYFLAG NOCOMM SYSLOG+WALL
|
||||
#
|
||||
# Possible values for the flags:
|
||||
#
|
||||
# SYSLOG - Write the message in the syslog
|
||||
# WALL - Write the message to all users on the system
|
||||
# EXEC - Execute NOTIFYCMD (see above) with the message
|
||||
# IGNORE - Don't do anything
|
||||
#
|
||||
# If you use IGNORE, don't use any other flags on the same line.
|
65
Cfg/etc/nut/upsmon.conf/upsmon.conf.G50_ups-server
Normal file
65
Cfg/etc/nut/upsmon.conf/upsmon.conf.G50_ups-server
Normal file
|
@ -0,0 +1,65 @@
|
|||
# Fichier gere par Bcfg2 (plugin Cfg)
|
||||
#
|
||||
# A ne modifier que sur vert
|
||||
#
|
||||
|
||||
# C'est vert qui monitore l'onduleur, il y a un seul onduleur
|
||||
MONITOR pulsar@localhost 1 upsmon_master iQ9C4jdaqmfp master
|
||||
|
||||
# Commande d'arret
|
||||
SHUTDOWNCMD "/sbin/shutdown -h +0"
|
||||
|
||||
# Avec ce truc on devrai pouvoir s'envoyer des mails en cas de coupue
|
||||
# voir pager.txt dans la doc
|
||||
NOTIFYCMD /etc/nut/mail.sh
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# NOTIFYMSG - change messages sent by upsmon when certain events occur
|
||||
#
|
||||
# You can change the stock messages to something else if you like.
|
||||
#
|
||||
# NOTIFYMSG <notify type> "message"
|
||||
#
|
||||
# NOTIFYMSG ONLINE "UPS %s is getting line power"
|
||||
# NOTIFYMSG ONBATT "Someone pulled the plug on %s"
|
||||
#
|
||||
# Note that %s is replaced with the identifier of the UPS in question.
|
||||
#
|
||||
# Possible values for <notify type>:
|
||||
#
|
||||
# ONLINE : UPS is back online
|
||||
# ONBATT : UPS is on battery
|
||||
# LOWBATT : UPS has a low battery (if also on battery, it's "critical")
|
||||
# FSD : UPS is being shutdown by the master (FSD = "Forced Shutdown")
|
||||
# COMMOK : Communications established with the UPS
|
||||
# COMMBAD : Communications lost to the UPS
|
||||
# SHUTDOWN : The system is being shutdown
|
||||
# REPLBATT : The UPS battery is bad and needs to be replaced
|
||||
# NOCOMM : A UPS is unavailable (can't be contacted for monitoring)
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# NOTIFYFLAG - change behavior of upsmon when NOTIFY events occur
|
||||
#
|
||||
# By default, upsmon sends walls (global messages to all logged in users)
|
||||
# and writes to the syslog when things happen. You can change this.
|
||||
#
|
||||
# NOTIFYFLAG <notify type> <flag>[+<flag>][+<flag>] ...
|
||||
#
|
||||
NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC
|
||||
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
|
||||
NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC
|
||||
NOTIFYFLAG FSD SYSLOG+WALL+EXEC
|
||||
NOTIFYFLAG COMMOK SYSLOG+WALL+EXEC
|
||||
NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC
|
||||
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
|
||||
NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC
|
||||
NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC
|
||||
#
|
||||
# Possible values for the flags:
|
||||
#
|
||||
# SYSLOG - Write the message in the syslog
|
||||
# WALL - Write the message to all users on the system
|
||||
# EXEC - Execute NOTIFYCMD (see above) with the message
|
||||
# IGNORE - Don't do anything
|
||||
#
|
||||
# If you use IGNORE, don't use any other flags on the same line.
|
|
@ -259,6 +259,16 @@
|
|||
<Group name="antispam-backend"/>
|
||||
</Group>
|
||||
|
||||
<Group name="ups-monitor"
|
||||
comment="client ups pour extinction du serveur">
|
||||
<Group name="ups-monitor-backend"/>
|
||||
</Group>
|
||||
|
||||
<Group name="ups-server"
|
||||
comment="serveur ups pour commander les extinctions">
|
||||
<Group name="ups-monitor"/>
|
||||
</Group>
|
||||
|
||||
<!-- *** Base de donnee *** -->
|
||||
|
||||
<Group name="db-main"
|
||||
|
@ -610,6 +620,10 @@
|
|||
<Group name="openvpn"/>
|
||||
</Group>
|
||||
|
||||
<Group name="ups-monitor-backend">
|
||||
<Group name="nut"/>
|
||||
</Group>
|
||||
|
||||
<!-- +==============+ -->
|
||||
<!-- | Les backends | -->
|
||||
<!-- +==============+ -->
|
||||
|
@ -763,6 +777,12 @@
|
|||
<Bundle name="openvpn"/>
|
||||
</Group>
|
||||
|
||||
<Group name="nut"
|
||||
category="ups-monitor-backend">
|
||||
<Bundle name="nut"/>
|
||||
</Group>
|
||||
|
||||
|
||||
<!-- +====================+ -->
|
||||
<!-- | Groupes dynamiques | -->
|
||||
<!-- +====================+ -->
|
||||
|
|
|
@ -57,4 +57,6 @@
|
|||
grpconv; }"/>
|
||||
|
||||
<Service name="monit" status="on"/>
|
||||
|
||||
<Service name="nut" status="on"/>
|
||||
</Rules>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue