Make nut ups monitoring work
This commit is contained in:
5
roles/ups/templates/nut.conf.j2
Normal file
5
roles/ups/templates/nut.conf.j2
Normal file
@@ -0,0 +1,5 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# /etc/nut/nut.conf
|
||||
|
||||
MODE=netserver
|
||||
8
roles/ups/templates/nut.j2
Normal file
8
roles/ups/templates/nut.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# /etc/default/nut
|
||||
|
||||
START_UPSD=yes
|
||||
UPSD_OPTIONS=""
|
||||
START_UPSMON=yes
|
||||
UPSMON_OPTIONS=""
|
||||
8
roles/ups/templates/ups.conf.j2
Normal file
8
roles/ups/templates/ups.conf.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# /etc/nut/ups.conf
|
||||
|
||||
[{{ ups_type }}]
|
||||
driver = {{ ups_drv }}
|
||||
port = {{ ups_port }}
|
||||
desc = {{ ups_desc }}
|
||||
6
roles/ups/templates/upsd.conf.j2
Normal file
6
roles/ups/templates/upsd.conf.j2
Normal file
@@ -0,0 +1,6 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# /etc/nut/upsd.conf
|
||||
|
||||
LISTEN 127.0.0.1 3493
|
||||
LISTEN ::1 3493
|
||||
12
roles/ups/templates/upsd.users.j2
Normal file
12
roles/ups/templates/upsd.users.j2
Normal file
@@ -0,0 +1,12 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# /etc/nut/upsd.users
|
||||
|
||||
[master]
|
||||
password = {{ ups_master_pw }}
|
||||
upsmon master
|
||||
{% if ups_slave_pw -%}
|
||||
[slave]
|
||||
password = {{ ups_slave_pw }}
|
||||
upsmon slave
|
||||
{% endif %}
|
||||
7
roles/ups/templates/upsmon.conf.j2
Normal file
7
roles/ups/templates/upsmon.conf.j2
Normal file
@@ -0,0 +1,7 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# /etc/nut/upsmon.conf
|
||||
|
||||
MONITOR {{ ups_type }}@localhost 1 master {{ ups_master_pw }} master
|
||||
NOTIFYCMD /sbin/upssched
|
||||
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
|
||||
10
roles/ups/templates/upssched.conf.j2
Normal file
10
roles/ups/templates/upssched.conf.j2
Normal file
@@ -0,0 +1,10 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# /etc/nut/upssched.conf
|
||||
|
||||
CMDSCRIPT /etc/nut/upssched/upsscript
|
||||
PIPEFN /etc/nut/upssched/upssched.pipe
|
||||
LOCKFN /etc/nut/upssched/upssched.lock
|
||||
AT ONBATT * START-TIMER onbatt 120
|
||||
AT ONLINE * CANCEL-TIMER onbatt
|
||||
AT LOWBATT * EXEC lowbatt
|
||||
14
roles/ups/templates/upsscript.j2
Normal file
14
roles/ups/templates/upsscript.j2
Normal file
@@ -0,0 +1,14 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# /etc/nut/upssched/upsscript
|
||||
|
||||
#! /bin/sh
|
||||
case $1 in
|
||||
onbatt)
|
||||
ssh
|
||||
;;
|
||||
lowbatt)
|
||||
/sbin/upssched fsd;;
|
||||
*)
|
||||
echo "wrong Parameter";;
|
||||
esac
|
||||
Reference in New Issue
Block a user