Cacti / plugin_mactrack

Mactrack Plugin for Cacti
GNU General Public License v2.0
12 stars 25 forks source link

Problems inserting rows with no VLAN defined #153

Closed JeffreyRoberson closed 3 years ago

JeffreyRoberson commented 4 years ago

My switches do not seem to enumerate the VLAN's. When the VLAN is null, the 'REPLACE INTO...' function fails due to the vlan_name being null. I added the following lines of code into the db_store_device_port_results function around line 2165 after the mac_authorized if/then/else statement. if (!isset($port_value['vlan_name'])) { $port_value['vlan_name']='N/A'; }

There may be a more elegant solution or allowing null values in the vlan_name field.

TheWitness commented 3 years ago

Okay, figured it out thanks for the tip. A pull request would have been easier ;)