Coder Social home page Coder Social logo

Comments (13)

Griesbacher avatar Griesbacher commented on August 22, 2024 1

I've made a release which should satisfy this issue. The panels in the default template are using difference, when the unit is c:
counter

There's just one thing, which is not so pretty, due to the 'c' in the perflables you've got no unit in the graph... but if you write your own template, e.g. for the time check you could set your unit hardcoded to seconds. Then you would see that my check interval is not just 60 but 60s.

from histou.

dpeer77 avatar dpeer77 commented on August 22, 2024 1

Thank you very much! You are super :-)

from histou.

Griesbacher avatar Griesbacher commented on August 22, 2024

Hi David,
I'm not sure if I got your question, but if you want to add the units which were returned by the check, it's implemented. There is a lookup table which converts conmen units to supported "grafana units".
Here is an example: https://demo.thruk.org/thruk/cgi-bin/extinfo.cgi?type=2&host=icinga2&service=disk%20%2F&backend=cacb0 - admin/admin
Check_disk returns Megabytes and they are converted to Gigabytes.
Is it what're looking for?

Greets,
Philip

from histou.

dpeer77 avatar dpeer77 commented on August 22, 2024

Hi Philip,

Sorry for the late response, was out for few days.

Regarding your reply, I was referring to counters that are always incremented, nagios pref data API mark it as "c" for the measurement unit. Now PNP does it well, plotting only the delta from the last measurement and I just wonder if grafana or histou can do similar....

Thanks,
David

from histou.

Griesbacher avatar Griesbacher commented on August 22, 2024

Ahh OK, it is not implemented at the moment but it sounds good, seems I've missed that one.
Do you have a check, which I can run without special hard/software on a Linuxserver to generate such Perfdata?

from histou.

dpeer77 avatar dpeer77 commented on August 22, 2024

I have a plugin that I still working on, that check docker containers stats via remote TCP API... not ready yet but the block IOps are counters that always increase.

But here is a quick and "dirty" example of interface network packets traffic that does what you need:

check_traffic:

#!/bin/sh

INT=$2

NET_RAW=`netstat -i | grep ^$INT`
if [ -z "$NET_RAW" ]; then
    echo "Could not find $INT Interface"
    exit 2
fi

NET_IN=`echo "$NET_RAW" | awk '{print $4}'`
NET_OUT=`echo "$NET_RAW" | awk '{print $8}'`

echo "OK - network traffic is, IN: $NET_IN OUT: $NET_OUT | ${INT}_IN=${NET_IN}c;; ${INT}_OUT=${NET_OUT}c;;"
exit 0

to run it, ./check_traffic -i eth0

Example output:
OK - network traffic is, IN: 4965649 OUT: 5456768 | eth0_IN=4965649c;; eth0_OUT=5456768c;;

Many thanks,
David

from histou.

sni avatar sni commented on August 22, 2024

Or just use:

echo "TIME OK - $(date)|seconds=$(date +%s)c;;;;"

This should roughly result in a graph showing seconds at a 1 second per second interval :-)

from histou.

Griesbacher avatar Griesbacher commented on August 22, 2024

That would be too easy :-D

I'll have a look at it, how to implement it best, because it breaks with the current handling of units.

from histou.

dpeer77 avatar dpeer77 commented on August 22, 2024

Yeh :-) what ever works for you.

Thanks again,
David

from histou.

sni avatar sni commented on August 22, 2024

If influxdb has a rate() function, then you could just add a exception for the unit "c" and use a rate function in the default template.
Maybe derivative() like in influxdata/influxdb#4081 does the trick already.

from histou.

Griesbacher avatar Griesbacher commented on August 22, 2024

Yes I was thinking about that too, but that requires that the query is dependent on the unit, which is current not implemented.

The result will be something like this, for the time check:
unbenannt
(At the beginning, I was impatient)

from histou.

sni avatar sni commented on August 22, 2024

looks good :-)

from histou.

Griesbacher avatar Griesbacher commented on August 22, 2024

Your welcome!

from histou.

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.