Skip to content

Instantly share code, notes, and snippets.

@originalhat
Last active December 15, 2015 17:08
Show Gist options
  • Save originalhat/5293775 to your computer and use it in GitHub Desktop.
Save originalhat/5293775 to your computer and use it in GitHub Desktop.

Nagios OSX Install

Install via brew:

sudo brew install nagios

may need to chown a few things...

sudo chown root /usr/local/bin/brew

Caveats

First we need to create a command dir using superhuman powers:

mkdir -p /usr/local/var/lib/nagios/rw
sudo chgrp _www /usr/local/var/lib/nagios/rw
sudo chmod 2775 /usr/local/var/lib/nagios/rw

Then install the Nagios web frontend into Apple's build-in Apache:

  1. Turn on Personal Web Sharing.

  2. Load the php module by patching /etc/apache2/httpd.conf:

-#LoadModule php5_module        libexec/apache2/libphp5.so
+LoadModule php5_module        libexec/apache2/libphp5.so

  3. Symlink the sample config and create your web account:

sudo ln -sf /usr/local/Cellar/nagios/3.5.0/share/nagios.conf /etc/apache2/other/
htpasswd -cs /usr/local/etc/nagios/htpasswd.users nagiosadmin
sudo apachectl restart

Log in with your web account (and don't forget to RTFM :-)

open http://localhost/nagios

To have launchd start nagios at startup:

sudo cp -fv /usr/local/opt/nagios/*.plist /Library/LaunchDaemons

Then to load nagios now:

sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nagios.plist

Or, if you don't want/need launchctl, you can just run:

nagios /usr/local/etc/nagios/nagios.cfg
@originalhat
Copy link
Author

thanks! updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment