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>
On Apr 17, 2017, at 3:43 AM, Karsten Kortenhorn <karstenkortenhorn at gmail.com> wrote:> > 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?upsmon should be running on the system with upsmon.conf (which does not need to be the same system running upsd). It does not matter whether the monitored UPS is connected to the driver with SNMP. On Ubuntu, upsmon should be started if MODE in /etc/nut/nut.conf is set to something other than "none". So your configuration looks correct. Which version of NUT and Ubuntu? As mentioned in other recent threads, there may be a race condition if you use LISTEN with something less reliable than a static IP configuration with ifupdown. Instead of binding to individual IPs, I would recommend listening to 0.0.0.0 and using a firewall rule to block traffic from other interfaces.
[please use Reply-All to keep the list CC'd. Thanks!]> On Apr 18, 2017, at 3:27 AM, Karsten Kortenhorn <karstenkortenhorn at gmail.com> wrote: > > Hi, > > I use upsd 2.7.2 on ubuntu 16.04.2 LTS. "ps aux" don't display upsmon!That's the first thing to troubleshoot. The flow of information is: SNMP card -> driver -> upsd -> clients (upsmon, upsc, CGI). So if upsc and the CGI scripts show valid data, they are pulling it from upsd. Do you see any log messages related to upsmon startup? (journalctl -t upsmon) What happens if you start upsmon manually? (sudo upsmon)> Is it even possible to check two UPS via SNMP in building A and B from one Linux Box (ubuntu-nut-server) to shutdown two datacenter in building A or B if needed?Sure, you just need to be certain that when the power goes out, all of the network connections between the server and the UPS are still powered on. Otherwise, the last status that the server sees is "OL", and then it goes to "data stale" when it cannot reach the UPS over SNMP. Likewise, you will need to be able to send the shutdown command over the network to those servers.> My plan is to shutdown all server in building B if power fails in building B and to shutdown all server in building A if power fails in building A. It is not so important to shutdown the ubuntu-nut-server. I can include him in one shutdown-building-script.This sounds reasonable.
On Apr 18, 2017, at 11:05 AM, Karsten Kortenhorn <karstenkortenhorn at gmail.com> wrote:> > OK, it works now. I noticed that I also have to start nut-client over systemctl and that /etc/default/nut is obsolate. > > > Thanks > > > >> Am 18.04.2017 um 14:27 schrieb Charles Lepple: >> [please use Reply-All to keep the list CC'd. Thanks!] >> >>> On Apr 18, 2017, at 3:27 AM, Karsten Kortenhorn <karstenkortenhorn at gmail.com> wrote: >>> >>> Hi, >>> >>> I use upsd 2.7.2 on ubuntu 16.04.2 LTS. "ps aux" don't display upsmon! >> That's the first thing to troubleshoot. >> >> The flow of information is: SNMP card -> driver -> upsd -> clients (upsmon, upsc, CGI). So if upsc and the CGI scripts show valid data, they are pulling it from upsd. >> >> Do you see any log messages related to upsmon startup? (journalctl -t upsmon) >> >> What happens if you start upsmon manually? (sudo upsmon) >> >>> Is it even possible to check two UPS via SNMP in building A and B from one Linux Box (ubuntu-nut-server) to shutdown two datacenter in building A or B if needed? >> Sure, you just need to be certain that when the power goes out, all of the network connections between the server and the UPS are still powered on. Otherwise, the last status that the server sees is "OL", and then it goes to "data stale" when it cannot reach the UPS over SNMP. Likewise, you will need to be able to send the shutdown command over the network to those servers. >> >>> My plan is to shutdown all server in building B if power fails in building B and to shutdown all server in building A if power fails in building A. It is not so important to shutdown the ubuntu-nut-server. I can include him in one shutdown-building-script. >> This sounds reasonable. >