Giter VIP home page Giter VIP logo

Comments (11)

XMaarten avatar XMaarten commented on June 1, 2024 1

This error was easily fixed, see #6

from check_apcaccess.

stdevel avatar stdevel commented on June 1, 2024

Hi @bumblebee-tgl,
the script is a couple of years old, looks like it is not compatible with Python 3.

Which exact Python version are you using?

Python 2 is EOL but still shipped with some distributions so using python instead of python3 to run it might do the trick. But anyhow, the script should be updated to be compatible with Python 3.. :)

from check_apcaccess.

bumblebee-tgl avatar bumblebee-tgl commented on June 1, 2024

Hello,
thanks for reply :-)

My Python is
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

Is it possible to make ready to python 3? :-)
I Use it on a rpi2 already.
I need it to save my Tank of fishes.

:-)

from check_apcaccess.

stdevel avatar stdevel commented on June 1, 2024

Thanks for the details! Could you please send me the output of the apcaccess utility on the system you're trying to run the plugin on? I don't have an APC UPS anymore and need to test it.

from check_apcaccess.

stdevel avatar stdevel commented on June 1, 2024

I did some refactoring for Python 3 - it might already work for you: https://raw.githubusercontent.com/stdevel/check_apcaccess/4-feat-python3/check_apcaccess.py

But anyhow I'd still be interested in your apcaccess output in order to do further testing.

from check_apcaccess.

bumblebee-tgl avatar bumblebee-tgl commented on June 1, 2024

hi stdevel,

at first thank you for feedback and work :-)

Here my outout from apcaccess:

APC : 001,036,0866
DATE : 2021-03-06 10:37:28 +0100
HOSTNAME : aqua
VERSION : 3.14.14 (31 May 2016) debian
UPSNAME : UPS_Aqua
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2021-02-19 06:21:03 +0100
MODEL : Back-UPS XS 700U
STATUS : ONLINE
LINEV : 234.0 Volts
LOADPCT : 16.0 Percent
BCHARGE : 100.0 Percent
TIMELEFT : 33.7 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME : 0 Seconds
SENSE : Medium
LOTRANS : 140.0 Volts
HITRANS : 300.0 Volts
ALARMDEL : 30 Seconds
BATTV : 13.6 Volts
LASTXFER : No transfers since turnon
NUMXFERS : 0
TONBATT : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : NO
STATFLAG : 0x05000008
SERIALNO : 3B1917X72244
BATTDATE : 2019-04-27
NOMINV : 230 Volts
NOMBATTV : 12.0 Volts
NOMPOWER : 390 Watts
FIRMWARE : 924.Z3 .I USB FW:Z3
END APC : 2021-03-06 10:38:03 +0100

I test the new version of your Work right now ;-)

from check_apcaccess.

bumblebee-tgl avatar bumblebee-tgl commented on June 1, 2024

I´ve testet with the newer Version, but I received Error too. :-(
Did i do somthing wrong?

Here my output of the last 5 Minutes:

[root@aqua plugins]# ./check_apcaccess.py -t 20 -T 10 -u 100 -U 150
Traceback (most recent call last):
File "./check_apcaccess.py", line 455, in
cli()
File "./check_apcaccess.py", line 451, in cli
check_ups(options)
File "./check_apcaccess.py", line 127, in check_ups
temp = get_value("ITEMP", True)
File "./check_apcaccess.py", line 101, in get_value
temp = re.findall(r"\d+", UPS_INFO[key])
KeyError: 'ITEMP'

[root@aqua plugins]# python3 ./check_apcaccess.py -t 20 -T 10 -u 100 -U 150
python3 python3.7 python3.7m python3m
[root@aqua plugins]# python3 ./check_apcaccess.py -t 20 -T 10 -u 100 -U 150
Traceback (most recent call last):
File "./check_apcaccess.py", line 455, in
cli()
File "./check_apcaccess.py", line 450, in cli
get_apcaccess_data(options)
File "./check_apcaccess.py", line 266, in get_apcaccess_data
key = line[: line.find(":")].strip()
TypeError: argument should be integer or bytes-like object, not 'str'

[root@aqua plugins]# python3.7 ./check_apcaccess.py -t 20 -T 10 -u 100 -U 150
Traceback (most recent call last):
File "./check_apcaccess.py", line 455, in
cli()
File "./check_apcaccess.py", line 450, in cli
get_apcaccess_data(options)
File "./check_apcaccess.py", line 266, in get_apcaccess_data
key = line[: line.find(":")].strip()
TypeError: argument should be integer or bytes-like object, not 'str'

[root@aqua plugins]#

from check_apcaccess.

stdevel avatar stdevel commented on June 1, 2024

Thanks for sharing - will have a look at it. This code is total mess. I think I need to rewrite it..

from check_apcaccess.

bumblebee-tgl avatar bumblebee-tgl commented on June 1, 2024

Coool, thanks a lot for this :)

from check_apcaccess.

stdevel avatar stdevel commented on June 1, 2024

Thanks a lot for your contribution, @XMaarten! 🥳

Does this also work for you, @bumblebee-tgl?

from check_apcaccess.

bumblebee-tgl avatar bumblebee-tgl commented on June 1, 2024

Hi,

my Problem is solved - yes.

Thank You for Help! :)

from check_apcaccess.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.