Git Product home page Git Product logo

librtinfo's Introduction

librtinfo

This is a small library (less than 1000 lines of C code) able to build easy-to-use data structures containing system information

Monitoring

This library can monitor (only Linux is really supported):

  • Basic overall cpu usage
  • Basic overall memory (ram and swap) usage
  • Battery status if any
  • Disks usage (bytes read/written, read/write rate)
  • System load average
  • Network usage (interface, state, speed, current rate, address, ...)
  • HDD and CPU tempeature
  • Current system time and uptime

Dependencies

There is no dependencies except default linux headers

How to use it

First of all, please check example/librtinfo-test.c which shows you how to use library internals.

Data representation

All data structures are formatted like: rtinfo_{type}_t (eg: rtinfo_memory_t) Here is a basic list of available structures:

- rtinfo_cpu_t
    rtinfo_cpu_dev_t
    rtinfo_cpu_time_t
- rtinfo_disk_t
    rtinfo_disk_dev_t
    rtinfo_disk_sectors_t
- rtinfo_memory_t
- rtinfo_loadagv_t
- rtinfo_battery_t
    info_battery_status_t
- rtinfo_network_t
    rtinfo_network_if_t
    rtinfo_network_byte_t
- rtinfo_uptime_t
- rtinfo_temp_cpu_t
- rtinfo_temp_hdd_t

Functions representation

Functions to manage structures are formatted like: rtinfo_{action}_{type} (eg: rtinfo_get_memory)

Some functions (like cpu, network and disks) require initialization: rtinfo_init_{type} (eg: rtinfo_init_cpu)

Arguments

Init functions need an integer as argument and return a pointer to a valid structure. Getter functions need an pointer to the data structure to use. mk functions need some different arguments, please read rtinfo.h for more information.

Compilation

Just compile your code using -lrtinfo

Bugs

Feel free to sumbit any pull requests to improve this project

Contributors

Thanks to: @nado, @bendardenne, @wget, @zaibon

librtinfo's People

Contributors

maxux avatar nado avatar

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.