Basic Info
Contents |
Monitoring tools
There are many like Big Brother, OpenNMS, OpenView and SysMon.
Nagios can monotor
- Ping to see if host is reachable
- Services such as DHCP, DNS, FTP, SSH, Telnet, HTTP, NTP, POP3, IMAP, SMTP etc.
- Database servers such as MySQL, Postgres, Oracle, SQL Server etc.
- Application level information (Apache, Postfix, LDAP, Citrix etc.)
Installing Nagios
- apt-get install nagios3
Default password
The default opassword goes in /etc/nagios3/htpasswd.users.
Nagios Files
- nagios.cfg
The main configuration file (usually /usr/local/nagios/etc/nagios.cfg) contains a number of directives that affect how Nagios operates. This config file is read by both the Nagios process and the CGIs. This is the first configuration file you're going to want to create or edit.
- resource.cfg
Resource files can be used to store user-defined macros. Resource files can also contain other information (like database connection settings), although this will depend on how you've compiled Nagios. The main point of having resource files is to use them to store sensitive configuration information and not make them available to the CGIs.
- cgi.cfg
The CGI configuration file (usually /usr/local/nagios/etc/cgi.cfg) contains a number of directives that affect the operation of the CGIs.
- object files
These are the object configuration files in which you define hosts, host groups, contacts, contact groups, services, etc. You can split your object definitions across several config files if you wish (as shown below), or keep them all in a single config file.
You can specify individual object config files as shown below:
cfg_file=/etc/nagios3/objects/commands.cfg
cfg_file=/etc/nagios3/objects/contacts.cfg
cfg_file=/etc/nagios3/objects/timeperiods.cfg
cfg_file=/etc/nagios3/objects/templates.cfg
Definitions for monitoring a Windows machine
cfg_file=/etc/nagios3/objects/windows.cfg
Definitions for monitoring a router/switch
cfg_file=/etc/nagios3/objects/switch.cfg
Definitions for monitoring a network printer
You can also tell Nagios to process all config files (with a .cfg extension) in a particular directory by using the cfg_dir
directive as shown below:
cfg_dir=/etc/nagios3/servers
cfg_dir=/etc/nagios3/printers
cfg_dir=/etc/nagios3/switches
cfg_dir=/etc/nagios3/routers
Enable Nagios
- deb = /etc/default/nagios3
- rpm = /etc/rc.conf
Verify config
- /usr/sbin/nagios3 -v nagios.cfg
Check config
- /usr/sbin/nagios3 -s nagios.cfg