Set up and Configure SNMP Monitoring
This section describes the steps to set up the SNMP service by configuring the SNMP Agent to provide and retrieve data over the network. Also, provides information about verify the SNMP monitoring.
Configure the SNMP Agent
To configure the SNMP Agent, follow the below steps:
-
Log in to the SNMP Agent (VRA) via SSH as root user. Refer to SSH Connections for more details.
-
Open the /etc/snmp/snmpd.conf file and edit the following:
-
Comment this line agentaddress 127.0.0.1,[::1] by adding # at the beginning.
-
Add this line agentaddress udp:127.0.0.1:161,udp:<IPv4 address of vra>:161 to the file.
-
-
Open the /etc/snmp/snmp.conf file and edit the following:
Comment this line mibs: by adding # at the beginning.
-
Go to the directory /opt/hidglobal/appliance/lib/.
-
Open the createSNMPv3User.sh file and edit the following:
net-snmp-create-v3-user -ro -A (Password Phrase) -a SHA -X (Password Phrase) -x AES (Username as per your choice).
-
Save and close the file.
-
Run the below command.
Copy./createSNMPv3User.sh
The created user will be added in the /var/lib/snmp/snmpd.conf file.
Sample Output:
# Creating the SNMPv3 user snmpAdmin to allow SNMP manager to query the appliance for the heartbeat check and application specific queries echo "Creating the SNMPv3 user ..." # backup the exisiting configuration #cp /etc/snmp/snmpd.conf{,.bak} sudo systemctl stop snmpd cp /usr/bin/net-snmp-create-v3-user ~/ sed -ie '/prefix=/adatarootdir=${prefix}\/share' /usr/bin/net-snmp-create-v3-user net-snmp-create-v3-user -ro -A STrP@SSWRD -a SHA -X STr0ngP@SSWRD -x AES snmpADmin sudo systemctl start snmpd
Verify the SNMP Monitoring
To verify the SNMP monitoring, follow the below steps:
-
Log in to the SNMP Manager and make sure the SNMP service is up and running.
-
Use snmpget or snmpwalk on the SNMP Manager with Agent address and credentials to retrieve data from a remote host.
Sample Output:
[root@varhel8 ~]# snmpget -v3 -l authpriv -u snmpAdministrator -a SHA -A hid@123456 -x AES -X hid@123456 10.40.34.205 sysName.0 SNMPv2-MIB::sysName.0 = STRING: appliance [root@varhel8 ~]# snmpget -v3 -l authpriv -u snmpAdministrator -a SHA -A hid@123456 -x AES -X hid@123456 10.40.34.205 sysDescr.0 SNMPv2-MIB::sysDescr.0 = STRING: Linux appliance 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) x86_64[root@varhel8 ~]# [root@varhel8 ~]# snmpwalk -v3 -a SHA -A Hid@123456 -x AES -X Hid@123456 -l authNoPriv -u SNMPAdmin 10.40.34.228 sysName.0 SNMPv2-MIB::sysName.0 = STRING: debian11