routerconfigs error.. can't figure it out.

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Moderators, Developers

Post Reply
Author
Message
dallenk
Posts: 10
Joined: Sat Nov 26, 2011 3:21 am

routerconfigs error.. can't figure it out.

#1 Post by dallenk » Sun Dec 25, 2011 4:16 pm

I installed routerconfigs plugin a couple days ago and have been tearing my hair out trying to figure out why I keep getting this error on the "Devices" tab.. I have configured everything that I can, and double checked to make sure the sql database is populated with data.

Warning: Invalid argument supplied for foreach() in /var/www/html/plugins/configstore/configstore_devices.php on line 777

line 777 is this function:

Code: Select all

	foreach ($result as $row) {
		form_alternate_row_color($colors["alternate"],$colors["light"],$i, 'line' . $row["id"]); $i++;

		$total = db_fetch_cell("SELECT count(device) FROM plugin_configstore_backups WHERE device=" . $row['id']);

                form_selectable_cell($row['backupresult'] == '0' ? '<img border=0 src="images/green-ball.png" height=10 width=10 alt="Backup Result" title="Backup OK" /></img>&nbsp;' : '<span style="white-space:nowrap"><image border=0 src="images/red-ball.png" height=10 width=10 alt="Backup Result" title="Backup Failed" /></img>&nbsp;' . '<a href="configstore_devices.php?action=viewdebug&id=' . $row['id'] . '">' . '<img border=0 src="images/debug.png" height=10 width=10 alt="Debug Info" title="Debug Info" /></img></a></span>', $row['id']);
                form_selectable_cell('<a href="configstore_devices.php?&action=edit&id=' . $row['id'] . '">' . $row['hostname'] . '</a>', $row['id']);
                form_selectable_cell("<a href=configstore_devices.php?action=viewconfig&id=" . $row['id'] . ">Current</a> - <a href=configstore_backups.php?device=" . $row['id'] . ">Backups ($total)</a>", $row['id']);
                form_selectable_cell($row['ipaddress'], $row['id']);
                form_selectable_cell($row['directory'], $row['id']);
                form_selectable_cell(($row['lastbackup'] < 1 ? '' : date('M j Y H:i:s', $row['lastbackup'])), $row['id']);
                form_selectable_cell(($row['lastchange'] < 1 ? '' : date('M j Y H:i:s', $row['lastchange'])), $row['id']);
                form_selectable_cell($row['username'], $row['id']);
                form_selectable_cell(($row['enabled'] == 'on' ? 'Yes' : '<font color=red><b>No</b></font>'), $row['id']);
                form_checkbox_cell($row["hostname"], $row["id"]);
		form_end_row();
	}
	print $nav;
using the newest Cacti version with integrated PA architecture.

any thoughts??? I haven't coded php is such a long time I'm not sure where to start looking..

dogs1005
Posts: 42
Joined: Tue Jul 15, 2014 3:39 am

Re: routerconfigs error.. can't figure it out.

#2 Post by dogs1005 » Wed Jan 07, 2015 12:07 pm

Did you get an answer to this as I am getting the exact same thing?

Post Reply