Discussion:
[Apcupsd-users] Unable to connect to UPS Network Management Card2 from CentOS
Halim Issa
2014-04-17 16:55:45 UTC
Permalink
Hello,

I run apcupsd 3.14.10 (13 September 2011) on CentOS release 6.5 (Final),
and I have an APC Smart-UPS with a Network Management Card 2 (AP9631).

When trying to get apcupsd to connect over ethernet to the management card,
I get an error that it is unable to bind to the socket:

Apr 17 18:48:53 Linux apcupsd[9702]: apcupsd FATAL ERROR in pcnet.c at line
661#012Cannot bind socket (13)

I have verified that there are no other instances of apcupsd runnning, and
also no other services claiming that port. The firewall on the Linux-box
has been shut down, and I have only one simple switch between the server
and the management card. Accessing the management card of the UPS via Web
and SSH works fine and the system appears correctly configured. The
documentation refers to an earlier version of the management card, but
AP9631 is supposedly fully backwards compatible, and regardless of that it
seems the error is on the linux box, long before it reaches the card.

I would be very grateful if someone could kindly help me point out what I
have missed in order to make this work. Thank you!

grep -v "^#" apcupsd.conf |egrep -v "^\s*$"

UPSNAME SmartUPS

UPSCABLE ether

UPSTYPE pcnet

DEVICE 192.168.1.4:xxxxx:xxxx <-intentionally changed

LOCKFILE /var/lock

SCRIPTDIR /etc/apcupsd

PWRFAILDIR /etc/apcupsd

NOLOGINDIR /etc

ONBATTERYDELAY 6

BATTERYLEVEL 5

MINUTES 3

TIMEOUT 0

ANNOY 300

ANNOYDELAY 60

NOLOGON disable

KILLDELAY 0

NETSERVER on

NISIP 0.0.0.0

NISPORT 3551

EVENTSFILE /var/log/apcupsd.events

EVENTSFILEMAX 10

UPSCLASS standalone

UPSMODE disable

STATTIME 0

STATFILE /var/log/apcupsd.status

LOGSTATS off

DATATIME 0
Seth Bardash
2014-04-17 18:42:05 UTC
Permalink
This post might be inappropriate. Click to display it.
Halim Issa
2014-04-18 07:00:27 UTC
Permalink
Thanks much! Switching to SNMP worked miracles! Much appreciated
We are running a Symmetra 16000 with a network card. Not sure which
version....
I am running CentOS 6.5 x86_64.
## apcupsd.conf v1.1 ##
#
# for apcupsd release 3.14.10 (13 September 2011) - redhat
#
# "apcupsd" POSIX config file
#
# ========= General configuration parameters ============
#
# UPSNAME xxx
# Use this to give your UPS a name in log files and such. This
# is particulary useful if you have multiple UPSes. This does not
# set the EEPROM. It should be 8 characters or less.
UPSNAME 16KVA
# UPSCABLE <cable>
# Defines the type of cable connecting the UPS to your computer.
#
# simple, smart, ether, usb
#
# 940-0119A, 940-0127A, 940-0128A, 940-0020B,
# 940-0020C, 940-0023A, 940-0024B, 940-0024C,
# 940-1524C, 940-0024G, 940-0095A, 940-0095B,
# 940-0095C, M-04-02-2000
#
UPSCABLE ether
# To get apcupsd to work, in addition to defining the cable
# above, you must also define a UPSTYPE, which corresponds to
# the type of UPS you have (see the Description for more details).
# You must also specify a DEVICE, sometimes referred to as a port.
# For USB UPSes, please leave the DEVICE directive blank. For
# other UPS types, you must specify an appropriate port or address.
#
# UPSTYPE DEVICE Description
# apcsmart /dev/tty** Newer serial character device, appropriate
for
# SmartUPS models using a serial cable (not
USB).
#
# usb <BLANK> Most new UPSes are USB. A blank DEVICE
# setting enables autodetection, which is
# the best choice for most installations.
#
# net hostname:port Network link to a master apcupsd through
apcupsd's
# Network Information Server. This is used if
the
# UPS powering your computer is connected to a
# different computer for monitoring.
#
# snmp hostname:port:vendor:community
# SNMP network link to an SNMP-enabled UPS
device.
# Hostname is the ip address or hostname of the
UPS
# on the network. Vendor can be can be "APC" or
# "APC_NOTRAP". "APC_NOTRAP" will disable SNMP
trap
# catching; you usually want "APC". Port is
usually
# 161. Community is usually "private".
#
# netsnmp hostname:port:vendor:community
# OBSOLETE
# Same as SNMP above but requires use of the
# net-snmp library. Unless you have a specific
need
# for this old driver, you should use 'snmp'
instead.
#
# dumb /dev/tty** Old serial character device for use with
# simple-signaling UPSes.
#
# pcnet ipaddr:username:passphrase:port
# PowerChute Network Shutdown protocol which
can be
# used as an alternative to SNMP with the
AP9617
# family of smart slot cards. ipaddr is the IP
# address of the UPS management card. username
and
# passphrase are the credentials for which the
card
# has been configured. port is the port number
on
# which to listen for messages from the UPS,
normally
# 3052. If this parameter is empty or missing,
the
# default of 3052 will be used.
#
UPSTYPE snmp
DEVICE 192.168.2.XXX:161:APC:public
The rest is pretty much standard and this works fine.
APC : 001,050,1192
DATE : 2014-04-17 12:33:51 -0600
HOSTNAME : D6328-10
VERSION : 3.14.10 (13 September 2011) redhat
UPSNAME : SYM16K
CABLE : Ethernet Link
DRIVER : SNMP UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2014-04-17 12:32:50 -0600
MODEL : Symmetra 16000
STATUS : ONLINE
LINEV : 242.0 Volts
LOADPCT : 12.0 Percent Load Capacity
BCHARGE : 100.0 Percent
TIMELEFT : 199.0 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME : 0 Seconds
MAXLINEV : 242.0 Volts
MINLINEV : 242.0 Volts
OUTPUTV : 244.0 Volts
SENSE : Auto Adjust
DWAKE : 000 Seconds
DSHUTD : 020 Seconds
DLOWBATT : 02 Minutes
LOTRANS : 155.0 Volts
HITRANS : 276.0 Volts
RETPCT : 015.0 Percent
ITEMP : 30.0 C Internal
ALARMDEL : No alarm
BATTV : 136.0 Volts
LINEFREQ : 60.0 Hz
LASTXFER : Automatic or explicit self test
NUMXFERS : 0
TONBATT : 0 seconds
CUMONBATT: 0 seconds
XOFFBATT : N/A
SELFTEST : OK
STESTI : 336
STATFLAG : 0x07000008 Status Flag
MANDATE : 02/19/04
SERIALNO : ED0408000371
BATTDATE : 12/00/12
NOMOUTV : 240 Volts
NOMBATTV : 120.0 Volts
HUMIDITY : 0.0 Percent
AMBTEMP : 0.0 C
EXTBATTS : 13
BADBATTS : 0
FIRMWARE : 260.137.I
END APC : 2014-04-17 12:34:20 -0600
Hope this helps.....
Seth Bardash
Integrated Solutions and Systems
1510 Old North Gate Road
Colorado Springs, CO 80921
719-495-5866 Shop
719-495-5870 Fax
719-337-4779 Cell
http://www.integratedsolutions.org
Failure can not cope with knowledge and perseverance!
------------------------------
*Sent:* Thursday, April 17, 2014 10:56 AM
*Subject:* [Apcupsd-users] Unable to connect to UPS Network Management
Card2from CentOS
Hello,
I run apcupsd 3.14.10 (13 September 2011) on CentOS release 6.5 (Final),
and I have an APC Smart-UPS with a Network Management Card 2 (AP9631).
When trying to get apcupsd to connect over ethernet to the management
Apr 17 18:48:53 Linux apcupsd[9702]: apcupsd FATAL ERROR in pcnet.c at
line 661#012Cannot bind socket (13)
I have verified that there are no other instances of apcupsd runnning, and
also no other services claiming that port. The firewall on the Linux-box
has been shut down, and I have only one simple switch between the server
and the management card. Accessing the management card of the UPS via Web
and SSH works fine and the system appears correctly configured. The
documentation refers to an earlier version of the management card, but
AP9631 is supposedly fully backwards compatible, and regardless of that it
seems the error is on the linux box, long before it reaches the card.
I would be very grateful if someone could kindly help me point out what I
have missed in order to make this work. Thank you!
grep -v "^#" apcupsd.conf |egrep -v "^\s*$"
UPSNAME SmartUPS
UPSCABLE ether
UPSTYPE pcnet
DEVICE 192.168.1.4:xxxxx:xxxx <-intentionally changed
LOCKFILE /var/lock
SCRIPTDIR /etc/apcupsd
PWRFAILDIR /etc/apcupsd
NOLOGINDIR /etc
ONBATTERYDELAY 6
BATTERYLEVEL 5
MINUTES 3
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 0
NETSERVER on
NISIP 0.0.0.0
NISPORT 3551
EVENTSFILE /var/log/apcupsd.events
EVENTSFILEMAX 10
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Apcupsd-users mailing list
https://lists.sourceforge.net/lists/listinfo/apcupsd-users
Adversio
2017-05-05 10:09:48 UTC
Permalink
I had the same problem, got it running using SNMP, after some more digging I
finally got the pcnet protocol to work too. Seems that the password must be
at least 15 characters long..



--
View this message in context: http://apcupsd-ups-control-software.10985.n7.nabble.com/Unable-to-connect-to-UPS-Network-Management-Card2-from-CentOS-tp8561p10025.html
Sent from the Users mailing list archive at Nabble.com.

Loading...