Menu

#220 nutups test cannot turn off runtime test

open-accepted
nobody
5
2006-02-20
2006-02-20
Derek
No

In the nutups test and monitoring, the nut ups drivers
I use are for the belkin series of UPS's. These
drivers do NOT support the runtime value. This lack of
support is common in the Nut drivers according to the
nut documentation.

So for the belkin ups's they return 0 for the runtime
value and always cause a critical failure condition to
exist. I tried to use parameters for the values:
runtimefail
runtimewarn

but passing in 0 for these values still cause the
critical failure condition. I looked at the code in
etc/testdef/nut.cfg and saw it would always fail, so I
removed lines 185-190, so now it always is green
nomatter what the runtime values registers.

There should be some way in a parameter to turn off
this and other sub tests, particularly since the system
that is reporting the values doesn't support that
particular value.

if you need more information please email me.

Discussion

  • Thomas Aeby

    Thomas Aeby - 2006-02-20
    • status: open --> open-wont-fix
     
  • Thomas Aeby

    Thomas Aeby - 2006-02-20

    Logged In: YES
    user_id=77961

    Well, on the first spot I'd tell that if your UPS (or the
    driver, does not really matter) always reports 0 for the
    runtime and you do not want this to cause an error, then why
    don't you just set runtimefail and runtimewarn to -1? That
    may sound weird at the first glance, but quite logic at the
    2nd. The runtime* semantics are: report (warn|fail) when the
    runtime is at or below the specified level. So if you don't
    want a warning/failure to be triggered at zero runtime just
    set the trigger levels to something below zero.

    (apart from that negative values for runtime* completely
    disable the test since we made the assumption that there
    aren't any negative runtimes ...)

    Therefore I consider this not a bug unless you tell me that
    I'm completely wrong with my "set it to -1" approach.
    However, this was an interesting bug report, anyway! Thanks
    a lot.

    Best regards,
    Tom

     
  • Derek

    Derek - 2006-02-20

    Logged In: YES
    user_id=1446366

    Tom,

    With this line in uxmon-net:
    localhost runtimefail=-1 runtimewarn=-1 status="OL
    CHRG" nutups

    using the original nut.cfg this still causes the critical
    failure.

    So, I would guess either -1 isn't valid, or these values
    aren't being read by the perl in nut.cfg, in either case
    please reopen this so it may get fixed.

    If there is anything else you want me to try I am happy to
    do that, you can email me directly if you want.

    Thanks,

    Derek

     
  • Thomas Aeby

    Thomas Aeby - 2006-02-20

    Logged In: YES
    user_id=77961

    Derek,

    you are right, arghl! The runtimefail and runtimewarn
    functionality is implemented but the arguments are never
    imported from the uxmon-net config file. So, the effective
    levels are always the default ones. Could you please try if
    adding "import runtimewarn; import runtimefail;" in nut.cfg
    at around line 77 does make "-1" work?

    Thanks a lot for your help,
    Tom

    P.S.: I haven't yet closed this report :-)

     
  • Thomas Aeby

    Thomas Aeby - 2006-02-20
    • status: open-wont-fix --> open-accepted
     
  • Derek

    Derek - 2008-01-28

    Logged In: YES
    user_id=1446366
    Originator: YES

    In the current nut.cfg it has on line 77:
    instance import loadfail;
    and on line 78:
    instance import loadwarn;

    I even tried to reset the defaults in nut.cfg to 0 for runtimewarn and runtimefail. I think the documantation is wrong for these values as well as it says these are percent, but the defaults are not percent values.

    The only work-around I was able to find was to comment out lines 186-191, so runtime always returns green,
    185 report for thismonitor {
    186 # status red in_range( 0, ${runtimefail}, ${ups.runtime[${p}]}, ${ups.runtime[${p}]} )
    187 # "&red" " " ${ups.name[${p}]} " runtime CRITICAL";
    188 # status yellow in_range( 0, ${runtimewarn}, ${ups.runtime[${p}]}, ${ups.runtime[${p}]} )
    189 # "&yellow" " " ${ups.name[${p}]} " runtime LOW";
    190 # status purple null( ${ups.runtime[${p}]} )
    191 # "&purple " ${ups.name[${p}]} " no info available";
    192 status green 1
    193 "&green" " " ${ups.name[${p}]} " runtime OK";

    If there is more I can try, happy to see what will make this work with the correct values.

    I also noticed one other "bug" seems to be any syntax issue on the line in uxmon-asroot for nutups is silently ignored and the test simply never happens. So in some of my trials with syntax, I wouldn't see the ups ever retested, which told me the syntax was bad. Let me know if I should post this as another bug. It is pretty annoying that it just doesn't do the test, while other syntax is flagged like the old test syntax's.

    Thanks,

    Derek

     

Log in to post a comment.