Coder Social home page Coder Social logo

Comments (3)

chriscareycode avatar chriscareycode commented on July 21, 2024

I like this idea of having the API only return items not in OK status to help the product scale and decrease the CPU on the server.

For Nagios CGIs it looks like we can do this adding this hostservice and servicestatus parameter to the API calls:

Hosts
http://10.10.0.42/nagios/cgi-bin/statusjson.cgi?query=hostlist&details=true&hoststatus=down+unreachable+pending

Services
http://10.10.0.42/nagios/cgi-bin/statusjson.cgi?query=servicelist&details=true&servicestatus=warning+critical+unknown+pending

For Livestatus we can do this with:

GET hosts
Filter: state = 1
Filter: state = 2
Or: 2

GET services
Filter: state = 1
Filter: state = 2
Filter: state = 3
Or: 3

After making this change, payloads are way smaller and this will make a huge improvement on the server CPU and the web browser. But now that we are only fetching things that are not UP and not OK, I need to fetch a new lightweight API "hostcount" and "servicecount" to get the "total # of hosts" and "total # of services" since we no longer have that information from the hoststatus and servicestatus apis.

Got through most of the work for this. I can share a dev build with you to try out.

from nagiostv-react.

chriscareycode avatar chriscareycode commented on July 21, 2024

This has been added in https://github.com/chriscareycode/nagiostv-react/releases/tag/v0.8.7

from nagiostv-react.

chriscareycode avatar chriscareycode commented on July 21, 2024

@bjhiggins Please test out 0.8.7, see how it works and report back

from nagiostv-react.

Related Issues (20)

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.