Alon Bar-Lev has posted comments on this change. Change subject: notifier: add support for snmpv6 in SNMP_MANAGERS. ......................................................................
Patch Set 1: (3 comments) http://gerrit.ovirt.org/#/c/33441/1/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/transport/snmp/Snmp.java File backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/transport/snmp/Snmp.java: Line 204: private static class Profile { Line 205: Line 206: private static final Pattern HOST_PATTERN = Pattern.compile( Line 207: "" + Line 208: "((?<host>[^\\[:\\s]+)|(?<ipv6>\\[[^\\]]+\\]))" + // DNS/IPv4/[IPv6]) I usually prefer \[ and not [[ and to make it simpler... (<host>(([^\\[:\\s]+)|(\\[^\\]+\\])) you do not care if it is host or ip... so label the group once... Line 209: "(:(?<port>[^\\s]*))?" // Port (optional) Line 210: ); Line 211: public List<Host> hosts = new LinkedList<>(); Line 212: public OctetString community; Line 215: public Profile(String managers, String community, String oid) { Line 216: Matcher m = HOST_PATTERN.matcher(managers); Line 217: while (m.find()) { Line 218: hosts.add(new Host( Line 219: m.group("host") != null ? m.group("host") : m.group("ipv6"), > The above line could be: I guess you mean the above... Line 220: m.group("port"))); Line 221: } Line 222: this.community = new OctetString(community); Line 223: this.oid = new OID(oid); http://gerrit.ovirt.org/#/c/33441/1/packaging/services/ovirt-engine-notifier/ovirt-engine-notifier.conf.in File packaging/services/ovirt-engine-notifier/ovirt-engine-notifier.conf.in: Line 145: # SNMP_MANAGERS="host" Line 146: # FILTER="include:*(snmp:) ${FILTER}" Line 147: Line 148: # Default whitespace separated IPv4/[IPv6]/DNS list with optional port, default is 162. Line 149: # SNMP_MANAGERS="manager1.example.com manager2.example.com:164" > Maybe I could add a ipv6 example? although it does not make sense to define I do not think it is required. Line 150: SNMP_MANAGERS= Line 151: Line 152: # Default SNMP Community String. Line 153: SNMP_COMMUNITY=public -- To view, visit http://gerrit.ovirt.org/33441 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9a21038928b7e553feefb9ab7669eac588c1c93c Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: mooli tayer <[email protected]> Gerrit-Reviewer: Alon Bar-Lev <[email protected]> Gerrit-Reviewer: Martin Peřina <[email protected]> Gerrit-Reviewer: Moti Asayag <[email protected]> Gerrit-Reviewer: Oved Ourfali <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: mooli tayer <[email protected]> Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
