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

Undefined offset: 5 #27

Closed
monitorjunkie opened this issue Feb 9, 2018 · 9 comments
Closed

Undefined offset: 5 #27

monitorjunkie opened this issue Feb 9, 2018 · 9 comments
Assignees
Labels

Comments

@monitorjunkie
Copy link

I need your help.
My Performance Graph Module PNP in Icinga2 display Error :
"Undefined offset: 5, templates/check_interface_table_global.php (70)"

I have found that, not all RRD files are created and the XML files are not completely or wrong.

-- If_eth0_BitsIn.rrd
-- If_eth0_BitsOut.rrd
-- If_eth0_OperStatus.rrd
-- If_eth0.xml
-- If_lo_BitsIn.rrd
-- If_lo_BitsOut.rrd
-- If_lo_OperStatus.rrd
-- If_lo.xml
-- Interface_global_adminupfree.rrd
-- Interface_global_freeports.rrd
-- Interface_global_ports.rrd
-- Interface_global_uptime.rrd
-- Interface_global_useddelta.rrd
-- Interface_global_watched.rrd
-- Interface_global.xml
-- Interface-Table_time.rrd
-- Interface-Table.xml

Unfortunately, 2 "Interface" XML files are created, instead of just one. (Interface_global.xml and Interface-Table.xml)
Each This file has only 1 section.
The other RRDs entries are missing (freeports, ports, uptime, useddelta, watched)

Interface_global.xml - only Interface_global_adminupfree.rrd
<DATASOURCE> <TEMPLATE>check_interface_table_global</TEMPLATE> <RRDFILE>/var/lib/pnp4nagios/perfdata/Monitor/Interface_global_adminupfree.rrd</RRDFILE> <RRD_STORAGE_TYPE>MULTIPLE</RRD_STORAGE_TYPE>

Interface-Table.xml - only Interface-Table_time.rrd
<DATASOURCE> <TEMPLATE>check_interface_table_global</TEMPLATE> <RRDFILE>/var/lib/pnp4nagios/perfdata/Monitor/Interface-Table_time.rrd</RRDFILE> <RRD_STORAGE_TYPE>MULTIPLE</RRD_STORAGE_TYPE>

Even the if_eth0 … and if_lo … XML files have only one section (If_xxx_BitsOut…)
Also missing are other RRD files (If_xxx_Pkts…) are not available.

I'm working with Icinga2, PNP4Nagios 0.6.25, PNP Module

I’ve already installed check_interface_table_v3t.pl (0.05-1) several times.

I have not found a solution to my problem on the internet
Thx.
monitorjunkie

@Tontonitch Tontonitch self-assigned this Feb 9, 2018
@Tontonitch
Copy link
Owner

Hello,
There was an issue with check_multi format produced by icinga2 and processed then by pnp. I don't remember when it was fixed, but for such it was before pnp 0.6.26. So you can try that new version of pnp.
Also, could you copy/paste the command used? Indeed, I could do some recommendations about how to use the plugin efficiently with icinga2 (I use it with Icinga2 myself ;-) )

@Tontonitch
Copy link
Owner

I remember that the fix for pnp had been merged in march/avril 2015, so pnp 0.6.25 is not compatible with check_multi format generated by icinga2. You need to use a newer version including the fix. Go for 0.6.26 to be sure.

@monitorjunkie
Copy link
Author

Hello
Thank you for your quick response and solution

I have newer version 0.6.26 installed.
There are still several RRD files created.

-- If_eth0_If_eth0__check_interface_table_port__BitsIn.rrd
-- If_eth0_If_eth0__check_interface_table_port__BitsOut.rrd
-- If_eth0_If_eth0__check_interface_table_port__PktsInDiscard.rrd
-- If_eth0_If_eth0__check_interface_table_port__PktsInErr.rrd
-- If_eth0_If_eth0__check_interface_table_port__PktsOutDiscard.rrd
-- If_eth0_If_eth0__check_interface_table_port__PktsOutErr.rrd
-- If_eth0_OperStatus.rrd
-- If_eth0.xml
-- If_lo_If_lo__check_interface_table_port__BitsIn.rrd
-- If_lo_If_lo__check_interface_table_port__BitsOut.rrd
-- If_lo_If_lo__check_interface_table_port__PktsInDiscard.rrd
-- If_lo_If_lo__check_interface_table_port__PktsInErr.rrd
-- If_lo_If_lo__check_interface_table_port__PktsOutDiscard.rrd
-- If_lo_If_lo__check_interface_table_port__PktsOutErr.rrd
-- If_lo_OperStatus.rrd
-- If_lo.xml
-- Interface-Table_Interface_global__check_interface_table_global__adminupfree.rrd
-- Interface-Table_Interface_global__check_interface_table_global__freeports.rrd
-- Interface-Table_Interface_global__check_interface_table_global__ports.rrd
-- Interface-Table_Interface_global__check_interface_table_global__uptime.rrd
-- Interface-Table_Interface_global__check_interface_table_global__useddelta.rrd
-- Interface-Table_Interface_global__check_interface_table_global__watched.rrd
-- Interface-Table_time.rrd
-- Interface-Table.xml

