Please read Script Templates section in Lighthouse manual https://ftp.opengear.com/download/documentation/manual/current/lighthouse/ and the following article as it explains Script Templates usage, how to upload and apply to specific nodes.
https://opengear.zendesk.com/hc/en-us/articles/115004747366-Configuration-Templating-on-Lighthouse-5
Note: Use the freely available Notepad++ which allows you to save the script with Unix (LF) line endings, not DOS (CRLF) line endings. Ensure any 'single' and "double" quotation marks have not been converted into curly “smart quotes”. Applying scripts with DOS (CRLF) line endings will break node configuration.
Enabling and Disable SNMP Service and Traps is covered in this article. The first tab configures SNMP service while Primary and Secondary Manager tab is used to configure SNMP Manager that will receive traps.
To disable SNMP Service:
config -d config.services.snmp.enabled -a
To enable SNMP Service:
Enable SNMP Service via the GUI on a Node (Console Server).
Here is an SNMPv2 service example. Use the read-only community field. The read-write community can be used but it's also read only. The Location and Contact fields are optional but is useful when monitoring the system. Enabling SNMPv3 is the same process and usually requires authentication, encryption protocols and passwords fields to be filled in.
SSH into the Node and run the following command to generate the configuration.
echo "config \\" ; config -g config.services.snmp | sed -e 's/ /=\'\''/' -e 's/$/'\'' \\/' -e 's/^/-s /'; echo "-a"
Here is an example SNMP Service configuration.
config \
-s config.services.snmp.enabled='on' \
-s config.services.snmp.protocol='UDP' \
-s config.services.snmp.roauthprotocol='SHA' \
-s config.services.snmp.rocommunity='opengear2020' \
-s config.services.snmp.roprivprotocol='DES' \
-s config.services.snmp.syscontact='support@opengear.com' \
-s config.services.snmp.syslocation='Gardner Close, Brisbane QLD' \
-a
Here is an example SNMPv3 Service configuration.
config \
-s config.services.snmp.enabled='on' \
-s config.services.snmp.protocol='UDP' \
-s config.services.snmp.roauthpassword='my_auth_password' \
-s config.services.snmp.roauthprotocol='SHA' \
-s config.services.snmp.roprivpassword='my_privacy_password' \
-s config.services.snmp.roprivprotocol='AES' \
-s config.services.snmp.roseclevel='priv' \
-s config.services.snmp.rousername='my_read_only_username' \
-a
To disable SNMP Manager (Traps):
The command below will delete Primary and Secondary SNMP Manager configuration.
config -d config.system.snmp -a
To enable SNMP Manager (Traps):
Enable SNMP Manager via the GUI on a Node (Console Server).
Here is a Primary SNMP Manager example using SNMPv2. Enabling SNMPv3 is the same process and usually requires authentication, encryption protocols and passwords fields to be filled in.
SSH into the Node and run the following command to generate the configuration.
echo "config \\" ; config -g config.system.snmp | sed -e 's/ /=\'\''/' -e 's/$/'\'' \\/' -e 's/^/-s /'; echo "-a"
Here is an example SNMP Manager configuration
config \
-s config.system.snmp.address='192.168.123.154' \
-s config.system.snmp.authprotocol='SHA' \
-s config.system.snmp.authprotocol2='SHA' \
-s config.system.snmp.community='opengear2020' \
-s config.system.snmp.privprotocol='DES' \
-s config.system.snmp.privprotocol2='DES' \
-s config.system.snmp.protocol='UDP' \
-s config.system.snmp.protocol2='UDP' \
-s config.system.snmp.trapport='162' \
-s config.system.snmp.version='2c' \
-a
The commands can be copied and pasted directly on the Console Server CLI or saved in a file (attached) and deployed via Lighthouse Script Template.
Comments
0 comments
Article is closed for comments.