{"id":1648,"date":"2012-10-30T17:01:02","date_gmt":"2012-10-30T09:01:02","guid":{"rendered":"http:\/\/rmohan.com\/?p=1648"},"modified":"2012-10-30T19:19:41","modified_gmt":"2012-10-30T11:19:41","slug":"nagios","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=1648","title":{"rendered":"NAGIOS"},"content":{"rendered":"<p><strong>Nagios<\/strong><\/p>\n<p><strong>Firewall and SElinux is Disable <\/strong><\/p>\n<div><strong>Server IP :- 192.168.0.10<\/strong><\/div>\n<div><strong>Hostname :- shashi.example.com<\/strong><\/div>\n<div>\u00a0<\/div>\n<div><strong>Client IP :- 192.168.0.11<\/strong><\/div>\n<div><strong>Hostname :- client.example.com<\/strong><\/div>\n<div>\u00a0<\/div>\n<div><strong>1.Package Requirement :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># yum install httpd php<\/div>\n<div># yum install gcc glibc glibc-common<\/div>\n<div># yum install gd gd-devel<\/div>\n<div>\u00a0<\/div>\n<div><strong>2.Create Nagios user and group :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># useradd -m nagios<\/div>\n<div># passwd nagios<\/div>\n<div># usermod -G nagios\u00a0 nagios<br \/> # groupadd nagcmd<\/div>\n<div># usermod -a -G nagcmd nagios<\/div>\n<div># usermod -a -G nagcmd apache<\/div>\n<div>\u00a0<\/div>\n<div><strong>3.Download Some Package :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># mkdir \/opt\/nagios<\/div>\n<div>\u00a0<\/div>\n<div># cd \/opt\/nagios<\/div>\n<div>\u00a0<\/div>\n<div># wget <span style=\"text-decoration: underline;\"><a href=\"http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagios\/nagios-\">http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagios\/nagios-<\/a><\/span><\/div>\n<div>3.2.3.tar.gz<\/div>\n<div>\u00a0<\/div>\n<div># wget <span style=\"text-decoration: underline;\"><a href=\"http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagiosplug\/nagios-\">http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagiosplug\/nagios-<\/a><\/span><\/div>\n<div>plugins-1.4.11.tar.gz<\/div>\n<div>\u00a0<\/div>\n<div># tar xvf nagios-3.2.3.tar.gz<\/div>\n<div>\u00a0<\/div>\n<div># cd nagios-3.2.3<\/div>\n<div>\u00a0<\/div>\n<div># .\/configure &#8211;with-command-group=nagcmd<\/div>\n<div>\u00a0<\/div>\n<div># make all<\/div>\n<div>\u00a0<\/div>\n<div># make install<\/div>\n<div>\u00a0<\/div>\n<div># make install-init<\/div>\n<div>\u00a0<\/div>\n<div># make install-config<\/div>\n<div>\u00a0<\/div>\n<div># make install-commandmode<\/div>\n<div>\u00a0<\/div>\n<div>\n<div># make install-webconf<\/div>\n<div>\u00a0<\/div>\n<p><strong>\u00a04.vim \/usr\/local\/nagios\/etc\/objects\/contacts.cfg<\/strong><\/p>\n<\/div>\n<div>\u00a0<\/div>\n<div>35: change &#8212;&gt; email youadmin-mail-ID<\/div>\n<div>\u00a0<\/div>\n<p><strong>6.Give the password web nagiosadmin user<\/strong><\/p>\n<div>\u00a0<\/div>\n<div>htpasswd -c \/usr\/local\/nagios\/etc\/htpasswd.users nagiosadmin<\/div>\n<div>New password :<\/div>\n<div>Re-type new password :<\/div>\n<div>\u00a0<\/div>\n<div>Note:- If you want to change admin \u201cnagiosadmin\u201d name change all in \u201c\/usr\/local\/nagios\/etc\/cgi.cfg\u201d file too.<\/div>\n<div>\u00a0<\/div>\n<div><strong>7. Go to this Path :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># cd \/opt\/shashi<\/div>\n<div>\u00a0<\/div>\n<div># tar xvf nagios-plugin-1.4.11.tar.gz<\/div>\n<div>\u00a0<\/div>\n<div># cd nagios-plugin-1.4.11<\/div>\n<div>\u00a0<\/div>\n<div># .\/configure &#8211; &#8211; with-nagios-user=nagios &#8211; &#8211; with-nagios-group=nagios<\/div>\n<div>\u00a0<\/div>\n<div># make<\/div>\n<div>\u00a0<\/div>\n<div># make install<\/div>\n<div>\u00a0<\/div>\n<div># chkconfig &#8211; &#8211; add nagios<\/div>\n<div>\u00a0<\/div>\n<div># chkconfig nagios on<\/div>\n<div>\u00a0<\/div>\n<div># \/etc\/init.d\/nagios start<\/div>\n<div>\u00a0<\/div>\n<div># \/etc\/init.d\/nagios restart<\/div>\n<div>\u00a0<\/div>\n<div># chkconfig nagios on<\/p>\n<p># \/etc\/init.d\/httpd restart<\/p>\n<p>#chkconfig httpd on<\/p>\n<\/div>\n<div>\u00a0<\/div>\n<div># \/usr\/local\/nagios\/bin\/nagios -v \/usr\/local\/nagios\/etc\/nagios.cfg (check nagios)<\/div>\n<div>\u00a0<\/div>\n<div>Total warnings: 0<\/div>\n<div>Total Errors: 0<\/div>\n<div>Things look okay \u2013 No serious problems<\/div>\n<div>\u00a0<\/div>\n<div><strong>8.Login to web interface :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div>URL:- <span style=\"text-decoration: underline;\"><a href=\"http:\/\/192.168.0.10\/nagios\/\">http:\/\/192.168.0.10\/nagios\/<\/a><\/span><\/div>\n<div>\u00a0<\/div>\n<div>username :- nagiosadmin<\/div>\n<div>passwd :- *******<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div><strong>9.Package Requirement :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># yum install openssl-devel xinetd<\/div>\n<div>\u00a0<\/div>\n<div># cd \/opt\/shashi<\/div>\n<div>\u00a0<\/div>\n<div># wget <span style=\"text-decoration: underline;\"><a href=\"http:\/\/sourceforge.net\/projects\/nagios\/files\/nrpe-\">http:\/\/sourceforge.net\/projects\/nagios\/files\/nrpe-<\/a><\/span><\/div>\n<div>2.x\/nrpe-2.13\/nrpe-2.13.tar.gz\/download<\/div>\n<div>\u00a0<\/div>\n<div># tar xvf nrpe-2.13.tar.gz<\/div>\n<div>\u00a0<\/div>\n<div># cd nrpe<\/div>\n<div>\u00a0<\/div>\n<div># .\/configure<\/div>\n<div>\u00a0<\/div>\n<div>General Options:<\/div>\n<div>\u00a0<\/div>\n<div>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/div>\n<div>\u00a0<\/div>\n<div>NRPE port:5666<\/div>\n<div>\u00a0<\/div>\n<div>NRPE user:nagios<\/div>\n<div>\u00a0<\/div>\n<div>NRPE group:nagios<\/div>\n<div>\u00a0<\/div>\n<div>Nagios user: nagios<\/div>\n<div>\u00a0<\/div>\n<div>Nagios group: nagios<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div># make all<\/div>\n<div>\u00a0<\/div>\n<div># make install-plugin<\/div>\n<div>\u00a0<\/div>\n<div># make install-daemon<\/div>\n<div>\u00a0<\/div>\n<div># make install-daemon-config<\/div>\n<div>\u00a0<\/div>\n<div># make install-xinetd<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div><strong>10.Enter the following entry :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># vim \/etc\/xinetd.d\/nrpe<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>only_from = 127.0.0.1 192.168.0.10 (nagios_ip_address<\/div>\n<div>)<\/div>\n<div>\u00a0<\/div>\n<div><strong>11.Now, add entry for nrpe daemon to \/etc\/services file :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># vim \/etc\/services<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>nrpe 5666\/tcp # NRPE<\/div>\n<div>\u00a0<\/div>\n<div># service xinetd restart<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div># chkconfig xinetd on<\/div>\n<div>\u00a0<\/div>\n<div><strong>12.Test NRPE Daemon Install :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># netstat -at |grep nrpe<\/div>\n<div>Output should be :<\/div>\n<div>\u00a0<\/div>\n<div>tcp 0 0 *:nrpe *.* LISTEN<\/div>\n<div>\u00a0<\/div>\n<div>13.Check NRPE Service :-<\/div>\n<div>\u00a0<\/div>\n<div># \/usr\/local\/nagios\/libexec\/check_nrpe -H 192.168.0.10<\/div>\n<div>\u00a0<\/div>\n<div>Output should be NRPE version:<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>NRPE v2.12<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div><strong>-: CLIENT SETUP :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div><strong>1.Package Requirement :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># yum install openssl-devel xinetd<\/div>\n<div>\u00a0<\/div>\n<div># yum install httpd php<\/div>\n<div>\u00a0<\/div>\n<div># yum install gcc glibc glibc-common<\/div>\n<div>\u00a0<\/div>\n<div># yum install gd gd-devel<\/div>\n<div>\u00a0<\/div>\n<div><strong>2.Create Nagios user and group :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># useradd -m nagios<\/div>\n<div># passwd nagios<br \/> # usermod -G nagios\u00a0 nagios<\/div>\n<div># groupadd nagcmd<\/div>\n<div># usermod -a -G nagcmd nagios<\/div>\n<div># usermod -a -G nagcmd apache<\/div>\n<div>\u00a0<\/div>\n<div><strong>3.Create a Directary shashi :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># mkdir \/opt\/shashi<\/div>\n<div>\u00a0<\/div>\n<div># cd \/opt\/shashi<\/div>\n<div>\u00a0<\/div>\n<div># wget <span style=\"text-decoration: underline;\"><a href=\"http:\/\/sourceforge.net\/projects\/nagios\/files\/nrpe-\">http:\/\/sourceforge.net\/projects\/nagios\/files\/nrpe-<\/a><\/span>2.x\/nrpe-2.13\/nrpe-2.13.tar.gz\/download<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div># tar -xvf nrpe-2.13.tar.gz<\/div>\n<div># cd nrpe<\/div>\n<div>\u00a0<\/div>\n<div># .\/configure<\/div>\n<div>\u00a0<\/div>\n<div>General Options:<\/div>\n<div>\u00a0<\/div>\n<div>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/div>\n<div>\u00a0<\/div>\n<div>NRPE port: 5666<\/div>\n<div>NRPE user: nagios<\/div>\n<div>NRPE group: nagios<\/div>\n<div>Nagios user: nagios<\/div>\n<div>Nagios group: nagios<\/div>\n<div>\u00a0<\/div>\n<div># make all<\/div>\n<div>\u00a0<\/div>\n<div># make install-plugin<\/div>\n<div>\u00a0<\/div>\n<div># make install-daemon<\/div>\n<div>\u00a0<\/div>\n<div># make install-daemon-config<\/div>\n<div>\u00a0<\/div>\n<div># make install-xinetd<\/div>\n<div>\u00a0<\/div>\n<div>Enter the following entry in :-<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div># vim \/etc\/xinetd.d\/nrpe<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>only_from = 127.0.0.1 &lt;192.168.0.10&gt;(nagios_ip_address)<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div><strong>4.Now, add entry for nrpe daemon to \/etc\/services file<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># vim \/etc\/services<\/div>\n<div>nrpe 5666\/tcp # NRPE<\/div>\n<div>\u00a0<\/div>\n<div># service xinetd start<\/div>\n<div>\u00a0<\/div>\n<div># service xinetd restart<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div># chkconfig xinetd on<\/div>\n<div>\u00a0<\/div>\n<div><strong>5.Test NRPE Daemon Install<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># netstat -at |grep nrpe<\/div>\n<div>\u00a0<\/div>\n<div>Output should be:<\/div>\n<div>tcp 0 0 *:nrpe *.* LISTEN<\/div>\n<div>\u00a0<\/div>\n<div>This command run by server side :-<\/div>\n<div># \/usr\/local\/nagios\/libexec\/check_nrpe -H 192.168.0.11 (client IP)<\/div>\n<div>\u00a0<\/div>\n<div>NRPE v2.12<\/div>\n<div>\u00a0<\/div>\n<div># cd \/opt\/shashi<\/div>\n<div>\u00a0<\/div>\n<div># wget <span style=\"text-decoration: underline;\"><a href=\"http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagiosplug\/nagios-\">http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagiosplug\/nagios-<\/a><\/span>plugins-1.4.11.tar.gz<\/div>\n<div>\u00a0<\/div>\n<div># tar xvf nagios-plugins-1.4.11.tar.gz<\/div>\n<div>\u00a0<\/div>\n<div># cd nagios-plugins-1.4.11<\/div>\n<div>\u00a0<\/div>\n<div># .\/configure &#8211;with-nagios-user=nagios &#8211;with-nagios-group=nagios<\/div>\n<div>\u00a0<\/div>\n<div># make<\/div>\n<div>\u00a0<\/div>\n<div># make install<\/div>\n<div>\u00a0<\/div>\n<div># chkconfig &#8211;add nagios<\/div>\n<div>\u00a0<\/div>\n<div># chkconfig nagios on<\/div>\n<div>\u00a0<\/div>\n<div># \/usr\/local\/nagios\/bin\/nagios -v \/usr\/local\/nagios\/etc\/nagios.cfg<\/div>\n<div>\u00a0<\/div>\n<div>Total Warnings: 0<\/div>\n<div>\u00a0<\/div>\n<div>Total Errors: 0<\/div>\n<div>Things look okay &#8211; No serious problems were detected during the pre-flight check<\/div>\n<div>\u00a0<\/div>\n<div><strong>6.All Plugin :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># cd \/usr\/local\/nagios\/libexec<\/div>\n<div>\u00a0<\/div>\n<div># cp check_http check_tomcat<\/div>\n<div># cp check_http check_jboss<\/div>\n<div>\u00a0<\/div>\n<div><strong>GO TO SERVER SIDE :-<\/strong><\/div>\n<div>\u00a0<\/div>\n<div># vim \/usr\/local\/nagios\/etc\/nagios.cfg<\/div>\n<div>\u00a0<\/div>\n<div>&gt;Definitions for monitoring the local (Linux) host<\/div>\n<div>\u00a0<\/div>\n<div>cfg_file=\/usr\/local\/nagios\/etc\/objects\/localhost.cfg (add line)<\/div>\n<div>\u00a0<\/div>\n<div>cfg_file=\/usr\/local\/nagios\/etc\/objects\/client.cfg (add line)<\/div>\n<div>\u00a0<\/div>\n<div># vim \/usr\/local\/nagios\/etc\/objects\/client.cfg<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>define host {<\/div>\n<div>\u00a0<\/div>\n<div>name client ; Name of this template<\/div>\n<div>\u00a0<\/div>\n<div>use generic-host ; Inherit default values<\/div>\n<div>\u00a0<\/div>\n<div>check_period 24&#215;7<\/div>\n<div>\u00a0<\/div>\n<div>check_interval 5<\/div>\n<div>\u00a0<\/div>\n<div>retry_interval 1<\/div>\n<div>\u00a0<\/div>\n<div>max_check_attempts 10<\/div>\n<div>\u00a0<\/div>\n<div>check_command check-host-alive<\/div>\n<div>\u00a0<\/div>\n<div>notification_period 24&#215;7<\/div>\n<div>\u00a0<\/div>\n<div>notification_interval 30<\/div>\n<div>\u00a0<\/div>\n<div>notification_options d,r<\/div>\n<div>\u00a0<\/div>\n<div>contact_groups admins<\/div>\n<div>\u00a0<\/div>\n<div>register 0 ; DONT REGISTER THIS &#8211; ITS A TEMPLATE<\/div>\n<div>\u00a0<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>define host {<\/div>\n<div>\u00a0<\/div>\n<div>use client ; Inherit default values from a template<\/div>\n<div>\u00a0<\/div>\n<div>host_name client ; The name we&#8217;re giving to this server<\/div>\n<div>\u00a0<\/div>\n<div>alias client ; A longer name for the server<\/div>\n<div>\u00a0<\/div>\n<div>address 192.168.0.11 ; IP address of the server<\/div>\n<div>}<\/div>\n<div>define service {<\/div>\n<div>\u00a0<\/div>\n<div>use local-service<\/div>\n<div>\u00a0<\/div>\n<div>host_name client<\/div>\n<div>\u00a0<\/div>\n<div>service_description PING<\/div>\n<div>\u00a0<\/div>\n<div>check_command check_ping!100.0,20%!500.0,60%<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>define service {<\/div>\n<div>\u00a0<\/div>\n<div>use local-service ; Name of service template to use<\/div>\n<div>\u00a0<\/div>\n<div>host_name client<\/div>\n<div>\u00a0<\/div>\n<div>service_description Disk Space<\/div>\n<div>\u00a0<\/div>\n<div>check_command check_disk!20%!10%!\/<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>define service {<\/div>\n<div>\u00a0<\/div>\n<div>use local-service ; Name of service template to use<\/div>\n<div>\u00a0<\/div>\n<div>host_name client<\/div>\n<div>\u00a0<\/div>\n<div>service_description Total Processes<\/div>\n<div>\u00a0<\/div>\n<div>check_command check_local_procs!150!300!RSZDT<\/div>\n<div>\u00a0<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>define service {<\/div>\n<div>\u00a0<\/div>\n<div>use local-service ; Name of service template to use<\/div>\n<div>\u00a0<\/div>\n<div>host_name client<\/div>\n<div>\u00a0<\/div>\n<div>service_description HTTP<\/div>\n<div>\u00a0<\/div>\n<div>check_command check_http<\/div>\n<div>\u00a0<\/div>\n<div>notification_interval 0 ; set &gt; 0 if you want to be renotified<\/div>\n<div>\u00a0<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>define service {<\/div>\n<div>\u00a0<\/div>\n<div>use local-service<\/div>\n<div>\u00a0<\/div>\n<div>host_name client<\/div>\n<div>\u00a0<\/div>\n<div>service_description MySQL connection-time<\/div>\n<div>\u00a0<\/div>\n<div>check_command check_mysql_health!root!XXXX!connection-time<\/div>\n<div>\u00a0<\/div>\n<div>notifications_enabled 1<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>#define service {<\/div>\n<div>\u00a0<\/div>\n<div>use local-service<\/div>\n<div>\u00a0<\/div>\n<div>host_name client<\/div>\n<div>\u00a0<\/div>\n<div>service_description Tomcat<\/div>\n<div>\u00a0<\/div>\n<div>check_command check_tomcat<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>define service {<\/div>\n<div>\u00a0<\/div>\n<div>use local-service<\/div>\n<div>\u00a0<\/div>\n<div>host_name client<\/div>\n<div>\u00a0<\/div>\n<div>service_description Jboss<\/div>\n<div>\u00a0<\/div>\n<div>check_command check_jboss<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>define service {<\/div>\n<div>\u00a0<\/div>\n<div>use local-service<\/div>\n<div>\u00a0<\/div>\n<div>host_name client<\/div>\n<div>\u00a0<\/div>\n<div>service_description SSH<\/div>\n<div>\u00a0<\/div>\n<div>check_command check_ssh<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>define service {<\/div>\n<div>\u00a0<\/div>\n<div>use local-service ; Name of service template to use<\/div>\n<div>\u00a0<\/div>\n<div>host_name client<\/div>\n<div>\u00a0<\/div>\n<div>service_description Current Users<\/div>\n<div>\u00a0<\/div>\n<div>check_command check_local_users!20!50<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div># <strong>vim \/usr\/local\/nagios\/etc\/objects\/command.cfg<\/strong><\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>################################################################################<\/div>\n<div>\u00a0<\/div>\n<div># NOTE: The following &#8216;check_&#8230;&#8217; commands are used to monitor services on<\/div>\n<div>\u00a0<\/div>\n<div># both local and remote hosts.<\/div>\n<div>\u00a0<\/div>\n<div>################################################################################<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div># &#8216;check_load&#8217; command definition<\/div>\n<div>\u00a0<\/div>\n<div>define command {<\/div>\n<div>\u00a0<\/div>\n<div>command_name check_procs<\/div>\n<div>\u00a0<\/div>\n<div>command_line $USER1$\/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div># &#8216;check_ftp&#8217; command definition<\/div>\n<div>\u00a0<\/div>\n<div>define command {<\/div>\n<div>\u00a0<\/div>\n<div>command_name check_ftp<\/div>\n<div>\u00a0<\/div>\n<div>command_line $USER1$\/check_ftp -H $HOSTADDRESS$ $ARG1$<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div># &#8216;check_http&#8217; command definition<\/div>\n<div>\u00a0<\/div>\n<div>define command {<\/div>\n<div>\u00a0<\/div>\n<div>command_name check_http<\/div>\n<div>\u00a0<\/div>\n<div>command_line $USER1$\/check_http -H $HOSTADDRESS$ -w 10 -c 20<\/div>\n<div>}<\/div>\n<div># &#8216;check_ssh&#8217; command definition<\/div>\n<div>\u00a0<\/div>\n<div>define command {<\/div>\n<div>\u00a0<\/div>\n<div>command_name check_ssh<\/div>\n<div>\u00a0<\/div>\n<div>command_line $USER1$\/check_ssh $ARG1$ $HOSTADDRESS$<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div># &#8216;check_ping&#8217; command definition<\/div>\n<div>\u00a0<\/div>\n<div>define command {<\/div>\n<div>\u00a0<\/div>\n<div>command_name check_ping<\/div>\n<div>\u00a0<\/div>\n<div>command_line $USER1$\/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div># &#8216;check_remote_users&#8217; command definition<\/div>\n<div>\u00a0<\/div>\n<div>define command {<\/div>\n<div>\u00a0<\/div>\n<div>command_name check_remote_users<\/div>\n<div>\u00a0<\/div>\n<div>command_line $USER1$\/check_users -w $ARG1$ -c $ARG2$<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div># &#8216;check_disk&#8217; command defintion<\/div>\n<div>\u00a0<\/div>\n<div>define command {<\/div>\n<div>\u00a0<\/div>\n<div>command_name check_disk<\/div>\n<div>\u00a0<\/div>\n<div>command_line $USER1$\/check_disk -w 20% -c 10% -p \/dev\/sda1<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div># &#8216;check_mysql&#8217;comman definition<\/div>\n<div>\u00a0<\/div>\n<div>define command {<\/div>\n<div>\u00a0<\/div>\n<div>command_name check_mysql_health<\/div>\n<div>\u00a0<\/div>\n<div>command_line $USER1$\/check_mysql_health -H $HOSTADDRESS$ &#8211;user $ARG1$<\/div>\n<div>&#8211;password $ARG2$ &#8211;mode $ARG3$<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div># &#8216;check_tomcat&#8217;comman definition<\/div>\n<div>\u00a0<\/div>\n<div>define command {<\/div>\n<div>\u00a0<\/div>\n<div>command_name check_tomcat<\/div>\n<div>\u00a0<\/div>\n<div>command_line $USER1$\/check_tomcat -H $HOSTADDRESS$ -p 8080 -w 4 -c 5<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>#&#8217;check_jboss&#8217;command definition<\/div>\n<div>\u00a0<\/div>\n<div>define command{<\/div>\n<div>\u00a0<\/div>\n<div>command_name check_jboss<\/div>\n<div>\u00a0<\/div>\n<div>command_line $USER1$\/check_jboss -H $HOSTADDRESS$ -p 4444 -w 4 -c 5<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>Check Configuration :-<\/div>\n<div>\u00a0<\/div>\n<div># \/usr\/local\/nagios\/bin\/nagios -v \/usr\/local\/nagios\/etc\/nagios.cfg<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div># \/etc\/init.d\/nagios restart<\/div>\n<div>\u00a0<\/div>\n<div>######################### Now Enjoy Working with Nagios ###########################<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\n<h3 class=\"post-title entry-title\">Installing nagios with nrpe to monitor remote hosts<\/h3>\n<div id=\"aim26747383284395114179\">\n<div>This post explains <span id=\"IL_AD3\" class=\"IL_AD\">installing<\/span>nagios with nrpe to monitor remote hosts. Nagios is one of the most used monitoring tools today.<\/p>\n<p>On Remote client <span id=\"IL_AD9\" class=\"IL_AD\">server<\/span> to be monitored:<\/p>\n<\/div>\n<div>\u00a0<\/div>\n<div>Create the user nagios and set password:<\/div>\n<div># useradd nagios<\/div>\n<div># passwd nagios<\/div>\n<div>\u00a0<\/div>\n<div><span id=\"IL_AD11\" class=\"IL_AD\">Download<\/span> the nagios plugin from <a href=\"http:\/\/www.nagios.org\/download\/plugins\">http:\/\/www.nagios.org\/download\/plugins<\/a><\/div>\n<div>\u00a0<\/div>\n<div># mkdir -p \/opt\/Nagios\/Nagios_Plugins<\/div>\n<div># cd \/opt\/Nagios\/Nagios_Plugins<\/div>\n<div># cd ..<\/div>\n<div># wget <a href=\"http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagiosplug\/nagios-plugins-1.4.15.tar.gz\">http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagiosplug\/nagios-plugins-1.4.15.tar.gz<\/a><\/div>\n<div># tar xzf nagios-plugins-1.4.15.tar.gz<\/div>\n<div># cd nagios-plugins-1.4.15<\/div>\n<div>\u00a0<\/div>\n<div>Compiling and Installing:<\/div>\n<div>Pere-requisite openssl-devel package.<\/div>\n<div>#rpm -q openssl-devel<\/div>\n<div>if not installed, then<\/div>\n<div># yum -y <span id=\"IL_AD5\" class=\"IL_AD\">install<\/span> openssl-devel<\/div>\n<div>\u00a0<\/div>\n<div>Configuring:\u00a0<\/div>\n<div>\u00a0<\/div>\n<div># cd \/opt\/Nagios\/nagios-plugins-1.4.15<\/div>\n<div># .\/configure &#8211;with-nagios-user=nagios &#8211;with-nagios-group=nagios<\/div>\n<div>If the configure struck with ICMP <span id=\"IL_AD6\" class=\"IL_AD\">ping<\/span> check run as below<\/div>\n<div>.\/configure &#8211;with-nagios-user=nagios &#8211;with-nagios-group=nagios &#8211;with-ping-command=ping<\/div>\n<div># make<\/div>\n<div># make install<\/div>\n<div>\u00a0<\/div>\n<div>Changing permissions:<\/div>\n<div># chown nagios.nagios \/usr\/local\/nagios<\/div>\n<div># chown -R nagios.nagios \/usr\/local\/nagios\/libexec<\/div>\n<div>\u00a0<\/div>\n<div>Installing xinetd super demon if not <span id=\"IL_AD7\" class=\"IL_AD\">installed<\/span><\/div>\n<div># yum install xinetd<\/div>\n<div>\u00a0<\/div>\n<div>Now <span id=\"IL_AD12\" class=\"IL_AD\">downloading<\/span> and installing nrpe demon from<\/div>\n<div><a href=\"http:\/\/exchange.nagios.org\/directory\/Addons\/Monitoring-Agents\/NRPE--2D-Nagios-Remote-Plugin-Executor\/details\">http:\/\/exchange.nagios.org\/directory\/Addons\/Monitoring-Agents\/NRPE&#8211;2D-Nagios-Remote-Plugin-Executor\/details<\/a><\/div>\n<div>\u00a0<\/div>\n<div># mkdir -p \/opt\/Nagios\/Nagios_NRPE<\/div>\n<div># cd \/opt\/Nagios\/Nagios_NRPE<\/div>\n<div>#cd ..<\/div>\n<div>#wget <a href=\"http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagios\/nrpe-2.12.tar.gz\">http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagios\/nrpe-2.12.tar.gz<\/a><\/div>\n<div># tar -xzf nrpe-2.12.tar.gz<\/div>\n<div># cd nrpe-2.12<\/div>\n<div>\u00a0<\/div>\n<div>Compiling and Configuring nrpe<\/div>\n<div># cd \/opt\/Nagios\/nrpe-2.12<\/div>\n<div># .\/configure\u00a0<\/div>\n<div># make all<\/div>\n<div># make install-plugin<\/div>\n<div># make install-daemon<\/div>\n<div># make install-daemon-config<\/div>\n<div># make install-xinetd<\/div>\n<div>\u00a0<\/div>\n<div>Add Nagios Monitoring server to the \u201conly_from\u201d directive<\/div>\n<div># vi \/etc\/xinetd.d\/nrpe<\/div>\n<div>only_from = \u00a0<\/div>\n<div>\u00a0<\/div>\n<div>Add entry for nrpe daemon to services<\/div>\n<div># vi \/etc\/services<\/div>\n<div>nrpe \u00a0 \u00a0 \u00a05666\/tcp \u00a0 \u00a0# NRPE<\/div>\n<div>\u00a0<\/div>\n<div>Restart Xinetd and set chkconfig on<\/div>\n<div># chkconfig xinetd on<\/div>\n<div># service xinetd restart<\/div>\n<div>\u00a0<\/div>\n<div>Checking whether NRPE daemon is running and <span id=\"IL_AD1\" class=\"IL_AD\">listening<\/span> on port 5666:<\/div>\n<div># netstat -at |grep nrpe<\/div>\n<div>tcp \u00a0 \u00a00 \u00a0 \u00a00 *:nrpe \u00a0 \u00a0*.* \u00a0 \u00a0<span id=\"IL_AD8\" class=\"IL_AD\">LISTEN<\/span><\/div>\n<div>\u00a0<\/div>\n<div>Open Port 5666 on Firewall<\/div>\n<div>if using csf add 5666 to TCP_IN and TCP_OUT in \/etc\/csf\/csf.conf and restart as<\/div>\n<div>#csf -r<\/p>\n<p>And add the following lines to\u00a0\/usr\/local\/nagios\/etc\/nrpe.cfg<\/p>\n<\/div>\n<div>\n<div>command[check_users]=\/usr\/local\/nagios\/libexec\/check_users -w 5 -c 10<\/div>\n<div>command[check_load]=\/usr\/local\/nagios\/libexec\/check_load -w 15,10,5 -c 30,25,20<\/div>\n<div>command[check_hda1]=\/usr\/local\/nagios\/libexec\/check_disk -w 20% -c 10% -p \/dev\/hda1<\/div>\n<div>command[check_zombie_procs]=\/usr\/local\/nagios\/libexec\/check_procs -w 5 -c 10 -s Z<\/div>\n<div>command[check_total_procs]=\/usr\/local\/nagios\/libexec\/check_procs -w 150 -c 200<\/div>\n<div>command[check_disk]=\/usr\/local\/nagios\/libexec\/check_disk -w 20% -c 10% -p \/dev\/sda<\/div>\n<div>command[check_mem]=\/usr\/local\/nagios\/libexec\/check_mem 85 95<\/div>\n<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>Nagios server \u00a0Setup (mail nagios server)<\/div>\n<div>Downloading and installing nrpe demon from<\/div>\n<div><a href=\"http:\/\/exchange.nagios.org\/directory\/Addons\/Monitoring-Agents\/NRPE--2D-Nagios-Remote-Plugin-Executor\/details\">http:\/\/exchange.nagios.org\/directory\/Addons\/Monitoring-Agents\/NRPE&#8211;2D-Nagios-Remote-Plugin-Executor\/details<\/a><\/div>\n<div>\u00a0<\/div>\n<div># mkdir -p \/opt\/Nagios\/Nagios_NRPE<\/div>\n<div># cd \/opt\/Nagios\/Nagios_NRPE<\/div>\n<div>#cd ..<\/div>\n<div>#wget <a href=\"http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagios\/nrpe-2.12.tar.gz\">http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagios\/nrpe-2.12.tar.gz<\/a><\/div>\n<div># tar -xzf nrpe-2.12.tar.gz<\/div>\n<div># cd nrpe-2.12<\/div>\n<div>\u00a0<\/div>\n<div>Compiling and Configuring nrpe<\/div>\n<div># cd \/opt\/Nagios\/nrpe-2.12<\/div>\n<div># .\/configure\u00a0<\/div>\n<div># make all<\/div>\n<div># make install-plugin<\/div>\n<div>\u00a0<\/div>\n<div>Check NRPE daemon is functioning from nagios server.\u00a0<\/div>\n<div># \/usr\/local\/nagios\/libexec\/check_nrpe -H<\/div>\n<div>Output:<\/div>\n<div>NRPE v2.12<\/div>\n<div>\u00a0<\/div>\n<div>Check whether it is defined or not.<\/div>\n<div># vi \/usr\/local\/nagios\/etc\/<span id=\"IL_AD10\" class=\"IL_AD\">objects<\/span>\/commands.cfg<\/div>\n<div>define command{<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 command_name check_nrpe<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 command_line $USER1$\/check_nrpe -H $HOSTADDRESS$ -c $ARG1$<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div>\u00a0<\/div>\n<div>If you want to add a few ips then define them in hosts.cfg<\/div>\n<div>and make a hostgroup in hostgroups.cfg with all the needed users as members<\/div>\n<div>and now in services.cfg and the services you want and specidy hostgroup name as follows<\/div>\n<div>\u00a0<\/div>\n<div>### CPU LOAD\/Load Average ###<\/div>\n<div>define service{<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 use \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 basic-service<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 hostgroup_name \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0customer1<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 contact_groups \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0admins<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 service_description \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CPU LOAD<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 check_command \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 check_nrpe!check_load<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>### Disk Usage ###<\/div>\n<div>define service{<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 use \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 basic-service<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 hostgroup_name \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0customer1<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 contact_groups \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0admins<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 service_description \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CHECK DISK<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 check_command \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 check_nrpe!check_disk<\/div>\n<div>}<\/div>\n<div>\u00a0<\/div>\n<div>### RAM Usage ###<\/div>\n<div>define service{<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 use \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 basic-service<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 hostgroup_name \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0customer1<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 contact_groups \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0admins<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 service_description \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CHECK MEM<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 check_command \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 check_nrpe!check_mem<\/div>\n<div>\u00a0<\/div>\n<div>Check the configuration \u00a0as :<\/div>\n<div>#\/usr\/local\/nagios\/bin\/nagios -v \/usr\/local\/nagios\/etc\/nagios.cfg<\/div>\n<div>Now restart<\/div>\n<div>#\/etc\/init.d\/nagios restart<\/div>\n<\/div>\n<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<span style=\"font-size: large;\">How to setup url or website monitoring in nagios server<\/span><\/div>\n<h3 class=\"post-title entry-title\">\u00a0<\/h3>\n<p>First of all create a configuration directory for writing the rules. You can also create the rules in localhost.cfg but I\u00a0recommend\u00a0 to create a separate directory and create the files in it.<\/p>\n<p>#mkdir \/etc\/nagios\/monitor_websites<br \/> and cd to this directory<\/p>\n<p>And create file host.cfg in this directory for setting the urls.<br \/> #vi host.cfg<\/p>\n<p>Suppose I want to monitor three sites<br \/> www.abc.com, www.xyz.com, www.pqr.com<\/p>\n<p>Configure host.cfg as below.<br \/> #vi host.cfg<\/p>\n<p>define host{<br \/> host_name \u00a0abc.com<br \/> alias \u00a0 \u00a0 \u00a0 \u00a0 abc<br \/> address \u00a0 \u00a0www.abc.com<br \/> use \u00a0 \u00a0 \u00a0 \u00a0generic-host<br \/> }<\/p>\n<p>define host{<br \/> host_name \u00a0xyz.com<br \/> alias \u00a0 \u00a0 \u00a0xyz<br \/> address \u00a0 \u00a0www.xyz.com<br \/> use \u00a0 \u00a0 \u00a0 \u00a0generic-host<br \/> }<\/p>\n<p>define host{<br \/> host_name \u00a0pqr.com<br \/> alias \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 pqr<br \/> address \u00a0 \u00a0www.pqr.com<br \/> use \u00a0 \u00a0 \u00a0 \u00a0generic-host<br \/> }<\/p>\n<p>#Defining group of urls \u00a0&#8211; you should add this if you want to set up an HTTP check service.<br \/> define hostgroup {<br \/> hostgroup_name \u00a0 \u00a0monitor_websites<br \/> alias \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 monitor_urls<br \/> members \u00a0 \u00a0 \u00a0 \u00a0 www.abc.com, www.xyz.com, www.pqr.com<br \/> }<br \/> :wq #save it<\/p>\n<p>And now create the file services.cfg for setting the service ( http_check )<\/p>\n<p>#vi services.cfg<br \/> ## Hostgroups services ##<br \/> define service {<br \/> hostgroup_name \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 monitor_websites<br \/> service_description \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 HTTP<br \/> check_command \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 check_http<br \/> use \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 generic-service<br \/> notification_interval \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0<br \/> }<\/p>\n<p>Now give the permissions for directory and configuration files.<br \/> #chown \u00a0-R nagios:nagios monitor_websites<\/p>\n<p>List and check.<br \/> [root@mail nagios]# \u00a0ll monitor_websites<br \/> total 16<br \/> -rw-r&#8211;r&#8211; 1 nagios nagios 669 Apr 25 23:13 host.cfg<br \/> -rw-r&#8211;r&#8211; 1 nagios nagios 253 Apr 25 23:15 services.cfg<br \/> [root@mail nagios]#<\/p>\n<p>Now give the configuration directory path in main nagios configuration file.<br \/> #vi \/etc\/nagios\/nagios.cfg<br \/> cfg_dir=\/etc\/nagios\/monitor_websites<br \/> :wq<\/p>\n<p>Now restart the nagios service.<br \/> #service nagios restart<\/p>\n<p>Thats it. Check the nagios site. You are done. You rocks.<\/p>\n<p><strong>\u00a0How to install and configure Nagios Monitoring tool in redhat linux rhel5 or centos<\/strong><\/p>\n<p>This article will help you to install and configure Nagios monitoring tool in redhat linux or other redhat distributions like fedora, centos etc.<br \/> <strong>Nagios Installation :<\/strong><br \/> Installing packages. Apache, PHP, GCC &amp; GD<\/p>\n<p><strong>Installing Apache web server:<\/strong> <br \/> #yum -y install httpd*<br \/> set hostname in FQDN<br \/> #service httpd on<br \/> <strong><br \/> <\/strong><br \/> <strong>Installing PHP, GCC and GD:<\/strong><br \/> #yum -y install php*<br \/> #yum -y install gcc*<br \/> #yum -y install gd*<\/p>\n<p><strong>Getting the package:<\/strong><br \/> Get the latest packages from net. Mov it to some directory and untar them.<\/p>\n<p>#wget http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagios\/nagios-3.2.0.tar.gz<br \/> #mv nagios-3.2.0.tar.gz\u00a0 \/usr\/local\/src<br \/> #tar xvf nagios-3.2.0.tar.gz<\/p>\n<p>#wget http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagiosplug\/nagios-plugins-1.4.14.tar.gz<br \/> #mv nagios-plugins-1.4.14.tar.gz\/usr\/local\/src<br \/> #tar xvf nagios-plugins-1.4.14.tar.gz<\/p>\n<p><strong>Adding nagios user and setting password for that user:<\/strong> <br \/> #useradd nagios<br \/> #passwd nagios<br \/> usermod -a -G nagios apache\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/To permit the commands through web interface.<\/p>\n<p><strong>Configuration of Nagios:<\/strong><br \/> cd \/usr\/local\/src\/nagios-3.2.0<\/p>\n<p>.\/configure <br \/> make all<br \/> make install<br \/> make install-init<br \/> make install-config<br \/> make install-commandmode<br \/> make install-webconf<\/p>\n<p><strong>Admin account setting for nagios:<\/strong><br \/> htpasswd -c \/usr\/local\/nagios\/etc\/htpasswd.users nagiosadmin\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/passwd\u00a0 for web interface<br \/> give passwd<br \/> service httpd restart<\/p>\n<p><strong>Nagios Plugin installation:<\/strong><br \/> install nagios &#8211; pluggin<\/p>\n<p>cd \/usr\/local\/src\/nagios-plugins-1.4.14<br \/> .\/configure<br \/> make<br \/> make install<\/p>\n<p><strong>Creating entry in \/etc\/init.d\/: <\/strong><br \/> chkconfig &#8211;add nagios<br \/> chkconfig nagios on<\/p>\n<p><strong>Checking the configuration:<\/strong><br \/> \/usr\/local\/nagios\/bin\/nagios -v \/usr\/local\/nagios\/etc\/nagios.cfg<\/p>\n<p><strong>Nagios Alert Plugin &#8211; Mozilla Addon:<\/strong><br \/> Name : Nagios Checker<br \/> [give name and url]<\/p>\n<p><strong>Configuring remotehost in nagios:<\/strong><br \/> cp \/usr\/local\/nagios\/etc\/objects\/localhost.cfg\u00a0 \/usr\/local\/nagios\/etc\/objects\/remotehost.cfg<br \/> [comment the hostgroup entries in order to prevent duplicate entries]<br \/> [change the localhost entries to the remote machine hostname and IP address.]<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nagios<\/p>\n<p>Firewall and SElinux is Disable <\/p>\n<p> Server IP :- 192.168.0.10 Hostname :- shashi.example.com Client IP :- 192.168.0.11 Hostname :- client.example.com 1.Package Requirement :- # yum install httpd php # yum install gcc glibc glibc-common # yum install gd gd-devel 2.Create Nagios user and group :- # useradd -m nagios # passwd nagios # usermod [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1648"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1648"}],"version-history":[{"count":9,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1648\/revisions"}],"predecessor-version":[{"id":1653,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1648\/revisions\/1653"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}