Showing posts from February, 2012

Samba as Primary Domain Controller in CentOS 6

Step 1: Installing Samba
All the necessary RPM should be present in the installation media (CD/DVD). If needed, the online repository of is very good too.

[root@firefly ~]# yum install samba  

Step 2: Preparing the Configuration Files
Now that Samba is installed, it is time to prepare the configuration file. I've said it before and I'll say it again, it's always a good idea to back up the .conf file before modifying.

[root@firefly ~]# cd /etc/samba/ [root@firefly samba]# cp smb.conf smb.conf.bak [root@firefly samba]# vim smb.conf  
Here are the modifications

workgroup = SCRUB ## The actual name of the domain ## hosts allow = 127. 192.168.1. ## The IP range to be allowed. Alternatively, the “interfaces” parameter may be used. ## security = user passdb backend = tdbsam domain master = yes domain logons = yes logon path = ## Because netlogons create more problems than benefit, we have used an empty logon path to force user accounts to be created at clien…

SARG on CentOS 6

A newer version of this article is available in my blog:

Usually, it's pretty hard to analyze information from the squid log file. For example, I don't know how to analyze date or number of hits from /var/log/squid/access.log. If someone needs to analyze which websites are being accessed from the network, SARG may be a very good tool. SARG, or Squid Analysis Report Generator ( analyzes the log, and generates a web based table where one can easily analyze proxy traffic.
Although SARG can be installed using YUM, I have faced problems with CentOS 6. So, I went for tarball installation instead. And believe, it's really easy unlike many tarball installtions.
So, let's start:[root@busy-bee2 ~]# yum install gcc make wget httpd [root@busy-bee2 ~]# wget [root@busy-bee2 ~]# tar zxvf …

Cacti Troubleshooting

Timezone Problem

If no graph is being generated and the cacti log keeps telling about timezone problem then this can be done:

PHP Warning:  strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Dacca' for 'BDT/6.0/no DST' instead in /var/www/cacti/include/global_arrays.php on line 671 

My timezone is Asia/Dhaka, so I modifed php.ini accordingly.

[root@centu ~]# vim /etc/php.ini date.timezone = Asia/Dhaka [root@centu ~]# service httpd restart 

Of course, PHP documentation should be consulted prior to editing php.ini. This may help:

Graphs Not Being Generated
The poller needs to run at least once for the RRD (typically stored in /var/www/cacti/rra/) files t…

Cacti on CentOS 6 (Adding Devices)

After a fresh installation, the default username is 'admin' & password is 'admin'. After the first successful login, the user is forced to change it.

Now, we will see how to add devices in Cacti for monitoring

Adding a device for traffic analysis

Cacti on CentOS 6 (Setting up the System)

Step 1: Installing RPM

I would recommend using the repository of It has a large collection and I can get all the necessary RPMs there.

[root@centu ~]# yum install freetype-devel libpng-devel libart_lgpl-devel php-gd mysql-server mysql php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-snmp php-pear-Net-SMTP php-mysql httpd net-snmp-utils php-snmp net-snmp-libs crontabs cacti  

Step 2: Preparing SNMP

It is always a best practice to backup any configuration file before editing. To get SNMP ready to roll, we need to edit the following configuration file:
[root@centu snmp]# vim /etc/snmp/snmpd.conf 

com2sec myUser myCommunity group myGroup v1 myUser group myGroup v2c myUser view all included .1 access myGroup "" any noauth exact all all none 

My Server IP is, and I have configured SNMP to match my requirements. Needless to say, your configuration should match you…