Quick Config: Install ClamAV & configure a daily scan on CentOS 6

I’m pretty well versed in the ways of Anti-Virus in Windows but I’ve wanted to get an AV engine installed on my Linux boxes for a while now. In looking around I’ve found a tried and true option in ClamAV and after a few stops and starts was able to get something usable. I’d still like to figure out how to have it send me a report by e-mail if it finds something but that’s for another day; I don’t have enough Linux in my environment to necessitate me putting the time in for that.

So with that here’s how to quickly get started.

Step 0: If not already there, install the EPEL repository

Step 1: Install ClamAV

Step 2: Perform the 1st update of ClamAV definitions (this will happen daily by default afterwards)

Step 3: Enable and Start Services

Step 4: Configure Daily Cron Job

I chose to have it scan the whole system and only report infected files, you may want to do differently

Enter the following:

Note the -i option tells it to only return infected files, the -r tells it to recursively search. You may want to add the –remove option as well to remove files that are seen as infected.

Step 6: Make Cron Job Executable

You can then kick of a manual scan if you’d like using

That’s it! pretty simple and all of your output will be logged daily to the /var/log/clamav/daily_clamscan.log file for review.

Fully Install VMware Tools Via Yum in CentOS

I’ll be the first to admit that I know far less about Linux than is necessary to be good at it and more than necessary to be dangerous at it.  That said, if nothing else, I do try to learn more about it.  I find that in general I’ve basically committed to CentOS as my flavor of choice with it being the underpinnings of every non-appliance installation I’ve got.  Alot of this has to do with the fact that my first experiences were with RedHat and the subsequent RHEL, so with CentOS being the server side, open source derivative of RHEL it makes sense that that’s where I’d go.  In the vSphere world as you get further down the rabbit hold of monitor systems for your infrastructure you’ll find that for most things to even begin to operate effectively you’ve got to have VMware tools installed.  While there are various instruction sets out there floating around for how to get these on both, through the “Install VMware Tools” GUI and via yum (the RHEL package installation system) I’ve found that your mileage may vary greatly.

Below is a list of commands that I’ve finally got happy with to get these installed and allow for complete control over the VM much like you do with your Windows VMs via the VI client.  With the exception of a couple of modifications regarding your revisions of vSphere and CentOS you can pretty much copy and paste this into your elevated prompt (root) on your linux box and get all the information and monitoring you need.

1. Add the VMware GPG keys
rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub
rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub

2. Copy the following to create a yum repository with all of the relevant information. You will need to change the ESXi version (red) and CentOS base (blue) to match what you run:
echo "[vmware-tools]" >> /etc/yum.repos.d/vmware-tools.repo
echo "name=VMware Tools" >> /etc/yum.repos.d/vmware-tools.repo
echo "baseurl=http://packages.vmware.com/tools/esx/5.0/rhel6/$basearch" >> /etc/yum.repos.d/vmware-tools.repo
echo "enabled=1" >> /etc/yum.repos.d/vmware-tools.repo
echo "gpgcheck=1" >> /etc/yum.repos.d/vmware-tools.repo

3. Install all portions of the VMware Tools:
yum -y install vmware-tools*

And that’s pretty much it.  Once done you’ll probably immediately notice that it shows as you are running a 3rd Party version of the tools, but now you’ll see the IP address of the box in the VM summary screen.  Further you’ll now be able to monitor heartbeat and view performance data for your VMs, which is very nice to have.  In my environment I immediately began getting issue notifications via Veeam ONE letting me know about issues I didn’t even know I had.

A lot of the other guides on how to do this have you use the command yum install vmware-tools-core, but I find that to be pretty incomplete as there are various plugins that allow for greater management and utilities such as auto update abilities.  You can see a whole list of what’s possible and cherry pick if you like by running the command yum search vmware-tools* once you’ve added your repository (step 2).