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

XML getting to large for pnp4nagios add garbage ^@^@ to XML file #46

Open
bjornfro opened this issue Apr 16, 2019 · 4 comments
Open

XML getting to large for pnp4nagios add garbage ^@^@ to XML file #46

bjornfro opened this issue Apr 16, 2019 · 4 comments

Comments

@bjornfro
Copy link

Hi,

I have a problem with pnp4nagios getting issues because XML gets corrupted with "^@^@" in the xml file. I think it's related to the size of the xml. There is one rrd and one xml file per switch interface. Problem is that the xml file for one interface contains the <NAGIOS_PERFDATA> for all interfaces. Then also <NAGIOS_SERVICEPERFDATA> contains all interfaces, so the XML file exceeds 128KB.

Error from pnp4nagios:
XML file "/opt/nagios/pnp4nagios/var/perfdata/sesssw101-vc/If_xe-0_0_23.xml" not parsable.

XML Errors:
Char 0x0 out of allowed range
Premature end of data in tag NAGIOS_CHECK_COMMAND line 163
Premature end of data in tag NAGIOS line 2

At least it seems related to size. Don't see this problem for anything else.

If I change in the XML file:

<NAGIOS_CHECK_COMMAND>check_junos_ex_interface^@^@</NAGIOS_CHECK_COMMAND>

To:

<NAGIOS_CHECK_COMMAND>check_junos_ex_interface</NAGIOS_CHECK_COMMAND>

It works. Meaning removing "^@^@". I guess the addition of the "^@^@" is not interfacetable's error but a side effect of xml getting so large.

Anything that can be done on interfacetable side of things to address this?

@Tontonitch
Copy link
Owner

Hello,
I didn't face this situation yet, my max xml file for such a check is 112K.
Looking at my xml file content, the "variable" NAGIOS_CHECK_COMMAND is null:
<NAGIOS_CHECK_COMMAND></NAGIOS_CHECK_COMMAND>
So do you redirect the perfdata to me processed directoy to pnp or do you process it through nagios/icinga?
To redirect directly to pnp you will need to use the option "--perfdatadir":

Keyword Description Default value
--perfdatadir When specified, the performance data are written directly to a file in the specified location instead of transmitted to Icinga/Nagios. Please use the same hostname as in Icinga/Nagios for -H or -h. /usr/local/pnp4nagios/var/spool
--perfdataservicedesc (only used when using --perfdatadir and --grapher pnp4nagios). Service description to use in the generated performance data. Should match what is used in the Nagios/Icinga configuration. Optional if environment macros are enabled in nagios.cfg/icinga.cfg (enable_environment_macros=1). "Interface status"

It would decrease also nagios/icinga load has no performance data will have to be processed anymore for that plugin. Also, no more hundreds of performance data showed in nagios/icinga gui (which is useless).
Would it be a solution for you?

@bjornfro
Copy link
Author

bjornfro commented Apr 23, 2019

Hi,

I am using Naemon which uses mod-gearman to distribute checks. So, pnp4nagios fetches the perfdata from gearmand queue. As described here: https://labs.consol.de/nagios/mod-gearman/index.html

I guess it's more likely this is a pnp4nagios issue or possibly Naemon/mod-gearman. However, if perfdata was less, it would perhaps not be triggered.

Regards, Bjorn

@bjornfro
Copy link
Author

"max xml file for such a check is 112K" does not mean you have defined a max of that, right? In interfacetable_v3t.

@Tontonitch
Copy link
Owner

As far as I remember I didn't specify any file size limit in interfacetable_v3t

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

2 participants