The XML files are correct. Have several section

But the files names are longer and problem with
"Undefined offset: 5, templates / check_interface_table_global.php (70)" persists

Are the filesnamen wrong?

My Service Name is "Interface-Table"
and Command Name "check_interface_table"

Check Command for Linux:
"check_interface_table" = "check_interface_table_v3t.pl -H $address$ -C $Community$ --timeout 45 -f --hostdisplay=$host.name$ --perfdataservicedesc=$service.name$ -2 --64bits -r --wp 1 --cp 1 --exclude-traffic "^lo"

Thx.
monitorjunkie

@Tontonitch
Copy link
Owner

the parameter --perfdataservicedesc should be used with --perfdatadir (see http://www.tontonitch.com/tiki/tiki-index.php?page=Nagios+plugins+-+interfacetable_v3t+-+documentation+-+0.05+-+Plugin+usage).

And that's my recommendation to use these 2 parameters to directly write the performance data files in the PNP spool dir.

Hereunder an example of service definition for icinga2. You can also put part of that in a "interface-table" service template and call that from a service definition.

apply Service "Interface status" {
  import "generic-service"
  vars.interfacetable_community = "$snmp_community$"
  vars.interfacetable_snmpv2 = true
  vars.interfacetable_timeout = 45
  vars.interfacetable_64bits = true
  vars.interfacetable_exclude = "'^lo'"
  vars.interfacetable_warningproperty = 1
  vars.interfacetable_criticalproperty = 1
  vars.interfacetable_regex = true
  vars.interfacetable_enableperfdata = true
  vars.interfacetable_trackproperty = "ifOperStatus"
  vars.interfacetable_noipinfo = false
  vars.interfacetable_tablesplit = true
  vars.interfacetable_htmltablelinktarget = "_blank"
  vars.interfacetable_perfdatadir = "/var/spool/icinga2/perfdata"
  vars.interfacetable_perfdataservicedesc = name
  vars.interfacetable_accessmethod = "ssh"
  vars.interfacetable_warningtraffic = "100,100,-1"
  vars.interfacetable_criticaltraffic = "100,500,-1"
  assign where ...
}

Tel me if this fix your issue, or if you prefer to let icinga2 processing the perfdata. In that second case, you should not specify perfdataservicedesc.

@monitorjunkie
Copy link
Author

Thank you for your support.

Now almost everything works.

I tested with "--perfdataservicedesc and --perfdatadir" -- is OK
I also tested without "--perfdataservicedesc and --perfdatadir" -- also OK

service_ interfacetable-eth0

It only miss a graph "Operations Status" for individual interfaces.

Do you know which option is still missing?

Thx.
monitorjunkie

@Tontonitch
Copy link
Owner

Nice to see that you've made it working on your environment 👍

The "Operations Status" graph is replaced by default by a status bar at the top of the "interface traffic" graph, for each interface (this is the green line at the top of the 1st graph you posted, green=up, red=down). It's to do an economy of 1 graph per interface.
Nevertheless, it's possible to switch back to a separate graph via a setting in the pnp template file.
(http://www.tontonitch.com/tiki/tiki-index.php?page=Nagios+plugins+-+interfacetable_v3t+-+documentation+-+0.05+-+Interface+statistics+and+trends&structure=Nagios+plugins+-+interfacetable_v3t+-+documentation+-+0.05)

@monitorjunkie
Copy link
Author

👍
👍 Thanks again for your support.
👍 Everything works now.
👍
monitorjunkie

@monitorjunkie
Copy link
Author

monitorjunkie commented Sep 20, 2019 via email

@Tontonitch
Copy link
Owner

This is a new issue -> opened a new issue #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants