Menu

#1 Truncate last entry in Cfg files

open
nobody
None
5
2009-02-10
2009-02-10
tkivinen
No

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;

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.