NUT UPS Plugin - unable to configure the ups

  • The config page for the NUT UPS plugin refuses to allow configuration.


    Steps to replicate -


    Install nut plugin
    Goto Services \ UPS
    Without editing the Identifier from default - ups - add a driver directive


    driver = apcsmart


    Hit save.


    Error Message -


    upsname: The value 'ups' doesn't match the pattern '^[a-z0-9_-]+$'.


    In what programming language do the letters u, p and s NOT match ^[a-z0-9_-]+$ regex?



    This cannot be anything other than a bug.

  • Had to completely erase and build again due to hardware issues. Got to exactly the same place, tried your settings and -


    "upsname: The value '1000xs' doesn't match the pattern '^[a-z0-9_-]+$'."


    I'm using the British English Keyboard and language.


    I'd still like someone to explain how 1000xs does not match ^[a-z0-9_-]+$' , does openmediavault use regexp definitions that are non standard or something?

  • It seems you have a similar problem as here

    OMV 3.0.100 (Gray style)

    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1) - Fractal Design Node 304 -

    3x WD80EMAZ Snapraid / MergerFS-pool via eSATA - 4-Bay ICYCube MB561U3S-4S with fan-mod

    • Offizieller Beitrag

    No matter what I type in there, it does not match that regex.

    In my case, I know of two settings that work in the identifier; the model, 1000xs , or ups. Leaving it set to ups is a safe choice.


    Maybe you don't have the right driver for your UPS. (There's more than one driver for an ACP smart UPS. As an example usbhid-ups will work for some models.)
    To find the appropriate driver or a substitute, for your model UPS, look -> here. Note (as it says on the page) if your exact model is not listed, try selecting something close.


    Once you find the right driver, or one you want to try, substitute it in, in the Driver Configuration Directives Box.
    driver = yourdriver
    port = auto


    ("port - auto" works for most USB connected UPS systems)
    Let us know how it went.


  • 1. Install OMV 4.1.3 - Language = British English
    2. Set static from console.
    3. Logged in to Web interface
    4. Installed OMV extras deb
    5. Installed nut 4.0.13-1
    6. Toggled enable switch
    7. Set a name
    8 Added config -


    [ups]
    driver = usbhid-ups
    port = auto
    vendorid = 051d
    productid = 0002


    9. Hit save.


    Result -


    upsname: The value 'ups' doesn't match the pattern '^[a-z0-9_-]+$'.
    Error #0:OMV\Json\SchemaValidationException: upsname: The value 'ups' doesn't match the pattern '^[a-z0-9_-]+$'. in /usr/share/php/openmediavault/json/schema.inc:478Stack trace:#0 /usr/share/php/openmediavault/json/schema.inc(370): OMV\Json\Schema->checkPattern('ups', Array, 'upsname')#1 /usr/share/php/openmediavault/json/schema.inc(297): OMV\Json\Schema->validateString('ups', Array, 'upsname')#2 /usr/share/php/openmediavault/json/schema.inc(624): OMV\Json\Schema->validateType('ups', Array, 'upsname')#3 /usr/share/php/openmediavault/json/schema.inc(395): OMV\Json\Schema->checkProperties(Object(stdClass), Array, '')#4 /usr/share/php/openmediavault/json/schema.inc(285): OMV\Json\Schema->validateObject(Object(stdClass), Array, '')#5 /usr/share/php/openmediavault/json/schema.inc(257): OMV\Json\Schema->validateType(Object(stdClass), Array, '')#6 /usr/share/php/openmediavault/rpc/paramsvalidator.inc(59): OMV\Json\Schema->validate(Object(stdClass))#7 /usr/share/php/openmediavault/rpc/serviceabstract.inc(178): OMV\Rpc\ParamsValidator->validate('{"enable":true,...')#8 /usr/share/openmediavault/engined/rpc/nut.inc(67): OMV\Rpc\ServiceAbstract->validateMethodParams(Array, 'rpc.nut.set')#9 [internal function]: OMVRpcServiceNetworkUPSTools->set(Array, Array)#10 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)#11 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('set', Array, Array)#12 /usr/sbin/omv-engined(536): OMV\Rpc\Rpc::call('Nut', 'set', Array, Array, 1)#13 {main}



    root@batserver:/# uname -a
    Linux batserver 4.14.0-0.bpo.3-amd64 #1 SMP Debian 4.14.13-1~bpo9+1 (2018-01-14) x86_64 GNU/Linux

    • Offizieller Beitrag

    No matter what I type in there, it does not match that regex.

    In my case, I know of two settings that work in the identifier; my UPS model, 1000xs , or ups. I believe both identifiers match the description of my UPS, provided by the UPS driver, on the command line. Leaving it set to ups is a safe choice.


    Maybe you don't have the right driver for your UPS. (Note, there's more than one driver for an APC Smart UPS. As an example usbhid-ups will work for some APC Smart UPS models.) To find the appropriate driver, or a substitute, for your model look -> here. Note (as it says on the page) if your exact model is not listed, try selecting something close.


    Once you find the right driver, or one you want to try, substitute the driver name in, in the Driver Configuration Directives Box.
    driver = yourdriver
    port = auto


    ("port - auto" works for most USB connected UPS systems)


    Let us know how it went.


  • So, just configured upsd manually, works perfectly -


    root@batserver:/etc/nut# upsc ups
    Init SSL without certificate database
    battery.charge: 100
    battery.charge.low: 10
    battery.charge.warning: 50
    battery.date: 2006/03/08
    battery.mfr.date: 2006/03/08
    battery.runtime: 2587
    battery.runtime.low: 120
    battery.temperature: 29.2
    battery.type: PbAc
    battery.voltage: 13.4
    battery.voltage.nominal: 12.0
    device.mfr: American Power Conversion
    device.model: Back-UPS CS 350
    device.serial: BB0611022945
    device.type: ups
    driver.name: usbhid-ups
    driver.parameter.pollfreq: 30
    driver.parameter.pollinterval: 2
    driver.parameter.port: auto
    driver.parameter.productid: 0002
    driver.parameter.synchronous: no
    driver.parameter.vendorid: 051d
    driver.version: 2.7.4
    driver.version.data: APC HID 0.96
    driver.version.internal: 0.41
    input.sensitivity: medium
    input.transfer.high: 256
    input.transfer.low: 196
    input.voltage: 240.0
    output.frequency: 50.0
    output.voltage: 230.0
    output.voltage.nominal: 230.0
    ups.beeper.status: enabled
    ups.delay.shutdown: 20
    ups.delay.start: 30
    ups.firmware: 807.q7.I
    ups.firmware.aux: q7
    ups.load: 3.0
    ups.mfr: American Power Conversion
    ups.mfr.date: 2006/03/08
    ups.model: Back-UPS CS 350
    ups.productid: 0002
    ups.realpower.nominal: 210
    ups.serial: BB0611022945
    ups.status: OL
    ups.test.result: No test initiated
    ups.timer.reboot: 0
    ups.timer.shutdown: -1
    ups.timer.start: 0
    ups.vendorid: 051d


    root@batserver:/etc/nut#cat /etc/nut/ups.conf


    [ups]
    driver = usbhid-ups
    port = auto
    vendorid = 051d
    productid = 0002


    root@batserver:/etc/nut#


    If I go back to your Web Config page -


    Error
    upsname: The value 'ups' doesn't match the pattern
    '^[a-z0-9_-]+$'.


    I think its broken.

  • It seems you have a similar problem as here

    Did you update all packages as proposed in the linked thread?

    OMV 3.0.100 (Gray style)

    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1) - Fractal Design Node 304 -

    3x WD80EMAZ Snapraid / MergerFS-pool via eSATA - 4-Bay ICYCube MB561U3S-4S with fan-mod

    • Offizieller Beitrag

    I've enhanced the error message in 4.1.19, so we will hopefully get some more information what happens here. See https://github.com/openmediava…b40ce69ca6533f26c9d0fe86a. If you have some coding experiences, then you can apply the changes manually and report the result immediatelly, otherwise you need to wait until the package is released. Because there are no important issues this might take some time.

  • Sorry for the delay - This patch gives me this in the error dialog -


    • Offizieller Beitrag

    Sorry for the delay - This patch gives me this in the error dialog -



    It seems you have not installed the latest version. The error string should look like.

    PHP
    %s: The value '%s' doesn't match the pattern '%s' (code=%d).

    The (code=X) is missing in your error report. Please make sure you've installed the latest version and re-post again, please.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!