Skip to content

Commit

Permalink
snmp update
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-du-car committed Nov 9, 2023
1 parent f9ecabf commit 331e390
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tmx/TmxUtils/src/SNMPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace tmx::utils
session.securityName = (char *)snmp_user.c_str();
session.securityNameLen = snmp_user.length();

session.securityModel = USM_SEC_MODEL_NUMBER;
// session.securityModel = USM_SEC_MODEL_NUMBER;

// Fallback behavior to setup a community for SNMP V1/V2
if (snmp_version_ != 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ namespace RSUHealthMonitor
PLOG(logDEBUG) << "RSU status update call at every " << _interval << " seconds!\n";

// Create SNMP client and use SNMP V3 protocol
PLOG(logINFO) << "Updated SNMP client: RSU IP: " << _rsuIp << ", RSU port: " << _snmpPort << ", User: " << _securityUser << ", auth pass phrase: " << _authPassPhrase << ", security level: "
PLOG(logINFO) << "Update SNMP client: RSU IP: " << _rsuIp << ", RSU port: " << _snmpPort << ", User: " << _securityUser << ", auth pass phrase: " << _authPassPhrase << ", security level: "
<< _securityLevel;
auto _snmpClientPtr = std::make_unique<snmp_client>(_rsuIp, _snmpPort, "", _securityUser, _securityLevel, _authPassPhrase, 3);
auto _snmpClientPtr = std::make_unique<snmp_client>(_rsuIp, _snmpPort, "", _securityUser, _securityLevel, _authPassPhrase, 3, SEC_TO_MICRO);
if (_snmpClientPtr == nullptr)
{
PLOG(logERROR) << "Error creating SNMP client!";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ namespace RSUHealthMonitor
string _securityUser;
string _securityLevel;
vector<RSUOIDConfig> _rsuOIDConfigMap;
const long SEC_TO_MICRO = 1000000;
// std::shared_ptr<snmp_client> _snmpClientPtr;
/**
* @brief Update RSU OID configuration map with input JSON string.
Expand Down

0 comments on commit 331e390

Please sign in to comment.