Skip to content

Commit

Permalink
add security level
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-du-car committed Nov 8, 2023
1 parent d959d97 commit bf91eae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/v2i-hub/RSUHealthMonitorPlugin/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"key":"SecurityUser",
"default":"authOnlyUser",
"description":"SNMP Security Name"
},
{
"key":"SecurityLevel",
"default":"authPriv",
"description":"SNMP Security level"
},
{
"key":"RSUOIDConfigMap",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace RSUHealthMonitor
GetConfigValue<uint16_t>("SNMPPort", _snmpPort);
GetConfigValue<string>("AuthPassPhrase", _authPassPhrase);
GetConfigValue<string>("SecurityUser", _securityUser);
GetConfigValue<string>("SecurityLevel", _securityLevel);


// Update the OID to RSU field mapping
string rsuOIDMapJsonStr;
Expand Down Expand Up @@ -117,9 +119,9 @@ namespace RSUHealthMonitor
PLOG(logDEBUG) << "RSU status update call at every " << _interval << " seconds!\n";

// Create SNMP client and use SNMP V3 protocol
auto _snmpClientPtr = std::make_unique<snmp_client>(_rsuIp, _snmpPort, "", _securityUser, "authNoPriv", _authPassPhrase, 3);
auto _snmpClientPtr = std::make_unique<snmp_client>(_rsuIp, _snmpPort, "", _securityUser, _securityLevel, _authPassPhrase, 3);
PLOG(logINFO) << "Updated SNMP client call: RSU IP: " << _rsuIp << ", RSU port: " << _snmpPort << ", User: " << _securityUser << ", auth pass phrase: " << _authPassPhrase << ", security level: "
<< "authNoPriv";
<< _securityLevel;
if (_snmpClientPtr == nullptr)
{
PLOG(logERROR) << "Error creating SNMP client!";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace RSUHealthMonitor
uint16_t _snmpPort;
string _authPassPhrase;
string _securityUser;
string _securityLevel;
vector<RSUOIDConfig> _rsuOIDConfigMap;
// std::shared_ptr<snmp_client> _snmpClientPtr;
/**
Expand Down

0 comments on commit bf91eae

Please sign in to comment.