/** * {@inheritDoc} * * Returns true if the protocol defined by this plugin is supported. If * the protocol is not supported then a false value is returned to the * caller. The qualifier map passed to the method is used by the plugin to * return additional information by key-name. These key-value pairs can be * added to service events if needed. */ @Override public boolean isServiceDetected(final InetAddress address, final SnmpAgentConfig agentConfig) { try { configureAgentPTR(agentConfig); configureAgentVersion(agentConfig); SnmpObjId snmpObjectId = SnmpObjId.get(LOGICAL_BASE_OID + '.' + m_arrayNumber); SnmpValue value = SnmpUtils.get(agentConfig, snmpObjectId); if (value.toInt() != 2) { LOG.debug("PercMonitor.poll: Bad Disk Found. Log vol({}) degraded", m_arrayNumber); return false; } } catch (Throwable t) { throw new UndeclaredThrowableException(t); } return true; }
LOG.debug("OMSAStorageMonitor.poll: SnmpAgentConfig address: {}", agentConfig); SnmpObjId virtualDiskRollUpStatusSnmpObject = SnmpObjId.get(virtualDiskRollUpStatus + "." + virtualDiskNumber); SnmpValue virtualDiskRollUpStatus = SnmpUtils.get(agentConfig, virtualDiskRollUpStatusSnmpObject); SnmpValue diskValue = SnmpUtils.get(agentConfig,arrayDiskStateSnmpObject); SnmpValue nexusValue = SnmpUtils.get(agentConfig,arrayDiskNexusIDSnmpObject);
SnmpValue result = SnmpUtils.get(agentConfig, snmpObjectId);
SnmpObjId lmTableCountSnmpObject = SnmpObjId.get(lmTableCount + "." + e.getKey().toString()); String lmErrorMsg = "Rexeg " + SnmpUtils.get(agentConfig,lmTableRegExSnmpObject).toDisplayString() + ", for log file " + SnmpUtils.get(agentConfig,lmTableFilenameSnmpObject).toDisplayString() + " has matched " + SnmpUtils.get(agentConfig,lmTableCountSnmpObject).toDisplayString() + "time(s).";
/** * <p>getValue</p> * * @param agentConfig a {@link org.opennms.netmgt.snmp.SnmpAgentConfig} object. * @param oid a {@link java.lang.String} object. * @return a {@link java.lang.String} object. */ protected static String getValue(SnmpAgentConfig agentConfig, String oid, boolean hex) { SnmpValue val = SnmpUtils.get(agentConfig, SnmpObjId.get(oid)); if (val == null || val.isNull() || val.isEndOfMib() || val.isError()) { return null; } else { return hex ? val.toHexString() : val.toString(); } }
String DiskErrorMsg = SnmpUtils.get(agentConfig,dskTableErrorMsgSnmpObject).toDisplayString();
/** * {@inheritDoc} * * Returns true if the protocol defined by this plugin is supported. If * the protocol is not supported then a false value is returned to the * caller. The qualifier map passed to the method is used by the plugin to * return additional information by key-name. These key-value pairs can be * added to service events if needed. */ @Override public boolean isServiceDetected(final InetAddress address, final SnmpAgentConfig agentConfig) { try { configureAgentPTR(agentConfig); configureAgentVersion(agentConfig); SnmpObjId virtualDiskRollUpStatusSnmpObject = SnmpObjId.get(virtualDiskRollUpStatus + '.' + m_virtualDiskNumber); SnmpValue virtualDiskRollUpStatus = SnmpUtils.get(agentConfig, virtualDiskRollUpStatusSnmpObject); if (virtualDiskRollUpStatus == null || virtualDiskRollUpStatus.isNull()) { LOG.debug("SNMP poll failed: no results, addr={} oid={}", agentConfig.getAddress(), virtualDiskRollUpStatusSnmpObject); return false; } if (virtualDiskRollUpStatus.toInt() != 3) { // 3 means Online LOG.debug("OMSAStorageMonitor.poll: Bad Disk Found. Log vol({}) degraded", m_virtualDiskNumber); return false; } } catch (Throwable t) { throw new UndeclaredThrowableException(t); } return true; }
String LaErrorMsg = SnmpUtils.get(agentConfig,laTableErrorMsgSnmpObject).toDisplayString();
SnmpValue chassisStatus = SnmpUtils.get(agentConfig, chassisStatusSnmpObject); SnmpValue eventLogStatus = SnmpUtils.get(agentConfig, eventLogStatusSnmpObject); SnmpValue manufacturer = SnmpUtils.get(agentConfig, manufacturerSnmpObject); SnmpValue model = SnmpUtils.get(agentConfig, modelSnmpObject); SnmpValue serviceTag = SnmpUtils.get(agentConfig, serviceTagSnmpObject);
String PrErrorMsg = SnmpUtils.get(agentConfig,prTableErrorMsgSnmpObject).toDisplayString();
SnmpValue bgpPeerState = SnmpUtils.get(agentConfig, bgpPeerStateSnmpObject); SnmpValue bgpPeerAdminState = SnmpUtils.get(agentConfig, bgpPeerAdminStateSnmpObject); SnmpValue bgpPeerRemoteAs = SnmpUtils.get(agentConfig, bgpPeerRemoteAsSnmpObject); SnmpValue bgpPeerLastError = SnmpUtils.get(agentConfig, bgpPeerLastErrorSnmpObject); SnmpValue bgpPeerFsmEstTime = SnmpUtils.get(agentConfig, bgpPeerFsmEstTimeSnmpObject);
SnmpValue value = SnmpUtils.get(agentConfig,snmpObjectId);
statusValues = SnmpUtils.get(agentConfig, pingEntry.generateResultsOids());
final SnmpObjId hrStorageUsedSnmpObject = SnmpObjId.get(hrStorageUsed, snmpInstance); final SnmpValue snmpSize = SnmpUtils.get(agentConfig, hrStorageSizeSnmpObject); final SnmpValue snmpUsed = SnmpUtils.get(agentConfig, hrStorageUsedSnmpObject); float calculatedPercentage = ((((float) snmpSize.toLong() - (float) snmpUsed.toLong()) / (float) snmpSize.toLong())) * 100;