Archive for April, 2010

SBDavid

NSClient++

NSClient++

NSClient++ is a windows service that allows performance metrics to be gathered by Nagios (and possibly other monitoring tools). It is an attempt to create a NSClient and NRPE compatible but yet extendable performance service for windows.

http://nsclient.org/nscp/

Using NSClient++ with nagios

http://nsclient.org/nscp/wiki/doc/usage/nagios

NSClient++ supports several transports and you can use either one or several of these or you can create your own cusom transport. Transports are methods which facilitates communication between Nagios and your server. You can look at this much like for instance HTTP (which you are using now) and FTP. They both support transferring files but they have slightly different approaches so things work differently but the end result is the same. A file gets transfered. In our case the end result is that a monitoring result gets submitted to Nagios.

SBDavid

Backing up your files with rsync

Backing up your files with rsync

rsync makes the task a lot easier as it only downloads files that have changed - saving time and bandwidth.

Setup ssh keys so that you don’t need to enter a password each time you attempt to rsync folders.

On the destination server, the command is as follows:

rsync -e ’ssh -p 2222′ -avl –delete –stats –progress root@192.168.1.1:/home/buddy /backup/

-e ’ssh -p 2222′: this ensures rsync uses the SSH protocol and sets the port.

-avl: This contains three options;

(a) is archive mode which basically keep the permission settings for the files.
(v) is verbose mode. You can leave it out or increase it by appending two v’s (-vv).
(l) preserves any links you may have created.

–delete: deletes files from the destination folder that are no longer required (i.e. they have been deleted from the folder being backed up).

–stats: Adds a little more output regarding the file transfer status.

–progress: shows the progress of each file transfer. Can be useful to know if you have large files being backup up.

SBDavid

rsync - exclude files and folders

rsync - exclude files and folders

First - define the files and folders you want to exclude from the rsync:

To do this create a file called ‘exclude.txt’ on the destination machine (the system you give the rsync command on):

pico /home/buddy/exclude.txt

Now we have defined what to exclude we can direct rsync to the file with:

–exclude-from ‘/home/buddy/exclude.txt’

The final command would be:

rsync -e ’ssh -p 2222′ -avl –delete –stats –progress –exclude-from ‘/home/buddy/exclude.txt’ root@192.168.1.1:/home/buddy /backup/

Exporting and Importing mysql databases

Exporting the Database.

In this example, we will export the ‘mydb’ database into a file called ‘mydb.sql’:

mysqldump -u root -p mydb > mydb.sql

Importing the data is just as easy but involves two steps.

The first step is to create a blank database ready to receive the data.

mysqladmin -u root -p create mydb1

Once done, all that is left is to actually import the data:

mysql -u root -p mydb1 < mydb.sql

Removing a mail server from the Spamhaus PBL

How to check if your IP is listed.

http://www.spamhaus.org/lookup.lasso

Spamhaus assists Internet service providers with preventing unsolicited email (spam) from passing through their mail servers. One of the tools Spamhaus employs is a “Policy Block List” (PBL) that lists addresses that get assigned to customers of dial-up, broadband, and hosting service providers. Those addresses are then blocked by default and have to be manually removed from the list when someone has a legitimate need to use one of those addresses to run a mail server (as many Slicehost customers do). It is therefore likely that a new slice, or one that hasn’t been used as a mail server before, will be on the Spamhaus PBL.

Being on the PBL doesn’t mean your address is blocked for spamming. The list is only there as a precaution against potential abuse. Spamhaus applies this policy to any IP addresses that could change hands from one customer to another. Their goal is to prevent computers that should not be sending email directly from being able to do so if they are compromised in some way.

« Prev - Next »