Page 6 of 9

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Posted: Fri Jul 06, 2018 4:00 pm
by lmiltchev
Is the ip accessible from your workstation? Can you ping it? Do you have iptables/firewalld or another firewall running? Is port 80 open?

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Posted: Fri Jul 06, 2018 4:01 pm
by scottwilkerson
what is the current output of now that you have fixed the config

Code: Select all

systemctl status nagios 

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Posted: Mon Jul 09, 2018 1:18 pm
by mtripodi
I disabled the firewall, noticed Nagios wasn't started automatically after reboot so I ran a command to set that. Confirmed both Nagios and httpd service are currently running. See attached imaged.
I can reach the test page when entering 172.19.1.7 with the /nagios at the end.
It was working initially, I ran through some of the configuration I copied over and resolved the errors. Once they were all corrected, I tried hitting the webpage again and ran into that message.

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Posted: Mon Jul 09, 2018 3:37 pm
by mtripodi
Ok I figured out that one on my own as well. The htpasswd.users and cgi.cfg files were moved and not in the /usr/local/nagios/etc/ directory. The last part preventing me from proceeding with testing is that I have no hosts or services listed, even though I copied my existing configuration from our production server to the test one. They are currently in the following directories on the test VM:

Root folder: /usr/local/nagios/etc/objects/
Hosts: /usr/local/nagios/etc/objects/hosts/
Services: /usr/local/nagios/etc/objects/services

I attached screenshots of what I see in the web interface and how the directory structure looks on my test server. I renamed some of the files that came with the 4.4.1 installation to .default so I can use my existing files instead for the new server.

Please let me know if there are conflicts in the files, in the wrong directories or if I didn't perform the step process correctly. I would like to have the web interface reflect the current hosts and service checks we have in place so I can test receiving an output from service check and notifications. Thanks!

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Posted: Tue Jul 10, 2018 8:23 am
by scottwilkerson
mtripodi wrote:The last part preventing me from proceeding with testing is that I have no hosts or services listed, even though I copied my existing configuration from our production server to the test one.
if you look in the nagios.cfg that is being used, it will have paths to both files and folder that need to be included, you need to make sure that your new setup is looking at the correct full paths.

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Posted: Wed Jul 11, 2018 4:00 pm
by mtripodi
I was able to edit the nagios.cfg file by adding the directories containing the configuration I copied over. Confirmed Nagios test server is now looking at all my files. However, now when I run the config test command i'm getting a "invalid max_check_attempts value for host" error. I confirmed each host is pointing to an existing template that Nagios should see and that those templates (generic-host and generic-service) have this value set. So i'm not sure why it keeps complaining. See attached screenshot.

Please HELP.

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Posted: Wed Jul 11, 2018 4:05 pm
by scottwilkerson
If you attach those 2 files I can look at them but you may have a definition in multiple locations and it is using the wrong one, for example there is a host defined in the hostgroups file and it ALSO has a hosts file, this sounds wrong.

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Posted: Wed Jul 11, 2018 8:29 pm
by mtripodi
Yes, I understand what your saying. However, all the same configuration is working on my production server. Something must have been changed recently when moving around files to correct errors. I have attached 4 files: host template, service template, hostgroups, and nagios.cfg file.
I have edited the nagios.cfg file to point to the directories containing my config files. Nothing has changed so i'm confused as to why those host files are complaining about not seeing the max_attempts value when they are in the templates associated.

I will continue looking around but spent a almost 2 days and i'm hoping you can help figure this out so I can continue testing and replace this working server with our existing one.

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Posted: Thu Jul 12, 2018 6:52 am
by scottwilkerson
The config files were not attached

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Posted: Thu Jul 12, 2018 8:39 am
by mtripodi
I meant I attached the 4 screenshots of my config. If that's not enough information, I have attached the zipped config files along with the host config file referenced in the error message.
Let me know if there is anything else you require.