Friday, March 18, 2011

Using check_openmanage with check_mk

Here's my guide to installing check_openmanage in an OMD site, in case it helps anyone:

This was done on the following system:
Unless otherwise specified all paths are relative to the site owners home (ex: /opt/omd/sites/mysite)
  1. Make sure your dell servers had the following SNMP packages installed prior to installing OMSA (if not, it's easy to 'yum remove srvadmin-\*' 'yum install srvadmin-all': net-snmp, net-snmp-libs, net-snmp-utils
    • Start the OMSA services 'srvadmin-services.sh start' and then check 'srvadmin-services.sh status' to verify that the snmpd component is running
    • Ensure that snmpd is running and configured
    • Configure the firewall to allow access from your OMD server to udp port 161
  2. change users on your OMD server to the site user: $ su - mysite
  3. Download the latest check_openmanage from http://folk.uio.no/trondham/software/check_openmanage.html to ~/tmp and extract
  4. copy the check_openmanage script to local/lib/nagios/plugins (this defaults to $USER2$ in your commands)
    
    $ cp tmp/check_openmanage-3.6.5/check_openmanage local/lib/nagios/plugins/
    $ chmod +x local/lib/nagios/plugins/check_openmanage
    
  5. copy the PNP4Nagios template
    
    $ cp tmp/check_openmanage-3.6.5/check_openmanage.php etc/pnp4nagios/templates/
    
  6. If you are running CentOS 5.5/RHEL 5.5 or earlier (it's unclear whether or not this will be an issue in EL5.6), and you want performance graphs, you'll need to edit the check_openmanage.php template (see this bug: https://bugs.op5.com/bug_view_advanced_page.php?bug_id=4008), comment out the original condition and replace:
    
    $ vi etc/pnp4nagios/templates/check_openmanage.php
    
    ##    if(preg_match('/^enclosure_(?.+?)_temp_\d+$/', $NAME[$i], $matches)
    ##       || preg_match('/^e(?.+?)t\d+$/', $NAME[$i], $matches)){
    # This is the fixed line for CentOS 5.5 and prior
         if(preg_match('/^enclosure_(.+?)_temp_\d+$/', $NAME[$i], $matches)){
    
  7. Test check_openmanage to see that it can successfully query a node (ack, I need to update my driver)
    
    local/lib/nagios/plugins/check_openmanage -H dell-r710-01 -p -C MySecretCommunity
    
    Controller 1 [SAS 5/E Adapter]: Driver '3.04.13rh' is out of date|fan_0_system_board_fan_1_rpm=3600;0;0 fan_1_system_board_fan_3_rpm=3600;0;0 fan_2_system_board_fan_4_rpm=3600;0;0 fan_3_system_board_fan_5_rpm=3600;0;0 fan_4_system_board_fan_2_rpm=3600;0;0 pwr_mon_0_ps_1_current=0.6;0;0 pwr_mon_1_ps_2_current=0.4;0;0 pwr_mon_2_system_board_system_level=182;0;0 temp_0_system_board_ambient=21;42;47
    
    
  8. Edit the main.mk file to add tags to the OMSA hosts and the check command (the perfdata_format and monitoring_host I got from a previous emailer to the list, not sure if they are needed)
    
    all_hosts = [ 'dell-r710-01|linsrv|kvm|omsa|nonpub', 'dell-2950-01|linsrv|omsa|nonpub', 'hp-srv-01|winsrv|smb', ]
    
    # Are you using PNP4Nagios and MRPE checks? This will make PNP
    # choose the correct template for standard Nagios checks:
    perfdata_format = "pnp"
    #set the monitoring host
    monitoring_host = "nagios"
    
    # SNMP Community
    snmp_default_community = "someCommunityRO"
    
    snmp_communities = [
      ( "MySecretCommunity", ["nonpub"], ALL_HOSTS ),
    ]
    
    # other main.mk stuff
    
    extra_nagios_conf += r"""
    
    # ARG1: community string
    define command {
        command_name    check_openmanage
        command_line    $USER2$/check_openmanage -H $HOSTADDRESS$ -p -C $ARG1$
    }
    
    """
    
    legacy_checks = [
      # On all hosts with the tag 'omsa' check Dell OpenManage for status 
      # service description "Dell OMSA", process performance data
      ( ( "check_openmanage!MySecretCommunity", "Dell OMSA", True), [ "omsa" ], ALL_HOSTS ),
    ]
    
  9. That should be it, simply reload and your new check should start working for all hosts tagged with 'omsa'
    
    $ check_mk -O
    
    
To make it cleaner, the legacy_check should be able to determine the community string based on the settings in snmp_default_community and snmp_communities

I've only been testing check_mk for a few days now and am not sure how to do that. (suggestions?)

Hope this helps, and comments are welcome.

4 comments:

FlakRat said...

Since writing this, I have upgraded OMD to 0.50 and OpenManage to 6.5.1. The OMSA upgrade resulted in some of my systems (Dell M600 blades) reporting a warning state constantly via the Dell OMSA check.

Upgrading the check_openmanage and check_openmanage.php script solved the problem (latest version as of this comment).

I have also upgraded CentOS to 5.7 and the PHP change specified is still necessary.

Tim said...

Thanks for the info! Works great insode OMD 0.50 with a custom installation of check_mk!

Anonymous said...

Hello,
I have this error when I load the graph page:

Fatal error: Class 'rrd' not found in /usr/local/pnp4nagios/share/templates.dist/check_openmanage.php on line 314

i have installed php5-rrd and phpinfo shows that rrd extention in enabled.

any idias

darkfader said...

You can access the community via python scripting btw :)