Page 1 of 1

RESOLVED: PNP4Nagios mixes up performance data of IP subnets

Posted: Mon Nov 04, 2024 9:04 am
by JaMo
Hello everyone!

I have the following problem at the moment:
I check the phase-2 connections of various VPN tunnels. The performance data is being output like this (ANON1-9 are subnet IDs like "192.168.0.0"):
up_networks=9, down_networks=0, local_networks=1, remote_networks=8, phase2_connections=8, "ANON1"=1, "ANON2"=1, "ANON3"=1, "ANON4"=1, "ANON5"=1, "ANON6"=1, "ANON7"=1, "ANON8"=1, "ANON9"=1
I noticed that the graphs sometimes change between the subnets, ANON1 might at first have the graph of ANON1 but the next time I check ANON4 has the graph of ANON1.
I only noticed this because one subnet was behaving strange and I could immediately make it out but then I wondered why a "different subnet" suddenly was behaving the same. Until I realized that the graphs actually changed.
The known subnets of every host are stored in a json file which the script compares to the found subnets in the snmp data of the firewall.

Now for my question:
Is this a known issue? Are there any solutions to that?


Currently running on Nagios Core 4.5.7 with PNP4Nagios 0.6.25 on CentOS 7 (not recommended, I know).

Attached is a screenshot of a subnet that was just added today, 2h ago.
Another subnet was removed, now the new subnet has the graph of the old one.
pnp4nagios_perfdata.png
Thanks in advance!
Jan

Re: PNP4Nagios mixes up performance data of IP subnets

Posted: Mon Nov 04, 2024 2:20 pm
by lgute
Hi @JaMo, thanks for reaching out.

I am looking into this issue and will let you know when I have more information.

Re: PNP4Nagios mixes up performance data of IP subnets

Posted: Tue Nov 05, 2024 10:46 am
by lgute
Hi @JaMo,

What plugin are you using to run your checks?

If the plugin is changing the ordering of the performance data, that would cause the issue you are seeing.

Re: PNP4Nagios mixes up performance data of IP subnets

Posted: Tue Nov 05, 2024 11:02 am
by JaMo
Hi @lgute,

I am using my own plugin.

Do you think sorting the performance data before outputting it would help?
If so, I can change the behavior.

You can see the script here:
https://pastebin.pl/view/bf12448c

Re: PNP4Nagios mixes up performance data of IP subnets

Posted: Thu Nov 07, 2024 8:57 pm
by lgute
Hi @JaMo,

If sorting the data would keep the performance data in a consistent order, I would give that a try.

Re: PNP4Nagios mixes up performance data of IP subnets

Posted: Tue Dec 03, 2024 4:16 am
by JaMo
After sorting the performance data, the graphs are consistent.

Thanks for your help!

Re: PNP4Nagios mixes up performance data of IP subnets

Posted: Tue Dec 03, 2024 9:44 am
by lgute
Hi @JaMo,

Thanks for the update. Great to hear that the performance data/graphs are now working correctly.

I'm going to lock this thread and mark it resolved, so others may with similar problems can find it.