Announcement

Collapse
No announcement yet.

Nagios How to.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Nagios How to.

    For those less fortunate to have MOM.

    Attatched are some screenshots.

    you can get a small net installation of debian from

    http://cdimage.debian.org/debian-cd/...86-netinst.iso

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

    Install is simple here is a guide.

    http://www.debian.org/releases/stabl...n#di-partition

    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

    #wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz

    #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 10.0.0.12 ; 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


    http://nsclient.org/nscp/downloads download

    http://nsclient.org/nscp/wiki 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;


    allowed_hosts=10.0.0.2/32


    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.

















    Attached Files
    MCSE 2003; MCTS Vista; Sec+; CCNA
    Attitude Makes The Difference!
    in other words you got to WANT to do it..


  • #2
    Re: Nagios How to.

    I agree- Nagios is a fantastic tool. I'm just limited in my time to deploy it, even though I'd love to.

    Could you tell us though, whether you wrote these instructions yourself, or if they came from somewhere else... ?It's always nice to acknowledge the source..
    Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

    Comment


    • #3
      Re: Nagios How to.

      Yes, these are my instructions, my config files, most online guides tell you to install nagios from package managers using Aptitude or Yum etc, i like to install from source.

      Hence why i wrote it this way
      MCSE 2003; MCTS Vista; Sec+; CCNA
      Attitude Makes The Difference!
      in other words you got to WANT to do it..

      Comment


      • #4
        Re: Nagios How to.

        Originally posted by ikon View Post
        Yes, these are my instructions, my config files, most online guides tell you to install nagios from package managers using Aptitude or Yum etc, i like to install from source.

        Hence why i wrote it this way
        Geek Nothing wrong with either of those package managers or precompiled binaries for that matter. What you use on the client? Presumably SNMP? Or does Nagios have its own agent like Zabbix does? Only ever used Nagios very sparingly as iv favored Zenoss in the past but you've made this look so pretty an all!
        Last edited by scurlaruntings; 5th November 2009, 22:43.

        Comment


        • #5
          Re: Nagios How to.

          probbaly a good time to rebump this thread.

          I have a HyperV guest, sitting on a HyperV cluster containing two nodes.

          I'm struggling with the parent/child relationship.

          Obviously the guest should be a child of something.
          but if i make the cluster a child of the two nodes, then if one node fails, the cluste rwill report as failed..
          so so I make the two nodes children of the cluster, and then the guest child of the cluster AND the nodes ?


          I also need to get some dell OMSA monitoring on the hyperv nodes.
          Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

          Comment


          • #6
            Re: Nagios How to.

            Originally posted by tehcamel View Post
            probbaly a good time to rebump this thread.

            I have a HyperV guest, sitting on a HyperV cluster containing two nodes.
            I cannot see how this is related to Nagios... Or is it only me?

            Sorin Solomon


            In order to succeed, your desire for success should be greater than your fear of failure.
            -

            Comment


            • #7
              Re: Nagios How to.

              the parent/child relationship within nagios

              ie, if I have a switch, with 10 computers below it, and i make the switch the parent for all those computers, if te switch goes down, it only tells me about the switch. I get one alert, instead of 11.

              If i have a cluster with two devices, do i make the cluster address the parent, or the clusternodes the parent?
              If I make the cluster nodes the parent, then if one fails, it will assume the cluster is down

              im confusing myself :P


              but it's relating to nagios in that I'm trying to work out hte most appropriate way to setup the parent relationship for the host object configuration
              Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

              Comment


              • #8
                Re: Nagios How to.

                Originally posted by scurlaruntings View Post
                Geek Nothing wrong with either of those package managers or precompiled binaries for that matter. What you use on the client? Presumably SNMP? Or does Nagios have its own agent like Zabbix does? Only ever used Nagios very sparingly as iv favored Zenoss in the past but you've made this look so pretty an all!
                Sorry took so long to reply,

                The server are installed with a small plugin called NSClient++ works with win2k to 2008, uses a custom protocol with encrytion options, basically remotely executes SNMP or WMI tasks and send back the results to nagios, its very nice.
                MCSE 2003; MCTS Vista; Sec+; CCNA
                Attitude Makes The Difference!
                in other words you got to WANT to do it..

                Comment


                • #9
                  Re: Nagios How to.

                  Originally posted by tehcamel View Post
                  the parent/child relationship within nagios

                  ie, if I have a switch, with 10 computers below it, and i make the switch the parent for all those computers, if te switch goes down, it only tells me about the switch. I get one alert, instead of 11.

                  If i have a cluster with two devices, do i make the cluster address the parent, or the clusternodes the parent?
                  If I make the cluster nodes the parent, then if one fails, it will assume the cluster is down

                  im confusing myself :P


                  but it's relating to nagios in that I'm trying to work out hte most appropriate way to setup the parent relationship for the host object configuration
                  Ive not found a way to have more than 1 parent, i guess you could make the load balancers parent of the cluster IP, then have the cluster nodes parent of eachother.

                  or if no loadbalancers then have Switch parent to cluster IP m the cluser nodes parent eachother, that way if the cluster nodes fail you get a specific alert just for the failover and if there is a total cluster failure your monitring the cluster IP, you can also monitor the specifc services.


                  Hope this helps
                  MCSE 2003; MCTS Vista; Sec+; CCNA
                  Attitude Makes The Difference!
                  in other words you got to WANT to do it..

                  Comment

                  Working...
                  X