Coder Social home page Coder Social logo

linux's Introduction

  • 👋 Hi, I’m @bms8197, an enthusiastic linux user currently working as a SysAdmin & DevOps.
  • 👀 I’m interested in Linux, technology, travelling and sexy chicks!
  • 🌱 I’m currently learning how to achieve financial freedom.
  • 💞️ I’m looking to collaborate on part-time and remote projects.
  • 📫 How to reach me? Just visit https://898.ro

linux's People

Contributors

bms8197 avatar

Watchers

 avatar

linux's Issues

Only exit code 0 for plugin check_cpu_temp

Hello bms8197,

Thanks and big up for the plugin.

An issue was encountered where the check exited with code 0 even if status was WARNING and CRITICAL (not checked UNKNOWN).

So, via command line the WARNING can be seen successfully but the exit code is still 0:

root@theflash /usr/lib/nagios/plugins # ./check_cpu_temp 
OK - CPU(s) temperature(s): 44°C 47°C; high=79.0; crit=89.0

root@theflash /usr/lib/nagios/plugins # ./check_cpu_temp -w 40 -c 70
WARNING - CPU(s) temperature(s): 44°C 47°C; high=40; crit=70

root@theflash (NEW) /usr/lib/nagios/plugins # echo $?
0

The issue is that one will not be alerted if the threshold is reached or exceeded. The check will always remain green and display OK.

Server Specs:

Virtualization Technology: Proxmox
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
CPU(s):              40
Vendor ID:           GenuineIntel
Model name:          Intel(R) Xeon(R) Silver 4114 CPU @ 2.20GHz

root@theflash /usr/lib/nagios/plugins # uname -a
Linux theflash 5.0.21-2-pve #1 SMP PVE 5.0.21-6 (Fri, 27 Sep 2019 17:17:02 +0200) x86_64 GNU/Linux

I have manually forced the exit code at STATUS check:

    # print statuses + output
    if status == OK:
        print("OK - " + output)
        exit(0)
    elif status == WARN:
        print("WARNING - " + output)
        exit(1)
    elif status == CRIT:
        print("CRITICAL - " + output)
        exit(2)

except Exception as e:
    print e
    status = UNK
    exit(3)
    raise

However, I dont think its clean code but it works. Can you check and possibly update the check with necessary the code?

Cheers,
Sarvesh.

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.