Problems installing/testing Nagios on OSX Sierra

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.

Re: Problems installing/testing Nagios on OSX Sierra

Postby scottwilkerson » Fri Sep 01, 2017 9:52 am

could you share the following:
Code: Select all
ls -al /usr/local/nagios/var/nagios.configtest
ls -al /usr/local/nagios/var
ls -al /usr/local/nagios
User avatar
scottwilkerson
CTO
 
Posts: 7590
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Problems installing/testing Nagios on OSX Sierra

Postby Aelonia » Fri Sep 01, 2017 1:17 pm

Code: Select all
ls -al /usr/local/nagios/var/nagios.configtest
ls: /usr/local/nagios/var/nagios.configtest: No such file or directory



ls -al /usr/local/nagios/var
total 104
drwxrwxrwx  9 nagios  nagios    306 Aug 31 19:46 .
drwxr-xr-x  8 root    wheel     272 Aug 18 16:11 ..
drwxrwxr-x  8 nagios  nagios    272 Aug 31 00:00 archives
-rw-r--r--  1 nagios  nagios   4041 Aug 31 17:33 nagios.log
-rw-r--r--  1 nagios  nagios  12655 Aug 28 15:12 objects.cache
-rw-r--r--  1 nagios  nagios  12655 Aug 31 15:40 objects.precache
-rw-------  1 nagios  nagios  13369 Aug 31 17:33 retention.dat
drwxrwsr-x  2 nagios  nagios     68 Aug 31 17:33 rw
drwxr-xr-x  3 root    nagios    102 Aug 18 16:01 spool



ls -al /usr/local/nagios
total 0
drwxr-xr-x   8 root    wheel    272 Aug 18 16:11 .
drwxr-xr-x  29 root    wheel    986 Aug 18 16:01 ..
drwxrwxr-x   4 nagios  nagios   136 Aug 31 18:53 bin
drwxrwxr-x  10 nagios  nagios   340 Aug 31 19:00 etc
drwxrwxr-x   2 nagios  nagios    68 Aug 18 16:01 libexec
drwxrwxr-x  21 nagios  nagios   714 Aug 31 18:53 sbin
drwxrwxr-x  37 nagios  nagios  1258 Aug 31 18:53 share
drwxrwxrwx   9 nagios  nagios   306 Aug 31 19:46 var
Aelonia
 
Posts: 12
Joined: Wed Aug 23, 2017 3:43 pm

Re: Problems installing/testing Nagios on OSX Sierra

Postby scottwilkerson » Fri Sep 01, 2017 3:57 pm

Based on what these show it should work, but just to make sure lets do the following
Code: Select all
touch /usr/local/nagios/var/nagios.configtest
chown nagios:nagios /usr/local/nagios/var/nagios.configtest
chmod ug+wx /usr/local/nagios/var/nagios.configtest


and then try again
User avatar
scottwilkerson
CTO
 
Posts: 7590
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Problems installing/testing Nagios on OSX Sierra

Postby Aelonia » Sun Sep 03, 2017 11:24 pm

I can touch nagios.configtest just fine, which creates the blank file.

Code: Select all
chown nagios:nagios /usr/local/nagios/var/nagios.configtest

doesn't work unless I use sudo - I get "Operation not permitted".

And I can similarly chmod the file if I use sudo. However, that doesn't seem to help with running sudo /etc/rc.d/init.d/nagios start. When I dig into that script, the line that triggers the error is:
Code: Select all
if ! su $NagiosUser -c "touch $NagiosCfgtestFile"; then
      echo "ERROR: Could not create or update '$NagiosCfgtestFile'"
      exit 8
   fi

When I checked NagiosUser, though, it was blank. When I changed that to my username, I had to enter a password but I was able to run that 'su' line, but after changing that, running the start command still gives me the same error. It seems to be some sort of user permission issue, then, but I'm not sure what's going on beyond that.
Aelonia
 
Posts: 12
Joined: Wed Aug 23, 2017 3:43 pm

Re: Problems installing/testing Nagios on OSX Sierra

Postby dwhitfield » Tue Sep 05, 2017 2:09 pm

Aelonia wrote:When I checked NagiosUser, though, it was blank. When I changed that to my username, I had to enter a password but I was able to run that 'su' line,


If you changed the file to be something specific, if should be nagios. What do you mean when you checked NagiosUser, it was blank? Are you saying you echoed the variable?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 3754
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC

Re: Problems installing/testing Nagios on OSX Sierra

Postby Aelonia » Tue Sep 05, 2017 4:20 pm

dwhitfield wrote:If you changed the file to be something specific, if should be nagios. What do you mean when you checked NagiosUser, it was blank? Are you saying you echoed the variable?


Yeah, which I guess isn't terribly useful. Just really not sure why sudo /etc/rc.d/init.d/nagios start isn't working for me.
Aelonia
 
Posts: 12
Joined: Wed Aug 23, 2017 3:43 pm

Re: Problems installing/testing Nagios on OSX Sierra

Postby dwhitfield » Tue Sep 05, 2017 4:26 pm

Aelonia wrote:
Yeah, which I guess isn't terribly useful.


Don't be so sure. If you don't have a nagios user, that could be a clue as to what is going on. Can you post your nagios.cfg? Also, what's the output of chage nagios -l

Also, is there a reason you need to install is on OS X? Why not just install it in Linux in a VM?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 3754
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC

Re: Problems installing/testing Nagios on OSX Sierra

Postby Aelonia » Tue Sep 05, 2017 5:46 pm

I've attached my nagios.cfg file. Unfortunately, the 'chage' command doesn't seem to exist.

And I don't need it on OSX. I'm looking into database monitoring for a research project, so before I set up a VM or try to set it running on a linux server, since there were OSX instructions, it seemed easier to just try and get it running locally to see if it would meet my needs. Turns out to be way harder than I realized, and it's unclear to me what of the issues I'm experiencing are OSX related and what are just me being too inexperienced in this area to set it up correctly.
Attachments
nagios.cfg
(43.77 KiB) Downloaded 7 times
Aelonia
 
Posts: 12
Joined: Wed Aug 23, 2017 3:43 pm

Re: Problems installing/testing Nagios on OSX Sierra

Postby scottwilkerson » Wed Sep 06, 2017 9:22 am

Lets do a quick test, edit /etc/rc.d/init.d/nagios

and change this line
Code: Select all
checkconfig="true"

to
Code: Select all
checkconfig="false"


Now lets try to start the service, I just want to make 100% sure the only problem is the configtest file
User avatar
scottwilkerson
CTO
 
Posts: 7590
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Problems installing/testing Nagios on OSX Sierra

Postby Aelonia » Wed Sep 06, 2017 11:50 am

Yeah, that totally works.

I tried redoing the whole installation process one more time, and there were some warnings after running
Code: Select all
cd /tmp/nagioscore-nagios-4.3.4/
sudo ./configure --with-httpd-conf=/opt/local/apache2/conf/extra --with-gd-lib=/opt/local/lib --with-gd-inc=/opt/local/include
sudo make all


I've attached the output of sudo make all in case it's relevant.
Attachments
Nagios_compile_warnings.txt
(13.68 KiB) Downloaded 7 times
Aelonia
 
Posts: 12
Joined: Wed Aug 23, 2017 3:43 pm

PreviousNext

Return to Nagios Core

Who is online

Users browsing this forum: Bing [Bot] and 26 guests