Nagios Core 3.5.1 to 4.3.4. Upgrade

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.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Post by scottwilkerson »

what is the current output of now that you have fixed the config

Code: Select all

systemctl status nagios 
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
mtripodi
Posts: 61
Joined: Thu Dec 17, 2015 11:15 am

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Post 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.
Attachments
nagios status.png
nagios web error.png
mtripodi
Posts: 61
Joined: Thu Dec 17, 2015 11:15 am

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Post 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!
Attachments
Nagios hosts.png
Nagios services.png
Test_server_directories.png
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
mtripodi
Posts: 61
Joined: Thu Dec 17, 2015 11:15 am

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Post 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.
Attachments
Nagios error.png
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
mtripodi
Posts: 61
Joined: Thu Dec 17, 2015 11:15 am

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Post 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.
Attachments
nagios config file.png
generic-service template.png
generic-host template.png
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Post by scottwilkerson »

The config files were not attached
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
mtripodi
Posts: 61
Joined: Thu Dec 17, 2015 11:15 am

Re: Nagios Core 3.5.1 to 4.3.4. Upgrade

Post 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.
Attachments
Nagios_config.7z
(18.09 KiB) Downloaded 172 times
Locked