Page 1 of 2

set up instructions for nagios core

Posted: Wed Nov 22, 2023 10:10 am
by vinmansbrew
I am trying an install of nagios core 4.4.13. I have it installed and it starts, authenticates, all that. What I need help with it actually configuring the service and host groups. Sp I can actually see and monitor things. It'll end up monitoring switches, linux, windows, and probably other stuff.
I can create empty cfg files, and add them into nagios.cfg. As soon as I enter anything, nagios will not restart.

I haven't seem to have found the correct documentation, so that is primarily what I would like.
I can't imagine the process is super complicated?

Re: set up instructions for nagios core

Posted: Thu Nov 23, 2023 3:41 am
by kg2857

Re: set up instructions for nagios core

Posted: Tue Nov 28, 2023 4:50 pm
by vinmansbrew
Well, the problem is, I create the cfg file I want under /objects. Add it to the nagios.cfg. That is fine, and I can restart nagios.
As soon as I add something to the file I made, anything at all, even commented lines, nagios fails to restart.

Re: set up instructions for nagios core

Posted: Wed Nov 29, 2023 10:39 am
by ppear
Can you post some results from the "/usr/local/nagios/sbin/nagios -v /usr/local/nagios/etc/nagios.cfg" command?

Re: set up instructions for nagios core

Posted: Thu Nov 30, 2023 2:42 pm
by vinmansbrew
I am unable to run that command.
/usr/local/nagios/sbin/nagios: no such file or directory.

I made a flub on my original post, I didn't list the OS, which is RHEL 8.8.
Most people are used to Ubuntu, but many commands do not work on both. That may be why this 1 didn't.
my apologies.

Re: set up instructions for nagios core

Posted: Fri Dec 01, 2023 10:14 am
by kabamaru
type which nagios and it should tell you where the executable is.

Re: set up instructions for nagios core

Posted: Mon Dec 04, 2023 9:37 am
by ppear
vinmansbrew wrote: Thu Nov 30, 2023 2:42 pm I am unable to run that command.
/usr/local/nagios/sbin/nagios: no such file or directory.

I made a flub on my original post, I didn't list the OS, which is RHEL 8.8.
Most people are used to Ubuntu, but many commands do not work on both. That may be why this 1 didn't.
my apologies.
I have my nagios core installed on RHEL 8. AND....I gave you the wrong string.It should be "usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg". Not /sbin. It's the typical config validation.

https://assets.nagios.com/downloads/nag ... nfig.html

Re: set up instructions for nagios core

Posted: Fri Dec 15, 2023 12:12 pm
by vinmansbrew
I'll have to use that command as I attempt to add things.
This is what it looks like, with nagios running.

Nagios Core 4.4.13
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2023-06-01
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check

Re: set up instructions for nagios core

Posted: Wed Dec 20, 2023 3:23 am
by ppear
Can you add your config files to (EDIT) nagios.cfg, which breaks the service, and provide the results of the same -v command? Also, check the permissions on your newly created object files to ensure Nagios can read them. If Root owns them, I suspect that may be the issue.

Re: set up instructions for nagios core

Posted: Wed Dec 20, 2023 12:04 pm
by vinmansbrew
So, no ansible.cfg, so I used a linux.cfg.
I added an entry, which broke it. The error was:
Error: Could not find any hostgroup matching 'rhel-servers' (config file '/usr/local/nagios/etc/objects/linux.cfg', starting on line 32)

However, I can't seem to find how to set up hostgroups?