GithubHelp home page GithubHelp logo

alastria-monitoring's Introduction

alastria-monitoring's People

Contributors

nachodelavega avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

alastria-monitoring's Issues

Include exit codes with the script

Hello.

We are using this script from our monitoring stack. Normally, this kind of platforms expect an exit code to determine if the script has ended Ok (with exit status 0). It would be great if you could end the execution with and exit code in addition to the output text.

To show this, we have added the following code at the end of the script:

print result
if (result == "OK"):
    exit(0)
elif (result == "ERR_NET_NODE"):
    exit(1)
elif (result == "ERR_NET_STAT"):
    exit(2)
elif (result == "ERR_SYNC"):
    exit(3)

Best regards.

Script failing with ERR_NET_STAT: ERROR in getHighestBlock:string indices must be integers

Hello.

Some times, the script fails with the indicated error.

We have noticed that Eth Netstats could give a non integer value for Best Block field over websocket and it makes the script to enter the exception on getHighestBlock function. We have included another try block that seems to solve the problem:

try:
    if (res_json['action']=='block'):
        if (int(res_json['data']['block']['number']) > highestBlock):
            highestBlock = int(res_json['data']['block']['number'])
            idx += 1
except Exception:
    time.sleep(0.5)
    pass # We could receive non integer value

I'm not an experienced developer and I don't know if this code is the best way to achieve a solution, but I hope that this helps to show the problem.

Best regards.

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.