Как мониторить 2 APC на одной машине?
Добавлено: 2010-04-21 15:41:30
Как мониторить 2 и больше APC на одной машине с помощью apcupsd?
Если не знаешь что делать – делай шаг вперёд
https://forum.lissyara.su/
Ksadoo писал(а):Где задаются эти параметры?
Код: Выделить всё
# cat apcupsd.conf | grep -v "^#"
UPSNAME apccccc
UPSCABLE smart
UPSTYPE apcsmart
DEVICE /dev/cuad0
LOCKFILE /var/spool/lock
ONBATTERYDELAY 6
BATTERYLEVEL 5
MINUTES 3
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 10
EVENTSFILE /var/log/apcupsd.events
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0
UPSNAME APC-1000 XL
WAKEUP 30Код: Выделить всё
# cat apcupsd.conf | grep -v "#"
UPSNAME apccccc
UPSCABLE smart
UPSTYPE apcsmart
DEVICE /dev/cuad0
LOCKFILE /var/spool/lock
ONBATTERYDELAY 6
BATTERYLEVEL 5
MINUTES 3
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 10
EVENTSFILE /var/log/apcupsd.events
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0
UPSNAME APC-1000 XL
WAKEUP 30
Код: Выделить всё
# cat apcupsd.conf2 | grep -v "#"
UPSNAME apcccc2
UPSCABLE smart
UPSTYPE apcsmart
DEVICE /dev/cuad1
LOCKFILE /var/spool/lock
ONBATTERYDELAY 6
BATTERYLEVEL 5
MINUTES 3
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 10
EVENTSFILE /var/log/apcupsd2.events
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0
UPSNAME APC-1000
WAKEUP 30
Код: Выделить всё
# cat apcupsd | grep -v "#"
. /etc/rc.subr
name="apcupsd"
rcvar=${name}_enable
load_rc_config $name
: ${apcupsd_enable="NO"}
: ${apcupsd_flags="--kill-on-powerfail"}
: ${apcupsd_pidfile="/var/run/apcupsd.pid"}
: ${apcupsd_lockfile="/var/spool/lock/apcupsd.lock"}
pidfile="/var/run/apcupsd.pid"
required_files="/usr/local/etc/apcupsd/apcupsd.conf"
command="/usr/local/sbin/apcupsd"
run_rc_command "$1"
Код: Выделить всё
# cat apcupsd2 | grep -v "#"
. /etc/rc.subr
name="apcupsd2"
rcvar=${name}_enable
load_rc_config $name
: ${apcupsd_enable="YES"}
: ${apcupsd_flags="--kill-on-powerfail"}
: ${apcupsd_pidfile="/var/run/apcupsd2.pid"}
: ${apcupsd_lockfile="/var/spool/lock/apcupsd2.lock"}
pidfile="/var/run/apcupsd2.pid"
required_files="/usr/local/etc/apcupsd/apcupsd.conf2"
command="/usr/local/sbin/apcupsd2"
run_rc_command "$1"
Код: Выделить всё
# ps -ax | grep apc
727 ?? Ss 0:00.26 /usr/local/sbin/apcupsd --kill-on-powerfail
1688 ?? Is 0:00.10 /usr/local/sbin/apcupsd2
2485 p0 S+ 0:00.00 grep apcКод: Выделить всё
2010-04-22 17:16:25 +0300 Communications with UPS lost.
2010-04-22 17:16:30 +0300 Communications with UPS restored.
2010-04-22 17:17:47 +0300 Communications with UPS lost.
2010-04-22 17:17:52 +0300 Communications with UPS restored.
2010-04-22 17:18:45 +0300 Communications with UPS lost.
2010-04-22 17:20:05 +0300 Communications with UPS restored.
2010-04-22 17:24:07 +0300 Communications with UPS lost.
2010-04-22 17:24:09 +0300 Communications with UPS restored.
2010-04-22 17:24:49 +0300 Communications with UPS lost.
2010-04-22 17:25:30 +0300 Communications with UPS restored.
Код: Выделить всё
-b, don't go into background
-d, --debug <level> set debug level (>0)
-f, --config-file <file> load specified config file
-k, --killpower, --hibernate put UPS into hibernation mode [*]
-o, --power-off turn off UPS completely [*]
-P, --pid-file specify name of PID file
-p, --kill-on-powerfail hibernate UPS on powerfail
-R, put SmartUPS into dumb mode
-t, --term-on-powerfail terminate when battery power fails
-T send debug to ./apcupsd.trace
-V, --version display version info
-h, --help display this helpпоздравляю-f, --config-file <file> load specified config file
даже слепой увидит что второй конфиг не используется727 ?? Ss 0:00.26 /usr/local/sbin/apcupsd --kill-on-powerfail
1688 ?? Is 0:00.10 /usr/local/sbin/apcupsd2
Код: Выделить всё
# cd /usr/ports/sysutils/apcupsd/
make && make install && make cleanКод: Выделить всё
# cd /usr/local/etc/apcupsd/apcupsd.confКод: Выделить всё
DEVICE /dev/cuad0Код: Выделить всё
DEVICE /dev/cuad0
EVENTSFILE /var/log/apcupsd.event
на
DEVICE /dev/cuad1
EVENTSFILE /var/log/apcupsd2.eventКод: Выделить всё
# cat apcupsd | grep -v "#"
. /etc/rc.subr
name="apcupsd"
rcvar=${name}_enable
load_rc_config $name
: ${apcupsd_enable="NO"}
: ${apcupsd_flags="--kill-on-powerfail"}
: ${apcupsd_pidfile="/var/run/apcupsd.pid"}
: ${apcupsd_lockfile="/var/spool/lock/apcupsd.lock"}
pidfile="/var/run/apcupsd.pid"
required_files="/usr/local/etc/apcupsd/apcupsd.conf"
command="/usr/local/sbin/apcupsd"
run_rc_command "$1"
Код: Выделить всё
# cat apcupsd2 | grep -v "#"
. /etc/rc.subr
name="apcupsd2"
rcvar=${name}_enable
load_rc_config $name
: ${apcupsd_enable="NO"}
: ${apcupsd_flags="--kill-on-powerfail"}
: ${apcupsd_pidfile="/var/run/apcupsd2.pid"}
: ${apcupsd_lockfile="/var/spool/lock/apcupsd.lock"}
pidfile="/var/run/apcupsd2.pid"
required_files="/usr/local/etc/apcupsd/apcupsd.conf2"
command="/usr/local/sbin/apcupsd"
run_rc_command "$1"Код: Выделить всё
# apcupsd -f /usr/local/etc/apcupsd/apcupsd.conf /usr/local/etc/rc.d/apcupsd
# apcupsd -f /usr/local/etc/apcupsd/apcupsd.conf2 /usr/local/etc/rc.d/apcupsd2Код: Выделить всё
apcupsd_enable="YES"
apcupsd2_enable="YES"
Код: Выделить всё
shutdown -r nowКод: Выделить всё
# ps -ax | grep apc
736 ?? Is 0:00.04 /usr/local/sbin/apcupsd --kill-on-powerfail
968 p0 S+ 0:00.00 grep apcэто что еще за ламерство?Потом делаю
# apcupsd -f /usr/local/etc/apcupsd/apcupsd.conf /usr/local/etc/rc.d/apcupsd
# apcupsd -f /usr/local/etc/apcupsd/apcupsd.conf2 /usr/local/etc/rc.d/apcupsd2
Код: Выделить всё
apcupsd_flags="--kill-on-powerfail -f/usr/local/etc/apcupsd/apcupsd.conf"
apcupsd2_flags="--kill-on-powerfail -f/usr/local/etc/apcupsd/apcupsd.conf2"Код: Выделить всё
# ps -ax | grep apc
752 ?? Ss 0:00.03 /usr/local/sbin/apcupsd --kill-on-powerfail
941 p0 S+ 0:00.00 grep apc
# /usr/local/etc/rc.d/apcupsd2 start
/etc/rc.conf: -f/usr/local/etc/apcupsd/apcupsd.conf2: not found
Starting apcupsd2.
# ps -ax | grep apc
752 ?? Is 0:00.03 /usr/local/sbin/apcupsd --kill-on-powerfail
1005 p0 S+ 0:00.00 grep apc
Код: Выделить всё
# cd /usr/local/etc/apcupsd/
# ls
apccontrol apcupsd.css commok multimon.conf.sample
apctest.output apcupsd.css.sample date.sh offbattery
apcupsd.conf cgi hosts.conf onbattery
apcupsd.conf.sample changeme hosts.conf.sample
apcupsd.conf2 commfailure multimon.conf