Archive for 'Bash' Category

Starting & stopping CF-Engine

By jbayer - Last updated: Wednesday, January 15, 2014

We are slowly implementing CF-Engine 3 in our environment.  Inevitably, there are occasionally problems on specific systems.  Sometimes we need to disable CF-Engine while debugging since the files that are being worked on are maintained by CF-Engine and would be overwritten during the debugging process. We also put a line in to /etc/cron.d/cfengine to restart […]

757 views

Find big files

By jbayer - Last updated: Wednesday, October 2, 2013

Someone is using a lot of space, and you want to find out who.  More specifically, you would like to identify the large files and automatically send them an email about it. This script will do that for you.  It’s called findbig, and can be called by hand or from a cron job.  It will […]

413 views

Detecting hardware virtualization in Linux

By jbayer - Last updated: Friday, May 10, 2013

For historical reasons, most systems which ship have the virtualization flag turned off.  If you aren’t expecting this, and try to install KVM in a Linux system, you can get unusual errors which don’t necessarily indicate the problem. This script performs a few simple tests to see if virtualization is active or not.  I can’t […]

611 views

Bacula & WeBacula Installation Script

By jbayer - Last updated: Thursday, April 25, 2013

Note:  The script was updated on 5/17/2013 due to a typo. We recently had an issue where we lost 3 drives in a RAID 5 array, causing the entire system to be lost.  Unfortunately, some data was lost due to the hosting service’s backups  not being complete. As a result of this, we decided to […]

1,818 views

Zabbix install script updated to v1.9

By jbayer - Last updated: Sunday, October 14, 2012

Here is the latest update to my zabbix installation script.  It defaults to Zabbix 2.0.1, but it checks to see what the latest version is and gives you the option to install it, along with everything else necessary. I noticed that when doing an upgrade, that the config files aren’t always updated properly.  In some […]

828 views

Monitoring Memcached servers

By jbayer - Last updated: Wednesday, August 15, 2012

If you are using memcached, you may want to know if it is running or not, and if it isn’t, to get it started. The attached script will do that.  Run it as on the server which is running the memcached instance(s), as root, from cron, once a minute, and it will check. In our […]

941 views

Count files in all subdirectories, by directory

By jbayer - Last updated: Friday, June 22, 2012

This is a quickie. I had a need to see how many files were in each directory (not including files in directories underneath) This little script will do just that, and save the output in a file called “b.csv” (I was lazy).  The file will be formatted as a comma separated csv, which you can load into […]

946 views

Zabbix 2.0.0 Install Script

By jbayer - Last updated: Friday, May 25, 2012

So Zabbix 2.0.0 was recently released.  It has a lot of improvements, and I’ve updated my script to install the new version. Download onto a bare-bones CentOS, Scientific Linux or RHEL install and run it. The script is also now capable of building and installing the Zabbix Proxy.  One thing, the proxy requires a database, […]

5,821 views

How to email the output of a cronjob to different addresses

By jbayer - Last updated: Thursday, May 10, 2012

Cron is a wonderful tool on a Linux/Unix box.  Normally, when a job runs and some output is generated, it is emailed to the owner of the job.  You can alter this by added the following line to the crontab file: MAILTO=address@domain.com However, if you have a number of jobs which are run by a […]

1,011 views

Scripts and cron

By jbayer - Last updated: Tuesday, December 13, 2011

Today I’m going to talk about three things;  two fairly common, and the third not so common.  Two are solved with the same script, while the third is a separate include. The problems addressed are the following: Making sure that only one copy of a script can be active at a time Limiting the run […]

581 views
asd