Friday, June 24, 2016

How to setup all of your iDrac6s for SNMP alerting

I first did this post for iDrac7s at the this link (http://bradsjumpbag.blogspot.com/2016/03/how-to-setup-all-of-your-idracs-for.html).  Below I will show how to do the same thing for iDrac6s using firmware 1.99.

Please remember when setting your SNMP Community String that it is Case Sensitive.  That means that "public" is not the same as "Public".

Let's start with logging into a single iDrac.  Open a browser window and go to the IP of your iDrac6s.  Login with your credentials or the default ones if you haven't changed them.  Which you should change the default credentials or disable them and add new accounts for security reasons.  You should also have all iDracs on a separate management network that is not accessible from the Internet.  If you need to get to them from external, I suggest you setup some machine that you can remote into and then access that management network from there, or setup a highly secure gateway or VPN that will give you access to that management network.




Go to Alerts.  The first thing you want to set is to make sure Platform Event Filter Alerts are Enabled.  Then look at the Generate Alert column and make sure all of these are checked.  They are checked by default, so the only way they should not be checked is if someone unchecked them.  Now scroll to the bottom of the page and click on the Apply button on the far right.




Click on the Trap Settings tab at the top..  On this page you will need to enable Destination1 with the check box and enter in the destination server IP address.  Since I am setting this up for OpsMgr, I will put in the IP of my OpsMgr server.  If you are using a community string other than "public", put it in the Community String field.  Then click on the Apply button at the bottom right of the page.




There is one more place to check your community string.  Go to iDrac Settings on the left side.  Click on Network/Security tab, and then the Services sub-tab at the top.  Scroll down to find SNMP Agent box.  Make sure the check box is checked so it is enabled and enter your community string here.  Then click the Apply button at the very bottom of the page.




Now, if you have your destination server (in my case OpsMgr) setup already, you should start receiving traps.  You can test this with the SNMP Test Trap button back on the Alerts\Trap Settings page.  Click the Send button under Test SNMP Trap in the same row as the destination server you want to send to.




In OpsMgr you will see an informational alert like these.  These alerts could show up in Active Alerts and Server and Rack Workstation Alerts, RemoteAccess Alerts, or PET Traps depending on the iDrac version and firmware version.  They will all be Informational Alerts but should have the word Test in the Name.




Now that we know that 1 iDrac works, we need to copy these settings to all the others.  You will need a machine with access to the management network of all of your iDracs.  That machine will need the Dell DRAC Tools installed. The current latest version, as of 6/24/2016, is 8.3 and here are the link for the 64bit version.
64bit - http://www.dell.com/support/home/us/en/04/Drivers/DriversDetails?driverId=6RWMR

You will also need a text file with all of your iDrac6 IPs, each listed on a separate line.

The next step is to grab a copy of the config of the iDrac that you just set in the above steps.  On your machine with access to your iDrac network, and with the DRAC Tools installed, you are going to run the following command from an Administrative level command prompt.

**NOTE**: These racadm commands below are for iDrac6 running 1.99.  Different firmware may have different commands that you will need to look up in the iDrac CLI manuals if the below do not work.

racadm -r IPofTheIDrac -u Username -p Password getconfig -f LocationForTxtFile

Replace IPofTheIDrac with the IP of the iDrac you configured above.
Replace Username with your iDrac username.
Replace Password with your iDrac password.
Replace LocationForTxtFile with a path to where you want the configuration text file created.  I put the config file in the same location as my iDracs.txt file with all of my iDrac IPs just to keep them together.  In this example I put both in a folder c:\idrac.




Now we need to edit that config.txt file.  Open it with your favorite text editor.  You can use this file to make changes to all of your iDracs with the same firmware.  As you scroll through you may see other sections you want to make changes to if you didn't do it in the GUI.  But for this post I am only focusing on SMNP settings.  So we are going to remove everything else in the config.txt file.

The other sections we are going to keep are [cfgOobSnmp], [cfgIpmiLan], [cfgIpmiPet] sections.  There are 4 cfgIpmiPet sections, each with a different Index, but I only set the first one so I am removing the others.  You don't have to keep every setting under each section.  Just the settings that we changed in the GUI.

Now save that file, maybe with a different name so that you can keep the original.  I'm going to save mine as idrac6push.txt in the same folder.

Here is where we finally push the config to all iDracs.  You will use a PowerShell script.  Right click on the PowerShell icon on your taskbar and select Run ISE as Administrator.  When it opens copy this script into the top window.  You will need to replace Username and Password to your own.

$servers = Get-Content .\idracs.txt
$servers | foreach {
    invoke-expression "racadm.exe -r $_ -u Username -p Password config -f c:\idrac\idrac6push.txt"
    }




When you are ready, click on the green play button in the middle of the tool bar to start the script.  The script will set the config on each iDrac one at a time.  You will see output for each idrac like in my screenshot above showing those 3 sections we kept in the config file.  You can scroll back through the results pane to see if there were any errors.

Congratulations, now all of your iDrac6 devices should have the same SNMP settings.