(I've already covered some of these commands, I plan to go over this section and tidy it up!)
Run a pre-flight check to verify configuration:
# /usr/local/bin/nagios -v /usr/local/etc/nagios/nagios.cfg
It's also worth mentioning that if something goes wrong and you need to make changes, there is no need to restart the server, you can start Nagios manually by running the following command:
# /usr/local/bin/nagios /usr/local/etc/nagios/nagios.cfg &
Check to make sure Nagios is running:
monitor# ps -aux | grep nagios
You can kill Nagios which will flush the config as an alternative to rebooting. You must replace PID with the actual process ID obtained from ps -aux.
monitor# kill -HUP PID
Running Nagios without any switches displays the following output.
monitor# nagios Nagios 2.0b3 Copyright (c) 1999-2005 Ethan Galstad (www.nagios.org) Last Modified: 04-03-2005 License: GPL Usage: nagios [option] <main_config_file> Options: -v Reads all data in the configuration files and performs a basic verification/sanity check. Always make sure you verify your config data before (re)starting Nagios. -s Shows projected/recommended check scheduling information based on the current data in the configuration files. -d Starts Nagios in daemon mode (instead of as a foreground process). This is the recommended way of starting Nagios for normal operation. Visit the Nagios website at http://www.nagios.org for bug fixes, new releases, online documentation, FAQs, information on subscribing to the mailing lists, and commercial and contract support for Nagios.