Koozali.org: home of the SME Server

Nut and APC Smart-UPS 1000i

Offline nigeltodd

  • ****
  • 82
  • +0/-0
    • http://nigelt.dyndns.org
Nut and APC Smart-UPS 1000i
« on: September 16, 2008, 06:39:53 AM »
Having managed to stuff my config up, I have since found a multitude of conflicting posts as to how to repair it. Does anyone have any idea how to reset nut to defaults (or uninstall/reinstall it) and then configure it for the smart ups connected via serial cable.

There are differing posts about Model, Type, device etc, which only confuse the issue further for me.

Any thoughts?

Thanks in advance

Nigel Todd
smoke-free since June 24th, 2004............

Offline pfloor

  • *****
  • 889
  • +1/-0
Re: Nut and APC Smart-UPS 1000i
« Reply #1 on: September 16, 2008, 07:26:09 AM »
It would help if you told us what cable came with the ups (eg. 940-0095A).  The cable number can usually be found on the serial connector.

What serial port is it connected to? (eg ttyS0, ttyS12, etc)

Also, tell us your current nut configuration by showing the output of:

config show nut
In life, you must either "Push, Pull or Get out of the way!"

Offline nigeltodd

  • ****
  • 82
  • +0/-0
    • http://nigelt.dyndns.org
Re: Nut and APC Smart-UPS 1000i
« Reply #2 on: September 16, 2008, 07:38:52 AM »
[root@gateway ~]# config show nut
nut=service
    Cable=940-0024C
    Device=/dev/ttyS0
    MasterPass=887638619708926
    Model=apcsmart
    SlavePass=979090968004555
    status=enabled
[root@gateway ~]#

I need to double check cable and port when i get home - I have tried both ttyS0 & ttyS1 - permissions are crw_cr____ for both, owne ris root, grpoup is uucp.

hope this helps

Nigel
smoke-free since June 24th, 2004............

Offline pfloor

  • *****
  • 889
  • +1/-0
Re: Nut and APC Smart-UPS 1000i
« Reply #3 on: September 16, 2008, 08:19:56 AM »
Cable is not a valid db setting. It won't do anything and the apcsmart driver expects that cable by default anyway. You can remove it if you want but it doesn't matter,

config delprop nut Cable

The rest of the configuration looks correct for that type of UPS/cable combination.

Are you sure your comm port(s) are enabled in your server's bios settings?

Did you?:

