The cmd "service nagios checkconfig" doesn't work

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.
Locked
User avatar
t3dus
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:

The cmd "service nagios checkconfig" doesn't work

Post by t3dus »

I'm having a problem after a fresh reinstal of nagios where the command below results in an error. I'm not sure how to fix it.

Code: Select all

# service nagios checkconfig
Running configuration check...
ERROR: Could not create or update '/usr/local/nagios/var/nagios.configtest'
but if I do

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
it works fine.

Clearly I like the shorter method of using "service nagios checkconfig" better than trying to remember that 2nd line above. How do I resolve this?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: The cmd "service nagios checkconfig" doesn't work

Post by scottwilkerson »

There is a but in 4.3.4 that has been identified by a few other users with this same issue.

Our developers are working on a fix for the next release.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
t3dus
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:

Re: The cmd "service nagios checkconfig" doesn't work

Post by t3dus »

Is there a way I can at least make

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
into something more remember-able?
User avatar
t3dus
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:

Re: The cmd "service nagios checkconfig" doesn't work

Post by t3dus »

NM i figured out a work around.. This is what I did..

On your home folder (you could also do this in the root folder):

Code: Select all

nano .bash_aliases
Enter the command for nagios checkconfig:

Code: Select all

alias nagioscheckconfig='/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg'
After saving the file reconfigure your bashrc

Code: Select all

. ~/.bashrc
And check your new alias is loaded

Code: Select all

alias
That's it, you can check config by typing

Code: Select all

nagioscheckconfig
Last edited by t3dus on Tue Sep 12, 2017 12:28 pm, edited 1 time in total.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: The cmd "service nagios checkconfig" doesn't work

Post by scottwilkerson »

t3dus wrote:NM i figured out a work around.. This is what I did..
Thanks for sharing the technique!
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
t3dus
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:

Re: The cmd "service nagios checkconfig" doesn't work

Post by t3dus »

scottwilkerson wrote:Thanks for sharing the technique!
No problem. I just can't ever remember that long check method so I had to come up with a work around. :) I'm sure others might have the same issue.
Locked