@Override public boolean isNodeReady(AdapterOperation op) { boolean readyState = false; OnmsNode node = m_nodeDao.get(op.getNodeId()); if (node != null && node.getSysObjectId() != null) { readyState = true; } return readyState; }
/** * <p>getSysObjectId</p> * * @return a {@link java.lang.String} object. */ @Override public String getSysObjectId() { return getIpInterface().getNode().getSysObjectId(); }
@Override public boolean isNodeReady(AdapterOperation op) { boolean readyState = false; OnmsNode node = m_nodeDao.get(op.getNodeId()); if (node != null && node.getSysObjectId() != null) { readyState = true; } return readyState; }
public static NodeTopologyEntity create(OnmsNode node){ return new NodeTopologyEntity(node.getId(), node.getType(), node.getSysObjectId(), node.getLabel(), node.getLocation().getLocationName()); }
m_config.getReadLock().lock(); try { for (AssetField field : m_config.getAssetFieldsForAddress(ipaddress, node.getSysObjectId())) { try { String value = fetchSnmpAssetString(m_locationAwareSnmpClient, agentConfig, locationName, field.getMibObjs(), field.getFormatString());
m_config.getReadLock().lock(); try { for (AssetField field : m_config.getAssetFieldsForAddress(ipaddress, node.getSysObjectId())) { try { String value = fetchSnmpAssetString(m_locationAwareSnmpClient, agentConfig, locationName, field.getMibObjs(), field.getFormatString());
m_config.getReadLock().lock(); try { for (final AssetField field : m_config.getAssetFieldsForAddress(ipaddress, node.getSysObjectId())) { try { final String value = fetchSnmpAssetString(m_locationAwareSnmpClient, agentConfig, locationName, field.getMibObjs(), field.getFormatString());
private Component createComponent(AbstractVertex ref) { Preconditions.checkState(ref.getNodeID() != null, "no Node ID defined."); OnmsNode node = nodeDao.get(ref.getNodeID()); FormLayout formLayout = new FormLayout(); formLayout.setSpacing(false); formLayout.setMargin(false); formLayout.addComponent(createLabel("Node ID", "" + node.getId())); final HorizontalLayout nodeButtonLayout = new HorizontalLayout(); Button nodeButton = createButton(node.getLabel(), null, null, event -> new NodeInfoWindow(ref.getNodeID()).open()); nodeButton.setStyleName(BaseTheme.BUTTON_LINK); nodeButtonLayout.addComponent(nodeButton); nodeButtonLayout.setCaption("Node Label"); formLayout.addComponent(nodeButtonLayout); if (!Strings.isNullOrEmpty(node.getSysObjectId())) { formLayout.addComponent(createLabel("Enterprise OID", node.getSysObjectId())); } return formLayout; }
@Override public List<Node> findAllSnmpNode() { final List<Node> nodes = new ArrayList<Node>(); final Criteria criteria = new Criteria(OnmsNode.class); criteria.setAliases(Arrays.asList(new Alias[] { new Alias( "ipInterfaces", "iface", JoinType.LEFT_JOIN) })); criteria.addRestriction(new EqRestriction("type", NodeType.ACTIVE)); criteria.addRestriction(new EqRestriction("iface.isSnmpPrimary", PrimaryType.PRIMARY)); for (final OnmsNode node : m_nodeDao.findMatching(criteria)) { nodes.add(new Node(node.getId(), node.getLabel(), node.getPrimaryInterface().getIpAddress(), node.getSysObjectId(), node.getSysName(),node.getLocation() == null ? null : node.getLocation().getLocationName())); } return nodes; }
private RancidNode getSuitableRancidNode(OnmsNode node) { //The group should be the foreign source of the node String group = node.getForeignSource(); if (group == null) return null; RancidNode r_node = new RancidNode(group, node.getLabel()); String ipaddress = m_onmsNodeIpMap.get(node.getId()); if (m_rancidAdapterConfig.useCategories(ipaddress)) { LOG.debug("getSuitableRancidNode: Using Categories to get Rancid devicetype for node: {}", node.getLabel()); r_node.setDeviceType(getTypeFromCategories(node)); } else { LOG.debug("getSuitableRancidNode: Using Sysoid to get Rancid devicetype for node: {}", node.getLabel()); r_node.setDeviceType(getTypeFromSysObjectId(node.getSysObjectId(),node.getSysDescription())); } r_node.setStateUp(false); r_node.setComment(RANCID_COMMENT+" nodeid:" + node.getNodeId()); r_node.setAuth(getSuitableRancidNodeAuthentication(node)); return r_node; }
private Component createComponent(AbstractVertex ref) { Preconditions.checkState(ref.getNodeID() != null, "no Node ID defined."); OnmsNode node = nodeDao.get(ref.getNodeID()); FormLayout formLayout = new FormLayout(); formLayout.setSpacing(false); formLayout.setMargin(false); formLayout.addComponent(createLabel("Node ID", "" + node.getId())); final HorizontalLayout nodeButtonLayout = new HorizontalLayout(); Button nodeButton = createButton(node.getLabel(), null, null, event -> new NodeInfoWindow(ref.getNodeID()).open()); nodeButton.setStyleName(BaseTheme.BUTTON_LINK); nodeButtonLayout.addComponent(nodeButton); nodeButtonLayout.setCaption("Node Label"); formLayout.addComponent(nodeButtonLayout); if (!Strings.isNullOrEmpty(node.getSysObjectId())) { formLayout.addComponent(createLabel("Enterprise OID", node.getSysObjectId())); } return formLayout; }
private RancidNode getSuitableRancidNode(OnmsNode node) { //The group should be the foreign source of the node String group = node.getForeignSource(); if (group == null) return null; RancidNode r_node = new RancidNode(group, node.getLabel()); String ipaddress = m_onmsNodeIpMap.get(node.getId()); if (m_rancidAdapterConfig.useCategories(ipaddress)) { LOG.debug("getSuitableRancidNode: Using Categories to get Rancid devicetype for node: {}", node.getLabel()); r_node.setDeviceType(getTypeFromCategories(node)); } else { LOG.debug("getSuitableRancidNode: Using Sysoid to get Rancid devicetype for node: {}", node.getLabel()); r_node.setDeviceType(getTypeFromSysObjectId(node.getSysObjectId(),node.getSysDescription())); } r_node.setStateUp(false); r_node.setComment(RANCID_COMMENT+" nodeid:" + node.getNodeId()); r_node.setAuth(getSuitableRancidNodeAuthentication(node)); return r_node; }
/** * <p>mergeAgentAttributes</p> * * @param scannedNode a {@link org.opennms.netmgt.model.OnmsNode} object. */ public void mergeAgentAttributes(OnmsNode scannedNode) { if (hasNewValue(scannedNode.getSysContact(), getSysContact())) { setSysContact(scannedNode.getSysContact()); } if (hasNewValue(scannedNode.getSysDescription(), getSysDescription())) { setSysDescription(scannedNode.getSysDescription()); } if (hasNewValue(scannedNode.getSysLocation(), getSysLocation())) { setSysLocation(scannedNode.getSysLocation()); } if (hasNewValue(scannedNode.getSysName(), getSysName())) { setSysName(scannedNode.getSysName()); } if (hasNewValue(scannedNode.getSysObjectId(), getSysObjectId())) { setSysObjectId(scannedNode.getSysObjectId()); } }
LOG.debug("getRootEntity: Getting ENTITY-MIB using {}", agentConfig); final List<SnmpObjId> vendorOidList = m_hwInventoryAdapterConfigDao.getConfiguration().getVendorOid(node.getSysObjectId()); final Map<String,String> replacementMap = m_hwInventoryAdapterConfigDao.getConfiguration().getReplacementMap(); final SnmpObjId[] vendorOids = vendorOidList.toArray(new SnmpObjId[vendorOidList.size()]);
@Override public Node getSnmpNode(final int nodeid) { final Criteria criteria = new Criteria(OnmsNode.class); criteria.setAliases(Arrays.asList(new Alias[] { new Alias( "ipInterfaces", "iface", JoinType.LEFT_JOIN) })); criteria.addRestriction(new EqRestriction("type", NodeType.ACTIVE)); criteria.addRestriction(new EqRestriction("iface.isSnmpPrimary", PrimaryType.PRIMARY)); criteria.addRestriction(new EqRestriction("id", nodeid)); final List<OnmsNode> nodes = m_nodeDao.findMatching(criteria); if (nodes.size() > 0) { final OnmsNode node = nodes.get(0); return new Node(node.getId(), node.getLabel(), node.getPrimaryInterface().getIpAddress(), node.getSysObjectId(), node.getSysName(),node.getLocation() == null ? null : node.getLocation().getLocationName()); } else { return null; } }
builder.setSysDescription(node.getSysDescription()); if (node.getSysObjectId() != null) { builder.setSysObjectId(node.getSysObjectId());
builder.setSysDescription(node.getSysDescription()); if (node.getSysObjectId() != null) { builder.setSysObjectId(node.getSysObjectId());
if (node.getSysObjectId() == null) { LOG.warn("Skiping hardware discover because the node {} doesn't support SNMP", nodeId); return;
public static LinkdVertex create(OnmsNode node, OnmsIpInterface primary) { LinkdVertex vertex = new LinkdVertex(node); vertex.setNodeID(node.getId()); vertex.setLabel(node.getLabel()); vertex.setNodeType(s_nodeStatusMap.get(node.getType())); vertex.setSysObjectId(node.getSysObjectId()); if (node.getLocation() != null) { vertex.setLocation(node.getLocation().getLocationName()); } vertex.setIpAddress("no ip address"); if (primary != null) { vertex.setIpAddress(InetAddressUtils.str(primary.getIpAddress())); } vertex.setManaged("Unmanaged"); if (primary != null && primary.isManaged()) { vertex.setManaged("Managed"); } return vertex; }
m_foreignId = alarm.getNode().getForeignId(); m_nodeLabel = alarm.getNode().getLabel(); m_nodeSysObjectId = alarm.getNode().getSysObjectId();