Description:With the following Add-in script you can configure SNMP (SNMPv1, SNMPv2 or SNMPv3) on Access Points using LCOS LX. List of used variables:Add-in code:
{
config.setScalarByOid("13.2.9.37", |
---|
SNMPv3
!
Community
var createSnmpCommunity = function Community var createSnmpCommunity = function (Name, |
---|
{
var SNMPCommunity = { varSNMPCommunity = config.getTableByOid("13.2.9.27"); |
---|
var SNMPCommunityEntry = varSNMPCommunityEntry = SNMPCommunity.createNewRow(); |
---|
SNMPCommunityEntry.setByOid("1", |
---|
SNMPCommunityEntry.setByOid("3", |
---|
SNMPCommunityEntry.setByOid("8", |
---|
// Active
SNMPCommunity.addOrMerge(SNMPCommunityEntry); |
---|
}
var createSnmpGroup = function (SecurityModel, SecurityName, GroupName, Status) {
var SNMPGroup = }
// function to create a SNMP Group var createSnmpGroup = function (SecurityModel, SecurityName, GroupName, Status) { varSNMPGroup = config.getTableByOid("13.2.9.28"); |
---|
var SNMPGroupEntry = varSNMPGroupEntry = SNMPGroup.createNewRow(); |
---|
SNMPGroupEntry.setByOid("1", |
---|
// Any
SNMPGroupEntry.setByOid("2", |
---|
SNMPGroupEntry.setByOid("3", |
---|
SNMPGroupEntry.setByOid("5", |
---|
// Active
SNMPGroup.addOrMerge(SNMPGroupEntry); |
---|
}
var createSnmpViews = function (ViewsName, OidSubtree, Type, Status) {
var SNMPViews = }
// function to create a SNMP Views var createSnmpViews = function (ViewsName, OidSubtree, Type, Status) { varSNMPViews = config.getTableByOid("13.2.9.30"); |
---|
var SNMPViewsEntry = varSNMPViewsEntry = SNMPViews.createNewRow(); |
---|
SNMPViewsEntry.setByOid("1", |
---|
SNMPViewsEntry.setByOid("3", |
---|
SNMPViewsEntry.setByOid("4", |
---|
// Included
SNMPViewsEntry.setByOid("6", |
---|
// Active
SNMPViews.addOrMerge(SNMPViewsEntry); |
---|
}
var createSnmpAccesses = function (GroupName, SecurityModel, MinSecurityLevel, ReadViewName, WriteViewName, NotifyViewName, Status) {
var SNMPAccesses = }
// function to create a SNMP Accesses var createSnmpAccesses = function (GroupName, SecurityModel, MinSecurityLevel, ReadViewName, WriteViewName, NotifyViewName, Status) { varSNMPAccesses = config.getTableByOid("13.2.9.29"); |
---|
var SNMPAccessesEntry = varSNMPAccessesEntry = SNMPAccesses.createNewRow(); |
---|
SNMPAccessesEntry.setByOid("1", |
---|
SNMPAccessesEntry.setByOid("3", |
---|
// Any
SNMPAccessesEntry.setByOid("10", |
---|
SNMPAccessesEntry.setByOid("5", |
---|
SNMPAccessesEntry.setByOid("6", |
---|
SNMPAccessesEntry.setByOid("7", |
---|
SNMPAccessesEntry.setByOid("8", |
---|
// Active
SNMPAccesses.addOrMerge(SNMPAccessesEntry); |
---|
}
var createSnmpUser = function (UserName, AuthenticationProtocol, AuthenticationPasswordType, AuthenticationPassword, PrivacyProtocol, PrivacyPasswordType, PrivacyPassword, Status) {
var SNMPUseres = }
// function to create a SNMP User var createSnmpUser = function (UserName, AuthenticationProtocol, AuthenticationPasswordType, AuthenticationPassword, PrivacyProtocol, PrivacyPasswordType, PrivacyPassword, Status) { varSNMPUseres = config.getTableByOid("13.2.9.32"); |
---|
var SNMPUserEntry = varSNMPUserEntry = SNMPUser.createNewRow(); |
---|
SNMPUserEntry.setByOid("2", |
---|
SNMPUserEntry.setByOid("5", |
---|
SNMPUserEntry.setByOid("14", |
---|
AuthenticationPasswordType); |
---|
SNMPUserEntry.setByOid("6", |
---|
SNMPUserEntry.setByOid("8", |
---|
// None
SNMPUserEntry.setByOid("15", |
---|
SNMPUserEntry.setByOid("9", |
---|
SNMPUserEntry.setByOid("13", |
---|
// Active
SNMPUser.addOrMerge(SNMPUserEntry); |
---|
}
var createSnmpTargetAdresses = function (Name, TransportAddress, ParameterName, Status) {
var SNMPTargetAdresses = }
// function to create a SNMP Target Adresses var createSnmpTargetAdresses = function (Name, TransportAddress, ParameterName, Status) { varSNMPTargetAdresses = config.getTableByOid("13.2.9.34"); |
---|
var SNMPTargetAdressesEntry = varSNMPTargetAdressesEntry = SNMPTargetAdresses.createNewRow(); |
---|
SNMPTargetAdressesEntry.setByOid("1", |
---|
SNMPTargetAdressesEntry.setByOid("3", |
---|
SNMPTargetAdressesEntry.setByOid("7", |
---|
SNMPTargetAdressesEntry.setByOid("9", |
---|
// Active
SNMPTargetAdresses.addOrMerge(SNMPTargetAdressesEntry); |
---|
}
var createSnmpTargetParams = function (Name, MessageProcessingModel, SecurityModel, SecurityName, SecurityLevel, Status) {
var SNMPTargetParams = }
// function to create a SNMP Target Params var createSnmpTargetParams = function (Name, MessageProcessingModel, SecurityModel, SecurityName, SecurityLevel, Status) { varSNMPTargetParams = config.getTableByOid("13.2.9.35"); |
---|
var SNMPTargetParamsEntry = varSNMPTargetParamsEntry = SNMPTargetParams.createNewRow(); |
---|
SNMPTargetParamsEntry.setByOid("1", |
---|
SNMPTargetParamsEntry.setByOid("2", |
---|
SNMPTargetParamsEntry.setByOid("3", |
---|
// Any
SNMPTargetParamsEntry.setByOid("4", |
---|
SNMPTargetParamsEntry.setByOid("5", |
---|
// NoAuthNoPriv
SNMPTargetParamsEntry.setByOid("7", |
---|
// Active
SNMPTargetParams.addOrMerge(SNMPTargetParamsEntry); |
---|
}
}
// After this command you can call the functions and fill them with data
createSnmpCommunity("Name", |
---|
createSnmpGroup("SecurityModel", |
---|
createSnmpViews("ViewsName", |
---|
createSnmpAccesses("GroupName", |
---|
createSnmpUser("UserName", |
---|
"AuthenticationProtocol", |
---|
"AuthenticationPasswordType", |
---|
"AuthenticationPassword", |
---|
createSnmpTargetAdresses("Name", |
---|
createSnmpTargetParams("Name", |
---|
"MessageProcessingModel", |
---|
Addin as JSON file: View file |
---|
name | LX_SNMP.json |
---|
height | 150 |
---|
|
|