Thursday, August 7, 2014

Nagios Pi: Nagios File Structure


The version of Nagios in the Raspian repository is Nagios3.  It's not the latest, but it's the easiest to install and for small/home network monitoring it will do just fine.

Once you've installed Nagios, you'll be able to test the web interface and see that you're already monitoring the localhost (the RaspberryPi Nagios is running on).  To make it monitor other devices on the network, you'll have to do some configuration.

Nagios runs from configuration (.cfg) files and most of the customization of NagiosPi is accomplished by editing these files.

/etc/nagios3 is where most of these files reside.  Within this directory:

  • Apache2.conf = configuration for the Nagios HTML (Web) interface
  • Commands.cfg = links comand names to shell commands.
  • Htpasswd.users = hashed user passwords
  • Resource.cfg = where user macros are defined
  • Cgi.cfg = configuration for Nagios CGI scripts
  • Nagios.cfg = Main configuration file for the Nagios program

/etc/nagios3/conf.d is where the generic configuration files and templates reside and where I'll add new files.  You can certainly create these files outside of this directory but for simplicity sake, I'm going to add them here.

  • Contacts_nagios2.cfg = contacts to send alerts to
  • Generic-service_nagios2.cfg = template for creating a service
  • Services_nagios2.cfg = defines services to monitor on hosts
  • Extinfo_nagios2.cfg = extended host and service information
  • Hostgroups_nagios2.cfg = defines hostgroups to organize multiple hosts by type
  • Timeperiods_nagios2.cfg = customize timeperiods for checks and notifications here
  • Generic-host_nagios2.cfg = template for a generic host
  • Localhost_nagios2.cfg = configuration for the localhost and an excellent reference source for the additional hosts that you create.

 /etc/nagios3/stylesheets/ is where all of the cascading style sheet (CSS) files that define how the HTML interface looks are created.

No comments:

Post a Comment