Details
-
Type:
Enhancement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.10.3
-
Fix Version/s: 1.11.91
-
Component/s: Provisioning/Discovery/Capsd/Provisiond
-
Security Level: Default (Default Security Scheme)
-
Labels:None
Description
Hi,
is it possible to allow to specify a "defaultzone" for DNS Provisioning Adapter, for example importer.adapter.dns.defaultzone=network.intern in opennms.properties?
So if nodelabel is not a FQDN and no zone information is found, add network.intern as zone DNS records are also added/updated.
For example this would be helpful for customers that don't like to have a DNS zone for network equipment, but like to backup their devices with RANCID, or access devices with nodelabel from opennms server. No need to edit hosts or call external DNS administrator.
is it possible to allow to specify a "defaultzone" for DNS Provisioning Adapter, for example importer.adapter.dns.defaultzone=network.intern in opennms.properties?
So if nodelabel is not a FQDN and no zone information is found, add network.intern as zone DNS records are also added/updated.
For example this would be helpful for customers that don't like to have a DNS zone for network equipment, but like to backup their devices with RANCID, or access devices with nodelabel from opennms server. No need to edit hosts or call external DNS administrator.
Following changes enable this enhancements.
In my tests it works as suggested, nodes without fqdn was added, updated and if deleted from requisition also deleted from defaultzone.
— DnsRecord.java Tue Jul 3 20:33:31 2012 UTC
+++ /source/opennms/integrations/opennms-dns-provisioning-adapter/src/main/java/org/opennms/netmgt/provision/DnsRecord.java Tue Jul 3 20:10:03 2012 UTC
@@ -30,6 +30,7 @@
import java.net.InetAddress;
import java.util.Set;
+import org.apache.commons.lang.StringUtils;
import org.opennms.core.utils.ThreadCategory;
{ + m_zone = System.getProperty("importer.adapter.dns.defaultzone") + "."; + log().debug("Constructor: set defaultzone: " + m_zone); + // set new hostname with defaultzone + m_hostname = m_hostname + m_zone; + log().debug("Constructor: set new hostname with defaultzone: " + m_hostname); + }import org.opennms.netmgt.model.OnmsIpInterface;
@@ -60,8 +61,17 @@
m_hostname = node.getLabel() + ".";
log().debug("Constructor: set hostname: " + m_hostname);
m_zone = m_hostname.substring(m_hostname.indexOf('.') + 1);
+ // test if m_zone is blank and get defaultzone
+ if (StringUtils.isBlank(m_zone))
else
{ + m_zone = m_hostname.substring(m_hostname.indexOf('.') + 1); log().debug("Constructor: set zone: " + m_zone); + }}
/**