SNMP ChecksSeptember 10. 2009
How check_mk makes use of SNMPA large class of hosts being monitored does not have an operating system where you can install a check_mk_agent but provides access to vital data via SNMP. Most prominent member of those devices are network and Fibre Channel switches. Check_mk supports monitoring via SNMP and ships a couple of SNMP checks for various devices ready to use. The basic principle is the same as with the check_mk agent: check_mk does not retrieve single values from the target host but gets all data to be monitored at once. However, there are a few differences to the classical checks via TCP:
Setting up SNMP checks with check_mk1. Configuring and trying out SNMP manuallyYour first step should always be to try out if you can get data via SNMP manually. Most probably you will have to configure your SNMP device in order to allow your Nagios server access via SNMP. In most cases you have to configure:
What SNMP calls "community" is basically a password. The default is public. If you do not worry about security then you can use that. After your configuration is done, you should be able to retrieve the OID sysDescr.0 via snmpget. Here is an example for the host 10.1.0.17 with the community public: user@host> snmpget -v1 -c public 10.1.0.17 sysDescr.0 SNMPv2-MIB::sysDescr.0 = STRING: Superduper Switch V34/A Version 11.02 2. Declaring hostsWhen that works, you are ready to configure your host for check_mk. Put it into all_hosts as usual, but add the host tag snmp the each SNMP based host. Otherwise check_mk would try to contact those hosts via TCP port 6556 when doing inventory. Here is an example: main.mk all_hosts = [ "switch14a|snmp", # SNMP host "switch14b|test|snmp", # SNMP host "hostfoo17|othertag|linux", # normal host "hostfoo18", # normal host ] 3. The SNMP communityCheck_mk needs to know your SNMP community. If that is "public", then you do not need to configure anything - that is the default. Otherwise set your company-wide default community in main.mk with the variable snmp_default_community: snmp_default_community = "this-is-secret" If some devices have other communities you need to configure them in the configuration list snmp_communities. It is compatible to datasource_programs. The easiest way is to use host tags. Lets assume you have switches with different communities in Munich and Berlin. First tag them accordingly in all_hosts main.mk all_hosts = [ "switch14a|munich|snmp", "switch14b|munich|snmp", "switch14c|berlin|snmp", "switch14d|berlin|snmp", ] Now you make use of these tags when assigning the communities. Please do not leave out the ALL_HOSTS and also make sure that you put the host tag into a Python-list (square brackets): main.mk snmp_communities = [ ( "muc-secret", ["munich"], ALL_HOSTS ), ( "ber-secret", ["berlin"], ALL_HOSTS ), ] Single hosts can more easily be configured without host tags. The following example defines an exception for the host switch14a. It shall have the SNMP community testpublic. Exceptions must always be put at the front of your list sinde the first match decides about the result: main.mk snmp_communities = [ ( "testpublic", ["switch14a"] ), # This switch uses "testpublic" ( "muc-secret", ["munich"], ALL_HOSTS ), ( "ber-secret", ["berlin"], ALL_HOSTS ), ] If you are unsure if your configuration is correct, you can use check_mk with -D in order to dump out the net result of main.mk:
4. InventoryA speciality of SNMP checks is that the inventory must always be done explicitely. A check_mk -I alltcp will not scan for SNMP based checks. The reason is that for performance issues check_mk will never retreive the complete SNMP tree of a device, but only those subtrees that are relevant for the configured checks. The following example will scan the devices switch14a and switch14b for new checks of the type ifoperstatus: root@linux# check_mk -I ifoperstatus switch14a switch14b ifoperstatus 27 new checks 5. Supported checksIn order to learn which types of SNMP checks your version of check_mk provides, please call check_mk -L and grep for snmp: user@host> check_mk -L | grep snmp blade_bays snmp no yes BAY %s blade_misc snmp yes yes SENSOR %s blade_powerfan snmp yes yes Power Module Cooling Device %s blade_powermod snmp no yes Power Module %s bluecoat_diskcpu snmp yes yes %s bluecoat_sensors snmp yes yes %s cisco_fan snmp no yes %s cisco_locif snmp yes yes Port %s cisco_power snmp no yes %s cisco_temp snmp yes yes %s df_netapp snmp yes yes fs_%s fc_brocade_port snmp yes yes PORT %s fsc_fans snmp yes yes FSC %s fsc_subsystems snmp no yes FSC %s fsc_temp snmp yes yes FSC TEMP %s ifoperstatus snmp yes yes Interface %s ironport_misc snmp yes yes %s snia_sml snmp no yes SNMP %s For more information about a specific check please refer to the check manual of the check type in question. Here you'll also learn if you need to install a specific SNMP MIB file. Only a few checks need that. Because of copyright issued those MIB files are not shipped together with check_mk. You hardware vendors should supply them for you. Please refer check type in question for further information. We also apologize for the fact that not all checks provide manual pages yet. We're working on that. Your contribution will be appreciated... |
| |||||||||||||||||||||