Nagios XI Docker Container

nagios_docker

I think most of you have heard of Docker. It’s free, ist’s fast, there are a lot of prebuild packages, in short: it’s the playground we’ve all been waiting for.
But when I searched for a Nagios XI docker container, there seemed to be no such thing….
Therefore I build one myself to experiment with.

So if you want to play with Nagios XI 5, check out Docker Hub and fire up a container within minutes
https://hub.docker.com/r/tgoetheyn/docker-nagiosxi/

For those not that familiar with docker, there is a bunch of helpfull information on the Docker site itself:  https://docs.docker.com/
Make sure to check out how to install docker and take som time to look at the different Docker Run options.

Enjoy!

Unified Monitoring Framework

Download Project

You can find the latest official release of this project on GitHub.


Error: Your Requested widget " wp-github-commits-12" is not in the widget list.
  • [do_widget_area sidebar-1]
    • [do_widget_area sidebar-2]
      • [do_widget id="tag_cloud-2"]
    • [do_widget_area widgets_for_shortcodes]
      • [do_widget id="wp-github-commits-14"]
      • [do_widget id="wp-github-commits-17"]
      • [do_widget id="wp-github-commits-15"]
      • [do_widget id="wp-github-commits-25"]
      • [do_widget id="wp-github-commits-3"]
      • [do_widget id="wp-github-commits-13"]
      • [do_widget id="wp-github-commits-20"]
      • [do_widget id="wp-github-commits-16"]
      • [do_widget id="wp-github-commits-2"]
      • [do_widget id="wp-github-commits-24"]
      • [do_widget id="wp-github-commits-23"]
      • [do_widget id="wp-github-commits-21"]
      • [do_widget id="wp-github-commits-5"]
      • [do_widget id="wp-github-commits-6"]
      • [do_widget id="wp-github-commits-26"]
      • [do_widget id="wp-github-commits-9"]
      • [do_widget id="wp-github-commits-22"]
      • [do_widget id="wp-github-commits-19"]
      • [do_widget id="wp-github-commits-8"]
      • [do_widget id="wp-github-commits-7"]
      • [do_widget id="wp-github-commits-18"]
      • [do_widget id="wp-github-commits-11"]
      • [do_widget id="wp-github-commits-4"]
      • [do_widget id="wp-github-commits-12"]
      • [do_widget id="wp-github-commits-27"]
    • [do_widget_area wp_inactive_widgets]
      • [do_widget id="recent-posts-2"]
      • [do_widget id="recent-comments-2"]

    Unified Monitoring Framework (UMF) – Introduction

    I wanted to make the ‘Nagios XI Downtime Framework‘ (NDF) better for quite some time, but was limited by the forms generated by an old community edition of Powershell Studio. As Sapien Technologies asks 389 $ for their Powershell Studio 2014, and is no longer distributing their Powershell Studio Community Edition, I started looking for an alternative. And it seems I did not have to search for a long time, as Microsoft enabled users to use their Community Edition of Visual Studio 2013 since beginning of 2014.

    Visual Studio means I can use XAML, which provides a way to write a GUI. XAML, which stands for ‘Extensible Application Markup Language’, is a declarative XML-based language used extensively in .NET Framework 3.0 and 4.0 technologies. The Powershell ability to load XAML into variables, made it the perfect combo to make rich and beautifull gui’s.

    So I started a project from scratch somewhere in November 2014, named ‘Windows Monitoring Framework’.  As I recently realized Microsoft would probably not be very happy if I released a project with ‘Windows’ in it, I decided today to change it’s name to ‘Unified Monitoring Framework’, shortnamed UMF. It’s a perfect name as the plan is to show outputs and issues gathered from multiple sources, such as Nagios, logfiles, backup reports, custom Powershell scripts etc.

    Important note is that my ‘Unified Monitoring Framework’ will only work on Windows boxes with Powershell v4 or later installed.. So on servers where you cannot yet install Powershell v4 or later, you will still have to use Nagios Downtime Framework to enable logged in users to schedule downtime.

    Unified Monitoring Framework (UMF) – Features

    So what’s better in UMF compared to my old ‘Nagios Downtime Framework’ (NDF)? How will it help you to improve your monitoring environment?

    – It is possible to specify the amount of days, hours or minutes you would like the selected hosts to go into downtime. NDF was limited, because it only gave you a few possible duration options.

    – It does not make use of a local configuration file stored, but will use a json query to the Nagios server to get all members of a hostgroup. This does require you to make a hostgroup for each host which has related hosts on it, but at least all the configs are in Nagios and do not have to be saved locally on all your servers. The hostgroup name needs to follow certain naming convention in order to work properly. The form is “hg_relations_<servername>”. So if your host would be named srvwindows01, the hostgroup containing the related host should be named “hg_relations_srvwindows01”. All members of this hostgroup will be detected and shown in the host relations listbox. Feel free to customize the Powershell code as you wish to reflect the naming conventions of your Nagios setup.

    – Besides quering the hostgroup that will contain all hosts related to the Windows host on which WMF is executed, it will also query the host itself and list all the hostgroups it is a member of. This seemed like an important feature, as at the moment I’m quite sure several hosts are not in the correct hostgroups. Showing this information when users enable downtime, should result in a more consistent and  less error prone host configuration. It is my hope that in time I find the time to exxpand the tool to enable users to edit the hostgroups from the tool, but this is a rather long term project.

    – Besides enabling users to start downtime, the tool will also be able to reset the state of passive services. As we send all critical application and system events to Nagios, thanks to the real-time eventlog monitoring capabilities of NSClient++, this is also an important feature for us. As setting downtime does not prevent events from coming into their respective services, we have multiple support incidents for critical events, which were in fact generated during maintenance windows. Every Windows host in my Nagios setup has one EVT_Application and one EVT_System service, which will receive all errors of their respective Windows eventlogs (minus excluded ones). These services will be reset to an OK state at the moment the “Reset Passive Services” button is pushed.

    – The System tab started from a tab with Powershell queried information to an integrated webbrowser xaml component making use of the backend api from Nagios XI to show the information of the host where UMF is launched.

    – The config tab enables you to see the Nagios and UMF related settings.

    UMF – Requirements and how to?

    In order to work several requirements have to be met.

    1. Nagios Core 4 is required, as UMF uses Json to query all the required information. Read through this article for more information about the new Json explorer in Nagios Core 4.
    2. Nagios Remote Data Processor (NRDP) is required, as UMF uses the NRDP token to start certain tasks, such as starting downtime. Please read through this document about configuring inbound checks in Nagios XI
    3. Powershell v4 or later is required, as some commands in the code will not work on Powershell v3 or lower. You can use Powershell v4 by installing Windows Management Framework 4.0.
    4. A Nagios XI read-only user is required with adequate permissions.
    5. Backend API token for this read-only user is required to enable passwordless login on the System tab.

    You will need a way to distribute and update UMF to your Windows Servers. I will release a script to do this soon, just need some time to clean it up.

    UMF_Tab_Config_01

    All the UMF settings are saved in umf_options.xml which needs to be in the same folder as the umf main script. Please start the script on one Windows Server, go to the configuration tab and fill inn all the required fields. Alternatively you can also open the XML containing the settings and edit it in your favorite XML editor.

    <Objs Version=”1.1.0.1″ xmlns=”http://schemas.microsoft.com/powershell/2004/04″>
    <Obj RefId=”0″>
    <TN RefId=”0″>
    <T>System.Collections.Hashtable</T>
    <T>System.Object</T>
    </TN>
    <DCT>
    <En>
    <S N=”Key”>MaxJobs</S>
    <S N=”Value”>4</S>
    </En>
    <En>
    <S N=”Key”>BackendApiToken</S>
    <Nil N=”Value” />
    </En>
    <En>
    <S N=”Key”>ReadOnlyUser</S>
    <S N=”Value”>unknown-read-only-user</S>
    </En>
    <En>
    <S N=”Key”>ReadOnlyPw</S>
    <S N=”Value”>unknown-read-only-password</S>
    </En>
    <En>
    <S N=”Key”>ReportPath</S>
    <S N=”Value”>C:UsersWillemDesktopTest</S>
    </En>
    <En>
    <S N=”Key”>NrdpToken</S>
    <S N=”Value”>unknown-nrdp-token</S>
    </En>
    <En>
    <S N=”Key”>NagiosServer</S>
    <S N=”Value”>unknown-nagios-server</S>
    </En>
    </DCT>
    </Obj>
    </Objs>

    After hitting the ‘Save Configuration’ button in the UMF gui, all configuration fields are saved to the XML file.

    More screenshots:

    UMF_Tab_System_02

     

    UMF_Tab_Nagios_01

    I hope you can make it work with the above information. I will try to add info when I find some time. As you can see in the later version, I added a recent backups listview. We are using Netbackup, so the script will read OpsCenter xml files with backup information ad fill up the listview with it. If you take the time to analyze the script, you should be able to do the same for you backup solution.

    Willem