Page 2 of 3
Re: How did Nagios update on it's own? How can I get running
Posted: Tue Aug 01, 2017 10:50 am
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.
Re: How did Nagios update on it's own? How can I get running
Posted: Tue Aug 01, 2017 12:50 pm
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:
Ok so i ran that and the result is attached.
Re: How did Nagios update on it's own? How can I get running
Posted: Tue Aug 01, 2017 1:02 pm
by eloyd
Thanks! Now we all know what version(s) we're dealing with!
Re: How did Nagios update on it's own? How can I get running
Posted: Tue Aug 01, 2017 1:19 pm
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.
Re: How did Nagios update on it's own? How can I get running
Posted: Tue Aug 01, 2017 2:44 pm
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:
And post the results.
Re: How did Nagios update on it's own? How can I get running
Posted: Tue Aug 01, 2017 3:19 pm
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:
And post the results.
Results
Re: How did Nagios update on it's own? How can I get running
Posted: Tue Aug 01, 2017 3:56 pm
by bolson
Please post the contents of /root/update.sh
Re: How did Nagios update on it's own? How can I get running
Posted: Tue Aug 01, 2017 4:04 pm
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
Re: How did Nagios update on it's own? How can I get running
Posted: Tue Aug 01, 2017 4:30 pm
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
Re: How did Nagios update on it's own? How can I get running
Posted: Wed Aug 02, 2017 7:23 am
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.