GithubHelp home page GithubHelp logo

Improving sensor "apt" about pythonminiprobe HOT 7 CLOSED

prtg avatar prtg commented on June 27, 2024
Improving sensor "apt"

from pythonminiprobe.

Comments (7)

 avatar commented on June 27, 2024

Or even better change the locale for the runtime:

LC_ALL=C apt-get upgrade -s

http://unix.stackexchange.com/questions/87745/what-does-lc-all-c-do

from pythonminiprobe.

konstantinpae avatar konstantinpae commented on June 27, 2024

Hi,
sorry for the delayed reply, was on vacation. Thank you for the feedback on the sensor, I will implement the proposed changes in the next version.
To get the sensor running correctly for now, please open the file apt.py and change the line:

ret = os.popen("apt-get -s dist-upgrade | grep 'newly inst'")

to

if locale == "en_GB.UTF-8" or "'en_US.UTF-8'":
ret = os.popen("apt-get -s dist-upgrade | grep 'newly inst'")
elif locale == "de_DE.UTF-8":
ret = os.popen("apt-get -s dist-upgrade | grep 'neu inst'")
else:
raise Exception

This fix will go to the development branch soon. I'm planning to do this by checking the locale rather than changing it.

from pythonminiprobe.

 avatar commented on June 27, 2024

Hi Konstantin,

i hope you had a good time!

Thank you for the implementation of a solution.
This solution sure works for us because we are using german and english systems. But i think you should considering using "LC_ALL=C" so it will work for every localised system.

We are planning to add a new sensor for softwareraidchecks (mdadm) to a fork and send you a pull request in the next day. Hope you can have a look on it.

from pythonminiprobe.

konstantinpae avatar konstantinpae commented on June 27, 2024

Hey,
I'll give your proposal a try although I will have to get this tested first. If this works, you can expect a new development release within the next week. :)
Also looking forward to your Pull request.

from pythonminiprobe.

konstantinpae avatar konstantinpae commented on June 27, 2024

Proposed change is available in this branch. Could you check if this works for your, if ok I'm going to merge this to development.

from pythonminiprobe.

 avatar commented on June 27, 2024

Hi Konstantin,

we tested the changes (apt sensor and mdadm) from the dev_apt_sensor-branch and it works like a charm.

Thank you!

from pythonminiprobe.

konstantinpae avatar konstantinpae commented on June 27, 2024

Nice, I'm glad it's working now. So I'll close this issue for now.

from pythonminiprobe.

Related Issues (19)

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.