nagios (net/nagios) Add to my watchlist
Nagios is a host and service monitoring programA network service and host monitor that can notify you when servers go down by monitoring for external services such as HTTP, FTP, SMTP, SNMP, as well as internal host checks for things such as CPU and disk usage and many other things.
Version: 4.4.6 License: GPL-2 GitHubMaintainers | No Maintainer |
Categories | net |
Homepage | https://nagios.org |
Platforms | darwin |
Variants |
|
"nagios" depends on
lib (2)
build (2)
Ports that depend on "nagios"
lib (2)Port notes
************************************************************
The basic steps to complete the installation are below. But Nagios is a complex program so you should read the documentation online at https://www.nagios.org or locally at ${prefix}/share/nagios/docs/index.html to fully understand Nagios.
************************************************************
IMPORTANT: A user and group called 'nagios' has been created and you must run nagios as that user.
1) Setup Apache's httpd.conf file for Nagios (restart Apache when done)
Insert the "Nagios stuff" text block somewhere *above* your Apache cgi-bin ScriptAlias statement:
ScriptAlias /cgi-bin/ "/Library/WebServer/CGI-Executables/"
#
# Nagios stuff
ScriptAlias /nagios/cgi-bin/ "${prefix}/sbin/nagios/"
<Directory "${prefix}/sbin/nagios">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile ${prefix}/etc/nagios/htpasswd.users
require valid-user
</Directory>
Alias /nagios "${prefix}/share/nagios"
<Directory "${prefix}/share/nagios">
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
# End Nagios stuff
#
2) Configure the Nagios sample files in ${prefix}/etc/nagios.
a) First, backup the Nagios sample files.
cd ${prefix}/etc/nagios
sudo mkdir sample
sudo cp *.cfg-sample sample/
b) Then rename the sample files for use.
sudo -s
for i in *cfg-sample; do mv $i `echo $i | sed -e s/cfg-sample/cfg/`; done;
exit
c) Configure the default commands.cfg file to your requirements. Then test the Nagios configuration with this command until you get no errors:
sudo nagios -v ${prefix}/etc/nagios/nagios.cfg
3) Set user 'nagiosadmin' as a "superuser" to browse all hosts/services in
${prefix}/etc/nagios/cgi.cfg
authorized_for_system_information= nagiosadmin
authorized_for_configuration_information= nagiosadmin
authorized_for_system_commands= nagiosadmin
authorized_for_all_services= nagiosadmin
authorized_for_all_hosts= nagiosadmin
authorized_for_all_service_commands= nagiosadmin
authorized_for_all_host_commands= nagiosadmin
4) Create a 'nagiosadmin' Apache user/password to correspond with the Nagios Apache user created above
htpasswd -c ${prefix}/etc/nagios/htpasswd.users nagiosadmin
Create other users as desired, omit '-c' since it creates the password file. Make additional users login names match Nagios contact names to restrict web viewing to your host's by contact.
5) Set Nagios to start at system boot, and start Nagios
Run launchctl so Nagios will start at system boot
sudo launchctl load -w /Library/LaunchDaemons/org.macports.nagios.plist
You may now start Nagios manually with this command (or a reboot):
sudo ${prefix}/var/nagios/nagios.init start
6) You may now login as 'nagiosadmin' to the Nagios web interface at http://localhost/nagios
NOTE: The SMTP server Postfix is required to enable Nagios email notifications
File Locations:
Configuration files: ${prefix}/etc/nagios
Nagios plugins: ${prefix}/libexec/nagios
Lock file: ${prefix}/var/nagios/nagios.lock
Init file: ${prefix}/var/nagios/nagios.init
HTML URL: http://localhost/nagios/
CGI URL: http://localhost/nagios/cgi-bin/ A startup item has been generated that will aid in starting nagios with launchd. It is disabled by default. Execute the following command to start it, and to cause it to launch at startup:
sudo port load nagios
Port Health:
Loading Port Health
Installations (30 days)
2
Requested Installations (30 days)
2
Livecheck results
nagios seems to have been updated (port version: 4.4.6, new version: 4.5.8)
livecheck ran: 1 day, 23 hours ago