<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>linuxbuddies.com &#187; server monitoring</title>
	<atom:link href="http://linuxbuddies.com/tag/server-monitoring/feed/" rel="self" type="application/rss+xml" />
	<link>http://linuxbuddies.com</link>
	<description>For linux documentations.</description>
	<lastBuildDate>Fri, 11 Sep 2009 10:11:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Nagios installation</title>
		<link>http://linuxbuddies.com/2008/12/27/nagios-installation/</link>
		<comments>http://linuxbuddies.com/2008/12/27/nagios-installation/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 08:22:39 +0000</pubDate>
		<dc:creator>Riyesh</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[server tweak]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[nagios configuration]]></category>
		<category><![CDATA[nagios edit]]></category>
		<category><![CDATA[nagios installation]]></category>
		<category><![CDATA[server monitoring]]></category>

		<guid isPermaLink="false">http://linuxbuddies.com/?p=226</guid>
		<description><![CDATA[Nagios is the new name for NetSaint, a network/service monitoring tool. It was designed for Linux, but can be compiled and run perfectly well under any UNIX variant as far as I am aware. The monitoring daemon runs intermittent checks on hosts and services you specify.Nagios can send report through ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-thumbnail wp-image-227" title="nagios" src="http://linuxbuddies.com/wp-content/uploads/2008/12/nagios-150x150.jpg" alt="nagios" width="150" height="150" />Nagios is the new name for NetSaint, a network/service monitoring tool. It was designed for Linux, but can be compiled and run perfectly well under any UNIX variant as far as I am aware. The monitoring daemon runs intermittent checks on hosts and services you specify.Nagios can send report through sms, email, instant message, etc..</p>
<p> </p>
<p>Please follow the steps to install nagios. </p>
<p> </p>
<p><span>Download nagios from source </span></p>
<blockquote><p><span><br />
wget <a href="http://prdownloads.sourceforge.net/nagios/nagios-2.9.tar.gz?download" target="_blank">http://prdownloads.sourceforge.net/nagios/nagios-2.9.tar.gz?download</a></span></p></blockquote>
<p><span><a href="http://prdownloads.sourceforge.net/nagios/nagios-2.9.tar.gz?download" target="_blank"></a></p>
<p>Unpack the sourc file </span></p>
<blockquote><p><span><br />
tar -xzvf nagios-2.9.tar.gz</span></p></blockquote>
<p><span></p>
<p>create user for nagios</span></p>
<blockquote><p><span><br />
useradd nagios</span></p>
<p><span><br />
</span></p></blockquote>
<p><span> Create Installation Directory</span></p>
<p><span><br />
</span></p>
<blockquote><p><span><br />
mkdir /usr/local/nagios</span></p></blockquote>
<p> </p>
<p class="MsoNormal">Change the owner of the base installtion directory to be the Nagios user and group you added earlier as follows:</p>
<blockquote>
<p class="MsoNormal">
chown nagios.nagios /usr/local/nagios</p></blockquote>
<p class="MsoNormal">
 Create a new command file group whose members include the user your web server is running as and the user Nagios is running<br />
as.</p>
<blockquote>
<p class="MsoNormal">
groupadd nagcmd </p></blockquote>
<blockquote>
<p class="MsoNormal">
<p> Add the users that your web server and Nagios run as to the newly created group</p>
<p>usermod -G nagcmd nagios<br />
usermod -G nagcmd nobody</p></blockquote>
<p class="MsoNormal"> Run the configuration script.</p>
<p class="MsoNormal"> </p>
<blockquote>
<p class="MsoNormal">./configure &#8211;prefix=/usr/local/nagios &#8211;with-cgiurl=/nagios/cgi-bin &#8211;with-htmurl=/nagios/ &#8211;with-nagios-user=nagios &#8211;with-nagios-group=nagios &#8211;with-command-group=nagcmd</p>
</blockquote>
<p class="MsoNormal"> Compile Binaries-</p>
<blockquote>
<p class="MsoNormal">
make all</p></blockquote>
<p class="MsoNormal">
<p> Install the Binaries And HTML Files-</p>
<blockquote>
<p class="MsoNormal">
make install </p></blockquote>
<p class="MsoNormal">
<p>9. Install An Init Script-</p>
<blockquote>
<p class="MsoNormal">
make install-init</p></blockquote>
<p class="MsoNormal">
<p> Download Nagios plugin to /usr/local/nagios  from</p>
<blockquote>
<p class="MsoNormal">
wget <a href="http://downloads.sourceforge.net/nagiosplug/nagios-plugins-1.4.9.tar.gz?modtime=1180952247&amp;big_mirror=0" target="_blank">http://downloads.sourceforge.net/nagiosplug/nagios-plugins-1.4.9.tar.gz?modtime=1180952247&amp;big_mirror=0</a></p></blockquote>
<p class="MsoNormal"><a href="http://downloads.sourceforge.net/nagiosplug/nagios-plugins-1.4.9.tar.gz?modtime=1180952247&amp;big_mirror=0" target="_blank"></a><br />
untar; and cd into the new directory.</p>
<blockquote>
<p class="MsoNormal">
<p> Compile Binaries- make</p></blockquote>
<blockquote>
<p class="MsoNormal">
<p> make install</p></blockquote>
<p class="MsoNormal">
<p> Setup The Web Interface</p>
<p class="MsoNormal">
<p>ADD THE FOLLOWING ENTRIES TO HTTPD.CONF</p>
<p class="MsoNormal">
<p>Configure Aliases and Directory Options For The Web Interface</p>
<blockquote>
<p class="MsoNormal">
<p>ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/<br />
&lt;Directory /usr/local/nagios/sbin/&gt;<br />
AllowOverride AuthConfig<br />
Options ExecCGI<br />
Allow from all<br />
Order allow,deny<br />
&lt;/Directory&gt;</p>
<p>Alias /nagios/ /usr/local/nagios/share/<br />
&lt;Directory /usr/local/nagios/share&gt;<br />
Options None<br />
AllowOverride AuthConfig<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;</p></blockquote>
<p class="MsoNormal">
 Include the file in the Apache configuration file.</p>
<p class="MsoNormal">
<p> Create a user for the web authentication -nagiosadmin<br />
 Provide a password that will be used when nagiosadmin authenticates to the web server.</p>
<blockquote>
<p class="MsoNormal">
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin</p></blockquote>
<p class="MsoNormal">
 Enable Authentication/Authorization Functionality In The CGIs</p>
<p class="MsoNormal"> </p>
<blockquote>
<p class="MsoNormal">
Set use_authentication=0 in cgi.cfg file.</p></blockquote>
<p class="MsoNormal">
<p>Set the default Permissions To CGI Information</p>
<blockquote>
<p class="MsoNormal">
<p>authorized_for_system_information=nagiosadmin<br />
authorized_for_configuration_information=nagiosadmin<br />
authorized_for_system_commands=nagiosadmin<br />
authorized_for_all_services=nagiosadmin<br />
authorized_for_all_hosts=nagiosadmin<br />
authorized_for_all_service_commands=nagiosadmin<br />
authorized_for_all_host_commands=nagiosadmin</p></blockquote>
<p class="MsoNormal">
<p>  Restart The Web Server</p>
<blockquote>
<p class="MsoNormal">
 cd  /user/local/nagios/etc</p></blockquote>
<p class="MsoNormal">
  Create directories hosts and services</p>
<blockquote>
<p class="MsoNormal">
mkdir hosts.<br />
mkdir services.</p></blockquote>
<p class="MsoNormal">  Specify the directories in the nagios.cfg file.</p>
<blockquote>
<p class="MsoNormal">
cfg_dir=/usr/local/nagios/etc/hosts<br />
cfg_dir=/usr/local/nagios/etc/services</p></blockquote>
<p class="MsoNormal">
 In each of these directories we need to create files for each servers we need to monitor.<br />
Each of these files will contain the hostname and ip of the respective servers.<br />
For this we need to make a copy of the HOSTS block in the localhost.cfg file for each servers.<br />
Similarly we need to make a copy of the SERVICES block of the localhost.cfg for each servers<br />
in the services directory.</p>
<p>  We need to specify the emailID where we recieve the alerts in the localhost.cfg file.</p>
<p> Also we need to add all the hostname we are monitoring in the HOSTGROUP of the localhost.cfg file.</p>
<p> Once this is done, we need to start nagios.</p>
<p>We can see the logg details of nagios in the /usr/local/nagios/var/nagios. log file.</p>
<p>This completes the configuration of NAGIOS!!!</p>
<p>SAMPLE CONFIGURATION TO ADD A HOST<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p># Generic host definition template &#8211; This is NOT a real host, just a template!</p>
<p>define host{<br />
        name                            generic-host    ; The name of this host template<br />
        notifications_enabled           1               ; Host notifications are enabled<br />
        event_handler_enabled           1               ; Host event handler is enabled<br />
        flap_detection_enabled          1               ; Flap detection is enabled<br />
        failure_prediction_enabled      1               ; Failure prediction is enabled<br />
        process_perf_data               1               ; Process performance data<br />
        retain_status_information       1               ; Retain status information across program restarts<br />
        retain_nonstatus_information    1               ; Retain non-status information across program restarts<br />
        notification_period             24&#215;7            ; Send host notifications at any time<br />
        register                        0               ; DONT REGISTER THIS DEFINITION &#8211; ITS NOT A REAL HOST, JUST A TEMPLATE!<br />
        }</p>
<p># Linux host definition template &#8211; This is NOT a real host, just a template!</p>
<p>define host{<br />
        name                            swww3.couchsurfing.com  ; The name of this host template<br />
        use                             generic-host    ; This template inherits other values from the generic-host template<br />
        check_period                    24&#215;7            ; By default, Linux hosts are checked round the clock<br />
        max_check_attempts              10              ; Check each Linux host 10 times (max)<br />
        check_command                   check-host-alive ; Default command to check Linux hosts<br />
        notification_period             workhours       ; Linux admins hate to be woken up, so we only notify during the day<br />
                                                        ; Note that the notification_period variable is being overridden from                                                        ; the value that is inherited from the generic-host template!<br />
        notification_interval           120             ; Resend notification every 2 hours<br />
        notification_options            d,u,r           ; Only send notifications for specific host states<br />
        contact_groups                  admins          ; Notifications get sent to the admins by default<br />
        register                        0               ; DONT REGISTER THIS DEFINITION &#8211; ITS NOT A REAL HOST, JUST A TEMPLATE!<br />
        }</p>
<p># Since this is a simple configuration file, we only monitor one host &#8211; the<br />
# local host (this machine).</p>
<p>define host{<br />
        use                     swww3.couchsurfing.com           ; Name of host template to use<br />
                                                        ; This host definition will inherit all variables that are defined<br />
                                                        ; in (or inherited by) the linux-server host template definition.<br />
        host_name               swww3.couchsurfing.com<br />
        alias                   swww3.couchsurfing.com<br />
        address                 207.210.80.122<br />
}</p>
<p>SAMPLE CONFIGURATION TO ADD SERVICES TO A HOST<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p># Generic service definition template &#8211; This is NOT a real service, just a template!</p>
<p>define service{<br />
        name                            generic-service         ; The &#8216;name&#8217; of this service template<br />
        active_checks_enabled           1                       ; Active service checks are enabled<br />
        passive_checks_enabled          1                       ; Passive service checks are enabled/accepted<br />
        parallelize_check               1                       ; Active service checks should be parallelized (disabling this can lead to major performance problems)<br />
        obsess_over_service             1                       ; We should obsess over this service (if necessary)<br />
        check_freshness                 0                       ; Default is to NOT check service &#8216;freshness&#8217;<br />
        notifications_enabled           1                       ; Service notifications are enabled<br />
        event_handler_enabled           1                       ; Service event handler is enabled<br />
        flap_detection_enabled          1                       ; Flap detection is enabled<br />
        failure_prediction_enabled      1                       ; Failure prediction is enabled<br />
        process_perf_data               1                       ; Process performance data<br />
        retain_status_information       1                       ; Retain status information across program restarts<br />
        retain_nonstatus_information    1                       ; Retain non-status information across program restarts<br />
        is_volatile                     0                       ; The service is not volatile<br />
        register                        0                       ; DONT REGISTER THIS DEFINITION &#8211; ITS NOT A REAL SERVICE, JUST A TEMPLATE!<br />
        }</p>
<p># Local service definition template &#8211; This is NOT a real service, just a template!</p>
<p>define service{<br />
        name                            local-service           ; The name of this service template<br />
        use                             generic-service         ; Inherit default values from the generic-service definition<br />
        check_period                    24&#215;7                    ; The service can be checked at any time of the day<br />
        max_check_attempts              4                       ; Re-check the service up to 4 times in order to determine its final (hard) state<br />
        normal_check_interval           5                       ; Check the service every 5 minutes under normal conditions<br />
        retry_check_interval            1                       ; Re-check the service every minute until a hard state can be determined<br />
        contact_groups                  admins                  ; Notifications get sent out to everyone in the &#8216;admins&#8217; group<br />
        notification_options            w,u,c,r                 ; Send notifications about warning, unknown, critical, and recovery events<br />
        notification_interval           60                      ; Re-notify about service problems every hour<br />
        notification_period             24&#215;7                    ; Notifications can be sent out at any time<br />
        register                        0                       ; DONT REGISTER THIS DEFINITION &#8211; ITS NOT A REAL SERVICE, JUST A TEMPLATE!<br />
        }</p>
<p># Define a service to &#8220;ping&#8221; the local machine</p>
<p>define service{<br />
        use                             local-service         ; Name of service template to use<br />
        host_name                       www4.couchsurfing.com<br />
        service_description             PING<br />
        check_command                   check_ping!100.0,20%!500.0,60%<br />
        }</p>
<p># Define a service to check the disk space of the root partition<br />
# on the local machine.  Warning if &lt; 20% free, critical if<br />
# &lt; 10% free space on partition.</p>
<p>define service{<br />
        use                             local-service         ; Name of service template to use<br />
        host_name                        www4.couchsurfing.com<br />
        service_description             Root Partition<br />
        check_command                   check_local_disk!20%!10%!/<br />
        }</p>
<p># Define a service to check the number of currently logged in<br />
# users on the local machine.  Warning if &gt; 20 users, critical<br />
# if &gt; 50 users.</p>
<p>define service{<br />
        use                             local-service         ; Name of service template to use<br />
        host_name                        www4.couchsurfing.com<br />
        service_description             Current Users<br />
        check_command                   check_local_users!20!50<br />
        }</p>
<p># Define a service to check the number of currently running procs<br />
# on the local machine.  Warning if &gt; 250 processes, critical if<br />
# &gt; 400 users.</p>
<p>define service{<br />
        use                             local-service         ; Name of service template to use<br />
        host_name                        www4.couchsurfing.com<br />
        service_description             Total Processes<br />
        check_command                   check_local_procs!250!400!RSZDT<br />
        }</p>
<p># Define a service to check the load on the local machine.</p>
<p>define service{<br />
        use                             local-service         ; Name of service template to use<br />
        host_name                        www4.couchsurfing.com<br />
        service_description             Current Load<br />
        check_command                   check_local_load!5.0,4.0,3.0!10.0,6.0,4.0<br />
        }</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxbuddies.com/2008/12/27/nagios-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cacti Installation</title>
		<link>http://linuxbuddies.com/2008/12/21/cacti-installation/</link>
		<comments>http://linuxbuddies.com/2008/12/21/cacti-installation/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 07:13:51 +0000</pubDate>
		<dc:creator>Riyesh</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[bandwitdthd]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[network monitoring]]></category>
		<category><![CDATA[server monitoring]]></category>

		<guid isPermaLink="false">http://linuxbuddies.com/?p=323</guid>
		<description><![CDATA[ Cacti uses RRDTool to generate graphs for network statistics like bandwidthd. 
 
Requirements:

Mysql
Php
Rrdtool
net-snmp
net-snmp-devel.i386
net-snmp-libs.i386
net-snmp-perl.i386
net-snmp-utils.i386
php-snmp
Apache with PHP Support
 
MySQL configuration for cacti:
 
mysql -u root -p
mysql&#62; create database cacti;
mysql&#62; grant all on cacti.* to cactiuser@’localhost’ identified by ‘cactipassword’;
mysql&#62; flush privileges;
 
RRDTool Installation
 
Requirements:

tcl
tcl-devel
 
[root]# cd /usr/local/src/
[root]# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz
[root]# tar -zxf rrdtool.tar.gz
[root]# cd rrdtool*
[root]# ./configure
[root]# make
[root]# make install
[root]# make site-perl-install
 
   ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-thumbnail wp-image-324" title="cacti1" src="http://linuxbuddies.com/wp-content/uploads/2009/01/cacti1-150x150.png" alt="cacti1" width="150" height="150" /> Cacti uses RRDTool to generate graphs for network statistics like bandwidthd. </p>
<p> </p>
<p><span><strong>Requirements:</strong></span></p>
<p style="padding-left: 30px; "><span><strong></strong></span><br />
Mysql<br />
Php<br />
Rrdtool<br />
net-snmp<br />
net-snmp-devel.i386<br />
net-snmp-libs.i386<br />
net-snmp-perl.i386<br />
net-snmp-utils.i386<br />
php-snmp<br />
Apache with PHP Support</p>
<p style="padding-left: 30px; "> </p>
<p><strong>MySQL configuration for cacti:</strong></p>
<p> </p>
<p style="padding-left: 30px; "><strong><span style="font-weight: normal;">mysql -u root -p<br />
mysql&gt; create database cacti;<br />
mysql&gt; grant all on cacti.* to cactiuser@’localhost’ identified by ‘cactipassword’;<br />
mysql&gt; flush privileges;</span></strong></p>
<p style="padding-left: 30px; "> </p>
<p><strong><span style="font-weight: normal;"><strong>RRDTool Installation</strong></span></strong></p>
<p> </p>
<p><strong><span style="font-weight: normal;"><strong><span>Requirements:</span><br />
</strong></span></strong></p>
<p style="padding-left: 30px; ">tcl<br />
tcl-devel</p>
<p style="padding-left: 30px; "> </p>
<p style="padding-left: 30px; ">[root]# cd /usr/local/src/<br />
[root]# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz<br />
[root]# tar -zxf rrdtool.tar.gz<br />
[root]# cd rrdtool*<br />
[root]# ./configure<br />
[root]# make<br />
[root]# make install<br />
[root]# make site-perl-install</p>
<p style="padding-left: 30px; "> </p>
<p>                  <strong>OR</strong></p>
<p style="padding-left: 30px; "> </p>
<p style="padding-left: 30px; "><strong><span style="font-weight: normal;"> yum install -y rrdtool*</span></strong></p>
<p style="padding-left: 30px; "><strong><span style="font-weight: normal;">[root]# useradd cactiuser<br />
[root]# tar -zxvf cacti*<br />
[root]# mv cacti-0.8.xx /home/cactiuser/cacti<br />
[root]# cd /home/cactiuser/cacti<br />
[root]# mysql cactidb &lt; cacti.sql</span></strong></p>
<p style="padding-left: 30px; "> </p>
<p><strong><span style="font-weight: normal;"><strong>Edit config.php:</strong></span></strong></p>
<p> </p>
<p style="padding-left: 30px; "><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;">[root]# vi /include/config.php<br />
$database_defaut = “cacti”;<br />
$database_hostname = “localhost”;<br />
$database_username = “cactiuser”;<br />
$database_password = “cactipassword”</span></strong></span></strong></p>
<p style="padding-left: 30px; "> </p>
<p><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><strong>Adding CRON Job:</strong></span></strong></span></strong></p>
<p> </p>
<p style="padding-left: 30px; "><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;">[root]# crontab -e<br />
*/5 * * * * cactiuser php /home/cactiuser/cacti/poller.php &gt; /dev/null 2&gt;&amp;1</span></strong></span></strong></span></strong></p>
<p style="padding-left: 30px; "> </p>
<p><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><strong>In httpd.conf:</strong></span></strong></span></strong></span></strong></p>
<p> </p>
<p style="padding-left: 30px; "><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;">Alias /cacti/ “/home/cactiuser/cacti/”</span></strong></span></strong></span></strong></span></strong></p>
<p style="padding-left: 30px; "> </p>
<p><strong>Restart Services </strong></p>
<p style="padding-left: 30px; "> </p>
<p style="padding-left: 30px; "><strong><span style="font-weight: normal;">/etc/init.d/httpd restart<br />
/etc/init.d/mysqld restart</span></strong></p>
<p style="padding-left: 30px; "> </p>
<p><strong><span style="font-weight: normal;"><span><strong>Cacti Installed Successfully&#8230;</strong></span><br />
Access: <a class="postlink" href="http://localhost/cacti">http://localhost/cacti</a><br />
Login with username/password : admin/admin<br />
</span></strong></p>
<p style="padding-left: 30px; "> </p>
]]></content:encoded>
			<wfw:commentRss>http://linuxbuddies.com/2008/12/21/cacti-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
