Commit 2d8dc277 authored by Michael Ott's avatar Michael Ott
Browse files

Remove port configuration parameter in SNMP plugin. This is to be configured via the host parameter

parent 4904e57d
......@@ -521,8 +521,7 @@ Explanation of the values specific for the SNMP plugin:
|:----- |:----------- |
| connection | An aggregating connection
| Type | Type of the SNMP application which runs on the device queried by the connection. Currently only the type Agent is supported.
| Host | Host name of the device which is to be queried.
| Port | The SNMP port should be usually 161. No changes should be required here.
| Host | Host name of the device which is to be queried. Follows net-snmp's [<transport-specifier>:]<transport-address> format, e.g. udp:hostname:161
| OIDPrefix | This OIDPrefix is used for all following sensors.
| |
| Version | Which SNMP version to use (either 2 (maps to 2c) or 3).
......
......@@ -13,7 +13,6 @@ template_single_sensor temp1 {
connection name1 {
Type Agent ; Type of connection
Host test.net-snmp.org ; Hostname of the SNMP agent
Port 161 ; Port of the SNMP agent
OIDPrefix 1.3.6.1.2.1.1 ; When querying OIDs, we'll
; always use this prefix
Version 3
......
......@@ -56,7 +56,6 @@ void SNMPConfigurator::sensorEntity(SNMPConnection& s, CFG_VAL config) {
//ATTRIBUTE("Type", setType) //TODO would be relevant if we would support more than just agent mode...
//at the moment we just ignore it, as it can be only "Agent" anyways
ATTRIBUTE("Host", setHost);
ATTRIBUTE("Port", setPort);
ATTRIBUTE("Community", setSNMPCommunity);
ATTRIBUTE("OIDPrefix", setOIDPrefix);
ATTRIBUTE("Version", setVersion);
......
......@@ -40,7 +40,6 @@ SNMPConnection::SNMPConnection(const std::string& name) :
_privProto(NULL),
_authProtoLen(0),
_privProtoLen(0),
_port(0),
_securityLevel(-1),
_version(-1),
_snmpSessp(NULL) {
......@@ -60,7 +59,6 @@ SNMPConnection::SNMPConnection(const SNMPConnection& other) :
_privProto(other._privProto),
_authProtoLen(other._authProtoLen),
_privProtoLen(other._privProtoLen),
_port(other._port),
_securityLevel(other._securityLevel),
_version(other._version),
_snmpSession(other._snmpSession),
......@@ -92,7 +90,6 @@ SNMPConnection& SNMPConnection::operator=(const SNMPConnection& other) {
_privProto = other._privProto;
_authProtoLen = other._authProtoLen;
_privProtoLen = other._privProtoLen;
_port = other._port;
_securityLevel = other._securityLevel;
_version = other._version;
_snmpSessp = NULL;
......@@ -248,7 +245,6 @@ int64_t SNMPConnection::get(const oid* const OID, size_t OIDLen) {
void SNMPConnection::printEntityConfig(LOG_LEVEL ll, unsigned int leadingSpaces) {
std::string leading(leadingSpaces, ' ');
LOG_VAR(ll) << leading << "Port: " << getPort();
LOG_VAR(ll) << leading << "OIDPrefix: " << getOIDPrefix();
std::string version("unknown");
switch(getVersion()) {
......
......@@ -87,7 +87,6 @@ public:
}
}
void setHost(const std::string& host) { _name = host; }
void setPort(const std::string& port) { _port = stoi(port); }
void setSecurityLevel(const std::string& securityLevel) {
if (boost::iequals(securityLevel, SEC_NOAUTHNOPRIV)) {
_securityLevel = SNMP_SEC_LEVEL_NOAUTH;
......@@ -142,7 +141,6 @@ public:
}
}
const std::string& getHost() const { return _name; }
int getPort() const { return _port; }
int getSecurityLevel() const { return _securityLevel; }
const std::string getSecurityLevelString() const {
if (_securityLevel == SNMP_SEC_LEVEL_NOAUTH) {
......@@ -194,7 +192,6 @@ private:
oid* _privProto;
size_t _authProtoLen;
size_t _privProtoLen;
int _port;
int _securityLevel;
long int _version;
struct snmp_session _snmpSession;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment