Nagios How to.

Viewing 1 post (of 1 total)
  • Author
  • Avatar

    For those less fortunate to have MOM.

    Attatched are some screenshots.

    you can get a small net installation of debian from

    mount the iso in ESX/Vmware or Burn to CD and boot.

    Install is simple here is a guide.

    now your booted into the system you need to log in as root and the password you chose during setup.

    the first step i always do is install Midnigth Commander, its a easy navigation tool for navigating through the Linux OS structure.

    #apt-get update
    #apt-get install mc

    after install mc you can simply type mc at the # and you will have your navigation menu to browse the OS

    Installing Apache

    #apt-get install apache2

    Install Other

    #apt-get install libapache2-mod-php5
    #apt-get install build-essential
    #apt-get install libgd2-xpm-dev

    Create a Nagios User

    #useradd -m -s /bin/bash nagios

    Create a password for it.

    #passwd nagios

    Ceate a group and add nagios and www-data users to the group.

    #groupadd nagcmd
    #usermod -a -G nagcmd nagios
    #usermod -a -G nagcmd www-data

    Installing Nagios

    #cd /tmp


    #tar xvzf nagios-3.2.0.tar.gz

    #cd nagios-3.2.0

    Run the Nagios configure script, passing the name of the group you created earlier like so:
    #./configure –with-command-group=nagcmd
    Compile the Nagios source code.
    #make all
    #make install
    #make install-init
    #make install-config
    #make install-commandmode

    Nagios is now installed to “usr/local/nagios”

    #mc /usr/local/nagios

    use the arrow keys to navigate and enter to proceed into the directory.
    while using “mc” the F keys are your tools.

    F4 = edit
    F2 = save
    F10 = quit or save and quit.

    the first thing we need to do is set up hosts and services.

    nagios config files are located in /usr/local/nagios/etc

    I have attached my config files for you to use.

    nagios.cfg belongs in the root of /usr/local/nagios/etc

    windows.cfg is my windows hosts and services this belongs in /usr/local/nagios/etc/objects/

    template.cfg also belongs here.

    Lastly hostextinfo.cfg copy this to the root of /nagios/etc

    once you have copied all the config files or edit yours.

    make sure that you edit the up addresses to match you config and the hostnames.

    example of a hosts setup

    define host{
    use windows-server ; Inherit default values from a template
    host_name Enterprise ; The name we’re giving to this host
    alias Exchange Server ; A longer name associated with the host
    address ; IP address of the host
    parents cisco

    “use” windows-server is a template, located in templates.cfg, it just sepcifies the alert times and monitoring settings such as how often to check for problems.

    “parents” is important for the MAP as in my attached image, i have told nagios that cisco is a parent of enterprise, cisco is our swicth, you must also have a host setup for this, at minimum you need a host setup, service is optional, in the map it will link enterprise to cisco.

    once you have a host setup and you need a service for that host like a ping or a http check, there are lots of checks available some advanced some simple.

    as in my config file an example of service is

    define service{
    use generic-service
    host_name Enterprise
    service_description Uptime
    check_command check_nt!UPTIME

    This will check the uptime of the machine and display it.

    Next install a tiny plugin to the servers/desktops.

    i use a tool called NSClient++ whcih works with Windows Server 2003/2008 download documentation

    i recommend you test 1 server first, choose your server and install nsclient, attached is my NSC.ini that needs to be placed in the NSClient Directory in Program Files.

    Firewall Ports needed Open on client firewall.

    TCP 12489
    TCP 5666

    copy the NSC.ini then edit;


    you will find this in 2 places.

    then start the service.

    commands to start/stop/restart nagios

    #/etc/init.d/nagios start
    #/etc/init.d/nagios restart
    #etc/init.d/nagios stop

    Nagios is the most anoying service to start if you have errors in your configs, especially when yo have multiple config files

    here is a great tool to run before you start nagios.

    /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

    this will report and errors in config files and there line number.

    Well hope this helps, seems like a lot to do but its worth it, i havent even touched on 5% of nagios capabilities, i can go into much more at the request of anybody.

    if you need assistance just reply here.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.