Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Things learnt since first release: Some switch manufacturers suck at …

…SNMP alias names. Stick with Cisco, yo. Really really hate sanitising like this.
  • Loading branch information...
commit f89301a10d0d0d195efefa71a20f0abe88d8ffc9 1 parent f698bd5
Laurie Denness authored

Showing 1 changed file with 11 additions and 6 deletions. Show diff stats Hide diff stats

  1. +11 6 poller_child.php
17 poller_child.php
@@ -44,11 +44,6 @@
44 44 foreach($ifEntry as $intid => $thisint) {
45 45 logline("{$pollprettyhost} - Starting interface loop for interface index {$intid} ({$thisint[2]})", 1, $verbose);
46 46
47   - # Sanitise the name
48   - $intname = str_replace("/", "-", $thisint[2]);
49   - $intname = str_replace(" ", "-", $intname);
50   - $thisint['name'] = $intname;
51   -
52 47 # Check if the interface is up. No point graphing down interfaces.
53 48 if (($thisint[7] == "1") && ($thisint['8'] == "1")) {
54 49
@@ -66,7 +61,17 @@
66 61 $thisint['inbroadcast'] = $ifXEntry[$intid][9];
67 62 $thisint['outbroadcast'] = $ifXEntry[$intid][13];
68 63 $thisint['alias'] = $ifXEntry[$intid][18];
69   -
  64 +
  65 + # Sanitise the name
  66 + $intname = str_replace("/", "-", $thisint[2]);
  67 + $intname = str_replace(" ", "-", $intname);
  68 + $intname = str_replace(":", "-", $intname);
  69 + $intname = str_replace('"', "", $intname);
  70 + $thisint['name'] = $intname;
  71 +
  72 + # Sanitise the alias
  73 + $thisint['alias'] = str_replace('"', "", $thisint['alias']);
  74 +
70 75
71 76 logline("{$pollprettyhost} - {$intname} - Description for {$intname} is {$thisint['alias']}.", 2, $verbose);
72 77

0 comments on commit f89301a

Please sign in to comment.
Something went wrong with that request. Please try again.