APC SmartUPS Status Device

These log statements are showing up at DEBUG level.

Here is the configuration of that specific UPS

Yours is coming out with duplicate lines for some reason. Mine is not with the same card. You would need to post full debug logs if you want me to figure out why. Or try to upgrade the fw in your card to latest.

I will start with firmware. Not sure how old the firmware on the 9631 is ...

Looks like 6.2.1 and 7.0.8 is available if I read APC website correctly ...

I added code to work around it.. still 4 lines come out you can comment them out if you want.

new version 3.9
v 3.9 in order to get all output some were repeatedly coming out more than once, there was no way around this so added variabled to not put out more than once.

  • also change messages that cannot be turned off to info instead of debug.
    */

this is what should come out every run

If that shows up in package manager, I will update.

I got my C7 for Christmas this year, so still have a lot to learn.
I used to use NUT on a Linux box to see the state of the UPSs in my house.

If you haven't looked at it, look at this link. It will help prevent some gotchas.

Will do, don't want to sidetrack the APC-UPS thread.

Thanks for the update. One big thing, is you are logging the password in plaintext when the preferences are saved. Probably shouldn't have that as the default behavior.

Suggested enhancement, use the device ID (2391 in your case above) with a modulo 10 to get the offset min to start your refreshes. That way if I have 3 UPSs (which I do) with 5 min refresh they won't all happen at the same time. Or something like that to prevent updates from happening in bunches. I tweaked my update rate to 5, 6, 7 to spread things out. But something automated based on a unique device attribute would be a good enhancement for multi-UPS situations.

1 Like

ya good idea.. to get around it on mine i have it run like every 15 20 and 25 minutes when not on battery so that they are not all coming out at once. for mine 1500 ups 5 minutes unless on battery is overkill so i dont set it that low... and on battery they last 3-5 hours so it does not need to poll that often when on power..

I actually picked 11, 13, 17 min for mine. Prime numbers should overlap less.

I can do you one better added an offset field to parameters so you can have all run at say x minutes but offset by so many minutes past the hour..

ie

new version on github

  • v 4.0 add minute offset for runtime, so with multiple device say you schedule every 15 minutes with offset 2, it will run at 2 past the hour then 17 past the hour etc
  • in this way you can have multiple ups's and have them run every x minutes but stagger them so they dont all run at the same time.

quite a few lines change so let me know if you see any issues especially when switching to on battery runtime and them back to normal, as I am not home where my ups are so cannot test the switch over.

I suppose i could force the ups on battery but dont want to risk mucking with that when i am not home.

I have one I can unplug to force battery. It is only running a switch an AP.

I just tweaked a preference, and I noticed that you are logging the password of the UPS login in the logs. You might want to remove that plain text security hole.

I believe it only comes out during debugging which is helpful at times. Debugging is not meant to be left on.

sorry researched it more and you were correct.. changed it to only come out with maximal debugging on.

new version:

  • v 4.1 only put out password if max debug level set.. otherwise less info

I hate to be a nit picker, because I like your driver. BUT... My UPS units all LOG info data on every invocation even though I have logging set to OFF.
I can see in the code the log.info statements are only supposed to happen if this is the initial iteration and the value is "Unknown". It seems like that test is failing for some reason.
I have attached an example of the log statements and the parameters for that particular UPS.
Anything else I can help with, just ask.

Thanks.


Turn.it to debug. Save post the logs then bacj off save again

The choices are "off", "minimum", "maximum" I will assume debug == maximum. I did one of three units. I will see what happens.

I believe I did what you asked. Toggled to maximum. Hit save preferences. Then toggled to off and hit save preferences. The iterative logging loop continues.
I did notice one thing. The "upsStatus" in the state variables is blank and the UPSStatus in the current state variables is populated. See the attachments
UPS5

i already commented previoiusly that is not debugging those 5 lines are info and come out every run.. in addition, no matter what you do the warning will come out as that is internal to the telnet library..