A Sysadmins blog

I once was 404, but now am 200.

Archive for the ‘linux’ tag

Re-scan the scsi bus after detecting a missing media changer for the tape drive

without comments

Well today ran into a nice problem, the media changer on a Dell 124T had disappeared and the backup server had been neglected for a while. So Amanda was spewing out backup failed reports for a while now. A bit of investigation later found that the media changer had “gone”. More poking showed the tape drive still present hmm.

As this media changer and server live in another state (1200km away) and it was Friday night, the chances of getting the tape drive power cycled == 0. Luckily a rescan of the correct SCSI bus resulted in the media changer being found and usable again.

For reference, check out your SCSI devices by running:

cat /proc/scsi/scsi

In my case the host bus I wanted to re-scan was 1. So running this command tells the controller to rescan all channels, IDs & LUNs..

echo "- - - " > /sys/class/scsi_host/host1/scan

After this, I was able to interact with the tape changer device via the Amanda tools again.

Note: Always be-careful when running commands that hot add/remove SCSI devices. I have seen some servers crash from this and others lose access to all SCSI devices which required a reboot to fix (Mostly it is okay though).

Written by pdeaudney

October 23rd, 2009 at 7:12 pm

Posted in backups,linux

Tagged with , , ,

LSI Megaraid physical device error counters and what SMART errors they imply

without comments

At work we have a number of LSI megaraid controllers & dell perc cards. Today I ran accross a system with a “Other Error Count: XX” assigned to the both drives in a raid 1 array. It took some googling but it turns out these are not ciritcal drive media errors, but some other SMART errors.

For reference here is a list of the LSI megaraid error codes and the corresponding SMART failure count (Thanks to the dell linux mailing list).

  • Predictive Failure Count == Number of SMART errors.
  • Media Error Count == Number of SMART errors related to the drive media.
  • Other Error Count == Number of SMART errors not related to the drive.

See wikipedia for the SMART error codes.

Written by pdeaudney

October 22nd, 2009 at 1:57 pm

SSH Access as root to your ESX 3.5 Server

with 2 comments

Lately I have been playing with ESX 3.5 and ESXi getting ready for a deployment at $work. Bellow is a tip to people want access using SSH keys to the root account.

As described in RTFM Education’s ESX guide it is possible to allow root user SSH/SCP/SFTP access to your ESX 3.5 server.

Disabling Auditing on ROOT (Not Recommended)
• Some applications do not support levitation to a higher plain – for example
WinSCP. Sure you could use WinSCP to gain access as an ordinary user,
but then you might lack permission to copy the files you need. If you try
to logon as root, WinSCP will give you access denied.
• If you wish to disable the restriction on ROOT not being allowed direct
access using SSH then carry out the following task. I wouldn’t recommend
doing this as you will loose enforcement of your audit trail.
1. nano –w /etc/ssh/sshd_config
2. Locate: PermitRootLogin no
3. Place a # in front of PermitRootLogin no like so: #PermitRootLogin no
4. Exit Nano & Save the file
5. Restart sshd with service sshd restart

You just need to modify the SSH daemon configuration. The described step will allow your root account open to logins with a password. In todays internet this is less than a great idea.

Personally, I like console logins as root to some servers using SSH keys. To enable root logins that allow SSH keys but disallow passwords edit your /etc/ssh/sshd_config as follows

1. Change the line readiing “PermitRootLogin no” to “PermitRootLogin without-password

2. Add the line “PermitEmptyPasswords no” underneath.

3. Save and exit

4. Restart SSHD “service sshd restart

Now you will need to place your ssh public key in the file system path “/root/.ssh/authorized_keys”

For further security you can restrict what hosts the key can login from. This is done by placing “from=hostname.domain.com” in front off the public key. It must all be on the one line.

Now you can use your SSH key to authenticate as the root user.

This guide assumes you have another user that has SSH access and can “su” to root on the ESX host. There is plenty of information in google on how to do that already. It also assumes you have a SSH keypair or can figure out how to generate them.

Written by pdeaudney

November 7th, 2008 at 7:04 pm

Posted in linux,systems administration,VMware

Tagged with , ,

dstat – one hell of an awsome performance monitoring tool

without comments

Dstat is a versatile replacement for vmstat, iostat, netstat, nfsstat and ifstat. Dstat overcomes some of their limitations and adds some extra features, more counters and flexibility. Dstat is handy for monitoring systems during performance tuning tests, benchmarks or troubleshooting.

Dstat allows you to view all of your system resources instantly, you can eg. compare disk usage in combination with interrupts from your IDE controller, or compare the network bandwidth numbers directly with the disk throughput (in the same interval).

This has to be my most favourite bit of software right about now. You can download it from http://dag.wieers.com/home-made/dstat/ or get it via your distros package manager.

It really helps you find the bottle neck in a system without having 10 terminals open.

Written by pdeaudney

October 9th, 2008 at 5:12 pm