<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=How_to_Install_Nagios</id>
	<title>How to Install Nagios - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=How_to_Install_Nagios"/>
	<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=How_to_Install_Nagios&amp;action=history"/>
	<updated>2026-04-08T05:19:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>http://wiki.docking.org/index.php?title=How_to_Install_Nagios&amp;diff=9489&amp;oldid=prev</id>
		<title>Benrwong: Created page based on &quot;HOW TO INSTALL NAGIOS&quot; from Lab Manual</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=How_to_Install_Nagios&amp;diff=9489&amp;oldid=prev"/>
		<updated>2016-06-30T21:45:28Z</updated>

		<summary type="html">&lt;p&gt;Created page based on &amp;quot;HOW TO INSTALL NAGIOS&amp;quot; from Lab Manual&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Installation==&lt;br /&gt;
 yum install php httpd mysql gd gd-devel gcc glibc glibc-common nagios nagios-plugins-all nagios-plugins-nrpe nrpe&lt;br /&gt;
 service mysqld start&lt;br /&gt;
 change the root password    #Just in case&lt;br /&gt;
 service mysqld stop&lt;br /&gt;
 edit the firewall to allow port 80 from everywhere &amp;lt;br /&amp;gt;&lt;br /&gt;
 vim /etc/nagios/objects/contacts.cfg    =&amp;gt;   Change the email to your email &amp;lt;br /&amp;gt;&lt;br /&gt;
 vim /etc/httpd/conf.d/nagios.conf &amp;lt;br /&amp;gt;&lt;br /&gt;
 Comment out the lines “Order allow,deny” and “Allow from all” and add these lines:&lt;br /&gt;
 Order deny,allow&lt;br /&gt;
   Deny from all&lt;br /&gt;
   Allow from 127.0.0.1 169.230.26.0/24 169.230.90.0/24 10.20.0.0/16 &amp;lt;br /&amp;gt;&lt;br /&gt;
 htpasswd /etc/nagios/passwd nagiosadmin&lt;br /&gt;
 service nagios start&lt;br /&gt;
 service httpd start&lt;br /&gt;
 chkconfig nagios on&lt;br /&gt;
 chkconfig httpd on &amp;lt;br /&amp;gt;&lt;br /&gt;
==CONFIGURE NAGIOS/ADDING CLIENTS: &amp;lt;br /&amp;gt;==&lt;br /&gt;
 http://nagios.sourceforge.net/docs/3_0/macrolist.html&lt;br /&gt;
 http://nagios.sourceforge.net/docs/3_0/monitoring-publicservices.html&lt;br /&gt;
 http://wiki.centos.org/HowTos/Nagios &amp;lt;br /&amp;gt;&lt;br /&gt;
Plugins list:&lt;br /&gt;
https://nagios-plugins.org/doc/man/index.html&lt;br /&gt;
To see how a specific plugin works (say for ssh):&lt;br /&gt;
 /usr/lib64/nagios/plugins/check_ssh --help &lt;br /&gt;
The different timeperiods are defined here:&lt;br /&gt;
 /etc/nagios/objects/timeperiods.cfg&lt;br /&gt;
Dummy templates for setting up dummy client.cfg files are here:&lt;br /&gt;
 /etc/nagios/objects/templates.cfg &lt;br /&gt;
To add a client: &lt;br /&gt;
 ssh to the client and do the following:&lt;br /&gt;
 yum install nrpe nagios-plugins-all openssl&lt;br /&gt;
 vim /etc/nagios/nrpe.cfg  =&amp;gt; Changed: &lt;br /&gt;
  allowed_hosts=169.230.26.197 (the ip of the nagios server)&lt;br /&gt;
 service nrpe start&lt;br /&gt;
 chkconfig nrpe on &amp;lt;br /&amp;gt;&lt;br /&gt;
*******NOTE FOR CENTOS 5*****************&lt;br /&gt;
For i386:&lt;br /&gt;
 rpm -Uvh http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS//rpmforge-release-0.5.3-1.el5.rf.i386.rpm&lt;br /&gt;
For x86_64:&lt;br /&gt;
 rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm&lt;br /&gt;
*******************************************************&lt;br /&gt;
Back on nagios server:&lt;br /&gt;
 vim /etc/nagios/nagios.cfg&lt;br /&gt;
 Uncomment this line   =&amp;gt;      cfg_dir=/etc/nagios/servers&lt;br /&gt;
 mkdir /etc/nagios/servers&lt;br /&gt;
 vim /etc/nagios/servers/client_hostname.cfg&lt;br /&gt;
I created one that looks like this for delta.cfg:&lt;br /&gt;
++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
 define host{&lt;br /&gt;
        use                             linux-server&lt;br /&gt;
        host_name                       delta.cluster.ucsf.bkslab.org&lt;br /&gt;
        alias                           delta&lt;br /&gt;
        address                         10.20.1.4&lt;br /&gt;
        max_check_attempts              5&lt;br /&gt;
        check_period                    24x7&lt;br /&gt;
        notification_interval           30&lt;br /&gt;
        notification_period             24x7&lt;br /&gt;
 } &amp;lt;br /&amp;gt;&lt;br /&gt;
 define service {&lt;br /&gt;
        use                             generic-service&lt;br /&gt;
        host_name                       delta.cluster.ucsf.bkslab.org&lt;br /&gt;
        service_description             PING&lt;br /&gt;
        check_command                   check_ping!100.0,20%!500.0,60%&lt;br /&gt;
 }&lt;br /&gt;
 define service {&lt;br /&gt;
        use                             generic-service&lt;br /&gt;
        host_name                       delta.cluster.ucsf.bkslab.org&lt;br /&gt;
        service_description             SSH&lt;br /&gt;
        check_command                   check_ssh&lt;br /&gt;
        notifications_enabled           1&lt;br /&gt;
 } &lt;br /&gt;
 define service {&lt;br /&gt;
        use                             generic-service&lt;br /&gt;
        host_name                       delta.cluster.ucsf.bkslab.org&lt;br /&gt;
        service_description             Current Load&lt;br /&gt;
        check_command                   check_local_load!5.0,4.0,3.0!10.0,6.0,4.0&lt;br /&gt;
 }&lt;br /&gt;
+++++++++++++++++++++++++++++++++++&lt;br /&gt;
 service nagios restart&lt;br /&gt;
That’s pretty much it!&lt;br /&gt;
&lt;br /&gt;
[[Category:Sysadmin]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
Nagios Hostgroups:&lt;br /&gt;
&lt;br /&gt;
On the nagios server:&lt;br /&gt;
vim /etc/nagios/nagios.cfg&lt;br /&gt;
Add the line  =&amp;gt; cfg_file=/etc/nagios/objects/hostgroups.cfg&lt;br /&gt;
vim /etc/nagios/objects/hostgroups.cfg =&amp;gt;&lt;br /&gt;
define hostgroup{&lt;br /&gt;
        hostgroup_name  cluster_2&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Then to add a server to this hostgroup:&lt;br /&gt;
vim /etc/nagios/servers/delta.cfg&lt;br /&gt;
Add this line within the “define host” curly brackets  =&amp;gt; hostgroups cluster_2&lt;br /&gt;
&lt;br /&gt;
service nagios restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References:==&lt;br /&gt;
http://www.unixmen.com/install-and-configure-nagios-in-centos-6-4-rhel-6-4/&lt;br /&gt;
https://www.digitalocean.com/community/tutorials/how-to-install-nagios-on-centos-6&lt;/div&gt;</summary>
		<author><name>Benrwong</name></author>
	</entry>
</feed>