Categories
Linux

FOG: Deleting all current active tasks

FOG is “a free computer cloning solution” found at http://www.fogproject.org/. If your a seasoned user you will no doubt have groups setup so you may run commands on multiple machine without loading each one individually. In my scenario we have 1000 machines that need to be imaged, easy, I just created a group with those particular machines (luckily most computers will have a common part of their MAC address so I could search for machines based on manufacturer). Once the group was created I then setup a task for that group to deploy an image.

OK, whoops, this is when you realise that the machines has the wrong image id assigned to them. Easy you think, you created the task as a group you can just as easily delete the active task as a group. No such luck here, what FOG will do to a group of computers is simply setup an individual task for each and every machine in the group. So your only option now is to click delete on each active task, now multiply this out to 1000 machines you have an annoying problem.

There is a simple solution, although a word of warning here “PLEASE MAKE SURE YOU HAVE A BACKUP”. All the tasks are contained within the “tasks” table within MySQL. So if you feel comfortable crack open a console connection and open up a console to MySQL.

root@fog:/# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or g.
Server version: 5.0.67-0ubuntu6.1 (Ubuntu)

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql> use fog;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> delete from tasks where taskState = 0;
Query OK, 8 rows affected (0.23 sec)

mysql>

This will delete all the active tasks running on the fog server. However the command files will still exist in the TFTPROOT folder. Exit out from MySQL and change directory into your TFTPROOT folder. Once inside change into the pxelinux.cfg folder.

You will notice several files in this directory, these are the files that control what a machine will do once it is PXE booted. To delete the command files you ONLY have to delete the files starting with “01-“, this is import as the other files will tell the machines what to do when they don’t have any active tasks.

root@fog:/tftpboot/pxelinux.cfg# rm 01-*

This will have completely removed all the active tasks.

Categories
Linux OpenSUSE

SUSE Studio

I have to say it has been a very long time since something on the web has impressed me to the point of being amazed. But today I found out about SUSE Studio.

SUSE Studio allows you to build/create your own Linux distribution based on SUSE linux.

“Build an appliance — or your own custom Linux distro — with a few mouse clicks. Customize it to your heart’s content, and share it with the world!”

Categories
Linux PostgreSQL Sys Admin

pg_standby triggering unexpectedly

I have been having a problem with my redundant PostgreSQL setup over the last couple of weeks. I run two Postgres servers with a WAL Logging Warm Standby system using pg_standby from 8.3. When the master server is under heavy load and generating a lot of WAL traffic the secondary server has been tripping and going active.

After checking all the logs and putting pg_standby in debug mode there was still no clue as to why this was happening.

Categories
Linux Postfix Sys Admin

Postfix/SASL/Courier AuthDaemon Cannot connect to Courier authdaemond: No such file or directory

I have a Ubuntu Virtual Server handling all my mail, recently after an apt-get upgrade I was unable to send email using my Postfix Virtual User setup through Courier and SASL.

I kept getting the following error in my logs:

Aug 18 07:53:53 marvin postfix/smtpd[23938]: warning: SASL authentication
  failure: cannot connect to Courier authdaemond: No such file or directory
Aug 18 07:53:53 marvin postfix/smtpd[23938]: warning: localhost[127.0.0.1]:
  SASL LOGIN authentication failed: generic failure

After consulting with Google for at least an hour i finally hit upon a page that helped me.

Categories
Cacti Linux Sys Admin

Linode Network Stats in Cacti

Linode provides a convenient XML data feed that provides information about your CPU usage and Network Usage. The graph for the CPU Usage seems a little useless, but I have included it here as the XML feed provides the data.

You will need your linode account number to use the graphs, you can find this number by looking at the graphs provided to you in your Linode account management interface. The title of the graph will be “http://www.linode.com/ – yourhostname (linode12345) – CPU – …….”. You will need the text from inside the ( ) for your username ie linode12345.