Home » Categories » Products » Nagios XI » Documentation » Architecture

Nagios XI - Manage MIBs Architecture

Nagios XI Manage MIBs Architecture Overview

Nagios XI allows users to manage their MIBs through the Manage MIBs page.  This will allow users to view permission, delete, upload and download MIBs.  This document will explain how the Manage MIBs page features, how the features work and how to troubleshoot using the page.

 

What is a MIB?

The Simple Network Management Protocol (SNMP) uses a Management Information Base (MIB) to define any Object Identifiers (OID) and TRAP definitions to be able to translate the machine messages sent a SNMP messages and use the MIB definitions and database to define these values into human readable events.  In the SNMP (Simple Network Management Protocol) there is more explanation on how MIBs are utilized in the SNMP workflow

 

Manage MIBs Features

The manage MIBs page is a table of each MIB file located in /usr/share/snmp/mibs/ which is the default MIBs directory for snmp and Net-SNMP which is the most commonly used SNMP Tool for Nagios XI.

By default Nagios XI installs Net-SNMP and this package contains a number of MIBs that you will already have displayed in the MIB table as shown below:

 

 

Here you can see the folder displayed showing the MIB name, the file name of the MIB, owner, group and permissions, the Date the MIB was put into the folder, and 2 Actions- the download button (the floppy icon) and a delete button (the orange X).

To add a new MIB download it to your you MIBs directory by clicking Choose File and selecting a proper MIB file from your local machine.  If you need to find a MIB use the links at the top of this page which will direct you to websites containing hundreds of MIBs.  Once you find a file select Upload to put it into the MIBs directory.

When you select the Process Trap check box the MIBs page will parse the MIB file you selected into the snmptt.conf which will allow the MIB definitions to be accepted by snmptrapd or whatever SNMP Agent you are using to collect MIBs.  If the TRAP definitions are found in snmptt.conf then the Traps of that kind you receive with the SNMP Agent will be written to the snmptt database as Normal traps.  If a definition is not located in snmptt.conf and you receive a SNMP Trap of that type then the SNMP Agent will receive the trap and write them to the snmptt_unknown database.

The architecture of these features is described in the next section.

 

Manage MIBs Architecture

The displaying of the MIBs table is done by the get_mibs() function located in /nagiosxi/basedir/html/includes/utils-mibs.inc.php. The function will parse each file located in /usr/share/snmp/mibs/ directory.  Here is the format that the MIBs will be added to an array that will help display the MIBs in our table:

 

$mibs[] = array(
    "mibname" => $mib_name,
    "file" => $file,
    "timestamp" => $ts,
    "date" => get_datetime_string($ts),
    "perms" => $perms,
    "permstring" => $perm_string,
    "owner" => $owner,
    "group" => $group,
);

 

Then the mibs.php page will display all the mibs in the array and draw the MIB table using html.

The Process trap check box uses either addmib(), which is part of a package created by Nagios to parse MIBs, or the commonly used snmpttconvertmib script.  Here is the workflow of using the Process trap check box and how the MIB is added using one of these to parse Trap definition into snmptt.conf:

 

 

  1. Choose File: Select a proper MIB to import and select the Process trap check box.

  2. Launch the do_upload()function that will decide how the MIB will be processed based on the system environment.

    1. Check if snmptt.ini exists and is writable by Nagios.

    2. Create a processed_mibs/ directory inside the /usr/share/snmp/mibs/ directory.

    3. Execute run_addmib() from /usr/local/bin/addmib, check if it is executable, run the command from the CLI and return the return code. (Failure message will be in this format: "Failed to execute addmib command for rc: addmib_returncode")

    4. If the addmib script failed for any reason then use the convert_mib() function which will process using snmpttconvertmib from /usr/bin/snmpttconvertmib.  'which snmpttconvertmib 2>&1' will be run to verify the location of the script.  The snmpttconvertmib command will use '--in=' and '--out=' to parse the Trap definitions into the snmptt.conf file.

  3. Reload and display MIB table with get_mibs().

Note: If you do not have addmib() on your local machine or the script isn't executable then the snmpttconvertmib Python script will be used instead.  This script WILL NOT process trap definitions through the user interface and you will have to either install the addmib() script using this document or by manually using another Manual MIB parser to write the Trap definitions to snmptt.conf.

 

Troubleshooting

addmib - "snmptt.ini is not writable by Nagios"

Run these commands on the CLI to update the permissions on the snmptt.ini file:

chown root.nagios /etc/snmp/snmptt.ini /etc/snmp
chmod g+w /etc/snmp/snmptt.ini /etc/snmp

 

snmpttconvertmib - "snmpttconvertmib is not in the correct location or is not installed. If you have not run the Nagios XI SNMP Integration"

Run the Nagios XI SNMP integration script.  The guide for this is located in the Resources section below and details exactly how to fix this issue.

 

snmpttconvertmib - "Failed to convert uploaded file to snmptt mib. (rc: ' ')"

There are a number of errors that can trigger this message, but when you receive this code it will be anything but a successful execution code (0) and a failure code (4).  A return code of 2 is considered an OK code and a code of 0 is a successful execution code which are considered the same thing when referring to snmpttconvertmib.

 

snmpttconvertmib - "Uploaded file had one or more failed translations when converting to snmptt mib."

The convert_mib() function, which runs snmpttconvertmib, will make a regex match on 'Failed Translations' from the snmpttconvertmib convert results.  If there are any failures then this message will be displayed.  This likely mean the MIB you are using is missing parts or is corrupt.  If the MIB looks correct it is prudent to find a fresh copy of the MIB and try running this again since there could be a single character out of place that would trigger this message.

 

snmpttconvertmib - "MIB file did not contain any TRAP-TYPE or NOTIFICATION-TYPE"

    "MIB is added, but is does not contain any TRAP-TYPE definitions, so no traps were added, even though user input said there should be traps specified."

This message will trigger if you try to process a MIB that doesn't need to be processed or is missing TRAP definitions that might have been expected, but aren't correct.  Again, the first and easiest step is to re-download the MIB file to ensure it is correct.  Sometimes you might need a MIB as a dependency to another MIB, which may or may not have Trap Definitions, but you more than likely will NOT have to process dependency MIBs at all.  They just need to be in the MIBs folder to fulfill their requirement.

 

Resources

How to Integrate SNMP Traps With Nagios XI

SNMPTT - snmpttconvermib

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/

5 (1)
Article Rating (1 Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments (2) Attachments
Related Articles RSS Feed
Nagios XI - Best Practices - NWC15
Viewed 2603 times since Thu, Feb 4, 2016
Nagios XI - Switch and Router Wizard Architecture
Viewed 2243 times since Fri, Feb 6, 2015
Nagios XI - Event Manager Architecture
Viewed 1334 times since Sun, Feb 8, 2015
Nagios XI - Cleaner Cron Architecure
Viewed 1046 times since Sun, Feb 8, 2015
Nagios XI - How to Manage Remote Nagios XI Servers
Viewed 1205 times since Thu, Jan 28, 2016
Nagios XI - Maximizing Performance In Nagios XI
Viewed 1500 times since Thu, Jan 28, 2016
Nagios XI DB - Maintenance Architecture
Viewed 1718 times since Sun, Feb 8, 2015
Nagios XI - Command Subsystem Architecture
Viewed 1461 times since Thu, Feb 5, 2015
Nagios XI - How XI Works
Viewed 1463 times since Wed, Jul 19, 2017
Nagios XI - Performance Data Architecture
Viewed 1767 times since Wed, Jan 28, 2015