The cmd "service nagios checkconfig" doesn't work

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

The cmd "service nagios checkconfig" doesn't work

Postby t3dus » Mon Sep 11, 2017 8:25 pm

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

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

Postby scottwilkerson » Tue Sep 12, 2017 7:39 am

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.
User avatar
scottwilkerson
CTO
 
Posts: 7620
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

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

Postby t3dus » Tue Sep 12, 2017 7:44 am

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: 64
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA

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

Postby t3dus » Tue Sep 12, 2017 7:48 am

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

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

Postby scottwilkerson » Tue Sep 12, 2017 9:00 am

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


Thanks for sharing the technique!
User avatar
scottwilkerson
CTO
 
Posts: 7620
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

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

Postby t3dus » Tue Sep 12, 2017 12:29 pm

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


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 8 guests