Skip to content

Conversation

@seadog007
Copy link

[BF] Summary of fix - fixes template of MRTG Backend Config

The original template will cause the backend can't proper generate the graph for switch aggregated / infra / overall after manually adding interface (for example dummy interface).

The MRTG config of the original template will be like
截圖 2021-11-01 下午5 29 45
It contains some invalid reference which can't retrieve from the SNMP, eventually cause the graph fail to render.

The quick fix is to check whether or not the interface can be retrieved from the SNMP, to achieve that, the simply way is to check the existence of the return value of ifnameToSNMPIdentifier().

The final MRTG config will be like

截圖 2021-11-01 下午5 29 54

In addition to the above, I have:

  • ensured all relevant template output is escaped to avoid XSS attached with <?= $t->ee( $data ) ?> or equivalent.
  • ensured appropriate checks against user privilege / resources accessed
  • API calls (particular for add/edit/delete/toggle) are not implemented with GET and use CSRF tokens to avoid CSRF attacks

@barryo
Copy link
Member

barryo commented Nov 13, 2021

Hi @seadog007 - thanks for this. If I understand what you're trying to do, I think my version above will work and will sort it at source. Basically: if we have no ifIndex then we've never found the port via SNMP and so we should exclude it.

@barryo barryo closed this Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants