Can't believe I'm asking this... What's a serial port on an OpenBSD system?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't believe I'm asking this... What's a serial port on an OpenBSD system?

David Benfell-2
Hello all,

I think I've just about got nut going except for one incredibly
irritating detail.  ups.conf needs to say what serial port my UPS is
on.

I made a few guesses, all of which were apparently wrong.

I'm getting lots of this kind of thing in /var/log/daemon:

Feb 13 02:00:01 lupin newsyslog[22881]: logfile turned over
Feb 13 02:00:04 lupin upsmon[31538]: Poll UPS [1500AVR@localhost]
failed - [1500AVR] does not exist on server localhost
Feb 13 02:00:09 lupin upsmon[31538]: Poll UPS [1500AVR@localhost]
failed - [1500AVR] does not exist on server localhost
Feb 13 02:00:09 lupin upsmon[31538]: UPS 1500AVR@localhost is
unavailable
                                                                               
Broadcast Message from [hidden email]                                
        ((not a tty)) at 2:00 ...                                              
                                                                               
UPS 1500AVR@localhost is unavailable                                          
                                                                               
dmesg looks like:

OpenBSD 3.8-stable (GENERIC) #33: Sun Feb 12 02:28:05 PST 2006
    [hidden email]:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Pentium(R) 4 CPU 2.40GHz ("GenuineIntel" 686-class) 2.41 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,CNXT-ID
