“Quick quick, write it down before you forget!” <– What I always tell myself when I’m in the middle of figuring something out.
What you will need:
- PowerFlex Gateway Server up and running – usually this should be already pre-installed in your environment
- SNMP trap destination server. In my lab environment I’m using a Fedora 25 server for some reason.
First let’s get your SNMP trap destination server up and running:
yum install net-snmp-utils net-snmp-devel net-snmp
Edit the snmptrapd file and add in this option:
vim /etc/sysconfig/snmptrapd
# snmptrapd command line options
# '-f' is implicitly added by snmptrapd systemd unit file OPTIONS="-Lsd"
OPTIONS="-Lsd -Lf /var/log/snmptrapd.log -m ALL"
Save and quit (:x) and then check your default directories for your MIBs (you will need this later).
net-snmp-config --default-mibdirs
/root/.snmp/mibs:/usr/share/snmp/mibs
Next, log into your PowerFlex Gateway Server, and edit your gatewayUser.properties file:
vim /opt/emc/scaleio/gateway/webapps/ROOT/WEB-INF/classes/gatewayUser.properties
Modify these two lines:
features.enable_snmp=true
snmp.traps_receiver_ip=<Destination IP>
Save and quit, (:x), and then make sure your MDM credentials are set properly:
./opt/emc/scaleio/gateway/bin/FOSGWTool.sh --set_mdm_credentials --mdm_user admin --mdm_password YourPWD --create_default_lockbox
Restart the Gateway service:
systemctl restart scaleio-gateway.service
While you are still in the /opt/emc/scaleio/gateway/webapps/ROOT/WEB-INF/classes/ path, copy the scaleio.mib file to your SNMP trap server destination host. (Ensure the destination path is correct as mentioned earlier).
scp scaleio.mib root@IP_of_SNMP_trap_server:/usr/share/snmp/mibs
Jump back over to your SNMP trap server, and restart the service (now that you have copied the MIB over, it will need a restart to load it).
[root@trap-server]# systemctl restart snmptrapd.service
Very that the snmptrapd service is now running, and listening on port 162:
systemctl status snmptrapd.service netstat -nlp | grep 162
You may need to also check that your firewall is open on the host too, e.g.
firewall-cmd --zone=public --add-port=162/udp –-permanent firewall-cmd --reload
Finally, you should now be able to see all of the SNMP traps from the system:
tailf /var/log/snmptrapd.log
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (501004) 1:23:30.04 SNMPv2-MIB::snmpTrapOID.0 = OID: SCALEIO-MIB::scaleioAEAlert SCALEIO-MIB::scaleioAlertSeverity = INTEGER: 3 SCALEIO-MIB::scaleioAlertType = STRING: "SDC.SDC.SDC_DISCONNECTED" SCALEIO-MIB::scaleioAlertSourceObjectId = STRING: "d1cb724e0000000a" SCALEIO-MIB::scaleioAlertActionCode = STRING: "SIO04.01.0000001"
Note: For some systems, you may also need the “EMC-MIB.MIB” file, please do contact Dell EMC support for this – https://www.dell.com/support/kbdoc/en-sg/497610
1 Response
[…] up from one of my earlier posts on SNMP traps, I often get asked on how to receive email alerts with […]