expand-template /etc/sysconfig/ups
expand-template /etc/ups/*
/etc/rc7.d/S38nut stop
*wait 5 seconds*
/etc/rc7.d/S38nut start

That sometimes doesn't always do the trick and you need to reboot so to be on the safe side you should:

signal-event post-upgrade
signal-event reboot

There are differing posts about Model, Type, device etc, which only confuse the issue further for me.

Did you look in the documentation?

http://wiki.contribs.org/Uninterruptable_Power_Supply

and more specifically for APC devices using a serial connections:

http://wiki.contribs.org/APC_Serial_UPS

The second link also provides information about setting your serial port up as a symlink, read it carefully as it is a bit confusing at first glance.
In life, you must either "Push, Pull or Get out of the way!"

Offline nigeltodd

  • ****
  • 82
  • +0/-0
    • http://nigelt.dyndns.org
Re: Nut and APC Smart-UPS 1000i
« Reply #4 on: September 16, 2008, 09:41:19 AM »
All fixed now I think!!

Once I inspected the cable, I discovered it was no longer connected to the UPS!! restarted S38nut - all ok - although I do ghet a battery low message when I start S38nut
 This is output from upsc UPS@localhost

login as: root
root@gateway's password:
Last login: Tue Sep 16 17:28:51 2008
[root@gateway ~]# upsc UPS@localhost
battery.alarm.threshold: 0
battery.charge: 100.0
battery.charge.restart: 00
battery.date: 05/09/05
battery.packs: 000
battery.runtime: 0
battery.runtime.low: 120
battery.voltage: 27.54
battery.voltage.nominal: 024
driver.name: apcsmart
driver.parameter.cable: 940-0024C
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ttyS0
driver.version: 2.2.0-
driver.version.internal: 1.99.8
input.frequency: 50.00
input.quality: FF
input.sensitivity: H
input.transfer.high: 253
input.transfer.low: 208
input.transfer.reason: O
input.voltage: 253.4
input.voltage.maximum: 253.4
input.voltage.minimum: 252.0
output.voltage: 224.6
output.voltage.nominal: 230
ups.delay.shutdown: 090
ups.delay.start: 000
ups.firmware: 631.3.I
ups.id: UPS_IDEN
ups.load: 040.9
ups.mfr: APC
ups.mfr.date: 05/09/05
ups.model: Smart-UPS 1000 XL
ups.serial: AS0520120884(
ups.status: TRIM OL LB
ups.temperature: 022.9
ups.test.interval: 1209600
ups.test.result: NO
[root@gateway ~]#

Will see how it stands up in next few days, and will force a power outage for testing.

Nigel
smoke-free since June 24th, 2004............

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Nut and APC Smart-UPS 1000i
« Reply #5 on: September 16, 2008, 03:49:48 PM »
Does anyone have any idea how to reset nut to defaults

config delete nut
signal-event post-upgrade
signal-event reboot

Note that 'default' for nut is configured for USB connection, but disabled.

Offline nigeltodd

  • ****
  • 82
  • +0/-0
    • http://nigelt.dyndns.org
Re: Nut and APC Smart-UPS 1000i
« Reply #6 on: September 23, 2008, 09:11:19 AM »
OK- once more .....
I have deleted the nut from the config as  per CharlieBrady's instruction - but how do i get it back now?

smoke-free since June 24th, 2004............

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Nut and APC Smart-UPS 1000i
« Reply #7 on: September 23, 2008, 12:52:59 PM »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline nigeltodd

  • ****
  • 82
  • +0/-0
    • http://nigelt.dyndns.org
Re: Nut and APC Smart-UPS 1000i
« Reply #8 on: September 24, 2008, 09:04:49 AM »
Thanks Mary,

However I should have added the following :

When I do the following:
{
[root@gateway ~]# config show nut
[root@gateway ~]# config setprop nut Device /dev/ttyS0
[root@gateway ~]# config setprop nut Model apcsmart
[root@gateway ~]# config setprop nut status enabled
[root@gateway ~]# config show nut
[root@gateway ~]#
}
I get no output from the show command. Somehow the nut config is not being saved.

I have been trhought the expand-template commands, and started the servuce - which fails with a "Driver Error 1".

then -
  signal-event post-upgrade
  signal-event reboot
makes no difference either

This all occurred after i did the "config delete nut" command.

What i suspect I need to do is to re-install  nut, and then perform the configuration, hence the 'how do I get it back' question.
I have searched through yum and rpm, but have not been able to find any way to remove and/or update it for sme.

Hopefully someone will have an answer?

Thanks,

Nigel
« Last Edit: September 24, 2008, 09:25:31 AM by nigeltodd »
smoke-free since June 24th, 2004............

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Nut and APC Smart-UPS 1000i
« Reply #9 on: September 24, 2008, 09:52:49 AM »
nigeltodd

As you have previously deleted the service then first do
config set nut service
then
config setprop nut Device /dev/ttyS0
config setprop nut Model apcsmart
config setprop nut status enabled
config show nut
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline nigeltodd

  • ****
  • 82
  • +0/-0
    • http://nigelt.dyndns.org
Re: Nut and APC Smart-UPS 1000i
« Reply #10 on: September 24, 2008, 11:17:07 AM »
Thanks again Mary,

The set nut service has rebirthed the nut entries ok now.

Now when I go through the expand-templates I get the following:

[root@gateway ups]# config show nut
nut=service
    Device=/dev/ttyS0
    Model=apcsmart
    status=enabled

[root@gateway ups]# expand-template /etc/sysconfig/ups

[root@gateway ups]# expand-template /etc/ups/ups*
WARNING in /etc/e-smith/templates-custom//etc/ups/ups.conf/UPS: Use of uninitialized value in concatenation (.) or string at /etc/e-smith/templates-custom//etc/ups/ups.conf/UPS line 10.
WARNING: Template processing succeeded for //etc/ups/ups.conf: 1 fragment generated warnings
 at /sbin/e-smith/expand-template line 45

[root@gateway ups]# /etc/rc7.d/S38nut start
Starting UPS driver controller: Unable to detect an APC Smart protocol UPS on port /dev/ttyS0
Check the cabling, port name or model name and try again
Network UPS Tools (version 2.2.0-) - APC Smart protocol driver
        Driver version 1.99.8, command table version 2.0
Network UPS Tools - UPS driver controller 2.2.0-
Driver failed to start (exit status=1)
                                                           [FAILED]
Starting upsd:                                             [  OK  ]
Starting UPS monitor (master): Network UPS Tools upsmon 2.2.0-
Unable to use old-style MONITOR line without a username
Convert it and add a username to upsd.users - see the documentation
Fatal error: unusable configuration
                                                           [FAILED]
[root@gateway ups]#

Getting closer at least!

Any thoughts? the HowTo's etc don't cover these situations alas!
I have also seen a message regarding the worng version of mONITOR Suggests upgrading it) and no user found in ups.users.

Should I add the previous entries as shown above?

Nigel

smoke-free since June 24th, 2004............

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Nut and APC Smart-UPS 1000i
« Reply #11 on: September 24, 2008, 11:39:08 AM »
nigeltodd

Sorry the
config set nut service
command is not enough to fix your issues.

It looks like you have a custom template that is creating problems. Delete it.

rm /etc/e-smith/templates-custom/etc/ups/ups.conf

Then please as Charlie has advised do
config delete nut
signal-event post-upgrade
signal-event reboot

Don't just do expanding of templates as you have obviously been playing with your system and a post-upgrade is needed.
Default values should be reinstated after this, so again issue your setprop commands

config setprop nut Device /dev/ttyS0
config setprop nut Model apcsmart
config setprop nut status enabled

and to avoid further problems do
signal-event post-upgrade
signal-event reboot
« Last Edit: September 24, 2008, 11:56:06 AM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.