Nagios Getting Started Step-By-Step?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
mannyjacobs73
Posts: 6
Joined: Thu Jun 23, 2016 6:43 am

Nagios Getting Started Step-By-Step?

Post by mannyjacobs73 »

Hello...

Trying to get a handle on Nagios for the first time, using the Open Source Core, not XI.

I've found the documentation on the Nagios site very useful and successfully completed an initial install (4.1.1) on a Fedora test box.

Now that the basic system is up and running, I'm struggling to find a basic tutorial / guide which explains how to configure additional hosts etc. and how the various addons/checks are used. In particular how the various config files come together to make things work. If there is a summary document / link for this, please send me a link and ignore the rest of this post.


Using check_ncpa as an example and based on the 'check_ncpa.py' topic I found here: https://support.nagios.com/forum/viewtopic.php?f=7&t=34572, I think I have sussed out the explanation below - Please let me know if I have understood things correctly so far, or if I am getting mixed up...

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
$Nagios_DIR/etc/nagios.cfg --> Main configuration file. Controls overall environment and settings. Decide here which .cfg files to enable.

$Nagios_DIR/etc/commands.cfg --> Command definitions for all the checks run.

$Nagios_DIR/objects/*.cfg --> Config files grouped by similar services / devices. This is where the main host/device checks are defined (individual Hosts and their corresponding Services to check)

$Nagios_DIR/libexec/ --> These are the binaries/scripts for the checks to be run. External addons downloaded to be placed here.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Steps to follow to add host to server using check_ncpa.py:

1. Install ncpa OS executable on remote machine.
I'm not sure yet of the difference between 'passive' and 'active' check, but I chose Active as is seemed the easiest and only added a token during the install.

There is mention of nrds / nrdp, but I am not sure what these are and if they are needed.

2. Copy check_ncpa.py script under '$Nagios_DIR/libexec/'. Make executable and owned user:group nagios.

3. Add command definition for 'check_ncpa.py' to '$Nagios_DIR/etc/commands.cfg'. Not strictly necessary in this file, but keeps things 'clean' across the system.

define command{
command_name check_ncpa
command_line /usr/local/nagios/libexec/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}

4. Add host(s) to check and service definitions to '$Nagios_DIR/objects/*.cfg'.
I can create a new file here (adding this file to nagios.cfg, or use one of the existing templates and allow the template from nagios.cfg).

Similar checks will be run on multiple hosts so add hostgroup definition:
define hostgroup{
hostgroup_name windows-servers
}

Add Host to be checked:
define host{
use windows-server
hostname test_host
hostgroups windows_servers
address x.x.x.x
}

Add services to be checked -- Command here will vary, depending on the addon/check??
define service{
use generic-service
host_name test_host
service_description NCPA CPU Percent
check_command check_ncpa!-t 'xyz' -P 5693 -M cpu/percent -w 40 -c 80
}

define service{
use generic-service
host_name test_host
service_description NCPA DISK free
check_command check_ncpa!-t 'xyz' -P 5693 -M 'disk/logical/C:|/free' -w 80 -c 90
}

define service{
use generic-service
host_name test_host
service_description NCPA ETH0 recevied
check_command check_ncpa!-t 'xyz' -P 5693 -M windowscounters/interface/Ethernet0/bytes_recv'
}

And this is repeated for each host, or at least a new host using the same hostgroup would simply need a new host definition added.


Any advice/comments welcome.

Thanks,
Manny
warnox
Posts: 39
Joined: Thu Nov 20, 2014 5:22 am

Re: Nagios Getting Started Step-By-Step?

Post by warnox »

I think the best way you'll get to understand the complexity is by playing around with it. When I first started I created the attached diagram, maybe you'll find it useful.

And these are the links I often refer to...

Simple How-To Guide: http://users.telenet.be/mydotcom/howto/ ... index.html
NRPE Module List (check commands): http://docs.nsclient.org/0.4.2/reference/index.html
Object definitions: http://nagios.sourceforge.net/docs/3_0/ ... tions.html
3rd Party Nagios Documentation: https://sites.google.com/a/box293.com/nagios/home
Attachments
Capture.JPG
mannyjacobs73
Posts: 6
Joined: Thu Jun 23, 2016 6:43 am

Re: Nagios Getting Started Step-By-Step?

Post by mannyjacobs73 »

That is all extremely useful!

Thank you very much...
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios Getting Started Step-By-Step?

Post by mcapra »

Here's a few handy talks given at past conferences:

https://www.youtube.com/watch?v=T7TAG_J ... e=youtu.be
https://www.youtube.com/watch?v=tOEe9cZ ... e=youtu.be
https://www.youtube.com/watch?v=-Iq7wTd ... e=youtu.be

It's difficult to create a definitive step-by-step guide since every environment is unique and will have it's own specific quirks in terms of monitoring. Not all agents work on all operating systems, not all plugins work for every check on every platform, etc.
Former Nagios employee
https://www.mcapra.com/
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Nagios Getting Started Step-By-Step?

Post by eloyd »

Cheap plug:

Another great way to get to know Nagios is to attend the 2016 Nagios World Conference and talk to others who are learning Nagios just like you, as well as more experienced people like me, and even directly with Nagios support staff. There's a coupon code at the top of the forums to save you some money, and if you're one of our EverWatch consulting customers, we offer additional discounts. PM me for details if you're one of our customers. :-)
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Nagios Getting Started Step-By-Step?

Post by bwallace »

Op, did you have any other questions or are we good to lock this thread?
Be sure to check out the Knowledgebase for helpful articles and solutions!
mannyjacobs73
Posts: 6
Joined: Thu Jun 23, 2016 6:43 am

Re: Nagios Getting Started Step-By-Step?

Post by mannyjacobs73 »

All perfect, thank you for the links and replies!

I'll look to attend a show when possible.


You guys can close this now.


Cheers,
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios Getting Started Step-By-Step?

Post by mcapra »

Closing this up!
Former Nagios employee
https://www.mcapra.com/
Locked