Truncate last entry in Cfg files
Status: Pre-Alpha
Brought to you by:
gicara
When first loading any Nagios 3.x config file into phpNagios, the last entry does not appear in the HTML list. And when you edit/add a record then save, it truncates the last entry from the file. Subsequent edits of the file no longer truncate.
Logic in print_list() and format() iterate in a loop:
for($x=1; $x<count($data_arr); $x++){}
But the count of array increases by 1 if the "#<node>" row exists in the CFG text file or not.
I worked around this with the following:
for($x=1; $x<=count($data_arr); $x++){
if (!isset($data_arr[$x]))
continue;