How did Nagios update on it's own? How can I get running?

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.
bolson

Re: How did Nagios update on it's own? How can I get running

Post by bolson »

Could it be that after the upgrade it is not looking in the correct location for the config files?
squirrely73

Posts: 11
Joined: Mon Jul 24, 2017 8:15 am
That is likely the case as the version installed via yum has the /usr/local/nagios/xxx directory structure.
squirrely73
Posts: 22
Joined: Mon Jul 24, 2017 8:15 am

Re: How did Nagios update on it's own? How can I get running

Post by squirrely73 »

eloyd wrote:It's not clear to me that this is actually the case, but maybe I missed something in the previous postings.

Can you do this:

Code: Select all

yum list | grep -i nagios
Ok so i ran that and the result is attached.
Attachments
Nagios Results.txt
(9.34 KiB) Downloaded 395 times
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: How did Nagios update on it's own? How can I get running

Post by eloyd »

Thanks! Now we all know what version(s) we're dealing with!
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
squirrely73
Posts: 22
Joined: Mon Jul 24, 2017 8:15 am

Re: How did Nagios update on it's own? How can I get running

Post by squirrely73 »

eloyd wrote:Thanks! Now we all know what version(s) we're dealing with!
And to be clear that is where it is right now after reverting to the previous VM snapshot.
I've added the exclude=nagios* into the main /etc/yum.conf file, if it doesn't update in the morning than i guess that fixes the auto-update issue if it does update again then i can grab the updated results and post again.

The main goal is to stop the auto-update for now, then I'll have to look at trying to upgrade and get it working in the future.
bolson

Re: How did Nagios update on it's own? How can I get running

Post by bolson »

Do you have admin (root) privileges for this Nagios server? If so, as root run the following command:

Code: Select all

for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
Then for each user that has a crontab, run this command:

Code: Select all

crontab -u USERNAME -e
And post the results.
squirrely73
Posts: 22
Joined: Mon Jul 24, 2017 8:15 am

Re: How did Nagios update on it's own? How can I get running

Post by squirrely73 »

bolson wrote:Do you have admin (root) privileges for this Nagios server? If so, as root run the following command:

Code: Select all

for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
Then for each user that has a crontab, run this command:

Code: Select all

crontab -u USERNAME -e
And post the results.
Results
Attachments
NagiosCrontab.txt
(1.12 KiB) Downloaded 374 times
bolson

Re: How did Nagios update on it's own? How can I get running

Post by bolson »

Please post the contents of /root/update.sh
squirrely73
Posts: 22
Joined: Mon Jul 24, 2017 8:15 am

Re: How did Nagios update on it's own? How can I get running

Post by squirrely73 »

bolson wrote:Please post the contents of /root/update.sh

[root@wc-nagios ~]# cat /root/update.sh
date >> update.log
yum -y update >> update.log
yum -y upgrade >> update.log
shutdown -r now >> update.log
bolson

Re: How did Nagios update on it's own? How can I get running

Post by bolson »

Mystery solved...

Change to:

Code: Select all

date >> update.log
yum -y -x 'nagios*' upgrade >> update.log
shutdown -r now >> update.log
Running yum update and yum upgrade is redundant as they do the same thing. The difference is that yum upgrade removes obsolete packages.
yum upgrade = yum update --obsoletes
squirrely73
Posts: 22
Joined: Mon Jul 24, 2017 8:15 am

Re: How did Nagios update on it's own? How can I get running

Post by squirrely73 »

bolson wrote:Mystery solved...

Change to:

Code: Select all

date >> update.log
yum -y -x 'nagios*' upgrade >> update.log
shutdown -r now >> update.log
Running yum update and yum upgrade is redundant as they do the same thing. The difference is that yum upgrade removes obsolete packages.
yum upgrade = yum update --obsoletes
Thanks bolson, Besides adding the exclusion for nagios* in the /etc/yum.conf file I've also made the changes mentioned above and as of this morning Nagios is still running 3.5.1 and working like a dream.
Once again thanks for all the help.

Now when time allows we'll see how the eventual planned upgrade goes.
Locked