<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>takizo, not takezo</title>
	
	<link>http://systems.takizo.com</link>
	<description>the systems admin blog</description>
	<lastBuildDate>Fri, 06 Nov 2009 09:40:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-sa/2.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/takizo" type="application/rss+xml" /><feedburner:emailServiceId>takizo</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Retrieve CPU and Memory Information on FreeBSD</title>
		<link>http://feedproxy.google.com/~r/takizo/~3/97v6JNZ5uR0/</link>
		<comments>http://systems.takizo.com/2009/11/06/retrieve-cpu-and-memory-information-on-freebsd/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 09:32:25 +0000</pubDate>
		<dc:creator>takizo</dc:creator>
				<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://systems.takizo.com/?p=813</guid>
		<description><![CDATA[Server running slow and how to check CPU/Processor and RAM/Memory info on FreeBSD? There are couple of ways to retrieve the information, by dmesg or sysctl. 
Check CPU/Processor Speed on FreeBSD
Get CPU info by sysctl; 



shell> sysctl -a &#124; egrep -i 'machine&#124;model&#124;ncpu'

hw.machine: i386
hw.model: Intel(R) Pentium(R) D CPU 3.00GHz
hw.ncpu: 2
hw.machine_arch: i386


Get CPU info by dmesg boot [...]]]></description>
			<content:encoded><![CDATA[<p>Server running slow and how to check CPU/Processor and RAM/Memory info on FreeBSD? There are couple of ways to retrieve the information, by dmesg or sysctl. </p>
<h2>Check CPU/Processor Speed on FreeBSD</h2>
<p>Get CPU info by sysctl; </p>
<p><span id="more-813"></span></p>
<pre>
<code>
shell> sysctl -a | egrep -i 'machine|model|ncpu'

hw.machine: i386
hw.model: Intel(R) Pentium(R) D CPU 3.00GHz
hw.ncpu: 2
hw.machine_arch: i386
</code>
</pre>
<p>Get CPU info by dmesg boot message;</p>
<pre>
<code>
shell> egrep -i cpu /var/run/dmesg.boot

CPU: Intel(R) Pentium(R) D CPU 3.00GHz (2998.50-MHz 686-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
cpu0: <ACPI CPU> on acpi0
acpi_perf0: <ACPI CPU Frequency Control> on cpu0
acpi_perf0: <ACPI CPU Frequency Control> on cpu0
cpu1: <ACPI CPU> on acpi0
acpi_perf1: <ACPI CPU Frequency Control> on cpu1
acpi_perf1: <ACPI CPU Frequency Control> on cpu1
SMP: AP CPU #1 Launched!
</code>
</pre>
<h2>Check Total Memory/RAM on FreeBSD</h2>
<p>Get Memory/RAM information from dmesg boot message;</p>
<pre>
<code>
shell> grep -i 'memory' /var/run/dmesg.boot
real memory  = 1072107520 (1022 MB)
avail memory = 1039966208 (991 MB)
</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://systems.takizo.com/2009/11/06/retrieve-cpu-and-memory-information-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://systems.takizo.com/2009/11/06/retrieve-cpu-and-memory-information-on-freebsd/</feedburner:origLink></item>
		<item>
		<title>How to Remove MySQL Binary Log</title>
		<link>http://feedproxy.google.com/~r/takizo/~3/2bU4E99RdaQ/</link>
		<comments>http://systems.takizo.com/2009/08/23/how-to-remove-mysql-binary-log/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 11:38:50 +0000</pubDate>
		<dc:creator>takizo</dc:creator>
				<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://systems.takizo.com/?p=761</guid>
		<description><![CDATA[By default, MySQL 5.0 and above enables MySQL Binary Log. Keeping MySQL Binary Log might take up a lot of disk space for long run. Older MySQL Binary log can be removed in order to keep your hard disk space free. 

MySQL Binary Log stores query event such as add, delete and update in a [...]]]></description>
			<content:encoded><![CDATA[<p>By default, MySQL 5.0 and above enables <a target="_blank" href="http://dev.mysql.com/doc/refman/5.0/en/binary-log.html" target="_blank">MySQL Binary Log</a>. Keeping MySQL Binary Log might take up a lot of disk space for long run. Older MySQL Binary log can be removed in order to keep your hard disk space free. </p>
<p><span id="more-761"></span></p>
<p>MySQL Binary Log stores query event such as add, delete and update in a very details way. The Binary Log is used for two main purposes;</p>
<ul>
<li>1. Replication between master and slave server, statement that has been made on Master server will later send it to slave server. </li>
<li>2. Recovery, certain recovery job required data stored in MySQL Binary Log. </li>
</ul>
<p>MySQL Binary Log is located at the database&#8217;s root folder with the naming convention of mysql-bin.<sequence number>. Sample of the binary files as shown below;</p>
<p><img src="http://systems.takizo.com/wp-content/uploads/2009/08/mysql-binary-log.jpg" alt="mysql-binary-log" title="mysql-binary-log" width="449" height="302" class="aligncenter size-full wp-image-763" /></p>
<h2>Can I Remove MySQL Binary Log</h2>
<p>Yes, as long as the data is replicated to Slave server, it&#8217;s safe to remove the file. It&#8217;s recommend only remove MySQL Binary Log older than 1 month. </p>
<p>Besides, if Recovery of data is the main concern, it&#8217;s recommend to archive MySQL Binary Log.</p>
<p>There are several ways to remove or clean up MySQL Binary Log, it&#8217;s not recommend to clean up the file manually, manually means running the remove command. </p>
<h2>Remove MySQL Binary Log with RESET MASTER Statement</h2>
<p><em><a target="_blank" href="http://dev.mysql.com/doc/refman/5.0/en/reset-master.html" target="_blank">Reset Master</a></em> statement is uses for new database start up during replication for Master and Slave server. This statement can be used to remove all Binary Log.</p>
<p>To clean up Binary Log on Master Server</p>
<pre>
<code>
shell> mysql -u username -p
mysql> RESET MASTER;
</code>
</pre>
<p>To clean up Binary Log on Slave Server</p>
<pre>
<code>
mysql -u username -p
mysql> RESET SLAVE;
</code>
</pre>
<h2>Remove MySQL Binary Log with PURGE BINARY LOGS Statement</h2>
<p><a target="_blank" href="http://dev.mysql.com/doc/refman/5.0/en/purge-binary-logs.html" target="_blank">PURGE BINARY LOGS</a> statement can remove Binary Log base on date or up to a Binary Log sequence number</p>
<p>Base on the binary logs example shown above, I would like to remove binary up to mysql-bin.000015</p>
<pre>
<code>
shell> mysql -u username -p
mysql>PURGE BINARY LOGS TO 'mysql-bin.000015';
</code>
</pre>
<p>Alternatively, you can remove the binary older than a specific date.</p>
<pre>
<code>
shell> mysql -u username -p
mysql> PURGE BINARY LOGS BEFORE '2009-05-01 00:00:00';
</code>
</pre>
<h2>Remove MySQL Binary Log with mysqladmin flush-logs Command</h2>
<p>Another method is running mysqladmin flush-logs command, it will remove binary logs more than 3 days old. </p>
<pre>
<code>
shell> mysqladmin -u username -p flush-logs
</code>
</pre>
<h2>Keep MySQL Binary Log for X Days</h2>
<p>All of the methods above required monitoring on disk usage, to &#8220;rotate&#8221; and keep the binary logs for x number of day. The option below can be configured on MySQL&#8217;s config file, my.cnf</p>
<pre>
<code>
expire_logs_days = 7
</code>
</pre>
<p>Consider turning off MySQL Binary Log if MySQL Replication is not deploy on the database server and recovery is not the main concern.</p>
<p>I have additional 15GB if disk space now <img src='http://systems.takizo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://systems.takizo.com/2009/08/23/how-to-remove-mysql-binary-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://systems.takizo.com/2009/08/23/how-to-remove-mysql-binary-log/</feedburner:origLink></item>
		<item>
		<title>Install and Configure Thold on Cacti</title>
		<link>http://feedproxy.google.com/~r/takizo/~3/b54qbDdqfCE/</link>
		<comments>http://systems.takizo.com/2009/08/21/install-and-configure-thold-on-cacti/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 11:51:14 +0000</pubDate>
		<dc:creator>takizo</dc:creator>
				<category><![CDATA[nms]]></category>

		<guid isPermaLink="false">http://systems.takizo.com/?p=756</guid>
		<description><![CDATA[There are a bunch of Cacti&#8217;s plugins which can do better monitoring. One of the recommended and popular plugin for Cacti is Thold. Thold is a plugin to monitor bandwidth usage and trigger an alert when it reaches the threshold. Plugin Architecture needs to be installed in order to activate it on Cacti. 
Let&#8217;s start [...]]]></description>
			<content:encoded><![CDATA[<p>There are a bunch of Cacti&#8217;s plugins which can do better monitoring. One of the recommended and popular plugin for Cacti is Thold. Thold is a plugin to monitor bandwidth usage and trigger an alert when it reaches the threshold. Plugin Architecture needs to be installed in order to activate it on Cacti. </p>
<p>Let&#8217;s start  the installation and configuration.</p>
<p><span id="more-756"></span></p>
<h2>Backup Your Cacti Files</h2>
<p>Plugin Architecture will make some changes on some Cacti file, it&#8217;s recommend to backup Cacti&#8217;s core file before install Plugin Architecture. If Cacti application is monitoring thousand of routers, It&#8217;s advices not to backup RRA/RRD files together. Backing up RRA/RRD file will take up a lot of disk space and it&#8217;s time consuming. Log file folder can be excluded as well, since only the core files need to be backup.</p>
<p>Take /usr/local/share/cacti as the example of the located Cacti&#8217;s files, lets backup Cacti&#8217;s core files without RRA/RRD and log files;</p>
<pre>
<code>
cd /usr/local/share
tar -vzcf cacti-backup.tar.gz --exclude=cacti/rra/* --exclude=cacti/log/* cacti
</code>
</pre>
<p>After backup has been done, Plugin Architecture installation is ready to roll.</p>
<h2>Install Cacti Plugin Architecture</h2>
<p>Cacti Plugin Architecture can be downloaded from <a target="_blank" target="_blank" href="http://www.cactiusers.org">cactiusers.org</a>. Documentation of Cacti Plugin Architecture installation is available on <a target="_blank" target="_blank" href="http://cactiusers.org/wiki/PluginArchitectureInstall">Cacti Users&#8217; documentation wiki</a>.</p>
<h2>Install and Configure Thold Plugin</h2>
<p>Refer to <a target="_blank" href="http://cactiusers.org/wiki/PluginArchitectureInstall">Cacti&#8217;s plugin installation</a>, before installing Thold plugin, Settings plugin is needed for Thold plugin. Both of the plugin is available on <a target="_blank" href="http://cactiusers.org" target="_blank">Cacti Users</a> website. </p>
<p>Make sure Thold plugin has been activated on include/global.php. Installation has been done, but Thold setting on is not show Cacti&#8217;s Setting page? Permission needs to be granted before Thold setting is shown on Setting panel. To do so, go to User Management, and select your username. On Realm permission, make sure Plugin Management is check. </p>
<p>Now Thold tab should be shown on Cacti&#8217;s Setting panel.</p>
]]></content:encoded>
			<wfw:commentRss>http://systems.takizo.com/2009/08/21/install-and-configure-thold-on-cacti/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://systems.takizo.com/2009/08/21/install-and-configure-thold-on-cacti/</feedburner:origLink></item>
		<item>
		<title>Force Email Delivery on Exim</title>
		<link>http://feedproxy.google.com/~r/takizo/~3/6FSOBy3MU6U/</link>
		<comments>http://systems.takizo.com/2009/07/28/force-email-delivery-on-exim/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 09:17:09 +0000</pubDate>
		<dc:creator>takizo</dc:creator>
				<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://systems.takizo.com/?p=734</guid>
		<description><![CDATA[Hundred emails are queuing on your mail relay server, and you have to push the email to the destination mail server after it has came online. Using exim -M can helps you to delivery the email instantly. 

First and foremost, find out how many email is in the queue for a specific domain


shell> exim -bp [...]]]></description>
			<content:encoded><![CDATA[<p>Hundred emails are queuing on your mail relay server, and you have to push the email to the destination mail server after it has came online. Using <em>exim -M</em> can helps you to delivery the email instantly. </p>
<p><span id="more-734"></span></p>
<p>First and foremost, find out how many email is in the queue for a specific domain</p>
<pre>
<code>
shell> exim -bp | grep [domain name]
shell>
44m  1.7M xxxxx-000HXZ-4V <sentto-4293755-156184-1248768652-xxx=xxx.com@xxx.com>
          email@xxx.com
44m  803K xxxxx-000HZ0-0h <sentto-17568606-107766-1248769406-nora=xxx.com@xxx.com>
          email2@xxx.com
44m   74K xxxxx-000Gzk-6M <xxx@xxx.com>
          email3@xxx.com
</code>
</pre>
<p>Alright, you have grepped the email which are queuing on your mail server, which delivered to your relay server on 44 minutes ago with the email id. To deliver the email to destination mail server</p>
<pre>
<code>
shell> exim -M xxxxx-000HXZ-4V
shell> exim -M xxxxx-000HZ0-0h
shell> exim -M xxxxx-000Gzk-6M
</code>
</pre>
<p>What is there are more than 50 emails? Here is a simple sample bash script showing how to deliver the email to destination email server.</p>
<pre>
<code>
EXIM=/usr/local/sbin/exim
GREP=/usr/bin/grep
AWK=/usr/bin/awk

MAILID=(`$EXIM -bp | $GREP [the-domain] | $AWK '{print $3}'`)

for item in ${MAILID[*]}
do
    echo "flush email ID $item"
    $EXIM -M $item
done
</code>
</pre>
<p>Sit back and relax, the email is being push to the destination mail server. Check your email logs to see delivery status.</p>
]]></content:encoded>
			<wfw:commentRss>http://systems.takizo.com/2009/07/28/force-email-delivery-on-exim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://systems.takizo.com/2009/07/28/force-email-delivery-on-exim/</feedburner:origLink></item>
		<item>
		<title>Arrays in Bash</title>
		<link>http://feedproxy.google.com/~r/takizo/~3/xRWzzH1aqw0/</link>
		<comments>http://systems.takizo.com/2009/07/28/arrays-in-bash/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 06:27:35 +0000</pubDate>
		<dc:creator>takizo</dc:creator>
				<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://systems.takizo.com/?p=727</guid>
		<description><![CDATA[Arrays is useful when it comes to data processing. Using Arrays in Bash is quite easy, and most importantly is to get your job done with the data loaded into the Arrays. 

Declare and Assign Value into Array
To declare an array in bash,


declare -a HELLO


To assign values into arrays


HELLO[0] = 'world'


To assign multiple values into [...]]]></description>
			<content:encoded><![CDATA[<p>Arrays is useful when it comes to data processing. Using Arrays in Bash is quite easy, and most importantly is to get your job done with the data loaded into the Arrays. </p>
<p><span id="more-727"></span></p>
<p><strong>Declare and Assign Value into Array</strong></p>
<p>To declare an array in bash,</p>
<pre>
<code>
declare -a HELLO
</code>
</pre>
<p>To assign values into arrays</p>
<pre>
<code>
HELLO[0] = 'world'
</code>
</pre>
<p>To assign multiple values into arrays</p>
<pre>
<code>
HELLO=(hello world 'i am here')
</code>
</pre>
<p>To dump command line data into arrays</p>
<pre>
<code>
PROCESSID=(`ps ax | grep httpd`)
</code>
</pre>
<p><strong>Output Values from Arrays</strong></p>
<p>To output a value from an Array</p>
<pre>
<code>
HELLO[0] = 'world'
echo ${HELLO[0]}}
>> world
</code>
</pre>
<p>Loop through an Arrays and Output all the values</p>
<pre>
<code>
HELLO=(hello world 'i am here')

for values in ${HELLO[*]}
do
    echo "${values}"
done
</code>
</pre>
<p>For more advance scripting on Arrays, visit http://tldp.org/LDP/abs/html/arrays.html</p>
]]></content:encoded>
			<wfw:commentRss>http://systems.takizo.com/2009/07/28/arrays-in-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://systems.takizo.com/2009/07/28/arrays-in-bash/</feedburner:origLink></item>
	</channel>
</rss>
