Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, May 28, 2013

Mount USB disk on Xen Server

How to mount a USB disk on Xen Server
  1. Insert the USB stick or disk
  2. Check the device name with FDISK -l
  3. Make a mount point directory: mkdir /mnt/usbdisk
  4. Mount the disk (assuming FAT file system with mount -t vfat -o rw,users /dev/DEVNAME /mnt/usbdisk the DEVNAME is contained in the results of step 2.
  5. When done, use umount /mnt/usbdisk
  6. Then remove the drive.

Thursday, December 9, 2010

Debian SNMP daemon is not listening on addresses other than the loopback.

By default, with sarge/etch at least, the SNMP daemon will only listen on the loop back.
Instructions to fix:
Under /etc/default/snmpd there is a config file, edit it.
Find the line that looks like:
SNMPDOPTS='-Lsd -Lf /var/log/snmpd.log -u snmp -I -smux –p /var/run/snmpd.pid 127.0.0.1'
And change it to read:
SNMPDOPTS='-Lsd -Lf /var/log/snmpd.log -u snmp -I -smux –p /var/run/snmpd.pid'
Then restart the SNMP daemon.

Monday, November 1, 2010

Install HP Systems Manager on Xen Server 5.5

Installing HP Systems Management Homepage and the Disk Diagnostics / Configuration Plug ins on a Citrix Xen server 5.5 – Bronson Magnan

  1. Need to temporarily switch to the CentOS Base Repo, and away from the Citrix Repo
  2. cd /etc/yum.repos.d/
  3. vi CentOS-Base.repo
  4. Change “enabled=0” to “enabled=1” this turns on this repo
  5. Change “gpgcheck=1” to “gpgcheck=0” this turns on signature checking for the repo, the key site that is listed in the repo does not exit anymore.
  6. vi Citrix.repo
  7. Change “enabled=1” to “enabled=0”
  8. yum install compat-libstdc++-296.i386
  9. Turn the CentOS repo off and the Citrix repo back on by reversing the changes in step 1 to 7.
  10. Download the following from the HP system management download page to /usr/src 
  11. cpqacuxe-8.35-7.0.noarch.rpm – the array config utility
  12. hpacucli-8.35-7.0.noarch.rpm – the array config utility CLI
  13. hpadu-8.26-1.noarch.rpm – the array diagnostics utility
  14. hpsmh-6.1.0-103.i386.rpm – the systems manager homepage
  15. Trick the script into thinking that this is RHEL instead of CentOS.
  16. cp /etc/redhat-release /etc/xen-release – Making a backup copy.
  17. Vi /etc/redhat-release and change the line: "XenServer release xxxxxxxxx (xenenterprise)" To: "Red Hat Enterprise Linux AS release 4 (Nahant Update 1)"
  18. Save the changes and close the file
  19. rpm –ihv hpsmh-6.1.0-103.i386.rpm – install the system manager homepage.
  20. rpm –ihv hpadu-8.26-1.noarch.rpm – install the array diagnostics web app.
  21. rpm –ihv cpqacuxe-8.35-7.0.noarch.rpm – install the array configuration web app.
  22. rpm –ihv hpacucli-8.35-7.0.noarch.rpm – install the array configuration CLI.
  23. Reverse the changes done in step 15.
  24. mv /etc/xen-release /etc/redhat-release
  25. Edit the firewall ruleset and restart the firewall service.
  26. vi /etc/sysconfig/iptables
  27. Insert the following line before the deny all statement “-A RH-Firewall-1-INPUT –m state --state NEW –m tcp –p tcp --dport 2381 –j ACCEPT”
  28. Save and close the file
  29. service iptables restart
  30. Patch the diagnostics utility to work on Xen 5.5
  31. cp /usr/sbin/hpadu /usr/sbin/hpadu.bkp
  32. chmod 700 /usr/sbin/hpadu
  33. Now edit hpadu, locate the string "LD_ASSUME". I have to modify the complete section as follows (comment out every line by overwriting the first char)
  34. # 1. Don't set LD_ASSUME_KERNEL on SLES 10, RHEL5, or Debian 2.6
  35. #f
  36. #hen
  37. #xport LD_ASSUME_KERNEL=2.4.1
  38. #i
  39. Start the management services.
  40. service hpsmhd restart
  41. hpadu –start
  42. cpqacuxe –R
  43. You can view now from https://ipaddress:2381 – use the root credentials.

Using the Amavis "Soft" White List

Adding individual users or entire domains to the Amavis soft white list is possible. This differs from the hard white list. The difference between the two is that a score is still computed for items on the soft list, and then the soft list value is added to the score to produce, hopefully, a ham value.

The file is 20-debian_defaults under /etc/amavis/conf.d/

Find the section with the static hash table that occurs after the normally commented line of #read_hash(“/var/amavis/sender_scores_sitewide”).

Add entries as follows into the static hash table:
'user@domain.tld' => -3.0,
'wholedomain.tld' => -3.0,

Use negative values to soft white list, use positive values to soft black list.

Generally you will want to use this in response to sender mail being bounced back as UBE "Unsolicited Bulk Email", and should be used before progressing to using the hard white list array.

Monday, October 25, 2010

Hard white listing with amavis-new

Previously I had discussed white listing in Amavis, which is a soft white list.
When this continues to fail it is time to modify the Perl code of “20-debian_defaults” to include a hard white list.

Choose a blank space in the Perl code before the soft white listing section, and create a new ARRAY.
Call the array @whitelist_sender_maps and include the domains that you want to globally hard white list.

Here is an example:

@whitelist_sender_maps = ([‘.somedomain.com’.’bronson@bronsonitinnovations.blogspot.com’])

Note: there is a “.” Before globally hard white listing an entire domain.

Thursday, September 23, 2010

Checking free disk space on Debian systems

A great APT package to use for checking free disk space is "discus". Discus displays disk usage of each file system in a textual bar graph format.
Install with
apt-get install discus
Output appears as such
Mount Total Used Avail Prcnt Graph
/ 48.09 GB 3.34 GB 44.75 GB 6.9% [*---------]
+ib/init/rw 505.4 MB 0 KB 505.4 MB 0.0% [----------]
/sys 0 KB 0 KB 0 KB 0.0% [----------]
+oc/bus/usb 0 KB 0 KB 0 KB 0.0% [----------]
/dev 10.0 MB 52 KB 9.9 MB 0.5% [----------]
/dev/shm 505.4 MB 0 KB 505.4 MB 0.0% [----------]