Jump to content

Undefined Offset: 1 in pnp4nagios Custom Template


TrotskyIcepick

Recommended Posts

Hi,

 

I'm not a php programmer so forgive me if this is an easy one. I am using an addon called pnp4nagios to create performance graphs for the Nagios monitoring software. I have downloaded a custom template which will affect the graphs produced for a monitored service and when it is loaded it gives:

 

templates/check_network_load.php [20]:

 

Undefined offset: 1

 

The php code being loaded is attached.

 

Any advice will be greatly appreciated.

 

Thanks In Advance

Andrew

 

[attachment deleted by admin]

Try changing lines 20 and 22 respectively with:

 

		$def[$graphcount] .= "DEF:in_bytes=$rrdfile:" . (($key != null && array_key_exists($key, $DS)) ? $DS[$key] : null) . ":AVERAGE " ;

 

and:

 

		$def[$graphcount] .= "DEF:out_bytes=$rrdfile:" . (($nextkey != null && array_key_exists($nextkey, $DS)) ? $DS[$nextkey] : null) . ":AVERAGE " ;

Sorry about this, like I said I'm not a programmer and this is somebody elses code. I tried your last suggestion and now get: Undefined offset: 2. So it would appear to have run through 1 iteration of the script OK and fails on the next increment of graphcount.

 

Thanks

Andrew

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.