~ubuntu-branches/ubuntu/saucy/nut/saucy

« back to all changes in this revision

Viewing changes to docs/FAQ

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2005-07-20 19:48:50 UTC
  • mto: (16.1.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20050720194850-oo61wjr33rrx2mre
Tags: upstream-2.0.2
ImportĀ upstreamĀ versionĀ 2.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
Desc: Frequently Asked Questions
2
2
File: FAQ
3
 
Date: 9 March 2004
 
3
Date: 2 September 2004
4
4
Auth: Russell Kroll <rkroll@exploits.org>
5
5
 
6
6
-----------------------------------------------------------------------------
8
8
 Q: I just upgraded, and ...
9
9
 
10
10
 A: You have read UPGRADING in the base directory of the distribution,
11
 
    right?  If not, go read it now, then come back to this file.
 
11
    right?  If not, go read it now, then come back to this file if your
 
12
    question wasn't answered in there.
12
13
 
13
14
-----------------------------------------------------------------------------
14
15
 
15
16
 Q: upsstats says "Error: can't open template file (upsstats.html)".
16
17
    How do I fix this?
17
18
 
18
 
 A: Go into your CONFPATH and copy the sample template files over to
19
 
    their real names.
 
19
 A: Go into your configuration path (/usr/local/ups/etc by default) and
 
20
    copy the sample template files over to their real names.  The sample
 
21
    template files are installed with 'make install-cgi-conf' and can 
 
22
    also be found inside the source distribution in the conf directory. 
20
23
 
21
24
-----------------------------------------------------------------------------
22
25
 
26
29
 
27
30
-----------------------------------------------------------------------------
28
31
 
 
32
 Q: My 1.4 CGI programs won't talk to my 2.0 upsd.  What should I do?
 
33
 
 
34
 A: Upgrade the CGI programs to 2.0.  While 1.4 was intended as a 
 
35
    compatibility tree that used the new protocol by default, the CGI
 
36
    programs were not upgraded at the same time.  The 1.4 versions
 
37
    still use the old REQ protocol, and your 2.0 upsd expects GET.
 
38
 
 
39
-----------------------------------------------------------------------------
 
40
 
29
41
 Q: I just upgraded from 1.2 and upsmon now fails to start, saying
30
42
    "Fatal error: insufficient power configured!".  Why?
31
43
 
40
52
 
41
53
 Q: My UPS driver now says it's "broken", and won't start.  What now?
42
54
 
43
 
 A: Several drivers were purposely disabled during the 1.3 development
44
 
    process since they did not perform adequate checking on the status
45
 
    data from the hardware.  A few others were also disabled for other
46
 
    reasons.
47
 
 
48
 
    The driver needs to be fixed before it can be used reliably.  In
49
 
    many cases, a simple check of the incoming status data will suffice.
50
 
    One or two drivers may require a lot of work.
51
 
 
52
 
    This may also mean that a driver did not receive any attention
53
 
    from the original author during the 1.3 cycle.  In that case,
54
 
    consider adopting it and keep it running through future development
55
 
    changes.
56
 
 
57
 
    These drivers are being maintained in the tree in the hopes that the
58
 
    wider distribution of the stable 1.4 tree will encourage someone to
59
 
    fix them.  Those which are still broken will be removed before the
60
 
    release of 2.0.
61
 
 
62
 
    These drivers currently will not work as a result:
63
 
 
64
 
        bcmxcp, hp, microdowell, oneac, sec
65
 
 
66
 
-----------------------------------------------------------------------------
67
 
 
68
 
 Q: My favorite UPS driver disappeared after 0.45.5.  What happened?
69
 
 
70
 
 A: The actively maintained drivers were converted to use things like
71
 
    upsdrvctl and ups.conf between March 2001 and March 2002.  Your
72
 
    driver was probably removed because nobody converted it in all that
73
 
    time.
 
55
 Q: My favorite UPS driver disappeared after an upgrade.  What now?
 
56
 
 
57
 A: Drivers are occasionally removed from the tree if they are no longer
 
58
    receiving maintenance.  There have been several architectural
 
59
    changes to the driver code in recent times, and drivers which were
 
60
    not converted by someone are eventually dropped.
74
61
 
75
62
    This is called progress.  We do this in order to avoid a situation
76
63
    where someone believes that a driver is being maintained when it is
77
64
    actually rotting slowly in the tree.  It also keeps the tree free of
78
 
    old compatability hacks for code that nobody actually uses anyway.
 
65
    old compatibility hacks for code that nobody actually uses anyway.
79
66
 
80
67
    To get a driver back into current releases, you need to convert it
81
68
    yourself or get someone to do it for you.  This is not difficult.
82
69
    The hardest part of any driver is decoding the protocol, and that's
83
70
    already been done in the old version.
84
71
 
85
 
    The old code can be found in nut-0.45.5.tar.gz in the models
86
 
    directory.  If you can't find that online easily, try Google.
87
 
 
88
 
    These drivers were removed after 0.45.5 (released March 27, 2002) 
89
 
    and have not been fixed since then:
90
 
 
91
 
    aeg, bestfort, engetron, ipt-anzen, mustekups, optiups, toshiba1500
92
 
 
93
72
-----------------------------------------------------------------------------
94
73
 
95
 
 Q: I just upgraded and now it won't talk to any of my systems that are
96
 
    still running an older version before 0.50.0. 
 
74
 Q: I just upgraded and now I can't talk to older versions.
97
75
 
98
 
 A: Older versions of the software used port 3305, which was conflicting
99
 
    with an assignment for odette-ftp.  NUT now uses its official IANA  
100
 
    port number - 3493.  Until you get the other systems upgraded, put a
101
 
    :3305 on the host name to use the old port.
 
76
 A: Version 2.0 can't communicate with anything before 1.4 due to the
 
77
    protocol changes.  Version 1.4 can communicate with both 2.0 and
 
78
    most older versions since it was a transitional release and has
 
79
    compatibility code for both protocols.
102
80
 
103
81
-----------------------------------------------------------------------------
104
82
 
129
107
    drivers nor upsd ever need root powers, and that answer tells you
130
108
    how to make it work.
131
109
 
132
 
 A: You can also use -u <user> when calling upsdrvctl to make the drivers
133
 
    switch to another user.  This is usually much easier than recompiling.
 
110
 A: You can also specify a user with "user=" in the global part of
 
111
    ups.conf.  Just define it before any of your [sections]:
 
112
 
 
113
                user = nut
 
114
 
 
115
        [myups]
 
116
                driver = mge-shut
 
117
                port = /dev/ttyS0
134
118
 
135
119
-----------------------------------------------------------------------------
136
120
 
137
 
 Q: upsc, upsstats, and the other clients give me "access denied".  The
138
 
    serial port permissions are fine, so what gives?
 
121
 Q: upsc, upsstats, and the other clients say "access denied".  The
 
122
    serial port permissions are fine, so what gives? 
139
123
 
140
124
 A: In this case, "access denied" means the access to upsd, not the
141
125
    serial port.  You're being denied since the system has not been
142
126
    permission to speak to upsd according to the access controls.
143
127
 
144
 
    The fix is to edit the upsd.conf to allow those hosts to do what they
145
 
    need.  Clients like upsc, upsmon, and the CGI programs need "monitor"
146
 
    level access to work.  upsmon also needs a user defined in upsd.users.
147
 
 
148
 
    If you are getting this error from the programs that request a login
149
 
    name or password (upsrw, upscmd, upsset.cgi), then make sure your
150
 
    account is properly defined in upsd.users.
 
128
    The fix is to edit the upsd.conf to allow those hosts to do what
 
129
    they need.  Create ACL lines to match the hosts or networks, then
 
130
    use those ACL names on ACCEPT lines.
 
131
 
 
132
        ACL mybox 10.2.1.3/32
 
133
        ACCEPT mybox
 
134
 
 
135
    If upsmon is complaining, make sure you have defined a user for it
 
136
    in upsd.users.  This needs to be the same user name and password
 
137
    which is on the MONITOR line in upsmon.conf.
 
138
 
 
139
        [username]
 
140
                allowfrom = mybox
 
141
                password = mypass
 
142
                upsmon master           # or upsmon slave
 
143
 
 
144
    If the program asks for a username and password (upsrw, upscmd,
 
145
    upsset.cgi) and gives this error, then make sure your account is
 
146
    properly defined in upsd.users.
 
147
 
 
148
        [username]
 
149
                allowfrom = mybox
 
150
                password = mypass
151
151
 
152
152
    After editing the upsd config files, you can do 'upsd -c reload'
153
153
    or kill -HUP <pid of upsd> to make it reload the configuration
175
175
                port = /dev/whatever
176
176
                cable = 940-0095B
177
177
 
178
 
    This also applies for the newapc driver.
179
 
 
180
178
    All other grey cables from APC are assumed to be "dumb".
181
179
 
182
180
    If your grey cable isn't the 940-0095B, the solution is to dump that
189
187
 
190
188
    http://random.networkupstools.org/cables/940-0024C.jpg
191
189
 
192
 
    That should give you a workable clone of APC's 940-0024C cable.
 
190
    There is also a text version of that diagram in the docs/cables
 
191
    directory of the NUT source distribution.  Either one should allow
 
192
    you to build a good clone of APC's 940-0024C cable.
 
193
   
193
194
    There are simpler solutions involving 3 wires that work just fine
194
195
    too, but Powerchute won't find the loopback DTR-DCD and RTS-CTS and
195
196
    will be annoyed.  If you don't ever plan to use Powerchute, 3 wires
196
197
    (RxD, TxD, GND) are sufficient.
197
198
 
198
 
    It should also be noted that the genericups driver has no way to detect
199
 
    the UPS, so it will fire up quite happily if it can open the serial
200
 
    port.  Merely having it start up is not necessarily an indication
201
 
    of success.  You should start it and then check the status with upsc
202
 
    or similar to be sure that it's reading the hardware properly.
 
199
    It should also be noted that the genericups driver has no way to
 
200
    detect the UPS, so it will fire up quite happily if it can open the
 
201
    serial port.  Merely having it start up is not necessarily an
 
202
    indication of success.  You should start it and then check the
 
203
    status with upsc or similar to be sure that it's reading the
 
204
    hardware properly.
203
205
 
204
206
-----------------------------------------------------------------------------
205
207
 
206
 
 Q: Why isn't configure finding gd?
207
 
 
208
 
 A: The process of finding gd was recently replaced since it was failing
209
 
    in too many situations.  The new one allows you to specify all of
210
 
    the compiler flags that may be necessary to make it work.
211
 
 
212
 
    NOTE: gd 2.0.5 through 2.0.7 have a gdlib-config script that isn't
213
 
    usable.  If you upgrade to at least gd 2.0.8, configure will use
214
 
    it to find the right flags to make it compile and link properly.
 
208
 Q: Why does configure fail to find gd?
 
209
 
 
210
 A: Recent versions of gd should be detected automatically through the
 
211
    gdlib-config script.  Note that gd 2.0.5 through 2.0.7 have an
 
212
    unusable script, so upgrade to the newest version if you have one
 
213
    of those installed.
215
214
 
216
215
    If you're stuck with an older version of gd, you can use it if you
217
216
    specify the flags manually.  Look in gd's Makefile for "LIBS=", 
259
258
    This is also a good option to consider if you can't use networked
260
259
    monitoring code for security or safety reasons.
261
260
 
 
261
    See ideas.txt for more on this and other related topics.
 
262
 
262
263
-----------------------------------------------------------------------------
263
264
 
264
265
 Q: Why isn't upssched part of upsmon?
299
300
 
300
301
-----------------------------------------------------------------------------
301
302
 
302
 
 Q: Why won't bestfortress talk to my Best Fortress UPS?
303
 
 
304
303
 Q: Why won't bestups talk to my Best Fortress UPS?
305
304
 
306
305
 A: There are at least two different protocols being used for hardware
307
306
    with very similar names.  The bestups driver tends to support the
308
 
    units built around the newer "PhoenixTec" protocol.  The
309
 
    bestfortress driver handles the equipment that is much older.
 
307
    units built around the newer "PhoenixTec" protocol.  
310
308
 
311
 
    When in doubt, try both.
 
309
    Previous releases of this software included a driver called
 
310
    bestfortress which supported the older Best hardware.  See the
 
311
    earlier entries about updating old drivers which have been removed
 
312
    from the tree.
312
313
 
313
314
-----------------------------------------------------------------------------
314
315
 
332
333
    directly affects how long you run on battery without knowing
333
334
    what's going on with the UPS.
334
335
 
335
 
-----------------------------------------------------------------------------
336
 
 
337
 
 Q: Why do upsc (or any of the client programs) say "no such variable"
338
 
    when I try to run them?
339
 
 
340
 
 A: Usually this means that upsd has no data available for that UPS.
341
 
    Check your ups.conf and make sure that you have defined entries
342
 
    that make sense for the driver(s) that you are running.
 
336
    Note: some drivers occasionally need more time to update than the
 
337
    default value of MAXAGE (in upsd.conf) allows.  As a result, they 
 
338
    are temporarily marked stale even though everything is fine.  This
 
339
    can happen with MGE Ellipse equipment - see the mge-shut man page.
 
340
    In such cases, you can raise the value of MAXAGE to avoid these
 
341
    warnings; try a value like 25 or 30.
343
342
 
344
343
-----------------------------------------------------------------------------
345
344
 
353
352
    Check your syslog.  upsd will complain regularly if it can't
354
353
    connect to a driver, and it should say why it can't connect.
355
354
 
 
355
    Note: if you jumped in with both feet and didn't follow the INSTALL
 
356
    document, you probably started upsd by itself.  You have to run
 
357
    'upsdrvctl start' to start the drivers after configuring ups.conf.
 
358
 
356
359
-----------------------------------------------------------------------------
357
360
 
358
 
 Q: Everything works perfectly during the shutdown, but then my system
359
 
    never powers back on.  What happened?
 
361
 Q: Everything works perfectly during the shutdown, and the UPS comes 
 
362
    back on, but my system stays off.  What's happening?
360
363
 
361
364
 A: Assuming you don't have the problem in the next question, then you
362
365
    probably have an ATX motherboard, have APM or ACPI enabled in your
417
420
 
418
421
-----------------------------------------------------------------------------
419
422
 
420
 
 Q: My PowerMac G4 won't power back up by itself after the UPS shuts
421
 
    down.  What can I do about this?
 
423
 Q: My PowerMac G4 won't power back up by itself (into Linux) after the
 
424
    UPS shuts down.  What can I do about this?
422
425
 
423
426
 A: This is about the same situation as the ATX question above, only
424
427
    worse.  Earlier Macs apparently supported a hack where you could
442
445
    this affects one of my systems and my stop-gap solution is getting
443
446
    cranky.
444
447
 
445
 
    Note: this question has been in the FAQ for nearly a year and
 
448
    Note: this question has been in the FAQ for over a year and 
446
449
    there's still no answer.  Let me guess: everyone who runs a server
447
450
    on Mac hardware has a team of trained monkeys, and feeds them
448
451
    by growing bananas in the tropical environment formed by waste heat
452
455
    Mac OS to frob the "file server" panel is not an acceptable
453
456
    solution.
454
457
 
 
458
 A: If you're on OS X, this is relatively simple to fix.  Go to system
 
459
    preferences, click on energy saver, click on the options tab, check
 
460
    "Restart automatically after a power failure".
 
461
 
 
462
    If you're on some other OS, hope they've figured out how to duplicate
 
463
    the above in a non-simian manner.
 
464
 
455
465
-----------------------------------------------------------------------------
456
466
 
457
467
 Q: I want to keep the drivers and upsd in their own security domains.
493
503
    Note that /var/state/ups is group writable since upsd will
494
504
    place the upsd.pid file here.
495
505
 
496
 
    You may have to change the owner of upsd.conf and upsd.users to
497
 
    nutsrv if you haven't already.  Once the config files are ready,
498
 
    start upsd:
 
506
    You may have to change the groups of upsd.conf and upsd.users to
 
507
    make them readable.  These files should not be owned by nutsrv,
 
508
    since someone could compromise the daemon and change the config
 
509
    files.  Instead, put nutsrv in a group ("nut" in this example), then
 
510
    make the files owned by root.nut, with mode 0640.
 
511
 
 
512
    Once the config files are ready, start upsd:
499
513
 
500
514
    # /usr/local/ups/sbin/upsd -u nutsrv
501
515
 
515
529
    to that one user account.  Direct access to the serial device is
516
530
    not possible, since that is owned by another user.
517
531
 
518
 
    It also has the nice side effect that the drivers and upsd *never*
519
 
    have root permissions, even when started at boot-time.  Since they
520
 
    don't need it, there is no reason to let them have it, even 
521
 
    briefly. 
522
 
 
523
532
    There is also the possibility of running the drivers and upsd in a
524
533
    chroot jail.  See the chroot.txt provided in the source 
525
534
    distribution for an example implementation. 
573
582
 
574
583
 A: Those programs need to see a host in your hosts.conf before they
575
584
    will attempt communications.  This keeps people from feeding it
576
 
    random data to the programs and annoying others via your system.
 
585
    random "host=" settings, which would annoy others with outgoing
 
586
    connection attempts from your system.
577
587
 
578
588
    If your hosts.conf turns out to be configured correctly with 
579
589
    MONITOR entries and all that, check the permissions.  Your web
580
590
    server may be running the CGI programs as a user that can't read
581
591
    the file.
582
592
 
 
593
    If you run your web server in a chroot jail, make sure the programs
 
594
    can still read hosts.conf.  You may have to copy it into the jail
 
595
    for this to work.  If you do that, make sure it's not writable by
 
596
    any of the user accounts which run inside the jail.   
 
597
 
583
598
-----------------------------------------------------------------------------
584
599
 
585
600
 Q: upsd is running, so why can't I connect to it?
586
601
 
587
 
 A: Assuming you haven't changed the port on the command line or at
588
 
    compile-time, then you probably have some sort of firewall blocking
589
 
    the connection.
 
602
 A: Assuming you haven't changed the TCP port number on the command line
 
603
    or at compile-time, then you probably have some sort of firewall
 
604
    blocking the connection.
590
605
 
591
 
    When securing port 3493, remember that upsd runs both TCP and UDP
592
 
    listeners.
 
606
    upsd listens on TCP port 3493 by default.
593
607
 
594
608
-----------------------------------------------------------------------------
595
609
 
620
634
    series, should also have it available.
621
635
 
622
636
    First you need to point configure at your hiddev.h file.  If it
623
 
    happens to be in /usr/src/linux/include/linux/hiddev.h, then you
624
 
    don't need to do anything.  Otherwise, use --with-linux-hiddev=PATH
625
 
    and set it right.
 
637
    happens to be /usr/include/linux/include/linux/hiddev.h, then you
 
638
    don't need to do anything.  Otherwise, use --with-linux-hiddev
 
639
    and provide the full path to the right file.
626
640
 
627
641
    hidups is not built by default, so call configure with 
628
642
    "--with-drivers=hidups" or go into your drivers directory and do
738
752
    way to do this.
739
753
 
740
754
    Note: upsd.conf and upsd.users should not be writable by this user.
741
 
     
 
755
 
 
756
    Recent versions of the INSTALL document assume this throughout, so
 
757
    you may want to go back and reinstall using that as a reference.
 
758
 
742
759
    *** NEVER make upsd.conf or upsd.users world readable or writable.
743
760
 
744
761
    *** NEVER make upsd.conf or upsd.users accessible by "nobody".
760
777
 
761
778
    If your problem is STILL there, then contact the mailing lists.
762
779
 
 
780
    Hint: check the release date on the version you have.  If it's more
 
781
    than about 6 months old, there's probably a newer stable tree
 
782
    version out there.
 
783
 
763
784
-----------------------------------------------------------------------------
764
785
 
765
786
 Q: Do you have to use a serial connection to monitor the UPS?
799
820
 
800
821
 A: There's always work to be done outside of the realm of code bashing.
801
822
    Documentation might not always be so clear.  A user's perspective
802
 
    is sometimes needed to appreciate this.
 
823
    is sometimes needed to appreciate this.  Bug reports on a project's
 
824
    documentation are just as valuable as those for the actual source.
803
825
 
804
826
    Fielding questions on the mailing lists is also helpful.  This
805
827
    lets other people to focus on coding issues while allowing the
807
829
    quite a relief to open that mailbox and find that someone else
808
830
    has already handled it successfully.
809
831
 
810
 
    You might also visit the Walnut community project and lend a hand.
811
 
 
812
 
    http://walnut.tuxfamily.org/
813
 
 
814
832
-----------------------------------------------------------------------------
815
833
 
816
834
 Q: I replaced the battery in my APC Smart-UPS and now it thinks the 
884
902
 
885
903
-----------------------------------------------------------------------------
886
904
 
 
905
 Q: I found some information about another kind of UPS protocol you
 
906
    don't support yet, but I don't know what to do with it.  Can you
 
907
    help?
 
908
 
 
909
 A: If you're not a programmer, you can still help others by making
 
910
    that protocol available.  You might host the document somewhere and
 
911
    send the URL to one of the mailing lists.
 
912
 
 
913
-----------------------------------------------------------------------------
 
914
 
887
915
 Q: How can you answer questions to situations that nobody's encountered
888
916
    yet?  Isn't this a frequently asked questions file?
889
917