real mem  = 1610133504 (1572396K)
avail mem = 1461854208 (1427592K)
using 4278 buffers containing 80609280 bytes (78720K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(de) BIOS, date 10/24/02, BIOS32 rev. 0 @ 0xfb1b0
apm0 at bios0: Power Management spec V1.2
apm0: AC on, battery charge unknown
apm0: flags 70102 dobusy 1 doidle 1
pcibios0 at bios0: rev 2.1 @ 0xf0000/0xdf44
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdea0/160 (8 entries)
pcibios0: PCI Exclusive IRQs: 5 9 11 12
pcibios0: no compatible PCI ICU found
pcibios0: Warning, unable to fix up PCI interrupt routing
pcibios0: PCI bus #2 is the last bus
bios0: ROM list: 0xc0000/0x8000
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 vendor "VIA", unknown product 0x3168 rev 0x03
ppb0 at pci0 dev 1 function 0 "VIA VT8235 AGP" rev 0x00
pci1 at ppb0 bus 1
vga1 at pci0 dev 8 function 0 "ATI Rage 128 Pro TR" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
ppb1 at pci0 dev 9 function 0 "Intel S21154AE/BE PCI-PCI" rev 0x00
pci2 at ppb1 bus 2
sf0 at pci2 dev 4 function 0 "Adaptec AIC-6915" rev 0x03: irq 9 address 00:00:d1:f0:24:2d
sqphy0 at sf0 phy 1: Seeq 84220 10/100 PHY, rev. 0
sf1 at pci2 dev 5 function 0 "Adaptec AIC-6915" rev 0x03: irq 5 address 00:00:d1:f0:24:2e
sqphy1 at sf1 phy 1: Seeq 84220 10/100 PHY, rev. 0
sf2 at pci2 dev 6 function 0 "Adaptec AIC-6915" rev 0x03: irq 12 address 00:00:d1:f0:24:2f
sqphy2 at sf2 phy 1: Seeq 84220 10/100 PHY, rev. 0
sf3 at pci2 dev 7 function 0 "Adaptec AIC-6915" rev 0x03: irq 11 address 00:00:d1:f0:24:30
sqphy3 at sf3 phy 1: Seeq 84220 10/100 PHY, rev. 0
dc0 at pci0 dev 11 function 0 "Lite-On PNIC" rev 0x20: irq 12, address 00:a0:cc:65:ba:d0
bmtphy0 at dc0 phy 1: BCM5201 10/100 PHY, rev. 2
xl0 at pci0 dev 12 function 0 "3Com 3c905 100Base-TX" rev 0x00: irq 11, address 00:60:97:58:f4:49
nsphy0 at xl0 phy 24: DP83840 10/100 PHY, rev. 0
vr0 at pci0 dev 14 function 0 "VIA VT6105M RhineIII" rev 0x96: irq 5 address 00:40:63:c3:80:0e
ukphy0 at vr0 phy 1: Generic IEEE 802.3u media interface
ukphy0: OUI 0x004063, model 0x0034, rev. 3
uhci0 at pci0 dev 16 function 0 "VIA VT83C572 USB" rev 0x80: irq 11
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: VIA UHCI root hub, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 16 function 1 "VIA VT83C572 USB" rev 0x80: irq 9
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: VIA UHCI root hub, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 16 function 2 "VIA VT83C572 USB" rev 0x80: irq 5
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: VIA UHCI root hub, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 16 function 3 "VIA VT6202 USB" rev 0x82: irq 12
usb3 at ehci0: USB revision 2.0
uhub3 at usb3
uhub3: VIA EHCI root hub, rev 2.00/1.00, addr 1
uhub3: 6 ports with 6 removable, self powered
pcib0 at pci0 dev 17 function 0 "VIA VT8235 ISA" rev 0x00
pciide0 at pci0 dev 17 function 1 "VIA VT82C571 IDE" rev 0x06: ATA133, channel 0 configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0: <WDC WD400BB-00DEA0>
wd0: 16-sector PIO, LBA, 38166MB, 78165360 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <, CD-ROM CMD5X11, 1.06> SCSI0 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 4
auvia0 at pci0 dev 17 function 5 "VIA VT8233 AC97" rev 0x50: irq 5
ac97: codec id 0x49434552 (ICEnsemble VIA VT1616i)
ac97: codec features headphone, 18 bit DAC, 18 bit ADC, KS Waves 3D
audio0 at auvia0
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
sysbeep0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
it0 at isa0 port 0x290/8: IT87
npx0 at isa0 port 0xf0/16: using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
biomask ff65 netmask ff65 ttymask ffe7
pctr: user-level cycle counter enabled
dkcsum: wd0 matches BIOS drive 0x80
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302
uaudio0 at uhub0 port 1 configuration 1 interface 1: Logitech Camera, rev 1.00/1.00, addr 2
uaudio0: audio rev 1.00, 5 mixer controls
audio1 at uaudio0
dc0: failed to force tx and rx to idle state
dc0: failed to force tx and rx to idle state
dc0: failed to force tx and rx to idle state
dc0: failed to force tx and rx to idle state

I am really utterly clueless as to what of this is a serial port.
But there are two of them on the back of the system.

Help!

Thanks!
--
David Benfell, LCP
[hidden email]
---
Resume available at http://www.parts-unknown.org/

Reply | Threaded
Open this post in threaded view
|

Re: Can't believe I'm asking this... What's a serial port on an OpenBSD system?

Damien Miller
On Mon, 13 Feb 2006, David Benfell wrote:

> Hello all,
>
> I think I've just about got nut going except for one incredibly
> irritating detail.  ups.conf needs to say what serial port my UPS is
> on.
>
> I made a few guesses, all of which were apparently wrong.

> pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo

/dev/tty00

> pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo

/dev/tty01

-d

Reply | Threaded
Open this post in threaded view
|

Re: Can't believe I'm asking this... What's a serial port on an OpenBSD system?

Daniel Ouellet
In reply to this post by David Benfell-2
David Benfell wrote:
> I am really utterly clueless as to what of this is a serial port.
> But there are two of them on the back of the system.


Theses are:

pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo

Reply | Threaded
Open this post in threaded view
|

Re: Can't believe I'm asking this... What's a serial port on an OpenBSD system?

John Wright-6
In reply to this post by David Benfell-2
On Mon, Feb 13, 2006 at 02:04:23AM -0800, David Benfell wrote:
> [...]
> pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
> pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
> [...]

These in the dmesg.

man pccom lists the /dev files as tty00, tty01, cua00, cua01.

Reply | Threaded
Open this post in threaded view
|

nut problems, was Re: Can't believe I'm asking this... What's a serial port on an OpenBSD system?

David Benfell-2
In reply to this post by David Benfell-2
Hello all,

Thanks a million, to all who responded.  And I think I've managed to
identify the correct tty, but...:

<quote>
Broadcast Message from [hidden email]                                
        ((not a tty)) at 9:31 ...                                              
                                                                               
Communications with UPS lupin1500AVR@localhost lost                            
                                                                               
                                                                               
Broadcast Message from [hidden email]                                
        ((not a tty)) at 9:31 ...                                              
                                                                               
UPS lupin1500AVR@localhost is unavailable                                      
</quote>

And /var/log/daemon now says:
<quote>
Feb 13 10:00:02 lupin newsyslog[16135]: logfile turned over
Feb 13 10:00:05 lupin upsmon[18984]: Poll UPS [lupin1500AVR@localhost]
failed - Driver not connected
Feb 13 10:00:40 lupin last message repeated 7 times
Feb 13 10:02:30 lupin last message repeated 22 times
Feb 13 10:02:34 lupin upsd[5225]: Can't connect to UPS [lupin1500AVR]
(cyberpower-tty01): No such file or directory
Feb 13 10:02:35 lupin upsmon[18984]: Poll UPS [lupin1500AVR@localhost]
failed - Driver not connected
Feb 13 10:03:06 lupin last message repeated 6 times
Feb 13 10:05:01 lupin last message repeated 23 times
Feb 13 10:05:01 lupin upsmon[18984]: UPS lupin1500AVR@localhost is
unavailable
Feb 13 10:05:06 lupin upsmon[18984]: Poll UPS [lupin1500AVR@localhost]
failed - Driver not connected
Feb 13 10:05:41 lupin last message repeated 7 times
</quote>
                                                                               
So I tried running the driver in debug mode...

<quote>
cyberpower -a lupin1500AVR -u nutmon -DDDDD
Network UPS Tools - CyberPower driver 1.00 (2.0.0)
debug level is '5'
Detected Unknown model - 15 on /dev/tty01
dstate_init: sock /var/db/nut/cyberpower-tty01 open on fd 5
new connection on fd 6
                                                                               
Broadcast Message from [hidden email]                                
        ((not a tty)) at 9:31 ...                                              
                                                                               
Communications with UPS lupin1500AVR@localhost established                    
                                                                               
^CSignal 2: exiting
                                                                               
Broadcast Message from [hidden email]                                
        ((not a tty)) at 9:34 ...                                              
                                                                               
Communications with UPS lupin1500AVR@localhost lost                            
</quote>
                                                                               
It seems to come up, right up until I get bored and CTRL/C it.  Which
I take to mean I failed to reproduce the problem in debug mode.  (Yes,
I tried it several times with varying lengths of time.)

I'm thinking my problem is that for some reason the cyberpower driver
is failing to come up automatically.  I don't see it in the process
table.  And running it from the command line seems to work fine.
Configuration files follow.  What am I missing?

Thanks!

<quote>
# Network UPS Tools: example ups.conf
#
# --- SECURITY NOTE ---
#
# If you use snmp-ups and set a community string in here, you
# will have to secure this file to keep other users from obtaining
# that string.  It needs to be readable by upsdrvctl and any drivers,
# and by upsd.
#
# ---
#
# This is where you configure all the UPSes that this system will be
# monitoring directly.  These are usually attached to serial ports, but
# USB devices and SNMP devices are also supported.
#
# This file is used by upsdrvctl to start and stop your driver(s), and
# is also used by upsd to determine which drivers to monitor.  The
# drivers themselves also read this file for configuration directives.
#
# The general form is:
#
# [upsname]
#       driver = <drivername>
#         port = <portname>
# < any other directives here >
[lupin1500AVR]
        driver = cyberpower
          port = /dev/tty00
#
# The section header ([upsname]) can be just about anything as long as
# it is a single word inside brackets.  upsd uses this to uniquely
# identify a UPS on this system.
#
# If you have a UPS called snoopy, your section header would be "[snoopy]".
# On a system called "doghouse", the line in your upsmon.conf to monitor
# it would look something like this:
#
# MONITOR snoopy@doghouse 1 upsmonuser mypassword master
#
# It might look like this if monitoring in slave mode:
#
# MONITOR snoopy@doghouse 1 upsmonuser mypassword slave
#
# Configuration directives
# ------------------------
#
# These directives are common to all drivers that support ups.conf:
#
#  driver: REQUIRED.  Specify the program to run to talk to this UPS.  
#          apcsmart, fentonups, bestups, and sec are some examples.
#
#    port: REQUIRED.  The serial port where your UPS is connected.  
#          /dev/ttyS0 is usually the first port on Linux boxes, for example.
#
# sdorder: optional.  When you have multiple UPSes on your system, you
#          usually need to turn them off in a certain order.  upsdrvctl
#          shuts down all the 0s, then the 1s, 2s, and so on.  To exclude
#          a UPS from the shutdown sequence, set this to -1.
#
#          The default value for this parameter is 0.
#
#  nolock: optional, and not recommended for use in this file.
#
#          If you put nolock in here, the driver will not lock the
#          serial port every time it starts.  This may allow other
#          processes to seize the port if you start more than one by
#          mistake.
#
#          This is only intended to be used on systems where locking
#          absolutely must be disabled for the software to work.
#
# maxstartdelay: optional.  This can be set as a global variable
#                above your first UPS definition and it can also be
#                set in a UPS section.  This value controls how long
#                upsdrvctl will wait for the driver to finish starting.
#                This keeps your system from getting stuck due to a
#                broken driver or UPS.
#
#                The default is 45 seconds.
#
#
# Anything else is passed through to the hardware-specific part of
# the driver.
#
# Examples
# --------
#
# A simple example for a UPS called "powerpal" that uses the fentonups
# driver on /dev/ttyS0 is:
#
# [powerpal]
# driver = fentonups
# port = /dev/ttyS0
# desc = "Web server"
#
# If your UPS driver requires additional settings, you can specify them
# here.  For example, if it supports a setting of "1234" for the
# variable "cable", it would look like this:
#
# [myups]
# driver = mydriver
# port = /dev/ttyS1
# cable = 1234
# desc = "Something descriptive"
#
# To find out if your driver supports any extra settings, start it with
# the -h option and/or read the driver's documentation.


# Network UPS Tools: example upsmon configuration
#
# This file contains passwords, so keep it secure.

# --------------------------------------------------------------------------
# RUN_AS_USER <userid>
#
# By default, upsmon splits into two processes.  One stays as root and
# waits to run the SHUTDOWNCMD.  The other one switches to another userid
# and does everything else.
#
# The default nonprivileged user is set at compile-time with
# 'configure --with-user=...'.  
#
# You can override it with '-u <user>' when starting upsmon, or just
# define it here for convenience.
#
# Note: if you plan to use the reload feature, this file (upsmon.conf)
# must be readable by this user!  Since it contains passwords, DO NOT
# make it world-readable.  Also, do not make it writable by the upsmon
# user, since it creates an opportunity for an attack by changing the
# SHUTDOWNCMD to something malicious.
#
# For best results, you should create a new normal user like "nutmon",
# and make it a member of a "nut" group or similar.  Then specify it
# here and grant read access to the upsmon.conf for that group.
#
# This user should not have write access to upsmon.conf.
#
RUN_AS_USER nutmon

# --------------------------------------------------------------------------
# MONITOR <system> <powervalue> <username> <password> ("master"|"slave")
#
# List systems you want to monitor.  Not all of these may supply power
# to the system running upsmon, but if you want to watch it, it has to
# be in this section.
#
# You must have at least one of these declared.
#
# <system> is a UPS identifier in the form <upsname>@<hostname>[:<port>]
# like ups@localhost, su700@mybox, etc.
#
# Examples:
#
#  - "su700@mybox" means a UPS called "su700" on a system called "mybox"
#
#  - "fenton@bigbox:5678" is a UPS called "fenton" on a system called
#    "bigbox" which runs upsd on port "5678".
#
# The UPS names like "su700" and "fenton" are set in your ups.conf
# in [brackets] which identify a section for a particular driver.
#
# If the ups.conf on host "doghouse" has a section called "snoopy", the
# identifier for it would be "snoopy@doghouse".
#
# <powervalue> is an integer - the number of power supplies that this UPS
# feeds on this system.  Most computers only have one power supply, so this
# is normally set to 1.  You need a pretty big or special box to have any
# other value here.
#
# You can also set this to 0 for a system that doesn't supply any power,
# but you still want to monitor.  Use this when you want to hear about
# changes for a given UPS without shutting down when it goes critical,
# unless <powervalue> is 0.
#
# <username> and <password> must match an entry in that system's
# upsd.users.  If your username is "monmaster" and your password is
# "blah", the upsd.users would look like this:
#
# [monmaster]
# password  = blah
# allowfrom = (whatever applies to this host)
# upsmon master (or slave)
#
# "master" means this system will shutdown last, allowing the slaves
# time to shutdown first.
#
# "slave" means this system shuts down immediately when power goes critical.
#
MONITOR lupin1500AVR@localhost 1 monmaster ******* master
# Examples:
#
# MONITOR myups@bigserver 1 monmaster blah master
# MONITOR [hidden email] 1 upsmon secretpass slave

# --------------------------------------------------------------------------
# MINSUPPLIES <num>
#
# Give the number of power supplies that must be receiving power to keep
# this system running.  Most systems have one power supply, so you would
# put "1" in this field.
#
# Large/expensive server type systems usually have more, and can run with
# a few missing.  The HP NetServer LH4 can run with 2 out of 4, for example,
# so you'd set that to 2.  The idea is to keep the box running as long
# as possible, right?
#
# Obviously you have to put the redundant supplies on different UPS circuits
# for this to make sense!  See big-servers.txt in the docs subdirectory
# for more information and ideas on how to use this feature.

MINSUPPLIES 1

# --------------------------------------------------------------------------
# SHUTDOWNCMD "<command>"
#
# upsmon runs this command when the system needs to be brought down.
#
# This should work just about everywhere ... if it doesn't, well, change it.

SHUTDOWNCMD "/sbin/shutdown -h +0"

# --------------------------------------------------------------------------
# NOTIFYCMD <command>
#
# upsmon calls this to send messages when things happen
#
# This command is called with the full text of the message as one argument.
# The environment string NOTIFYTYPE will contain the type string of
# whatever caused this event to happen.
#
# Note that this is only called for NOTIFY events that have EXEC set with
# NOTIFYFLAG.  See NOTIFYFLAG below for more details.
#
# Making this some sort of shell script might not be a bad idea.  For more
# information and ideas, see pager.txt in the docs directory.
#
# Example:
NOTIFYCMD /usr/local/ups/bin/notifyme

# --------------------------------------------------------------------------
# POLLFREQ <n>
#
# Polling frequency for normal activities, measured in seconds.
#
# Adjust this to keep upsmon from flooding your network, but don't make
# it too high or it may miss certain short-lived power events.

POLLFREQ 5

# --------------------------------------------------------------------------
# POLLFREQALERT <n>
#
# Polling frequency in seconds while UPS on battery.
#
# You can make this number lower than POLLFREQ, which will make updates
# faster when any UPS is running on battery.  This is a good way to tune
# network load if you have a lot of these things running.  
#
# The default is 5 seconds for both this and POLLFREQ.

POLLFREQALERT 5

# --------------------------------------------------------------------------
# HOSTSYNC - How long upsmon will wait before giving up on another upsmon
#
# The master upsmon process uses this number when waiting for slaves to
# disconnect once it has set the forced shutdown (FSD) flag.  If they
# don't disconnect after this many seconds, it goes on without them.
#
# Similarly, upsmon slave processes wait up to this interval for the
# master upsmon to set FSD when a UPS they are monitoring goes critical -
# that is, on battery and low battery.  If the master doesn't do its job,
# the slaves will shut down anyway to avoid damage to the file systems.
#
# This "wait for FSD" is done to avoid races where the status changes
# to critical and back between polls by the master.

HOSTSYNC 15

# --------------------------------------------------------------------------
# DEADTIME - Interval to wait before declaring a stale ups "dead"
#
# upsmon requires a UPS to provide status information every few seconds
# (see POLLFREQ and POLLFREQALERT) to keep things updated.  If the status
# fetch fails, the UPS is marked stale.  If it stays stale for more than
# DEADTIME seconds, the UPS is marked dead.
#
# A dead UPS that was last known to be on battery is assumed to have gone
# to a low battery condition.  This may force a shutdown if it is providing
# a critical amount of power to your system.
#
# Note: DEADTIME should be a multiple of POLLFREQ and POLLFREQALERT.
# Otherwise you'll have "dead" UPSes simply because upsmon isn't polling
# them quickly enough.  Rule of thumb: take the larger of the two
# POLLFREQ values, and multiply by 3.

DEADTIME 15

# --------------------------------------------------------------------------
# POWERDOWNFLAG - Flag file for forcing UPS shutdown on the master system
#
# upsmon will create a file with this name in master mode when it's time
# to shut down the load.  You should check for this file's existence in
# your shutdown scripts and run 'upsdrvctl shutdown' if it exists.
#
# See the shutdown.txt file in the docs subdirectory for more information.

POWERDOWNFLAG /etc/killpower

# --------------------------------------------------------------------------
# NOTIFYMSG - change messages sent by upsmon when certain events occur
#
# You can change the stock messages to something else if you like.
#
# NOTIFYMSG <notify type> "message"
#
# NOTIFYMSG ONLINE "UPS %s is getting line power"
# NOTIFYMSG ONBATT "Someone pulled the plug on %s"
#
# Note that %s is replaced with the identifier of the UPS in question.
#
# Possible values for <notify type>:
#
# ONLINE   : UPS is back online
# ONBATT   : UPS is on battery
# LOWBATT  : UPS has a low battery (if also on battery, it's "critical")
# FSD      : UPS is being shutdown by the master (FSD = "Forced Shutdown")
# COMMOK   : Communications established with the UPS
# COMMBAD  : Communications lost to the UPS
# SHUTDOWN : The system is being shutdown
# REPLBATT : The UPS battery is bad and needs to be replaced
# NOCOMM   : A UPS is unavailable (can't be contacted for monitoring)

# --------------------------------------------------------------------------
# NOTIFYFLAG - change behavior of upsmon when NOTIFY events occur
#
# By default, upsmon sends walls (global messages to all logged in users)
# and writes to the syslog when things happen.  You can change this.
#
# NOTIFYFLAG <notify type> <flag>[+<flag>][+<flag>] ...
#
# NOTIFYFLAG ONLINE SYSLOG
# NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
#
# Possible values for the flags:
#
# SYSLOG - Write the message in the syslog
# WALL   - Write the message to all users on the system
# EXEC   - Execute NOTIFYCMD (see above) with the message
# IGNORE - Don't do anything
#
# If you use IGNORE, don't use any other flags on the same line.
NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC
NOTIFYFLAG FSD SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC
NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC

# --------------------------------------------------------------------------
# RBWARNTIME - replace battery warning time in seconds
#
# upsmon will normally warn you about a battery that needs to be replaced
# every 43200 seconds, which is 12 hours.  It does this by triggering a
# NOTIFY_REPLBATT which is then handled by the usual notify structure
# you've defined above.
#
# If this number is not to your liking, override it here.

RBWARNTIME 43200

# --------------------------------------------------------------------------
# NOCOMMWARNTIME - no communications warning time in seconds
#
# upsmon will let you know through the usual notify system if it can't
# talk to any of the UPS entries that are defined in this file.  It will
# trigger a NOTIFY_NOCOMM by default every 300 seconds unless you
# change the interval with this directive.

NOCOMMWARNTIME 300

# --------------------------------------------------------------------------
# FINALDELAY - last sleep interval before shutting down the system
#
# On a master, upsmon will wait this long after sending the NOTIFY_SHUTDOWN
# before executing your SHUTDOWNCMD.  If you need to do something in between
# those events, increase this number.  Remember, at this point your UPS is
# almost depleted, so don't make this too high.
#
# Alternatively, you can set this very low so you don't wait around when
# it's time to shut down.  Some UPSes don't give much warning for low
# battery and will require a value of 0 here for a safe shutdown.
#
# Note: If FINALDELAY on the slave is greater than HOSTSYNC on the master,
# the master will give up waiting for the slave to disconnect.

FINALDELAY 5
--
David Benfell, LCP
[hidden email]
---
Resume available at http://www.parts-unknown.org/

Reply | Threaded
Open this post in threaded view
|

partly resolved: Re: nut problems, was Re: Can't believe I'm asking this... What's a serial port on an OpenBSD system?

David Benfell-2
On Mon, 13 Feb 2006 10:10:57 -0800, David Benfell wrote:
>                                                                                
> So I tried running the driver in debug mode...
>
> <quote>
> cyberpower -a lupin1500AVR -u nutmon -DDDDD
                             ^^^^^^^^^
This appears to be key.  Apparently even adding a user directive to
ups.conf is insufficient.  Modifying rc.local to run upsdrvctl with
the -u option seems to resolve the problem.

I still see:

Feb 13 10:37:54 lupin ntpd[24521]: ntpd 4.1.74@1.998-r Wed Mar 24
05:29:33 MST 2004 (1)
Feb 13 10:37:54 lupin ntpd[24521]: precision = 1.000 usec
Feb 13 10:37:55 lupin ntpd[24521]: frequency initialized 371.616 PPM
from /etc/ntp.drift
Feb 13 10:37:57 lupin cyberpower[1459]: Startup successful
Feb 13 10:37:57 lupin upsd[1891]: Connected to UPS [lupin1500AVR]:
cyberpower-tty01
Feb 13 10:37:57 lupin upsd[17855]: Startup successful
Feb 13 10:37:57 lupin upsmon[5434]: Startup successful
Feb 13 10:37:57 lupin upsd[17855]: Connection from 127.0.0.1
Feb 13 10:37:57 lupin upsd[17855]: Client monmaster@127.0.0.1 logged
into UPS [lupin1500AVR]
Feb 13 10:37:57 lupin upsmon[31324]: Master privileges unavailable on
UPS [lupin1500AVR@localhost]
Feb 13 10:37:57 lupin upsmon[31324]: Reason: Access denied

This UPS is about 2 years old, but fairly substantial -- I can
generally go at least 1-1/2 hours on its battery.  I had the
impression it has fairly high-end capabilities.  Am I missing
something else that would cause "master privileges" to be
"unavailable?"

--
David Benfell, LCP
[hidden email]
---
Resume available at http://www.parts-unknown.org/

Reply | Threaded
Open this post in threaded view
|

Re: partly resolved: Re: nut problems, was Re: Can't believe I'm asking this... What's a serial port on an OpenBSD system?

Stuart Henderson
On 2006/02/13 10:47, David Benfell wrote:
> This UPS is about 2 years old, but fairly substantial -- I can
> generally go at least 1-1/2 hours on its battery.  I had the
> impression it has fairly high-end capabilities.  Am I missing
> something else that would cause "master privileges" to be
> "unavailable?"

seems like NUT permissions (it has it's own usernames/passwords
to e.g. allow monitoring a UPS without allowing shutdowns) rather
than anything on the UPS. carefully check configs/docs.

Reply | Threaded
Open this post in threaded view
|

Re: partly resolved: Re: nut problems, was Re: Can't believe I'm asking this... What's a serial port on an OpenBSD system?

David Benfell-2
On Mon, 13 Feb 2006 18:58:19 +0000, Stuart Henderson wrote:
>
> seems like NUT permissions (it has it's own usernames/passwords
> to e.g. allow monitoring a UPS without allowing shutdowns) rather
> than anything on the UPS. carefully check configs/docs.
>
Because the error comes from upsmon rather than upsd or the driver
itself?  Makes sense.

One thing I hadn't done was change the ownership on the serial port.
But by your logic, if this was a problem, the driver should have
complained.  It didn't, and changing the ownership made no difference
that I can see.

So I'm still looking.  This'll likely take a while.

Thanks!

--
David Benfell, LCP
[hidden email]
---
Resume available at http://www.parts-unknown.org/