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

[dev.icinga.com #10544] check_network performance data in invalid format #3606

Closed
icinga-migration opened this issue Nov 5, 2015 · 13 comments
Labels
bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/10544

Created by pv2b on 2015-11-05 09:51:22 +00:00

Assignee: jflach
Status: Resolved (closed on 2016-01-05 14:20:03 +00:00)
Target Version: 2.4.2
Last Update: 2016-08-23 18:03:43 +00:00 (in Redmine)

Icinga Version: 2.3.11
Backport?: Already backported
Include in Changelog: 1

The performance data output of check_output does not conform to the Nagios plugin specification, which causes Icinga2 not to be able to parse the performance data corectly.

The following output is seen when running check_network without arguments on a Windows Server 2008 R2 box:

PS C:\Program Files (x86)\ICINGA2\sbin> .\check_network.exe
NETWORK OK 57518B/s | network=57518B/s;;;0; netI="vmxnet3 Ethernet Adapter _2";in=9143B/s;out=48375B/s netI="isatap.{92FA5A87-8658-4708-AB90-470291F47375}";in=0B/s;out=0B/s netI="Anslutning till lokalt nätverk* 9";in=0B/s;out=0B/s

The following is logged in the log file:

[2015-11-05 10:17:57 +0100] warning/GraphiteWriter: Ignoring invalid perfdata value: network=7681B/s;;;0;
Context:
(0) Processing check result for 'srv1.example.com!network'

[2015-11-05 10:17:57 +0100] warning/GraphiteWriter: Ignoring invalid perfdata value: netI="vmxnet3
Context:
(0) Processing check result for 'srv1.example.com!network'

[2015-11-05 10:17:57 +0100] warning/GraphiteWriter: Ignoring invalid perfdata value: 'Ethernet Adapter _2";in'=3786B/s;out=3895B/s
Context:
(0) Processing check result for 'srv1.example.com!network'

[2015-11-05 10:17:57 +0100] warning/GraphiteWriter: Ignoring invalid perfdata value: netI="isatap.{92FA5A87-8658-4708-AB90-470291F47375}";in=0B/s;out=0B/s
Context:
(0) Processing check result for 'srv1.example.com!network'

[2015-11-05 10:17:57 +0100] warning/GraphiteWriter: Ignoring invalid perfdata value: netI="Anslutning
Context:
(0) Processing check result for 'srv1.example.com!network'

[2015-11-05 10:17:57 +0100] warning/GraphiteWriter: Ignoring invalid perfdata value: 'till lokalt ntverk* 9";in'=0B/s;out=0B/s
Context:
(0) Processing check result for 'srv1.example.com!network'

[2015-11-05 10:17:58 +0100] warning/GraphiteWriter: Ignoring invalid perfdata value: network=24780B/s;;;0;
Context:

Clearly, it's improperly splitting the performance data on spaces, rather than treating them as being escaped. Reading chapter 2.6 of the Monitoring Plugins Development Guidelines (https://www.monitoring-plugins.org/doc/guidelines.html#AEN201) the expected format is: 'label'=value[UOM];[warn];[crit];[min];[max]

The first issue is that the code in question improperly uses double quotes (") rather than single quotes (') around the friendly name of the network card.

More subtly, even the first performance data "item" is also incorrect, because "B/s" is not a valid unit according to the specs.

I'll be slapping together a patch for this.

Attachments

Changesets

2016-01-05 14:18:22 +00:00 by pv2b 370a112

Fixed invalid quoting for network device names

Quoting needs to be with single quotes, not double quotes. Also single quotes need to be escaped.

refs #10544

Signed-off-by: Jean Flach <jean-marcel.flach@netways.de>

2016-01-05 14:18:34 +00:00 by pv2b aa7ad72

Change B/s unit to B to comply with Nagios plugin spec

Unfortunately B/s is not a valid unit in the Nagios plugin specification. As a bit of a sad workaround, we set the unit to B, which is technically incorrect, but we can't really do much about that without amending the spec...

fixes #10544

Signed-off-by: Jean Flach <jean-marcel.flach@netways.de>

2016-02-23 08:17:46 +00:00 by pv2b 2117599

Fixed invalid quoting for network device names

Quoting needs to be with single quotes, not double quotes. Also single quotes need to be escaped.

refs #10544

Signed-off-by: Jean Flach <jean-marcel.flach@netways.de>

2016-02-23 08:17:53 +00:00 by pv2b 8eb55c1

Change B/s unit to B to comply with Nagios plugin spec

Unfortunately B/s is not a valid unit in the Nagios plugin specification. As a bit of a sad workaround, we set the unit to B, which is technically incorrect, but we can't really do much about that without amending the spec...

fixes #10544

Signed-off-by: Jean Flach <jean-marcel.flach@netways.de>

Relations:

@icinga-migration
Copy link
Author

Updated by pv2b on 2015-11-05 16:42:07 +00:00

  • File added 0001-Fixed-invalid-quoting-for-network-device-names.patch
  • File added 0002-Change-B-s-unit-to-B-to-comply-with-Nagios-plugin-sp.patch

Actually, it became two patches. One to fix the quoting issue, and another fix the incorrect unit. Unfortunately B/s is not a legitimate unit according to the spec :( so we might have to cheat and use B as a unit...

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-11-25 15:46:52 +00:00

  • Status changed from New to Assigned
  • Assigned to set to jflach
  • Target Version set to Backlog

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-12-18 10:45:38 +00:00

Might be related: #53

@icinga-migration
Copy link
Author

Updated by seferovic on 2016-01-05 13:09:36 +00:00

Would it be possible to get this patch into 2.4.2?

@icinga-migration
Copy link
Author

Updated by jflach on 2016-01-05 13:25:48 +00:00

seferovic wrote:

Would it be possible to get this patch into 2.4.2?

Yes, and I'll get right to it. I kind of forgot about this :(

@icinga-migration
Copy link
Author

Updated by pv2b on 2016-01-05 14:20:03 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset aa7ad72.

@icinga-migration
Copy link
Author

Updated by jflach on 2016-01-11 09:53:33 +00:00

  • Target Version changed from Backlog to 2.5.0

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-02-23 09:58:17 +00:00

  • Backport? changed from Not yet backported to Already backported

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-02-23 10:24:53 +00:00

  • Target Version changed from 2.5.0 to 2.4.2

@icinga-migration
Copy link
Author

Updated by seferovic on 2016-06-02 11:46:49 +00:00

Unfortunately the performance data returned by the check_network.exe are still unusable with the GraphiteWriter

drwxr-xr-x.  2 carbon carbon   22 Jun  2 12:59 netI='Ethernet0';in=1234B;out
drwxr-xr-x.  2 carbon carbon   22 Jun  2 12:58 netI='Ethernet0';in=1281B;out
drwxr-xr-x.  2 carbon carbon   22 Jun  2 12:47 netI='Ethernet0';in=1314B;out
drwxr-xr-x.  2 carbon carbon   22 Jun  2 12:50 netI='Ethernet0';in=1327B;out
drwxr-xr-x.  2 carbon carbon   22 Jun  2 13:01 netI='Ethernet0';in=1342B;out
drwxr-xr-x.  2 carbon carbon   22 Jun  2 12:56 netI='Ethernet0';in=1425B;out
drwxr-xr-x.  2 carbon carbon   22 Jun  2 12:55 netI='Ethernet0';in=1483B;out
drwxr-xr-x.  2 carbon carbon   22 Jun  2 12:49 netI='Ethernet0';in=1549B;out
drwxr-xr-x.  2 carbon carbon   22 Jun  2 12:53 netI='Ethernet0';in=1563B;out
drwxr-xr-x.  2 carbon carbon   22 Jun  2 12:44 netI='Ethernet0';in=1570B;out
drwxr-xr-x.  2 carbon carbon   22 Jun  2 12:52 netI='Ethernet0';in=1600B;out
drwxr-xr-x.  2 carbon carbon   22 Jun  2 12:46 netI='Ethernet0';in=1872B;out

May I suggest passing the name of the interface to the check_network and returning the in/out values with performance data in correct format? This would be much easier then to use perfmon-windows...

Kind regards from Vienna

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-07-12 16:06:31 +00:00

Please open a new issue :)

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-07-28 15:13:39 +00:00

  • Relates set to 12155

@icinga-migration
Copy link
Author

Updated by geotek on 2016-08-23 18:03:43 +00:00

With Icinga2 2.5.0 the perfdata of this Windows plugin is still broken. pnp4nagios errs out with "Invalid Perfdata detected". When can we expect this to be fixed? Is there a workaround?

@icinga-migration icinga-migration added bug Something isn't working Plugins labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.4.2 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant