Code Monkey home page Code Monkey logo

Comments (4)

sni avatar sni commented on May 30, 2024

In your case MAX would be the right choice i guess. According to
https://www.monitoring-plugins.org/doc/guidelines.html#AEN201
the syntax is 'label'=value[UOM];[warn];[crit];[min];[max].
There is no such thing as total_size.

from grafana-pnp-datasource.

Stex1980 avatar Stex1980 commented on May 30, 2024

Thanks for the response.
I try to use MIN or MAX but in the query inspector the value is the same with Avarage. If I use WARNING or CRITICAL the value is correct.

Capture

Capture

In Nagios perfdata the Value MAX Exist:

Capture

Could the problem be that PNP4Nagios changes the MAX Value to the Maximum value recorded in the sampling period?

In the perfdata file there are the information about MAX
DATATYPE::SERVICEPERFDATA TIMET::1664486591 HOSTNAME::xxxxxxx SERVICEDESC::[COLLAUDO] - SO Admin - Agent NRPE - Check Swap Usage SERVICEPERFDATA::swap=1808MB;198;39;0;3967 SERVICECHECKCOMMAND::check_nrpe_args!check_swap!5%!1% HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD

In the XML from PNP4Nagios the Value MAX is Present (erase Hostname for security)

Capture

from grafana-pnp-datasource.

Stex1980 avatar Stex1980 commented on May 30, 2024

I Resolve the problem.

In the api.php there are only configuration for Warning and Critical and I add it MAX Value.

This code modify:

$perflabels[] = array(
"label" => arr_get($value, "NAME" ),
"warn" => arr_get($value, "WARN" ),
"crit" => arr_get($value, "CRIT" ),
"max" => arr_get($value, "MAX" )
);

AND this

        foreach ( $xpd->data->row as $row=>$value){
          // timestamp in milliseconds
          $timestamp = ( $start + $i * $step ) * 1000;
          if($type == "WARNING") {
            $d = floatval($tmp_perflabel['warn']);
          } elseif($type == "CRITICAL") {
            $d = floatval($tmp_perflabel['crit']);
          } else {
            $d = floatval($tmp_perflabel['max']);
          }
          $data['targets'][$key][$hk]['datapoints'][] = array( $d, $timestamp );
          $i++;
        }

The Issue can be closed

from grafana-pnp-datasource.

sni avatar sni commented on May 30, 2024

is this something that needs to be fixed in the api.php from pnp4nagios? If so, could you please provide a patch?

from grafana-pnp-datasource.

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.