[Nut-upsuser] Two UPS via SNMP at one ubunut box

Karsten Kortenhorn karstenkortenhorn at gmail.com
Mon Apr 17 07:43:36 UTC 2017


Hi all,

I would like to check two UPS in two different buildings with an ubuntu 
server. I use SNMP on both UPS. The cgi-page displayed all information 
as expected, but if I pull the fuse for one UPS in building A, none 
action occur. I expected that I get a mail "UPS A on Batt" and that 
after 5 minutes the shotdownscript starts. But no action.

I saw that there is no upsmon process running. Is this normal because of 
the SNMP connection?


Whats wrong?  Any ideas?

Thanks Kim


/etc/nut/hosts.conf     ==============================

MONITOR buildingA at localhost "eaton"

MONITOR buildingB at localhost "netman"

/etc/nut/nut.conf================================

MODE=netserver

/etc/nut/ups.conf=================================

maxretry = 3

[buildingA]

driver = snmp-ups

port = 192.168.1.2

community = snmp

snmp_version = v1

desc "EATON"

pollfreq = 15

[buildingB]

driver = snmp-ups

port = 192.168.1.3

mibs = ietf

community = snmp

snmp_version = v1

desc "NetMan"

pollfreq = 15

/etc/nut/upsd.conf=====================

LISTEN 127.0.0.1
LISTEN 192.168.1.200

/etc/nut/upsd.users    ==============================

[admin]

password = password

actions = SET

instcmds = ALL

[upsmaster]

password = mAster

upsmon master

/etc/nut/upsmon.conf  ===========================

RUN_AS_USER nut

MONITOR buildingA at localhost 1 upsmaster *** master

MONITOR buildingB at localhost 1 upsmaster *** master

MINSUPPLIES 1

NOTIFYCMD /etc/nut/notify_cmd

POLLFREQ 5

POLLFREQALERT 5

HOSTSYNC 15

DEADTIME 15

POWERDOWNFLAG /etc/killpower

NOTIFYFLAG ONLINESYSLOG

NOTIFYFLAG ONBATTSYSLOG

NOTIFYFLAG LOWBATTSYSLOG+EXEC

NOTIFYFLAG FSDSYSLOG+EXEC

NOTIFYFLAG COMMOKSYSLOG

NOTIFYFLAG COMMBADSYSLOG

NOTIFYFLAG SHUTDOWNSYSLOG+EXEC

NOTIFYFLAG REPLBATTSYSLOG+EXEC

NOTIFYFLAG NOCOMMSYSLOG+EXEC

NOTIFYFLAG NOPARENTSYSLOG

RBWARNTIME 43200

NOCOMMWARNTIME 300

FINALDELAY 5

/etc/nut/upssched.conf================================================

PIPEFN /var/run/nut/upssched/upssched.pipe

LOCKFN /var/run/nut/upssched/upssched.lock

AT ONBATT buildingA EXECUTE email_A_onbatt

AT ONBATT buildingA START-TIMER shutdownA 300

AT ONLINE buildingA CANCEL-TIMER shutdownA

AT ONLINE buildingA EXECUTE email_A_online

AT ONBATT buildingB EXECUTE email_B_onbatt

AT ONBATT buildingB START-TIMER shutdownB 300

AT ONLINE buildingB CANCEL-TIMER shutdownB

AT ONLINE buildingB EXECUTE email_B_online

/bin/upssched-cmd======================================

case $1 in

email_A_onbatt)

mail -s "UPS A on battery power" admin at xy

;;

email_A_online)

mail -s "UPS A on line power" admin at xy

;;

shutdownA)

/var/lib/nut/shutdownA.sh

;;

email_B_onbatt)

mail -s "UPS  B on battery power" admin at xy

;;

email_Bonline)

mail -s "UPS  B on line power" admin at xy

;;

shutdownB)

/var/lib/nut/shutdownB.sh

;;

upsonline)

#etherwake 01:23:45:AB:CD:EF

;;

upsgone)

logger -t upssched-cmd "The UPS has been gone for awhile"

;;

*)

logger -t upssched-cmd "Unrecognized command: $1"

;;

esac

/ var/lib/nut/shutdownB.sh      
=============================================

for vms in $(vmware-cmd -H esx01 -U root -P**** -l)

do

vmware-cmd -H esx01 -U root -P**** $vms stop soft

done

for vms in $(vmware-cmd -H esx02 -U root -P**** -l)

do

vmware-cmd -H esx02 -U root -P**** $vms stop soft

done

sleep 60

for vms in $(vmware-cmd -H esx01 -U root -P**** -l)

do

vmware-cmd -H esx01 -U root -P**** $vms stop hard

done

for vms in $(vmware-cmd -H esx02 -U root -P**** -l)

do

vmware-cmd -H esx02 -U root -P**** $vms stop hard

done




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170417/e6446896/attachment-0001.html>


More information about the Nut-upsuser mailing list