Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

nagios - any one familiar?

  • 07-09-2015 9:28am
    #1
    Registered Users, Registered Users 2 Posts: 4,782 ✭✭✭


    hi

    ive inherited a nagios monitoring system setup by an admin who left. my knowledge is minimal.

    it user nrpe to monitor a number of hosts & one of those hosts is no longer live.

    i have disabled active checks and notifications from the nagios web interface.

    i would like to remove the host from the list of hosts. so that it no longer appears in my list of hosts (and problems). i had a look on http://library.nagios.com/library and a couple of other sites and didn't find what im looking for.

    can anyone point me in the right direction?


Comments

  • Registered Users, Registered Users 2 Posts: 1,110 ✭✭✭Skrynesaver


    The main configuration file is usually named nagios.cfg and located in the /usr/local/nagios/etc/ directory, in there there should be a hosts.cfg (unless someone went off reservation and abused the flexibility)


  • Registered Users, Registered Users 2 Posts: 1,193 ✭✭✭liamo


    My familiarity with Nagios is limited to the Debian package. The location of files in other distros may vary however the principles remain the same.
    I am assuming that the config directory for nagios is "/etc/nagios3". You may have to modify commands below depending on where your config is stored.

    The first place to look is in the nagios.cfg file. This is likely to be in the /etc/nagios3 directory.

    The contents of this will tell you where the other configuration files are.

    In nagios.cfg, the directives "cfg_dir=" and "cfg_file=" tell nagios where to look for the individual configuration files.

    Depending on how organised the configuration is, there may be a multiple directories where hosts, commands, services, etc are stored in a logical manner. Alternatively, there may be a single file with everything dumped into it.

    You can perform a search for the host as follows "grep -r -i <myhostname> /etc/nagios3/*"
    This assumes that the configuration files are contained within the /etc/nagios3 directory or a subdirectory.

    Once you know the files that reference your host you can starting commenting.
    You may have to comment out the host name from a host file, a hostgroup file, multiple service files.

    When you have finished your commenting you should run "/usr/sbin/nagios3 -v /etc/nagios3/nagios.cfg" to check that you haven't broken your nagios config.

    Unless there are errors or warnings you can ignore pretty much all the output from that command and look for the summary at the end.
    What you want to see is :
    Total Warnings: 0
    Total Errors: 0

    At that point you can restart or reload nagios with "service nagios3 reload|restart" or whatever the appropriate command is for your distro.

    Hope this helps.

    Liam


  • Registered Users, Registered Users 2 Posts: 4,782 ✭✭✭Xterminator


    ill back the cfg file up before i give it that a try.

    cheers!


  • Registered Users, Registered Users 2 Posts: 5,053 ✭✭✭opus


    liamo is spot on in the earlier post. Just to add a real world example, I've this in my nagios.cfg file (/etc/nagios)
    cfg_dir=/etc/nagios/linux-servers
    cfg_dir=/etc/nagios/windows-servers
    cfg_dir=/etc/nagios/ups
    cfg_dir=/etc/nagios/cameras
    


    Then all the config files for the linux boxes I'm interested in are in the linux-servers folder. When a server dies or whatever I just move the cfg file for it into a folder called disabled and tell the process to reload its config file e.g.

    /etc/init.d/nagios configtest
    &
    /etc/init.d/nagios reload


  • Registered Users, Registered Users 2 Posts: 1,193 ✭✭✭liamo


    opus wrote: »
    I've this in my nagios.cfg file (/etc/nagios)

    It's always interesting to see how others implement things and how they differ from your own setup.

    I break up my config into nagios functionality:
    cfg_dir=/etc/nagios3/objects/templates
    cfg_dir=/etc/nagios3/objects/hosts
    cfg_dir=/etc/nagios3/objects/services
    cfg_dir=/etc/nagios3/objects/commands
    cfg_dir=/etc/nagios3/objects/contacts
    cfg_dir=/etc/nagios3/objects/timeperiods
    cfg_dir=/etc/nagios3/objects/escalations
    

    I then have a single file per host, service, command, etc in the respective directories. I find it very easy to locate a host, service, command, etc that way.

    Of course, the best setup is the one that works best for you!


  • Advertisement
Advertisement