Posted by keith in Plesk
Ever wonder if there was a faster way to get the details of websites hosted on a Plesk powered server? Will so did I and it got me motivated to find a script to do just that. And wouldn’t you know that after searching high and low I found one. This script will give you the size of a domain, the size and number of mysql DB’s in plesk, number of mailboxes on the server and it’s size, number of plesk backups and size and even the log directories. Pretty handy, huh?
clear; if [ -d /var/www/vhosts ]; then echo -ne “\n\n=== WEBSITES ===\n”; cd /var/www/vhosts && du -ks –exclude=’chroot’ –exclude=’default’ * | sort -nr | cut -f2 | xargs du -sh; echo “[`ls --ignore='chroot' --ignore='default' | wc -l` Sites - Total `du -hs . | cut -f1`]“; fi; if [ -d /var/qmail/mailnames ]; then echo -ne “\n\n=== MAILBOXES ===\n”; cd /var/qmail/mailnames && TMB=$(du -ks */* 2>/dev/null | sort -nr | cut -f2); if [ -n "$TMB" ]; then echo “$TMB” | xargs du -sh; fi; echo “[`find . -mindepth 2 -maxdepth 2 -type d | wc -l` Mailboxes - Total `du -hs | cut -f1`]“; fi; if [ -d /var/lib/mysql ]; then echo -ne “\n\n=== MySQL DATABASES ===\n”; mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e “SELECT round(sum( data_length + index_length )/1024/1024,0) ‘SM’, table_schema ‘DN’ FROM information_schema.TABLES GROUP BY table_schema ORDER BY SM DESC \G;” | sed ‘/\*\*\*/d’ | sed ‘s/SM: //’ | sed ‘:a;N;$!ba;s/\nDN:/M\t/g’; fi; if [ -d /var/lib/psa/dumps/domains ]; then echo -ne “\n\n=== PLESK BACKUPS ===\n”; cd /var/lib/psa/dumps/domains && du -ks * | sort -nr | cut -f2 | xargs du -sh; echo “[Total `du -hs . | cut -f1`]“; fi; echo -ne “\n\n=== TEMP FILES ===\n”; du -hs /tmp /var/tmp; echo -ne “\n\n=== LOGS ===\n”; du -hs /var/log /usr/local/psa/var/log; echo -ne “\n\n”;
Beats logging into Plesk and looking this over, especially if you have a large number of domains to sort through.
No Comments »
So I tend to recommend to friends and potential clients the wondrous world of Load Balancers and of course the very first thing I get from them is a blank expression on their face which is typically followed up by the question; What is a Load Balancer? Well normally I sit them down and example to them what a LB is a which typically clears the air. In fact I was on the fence about creating a video just for this purpose however thanks to Youtube I didn’t have to do it since there’s several of them available already.
Thank you Youtube.
Tags: load balancers
No Comments »
I haven’t dealt with Vmware’s Site Recovery Manager 5 since most of that is handled by a different department at my job and I don’t have a license for it in my home lab. However I definitely plan on playing with it more for hands on and wanted to note that I found an excellent resource for VMware’s SRM over at the Sysadmin Tutorials website:
Link – Site Recovery Manager 5 @ Sysadmin
1 – VMware SRM 5 Database Setup
2 – VMware SRM 5 Installation
3 – VMware SRM 5 Installing Netapp Array Manager
4 -VMware SRM 5 Site Pairing
5 – VMware SRM 5 Configuring Netapp SRA Array
6 – VMware SRM 5 Inventory Mappings
7 – VMware SRM 5 Protection Groups
8 – VMware SRM 5 Recovery Plans
9 – VMware SRM 5 Test Recovery Plan
10 – VMware SRM 5 Recovery and Failback
Definitely check it out.
No Comments »
Since I’ve seen this come up several times at my place of employment I’d figure I’d write this up real quick. Typically to convert a thin provisioned VDMK to a thick provisioned VMDK we would do a migration from one datastore to another datastore. However there is another way to do this that doesn’t involve a migration and I wasn’t sure if this was common knowledge or not so I decided to put this up there.
The only major issues with this process and it’s not an issue per-say however the VM that you are doing this for must be powered off and you MUST have the space available on your where your VDMK lives. If not this will fail and possibly cause issues.
1. Browse to the VM that you want to convert from thin to thick provisioned and access the datastore where the VMDK is stored.
2. Locate the VMDK,highlight it and then right-click on it. There will be an option to “Inflate” the file. What this does it convert the VMDK from thin to thick or like it says, it will inflate the file. Click “Inflate” to start the process.
3. The process will start and depending on the size of the current storage in use the time will vary. Once it is completed the VMDK will be thick provisioned.
No Comments »
Figured I’d toss these commands up there in the event that I forget them, of course these will likely also help some else out as well. See how thoughtful I am. Keep in mind that these commands must be ran from the host via SSH, so make sure you have the SSH s ervice daemon running prior.
- esxcli software vid list: This command will show a listing of all patches & updates installed on the EtSX/ESXi host.
- esxcli software vid install -d: This command will install a specified file as long as you specify the location of the local file. Example of this would be ” esxcli software vid install -d /vmfs/volumes/datastore/patches/file.zip.
- esxcli software vid install -v: This command is similar to “esxcli software vid install -d” however this will allow you to specify a file and install it via http as long as you the URL. Example of this would be “esxcli software install -v https://vmwarefiles.com/software/patches/myfile.vid.
- reboot: This command is pretty clear. This will reboot the ESX/ESXi host. Typically when you install a file the installation will tell you if a reboot is required or not and since it will not reboot during the installation you must reboot if it tells so. Failure to do so will simply be that your ESX/ESXi instance will not see the installed update.
- vim-cmd svc/maintenance_mode_enter: This command will force your ESX/ESXi instance to enter maintenance mode. Maintenance mode is required to for installs or updates on the ESX/ESXi host. Keep mind that if you have VM’s running prior to running this command then it will not go into maintenance mode. All VM’s must be powered off or moved off the host to enter maintenance mode.
- vim-cmd svc/maintenance_mode_exit: This command takes you out of maintenance mode. It does not power up your VM’s, so don’t expect it to do so.
And there you have it. Knowing these six commands will make your ESX/ESXi host administration that much easier if you are running the free version of the Hypervisor and don’t have access to the product updater but also applies for all ESX/ESXi 4 & 5 installations.
No Comments »