Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid perfdata values #47

Open
ix-dev opened this issue Sep 24, 2019 · 12 comments
Open

invalid perfdata values #47

ix-dev opened this issue Sep 24, 2019 · 12 comments

Comments

@ix-dev
Copy link

ix-dev commented Sep 24, 2019

The plugin returns invalid performance data values. According to the Nagios Plugins
Development Guidelines
the value has to be in class [-0-9.] and 'a' for the UOM (unit of measurement) is not supported.

icinga2.log

[2019-09-24 06:14:55 +0200] warning/InfluxdbWriter: Ignoring invalid perfdata value: ns.hacurstate=UP;;
[2019-09-24 06:14:55 +0200] warning/InfluxdbWriter: Ignoring invalid perfdata value: ns.hacurmasterstate=Primary;;
[2019-09-24 06:15:13 +0200] warning/InfluxdbWriter: Ignoring invalid perfdata value: hapktrxrate=5a;;;0;
[2019-09-24 06:15:13 +0200] warning/InfluxdbWriter: Ignoring invalid perfdata value: hapkttxrate=5a;;;0;
@slauger
Copy link
Owner

slauger commented Sep 27, 2019

Hi @ix-dev,

do you have an idea how we could fix this or are you able to provide a patch for this? A quick solution could be to add an switch, which completly disables the perfdata output for the plugin.

Maybe we also could ignore the metric if the value is e.g. an string.

@ix-dev
Copy link
Author

ix-dev commented Sep 30, 2019

I think the best solution would be to output only numeric perfdata since string values are not supported by Nagios/Icinga. In order to provide backward compatibility, a switch like '--numeric-perfdata' could also be added.

@fatslimjoe
Copy link

Hi just wanted to let you know that I have solved that.
It will be problem if in data output will be label with . in the name ... like system.memory ... it was similar case opened at icinga2 community:

https://community.icinga.com/t/issue-icinga-not-showing-metrics-stored-in-graphite/466/3

example:

-icinga2 will not store graphs:
NetScaler OK - perfdata: ns_tcpcurserverconn: 9163 | 'ns.tcpcurserverconn'=9163;;

-icinga2 will store graphs:
NetScaler OK - perfdata: ns_tcpcurserverconn: 9163 | 'ns_tcpcurserverconn'=9163;;

After troubleshooting I have made some changes almost on every line where I have $plugin->add_perfdata...

for 1 example changing label inside hash structure and changing the "." to "_"
original:
$plugin->add_perfdata(
label => "'" . $plugin->opts->objectname . ".member_quorum'",
value => $member_quorum . '%',
min => 0,
max => 100,
warning => $member_quorum_warning,
critical => $member_quorum_critical,
);

I have changed to this:

$plugin->add_perfdata(
label => "'" . $plugin->opts->objectname . "_member_quorum'",
value => $member_quorum . '%',
min => 0,
max => 100,
warning => $member_quorum_warning,
critical => $member_quorum_critical,
);

After changes has been done, we are getting the graphs.
Maybe you should think also to change the format of output.

This plugin is great and thank you for sharing it with community.

KR,
Josip

@slauger
Copy link
Owner

slauger commented Apr 1, 2020

HI @fatslimjoe,

thanks for your information and research. Changing the labels would break metrics for existing users. I'm not really happy with this, but it seems we need to do this.

Could you share your changes with us with a pull request?

@fatslimjoe
Copy link

Hi @slauger ,

I am getting 403 error. Could you be so kind and check permissions? Otherwise if the problem is on my side I will send you changed script.

BR,
Josip

@slauger
Copy link
Owner

slauger commented Apr 6, 2020

Hi @fatslimjoe,

I guess this would be your first contribution on GitHub? What exactly have you tried? it's not possible to push directly to this repository. Just create a fork (fork button in the top right), make your changes there and issue a pull request from it.

See also https://opensource.com/article/19/7/create-pull-request-github.

If you need more help, you could also reach me out via Microsoft Teams or Telegram.

@slauger
Copy link
Owner

slauger commented Sep 11, 2020

9a9a1b1 adds the ability to configure a custom separator (e.g. _ instead of the default .).

github-actions bot pushed a commit that referenced this issue Sep 18, 2020
## [1.6.1](v1.6.0...v1.6.1) (2020-09-18)

### Bug Fixes

* add --seperator to allow to configure a custom perfdata seperator ([#47](#47)) ([9a9a1b1](9a9a1b1))
* add limit switch ('--limit', '-l') and change spec for label switch from '-l' to '-L' ([f396fbe](f396fbe))
* add release automation via semantic-release-bot ([19bb5d1](19bb5d1))
* add support for limit in more subs ([90b7995](90b7995))
* add the ability to set a custom perfdata label for sub check_keyword and check_threshold_and_get_perfdata ([#56](#56)) ([5c0ef0a](5c0ef0a))
* get host, user and password from environment variables (NETSCALER_HOST, NETSCALER_USERNAME, NETSCALER_PASSWORD) ([4cec658](4cec658))
* replace hardcoded id with $plugin->opts->label ([2c623d3](2c623d3))
@slauger
Copy link
Owner

slauger commented Jul 10, 2021

Fixed with v1.6.1.

@slauger slauger closed this as completed Jul 10, 2021
@cmaile
Copy link

cmaile commented Sep 10, 2021

v.1.6.1 still returns invalid performance data values.

[2021-09-10 09:55:46 +0200] warning/InfluxdbWriter: Ignoring invalid perfdata value: ns.hacurstate=UP;;
[2021-09-10 09:55:46 +0200] warning/InfluxdbWriter: Ignoring invalid perfdata value: ns.hacurmasterstate=Primary;;

Could you please have a look at this issue?

@slauger
Copy link
Owner

slauger commented Sep 10, 2021

There are no plans to change the current default. Have you tried to use the --seperator='_' switch?

@cmaile
Copy link

cmaile commented Sep 10, 2021

The problem is not the label / separator. Nagios / Icinga2 only allows numeric values. Strings are not allowed.

According to the Nagios Plugins Development Guidelines the value has to be in class [-0-9.] and 'a' for the UOM (unit of measurement) is not supported. So 'UP' or 'PRIMARY' also not allowed.

@slauger
Copy link
Owner

slauger commented Sep 19, 2021

ef23964 should fix the measurement problem. For the rest i need to find a proper test environment first.

@slauger slauger reopened this Sep 19, 2021
github-actions bot pushed a commit that referenced this issue Sep 27, 2021
## [1.6.2](v1.6.1...v1.6.2) (2021-09-27)

### Bug Fixes

* measurement should be undef for hapktrxrate and hapkttxrate ([#47](#47)) ([1c721dd](1c721dd))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants