Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Monday, 31 August 2020

Upgrading pi-hole on Ubuntu 18.04 problems

 If you've tried to upgrade pi-hole running on 18.04LTS then you might have gotten an error like this:

The following packages have unmet dependencies:
       lighttpd : Depends: libssl1.1 (>= 1.1.0) but it is not going to be installed
      E: Unable to correct problems, you have held broken packages.

I've spent a bit of time poking around at this to no avail, until I stumbled upon a solution that is - install aptitude and use it to fix the dependency issue!

Indeed.

root@domains:~# apt install aptitude

then:

root@domains:~# aptitude install lighttpd

and choose downgrade libss1.1

and lighttpd installs and pi-hole works again.


This was a much harder solution to find than it should have been and something is really screwy with these packages. 

Hope this helps!

Monday, 10 October 2016

OTRS and HTTPS

Following the recent upgrade of OTRS on our servers to the latest version, I went one step further and decided to deploy https to wrap it all up. There is no significantly important data shared or entered in our OTRS configuration, but I think it a worthwhile exercise to put encryption in place. I've only really touched on SSL once or twice before with server configurations, and I started out by looking for a cheap certificate. The thing is, this is a commercial application of the system and I didn't want to use a non-profit or education SSL cert for something that is part of our money making enterprise.

Enter "Let's Encrypt". I read about this somewhere - probably one of the many *almost* spam newsletter type emails I get during the week from a vendor. A Google search brought up a DigitalOcean write up on how to apply this to the particular version of Linux I'm running.

I'm just going to say that I love the DigitalOcean walk through's. They're clear and easy to follow. I tend to have bits of extra complexity in my installs, but I'm usually able to extrapolate from the D/O information to get want I want. Here is the link to the walk through that I used:

https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-14-04

Get around it - it's great. So now we have an encrypted OTRS site and it works well.

Apart from just having an encrypted site, we have also noticed a pleasing uptick in the responsiveness of the site and a removal of an ongoing issue we were having access it from external. When my techs would try to connect to the page from outside the office and then enter data into it, they would have to continuously re-authenticate. This was completely unusable and also one of those problems I just never seemed to have time to get around to fixing. Now, with https:// in front of the address, this problem has disappeared! The site responsiveness isn't to be ignored - no matter where it's being accessed from, the page is significantly faster, a fact which pleases all of us.

To summarise - spend the time and get the encryption happening for OTRS - it's worth it!

Tuesday, 17 May 2016

Ubuntu 16.04 LTS First Impressions

Another polished release - Xenial Xerus (at least I hope it’s polished!)

I’m using it for a test WordPress system at the moment so I’ve been concerned mostly with that. PHP5 is gone, replaced by PHP7. The main issue with this is no more SSH2 PHP7 extension! It makes installing new themes or plugins, or updating them tricky in WordPress as it relies on this. I’ve had to default back to using vsftpd but even that is crashing at this time. To work around that, add:

define(‘FS_METHOD’, ‘direct’);

into wp-config.php

See https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lemp-on-ubuntu-16-04 for a great walk through on this - in fact, check out Digital Ocean - they have some excellent stuff on there, including these tutorials. If you're like me and would love to delve into the intricacies of nginx or some other equally complex bit of software but don't have the time, Digital Ocean give you a way to get things up and going with very little in the way of issues. Nicely typeset and well laid out tutorials - thanks a million guys! (I am in no way affiliated, merely a fan).

I performed the install inside a VMware Player and it was as usual quite fast. Updated hostname and /etc/interfaces/network to sort out IP addresses and the like and off I went. Install of WordPress was straightforward and the set up was reasonably quick - a mite quicker I might say than the one on 14.04LTS that I performed last week. PHP7 seems more responsive and I played around with both my VMs to see if there was much difference - installing the same theme into both to see what the speed impact might be. PHP7 was marginally quicker, although I wouldn't suggest it was statistically significantly quicker.

I noticed that updates using apt-get had a much shorted list of archives being hit which was interesting. In the past it seems there was an ever increasing number of new archives being added until the sources.list ends up a mile long. So quicker updates, presumably more efficient is always a good thing. I have no idea what the desktop interface looks like - probably more of the same of that Ubuntu look (which I personally am not in love with - give me Mint's any day).

Much more of my time was spent using this VM to try and get a dirty website going - I am no webdev and I really don't like doing it. Sadly, sometimes you have to so I will continue plugging away at it tomorrow. Ubuntu 16.04 LTS though - looks like it's the goods. Get on it and see how if it does the job for you!

Thursday, 30 July 2015

Plone - the open source Content Management System - a review

One of my clients, a non-profit, has a lot of files on it's clients. They need a way to digitally store these files, securely and with availability for certain people. They also need these files to expire and be deleted after a given length of time - usually about 7 years.

These were the parameters I was given to search for a Document Management System (DMS) or more commonly a Content Management System (CMS). There are quite a lot of them, but most are designed for front facing information delivery - that is, to write something, put it up for review, have it reviewed and then published. We do not want this data published ever - and some CMS's make that a bit tricky to manage. So at the end of the day, I looked into several CMS systems that looked like they could be useful.

The first one to be reviewed was OpenKM (www.openkm.com). It looked OK, was open source which is preferable and seemed to have solid security and publishing options. Backing up the database and upgrading OpenKM seemed like a nightmare. I tried a couple of times only to experience great sadness and eventually throwing my hands up in defeat. Scratch that guy off the list.

The next one I seriously considered was Plone (www.plone.org). An open, attractive looking interface certainly helped matters from the get go. I liked it, it looked nice and the decision makers at my client would like it too. Open Source, Linux install - OK good to go. The installation documentation is pretty good, a bit fuzzy at times ( though I do attribute that in part to a lack of solid caffeine) and it was relatively straightforward to get going.

I followed the instructions and started to build the site. It was pretty straightforward and offers different workflow types - so for an internal site, there is no publishing option available. Posts (or uploads of files) are set to either "For Review" or "Private" which is perfect for the application we have at hand here. File size uploads are relatively straightforward to change - there is a config file, much like MediaWiki or similar, that allows for changes to the site that are outside the scope of the in-application setup.

After the build, and setting up internal DNS, outgoing mail and accounts, I set it loose with the client. They have logged in, tested it and come back with a plethora of questions - many many of them. I have changed the security options several times and it's handled it all quite well. Before the system goes into production I'll be making sure backups and restores work. Phone has internal ones that I still need to do more testing on. Stay tuned!

Thursday, 8 January 2015

XenServer 6.2 update woes

Recently I was required to update a number of XenServers that I've taken over. They were running 6.2SP1 but were about 6 updates behind. No problem, I'll just queue the updates up and shoot them over. Had 2 Windows VM's (2008R2 and 2012 server) and 5 Ubuntu 12.04LTS Linux Servers. The updates were fairly straight forward - I followed my own guide :-)

After the final update was completed I booted up the VMs only to find the two Windows Servers came up no problems, and none of the Linux servers booted. None of them. They started up, black screen and white cursor in the top left hand corner and that was it. No boot no errors, just gone.

I ran through some basic repair work and had no joy. I changed the GrubConf.py from if arg.strip() == "${saved_entry}": to if arg.strip() == "${saved_entry}" or arg.strip() == "${next_entry}":. Still no luck. I re-installed Grub - no joy. I booted from the Ubuntu server CD and tried to run rescue the broken install. On several of the VM's I couldn't even get the system to run a shell in the / file system (/dev/xvda1 typically on these setups). It was incredibly frustrating and after three weeks of banging my head against this, I've still not managed to get this all going.

Luckily I had backups of most of the servers and so I haven't lost everything but I have lost some critical data. The message here, dear friends, is multiple:

  • test the updates one at a time to make sure everything starts up. Yes it will take longer and it's a bit more frustrating, but believe me, you want to know if things are going to shit themselves.
  • backups backups backups - are not important. RESTORES! are the important part. Believe me, I cried into my beer when I couldn't get one of these machines back up and going - it just wasn't going to happen. I lost a wiki with data that wasn't anywhere else and that's caused me no end of grief. The extra work it's caused is phenomenal and I feel very bad about it indeed.
I've reached out to the collective wisdom of SAGE-AU (www.sage-au.org.au) but sadly no luck yet. I'm open to suggestions!

Saturday, 12 October 2013

ownCloud - your in house cloud file service

As usual, a client of mine requires something out to of the ordinary - they love Dropbox and Drive, using them extensively at home, and now want something for themselves at work. The catch is - the work they do requires their data to be housed in Australia. Some legal requirement I gather for their funding. After searching through the archives in the mailing lists for SAGE-AU (www.sage-au.org.au) for wisdom and nuggets of gold I stumbled across ownCloud. Several of their members expressed an admiration for this software so I thought I'd check it out.

You can find out a lot more about ownCloud on their website - www.owncloud.org but here is a brief overview of my experiences using this application.

Firstly I installed it on a spare PC I had, after first putting Ubuntu 12.04 LTS on there. Installation was straightforward, securing it a bit less so - there's a bit of work to be done there but it's reasonably well documented and then I installed the application on my Windows 7 laptop. It all just worked and worked quite well. The application on my Windows 7 box works almost exactly like Drive/Dropbox - copy files into there and they sync up to my ownCloud server. They are then available from the web page - secured with SSL - and available anywhere. I've punched a hole through the firewall for testing purposes to get this available. My clients love it.

The configuration options are quite straightforward and although I did get rid of a lot of the helpful folder customisations, I can see why these would be useful to others.

In terms of load on the server it's been quite minimal so far. The PC is running quite happily, only a low end dual core box with 2GB of RAM and a 160GB hard disk drive.

The production box with be either a Dell PowerEdge T110 II or a HP N54L - depending on funding. Requirements are quite low and depending on the volume of data to be stored, either of these servers will do a great job. Cloud in the office for under a $1000!

If you have half an hour (that's all it took for me to get it going) check out ownCloud :-)

Saturday, 27 April 2013

Linux and the Desktop

Often as I read my Internet news I note that the perennial question of "Is Linux ready for the desktop?" and I started thinking about it. I've also recently been playing with Windows 8 and I said to my co-worker "Is Windows 8 ready for the desktop?" We both laughed. As an outgrowth of this I started to really look at what it would take for me as a consultant with a range of small and medium business clients to move them to Linux. 

Obviously there are a range of applications that are not cross platform - usually either financial (MYOB etc) or industry specific stuff.Wine could potentially take care of this, or even running Windows in a virtual machine - which is common with people needing Windows XP to run specific software and being unable to run it on Windows 7 (and also 8). As for the common applications like word processing, spreadsheets and presentations there are a range of Open Source versions like NeoOffice, or even Google Apps or Office 365.

If you consider application support beyond the specific software noted above, there are plenty of applications available in your Linux of choice for all the stuff you want to do - video / audio / image editing, video / audio play etc. The options are numerous.

Taking into account Linux's robust architecture and resilience against viruses, trojans and malware, then the operating system starts to really look good. It's not uncommon for me to have a Linux desktop with 30 plus days of up time. Updates are easy and encompass the OS as well as apps, all in one reasonably easy to use package (I like Linux Mint personally and it's great for all these things). 

Take Android for example. Prior to it gaining popularity I bet there were a lot of people asking if Android was ready for the mobile market place. Time has certainly shown that it is. The difference between the mobile phone marketplace and the desktop is simply that the competition is so much more fierce. Microsoft's  stranglehold over the desktop, strengthened by their bundled browser Internet Explorer and Windows Media Player and buy in from all the big software firms. 

Chromebooks - Linux on the desktop! Obviously it's ready - it needs the brilliant packaging and design of MacOS X. And probably someone big to push it. Dell have been offering it for some time now and the excellent Ubuntu Windows installer (also available on Mint) gives the new user a chance to play with it. 

Give Linux a try - if only in a virtual machine and make up your own mind:

Friday, 8 February 2013

Traffic Monitoring using Ubuntu Linux, ntop, iftop and bridging

This is an update of an older post, as the utilities change, so has this concept of a cheap network spike - I use it to troubleshoot network issues, usually between a router and the network to understand what traffic is going where. The concept involves a transparent bridge between two network interface cards, and then looking at that traffic with a variety of tools to determine network traffic specifics. Most recently I used one to determine if a 4MB SDSL connection was saturated or not. It turned out the router was incorrectly configured and the connection had a maximum usage under 100Kb/s (!) At $1600 / month it's probably important to get this right - especially when the client was considering upgrading to a faster (and more expensive) link based on their DSL provider's advice.

Hardware requirements:


I'm using an old Dell Vostro desktop PC with a dual gigabit NIC in it - low profile and fits into the box nicely. Added a bit of extra RAM and a decent disk and that's really it. I'm also running this on an old Dell D420 with a gigabit PCMCIA adaptor - useful for the out and about jobs.

Software requirements:


  • Ubuntu 12.04 LTS - I've chosen this for longevity purposes, previously I'd used non-LTS operating systems and the updates naturally ran out. I tried this with FreeBSD 9.1 but had issues with packages and getting traffic across the network bridge effectively (probably more my screw up than FreeBSD's)
  • ntop - network traffic analysis monitor from www.ntop.org. They have version 5 available from the repositories on the site, version 4 is included in Ubuntu 12.04
  • iftop - a neat command line package that shows network usage from a terminal screen. Highly configurable
  • tcpdump or equivalent for deeper packet analysis.

Configuration

Setting up the box and the ethernet bridge
Setting up the box is straight forward - go through the usual Ubuntu installation. Use aptitude or apt-get to install bridge-utils and iftop

We want the network bridge between our ethernet adaptors to come up automatically. To do so edit /etc/rc.local and pop this into it (assuming eth1 and eth2 are the interfaces you want to bridge. I have eth0 configured statically in this instance so I can browse from other machines to it)

/etc/rc.local
brctl addbr br0
ifconfig eth1 0.0.0.0 promisc up
ifconfig eth2 0.0.0.0 promisc up
brctl addif br0 eth1
brctl addif br0 eth2
ip link set br0 up
This will bring the bridge up at boot time.

ntop

After you've added the necessary repositories to your aptitude configuration, install ntop5 using apt-get install ntop5

I run this from the command line - as a service it seems to fail fairly consistently. The command is:

ntop -P /var/lib/ntop -Q /usr/local/share/ntop/spool/ -i br0 -u ntop -m 192.168.0.0/24 -d

-P sets the database file path
-Q sets the spool file path
-i sets the interface (br0 as per /etc/rc.local)
-m sets the local subnet - in this case 192.168.0.0/24 (change to suit)
-d sets it to become a daemon freeing up your terminal
Browse to localhost:3000 to find your ntop installation, or if you have a third network card go to the address on the network e.g. 192.168.0.30:3000 and view your traffic stats.

iftop

To get what I want out of iftop, I run a script that calls it and configure the /etc/iftoprc file. The script is:
bridge_monitor.sh
#!/bin/sh
# customisable settings
LOCALNET="192.168.0.0/24"
IFACE="br0" # the bridged interface
CONF="/etc/iftoprc"
/usr/sbin/iftop -p -n -N -i $IFACE -F $LOCALNET -c $CONF

The contects of /etc/iftoprc are:
dns-resolution: yes
port-resolution: yes
show-bars: yes
promiscuous: no
port-display: source-only
#hide-source: yes
#hide-destination: yes
use-bytes: yes
sort: 2s
#line-display: one-line-both
show-totals: yes

Again customise to suit and start monitoring that network!

Wednesday, 6 February 2013

Upgrading OTRS 3.1 to 3.2.1

After noting that our OTRS (www.otrs.org) was complaining about a major release update pending I took the plunge this morning and set about upgrading it. Initially I ran through the normal upgrade procedure and couldn't log on. Oops. Maybe I need to pay more attention here? Turns out there are quite a few caveats about this upgrade, and I'm hoping that what I note here will assist you - especially the database upgrade stuff. That was a bit of a surprise!

Initially I ran my normal otrs_pre_upgrade.sh script which stops services and backs everything up. That script looks like this:

#!/bin/bash
service cron stop
service apache2 stop
NOW=`date +%F`mkdir /root/backup/$NOW
BDIR=/root/backup/$NOW
cp -R /opt/otrs/Kernel/Config.pm $BDIR
cp -R /opt/otrs/Kernel/Config/GenericAgent.pm $BDIR
cp -R /opt/otrs/Kernel/Config/Files/ZZZAuto.pm $BDIR
cp -R /opt/otrs/var/ $BDIR
/opt/otrs/scripts/backup.pl -d $BDIR

Usually I then ln -s otrs-new otrs and run my upgrade script - but something failed along the way. Here is what I found:

Firstly, there are a lot more PERL modules required in 3.2 - these three caught me out:

  • YAML::XS
  • DBD::ODBC
  • JSON::XS
I added them using aptitude - my OTRS install is on Ubuntu 12.04 LTS (www.ubuntu.com) - easy enough to do and then checked the modules again. If you are following the UPGRADING documentation, you should run:
  • /opt/otrs/bin/otrs.CheckModules.pl
This will tell you what modules you require. I didn't bother with the Oracle or PostgreSQL modules as I'm not using those databases, nor am I interested in the Encode::HanExtra (no Chinese characters). 

Secondly there are database changes to be made. MySQL uses INNODB as the default storage engine. I've never even thought about this before - OTRS had always just run happily without asking me fancy questions about this sort of thing. Now in 9 of the UPGRADING document I had to apply database changes, including changing the default storage engine from INNODB to MyISAM.

Fortunately I stumbled across some nice scripts to do this at Techusers.net - here they are tailored to suit OTRS:

Step 1. Get all the table names from OTRS (you'll have to put in your password and you might have to change root to something more site applicable):
mysql -u root -p -e "SHOW TABLES IN otrs;" | tail -n +2 | xargs -I '{}' echo "ALTER TABLE {} ENGINE=INNODB;" > alter_table.sql

Step 2. Updating all the tables in one go (same as above - password + username update)
perl -p -i -e 's/(search_[a-z_]+ ENGINE=)INNODB/\1MYISAM/g' alter_table.sql 

Step 3. Applying the change to your SQL Database:
mysql -u root -p otrs < alter_table.sql 
Much thanks and kudos to the writers at www.techusers.net - this saved me from doing each table by hand! The search_profile table refused to change from INNODB to MyISAM but when I checked the dbupgrade scripts, this particular table isn't mentioned. It did not seem to affect the overall upgrade.

The rest of the upgrade went fairly smoothly. It's important to note, however, that you must go to Admin -> Packages -> Update Online Repository and then upgrade your packages to get better speed from your OTRS install. I found that after I did this, I restarted the apache service (service apache2 restart) and OTRS began humming along quite nicely. I'm still exploring the new features. Enjoy

Sunday, 15 July 2012

Adventures with my new HP N40L Microserver

I took delivery today of my brand new HP N40L Microserver. I plan to use it to replace my existing whitebox server, Netgear Stora and add to my network at home. The idea is to install Citrix XenServer on this little box, then virtual guests running Ubuntu 10.04LTS, Windows Server (of some variety - 2008R2 or maybe Windows Home Server) and if required FreeNAS or another *BSD product (for fun).

The default N40L comes with 2GB of RAM, 250GB HDD and a 1.5GHz processor. I've updated the RAM to 8GB of RAM and I'll put a couple of 2TB HDDs in and probably 2 1TB HDDs disks as well.   The idea is then to set up two RAID arrays - one for the install of operating systems and associated applications, one as a storage pool for data (hopefully 2TB will be enough initially). I'll look into using 4 x 2TB disks in RAID10 and see what happens. Here we go!

Saturday, 30 June 2012

Munin for Monitoring

Lately I've been very busy with work, but I find that I still need to keep an eye on the Linux servers I have kicking around at home and at the office. I use Nagios for basic monitoring (ping, smtp, http) but wanted something a bit more fine grained on the actual host itself. I stumbled on munin when doing some Google searching.

Munin's homepage is here: http://munin-monitoring.org and I'm running it on a variety of servers at them moment (mostly Ubuntu and Debian). It supports quite a few distributions and operating systems so check it out if you're interested in seeing what's happening on your servers.

I like the many graphs that it produces to demonstrate what's happening and I also fell into the trap of trying to over-configure things. There are only a couple of basic things to change to suit yourself, restart apache2 and munin-node and it's slamming. It also monitors multiple machines - install munin-node instead of munin and munin-node and configure as recommended. I thought I'd be tricky with it and things didn't go as planned so it appeared that it wasn't working. I was over thinking it though and it did work, very well actually, once I found the spot it was creating the files in :-)

A handy app and a nice way to keep on top of your servers!

Saturday, 7 January 2012

rtorrent - the friendly torrent application

I use rtorrent for my legitimate torrent requirements. I find it extremely useful and here is why:

  • I run it on a linux server I have under a screen session so it's always available
  • it's set to have an upload and a download limit for torrents
  • stops after I've uploaded double what I've downloaded
  • reliable
  • easy to drive
Of course, getting it to this point wasn't totally straightforward. I had to set up my .rtorrent.rc file in my home directory to get all this stuff to work properly. It isn't using 100% of the capabilities of rtorrent, merely the ones I find most useful. For example I don't have it set to check for new torrents in a particular directory - I add them manually for an additional measure of control and so torrents I'm finished seeding aren't accidentally added back in. It does send me an email when a download is finished, retains info about where each torrent is up to and stops if diskspace becomes low (which it occasionally does)

Here is my .rtorrent.rc contents - everything in grey is a comment:
#=================================================================
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
# Maximum and minimum number of peers to connect to per torrent.
#min_peers = 40
#max_peers = 100
# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
#max_peers_seed = 50
# Maximum number of simultanious uploads per torrent.
#max_uploads = 15
# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 200
upload_rate = 5
# Default directory to save the downloaded torrents.
directory = /home/angus/torrents
# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = ~/torrents/.session
# Watch a directory for new torrents, and stop those that have been
# deleted.
#schedule = watch_directory,15,15,load_start=/home/angus/torrent/.torrent
#schedule = untied_directory,5,5,stop_untied=
# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=100M
# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# Enable the default ratio group.
ratio.enable=
# Change the limits, the defaults should be sufficient.
ratio.min.set=150
ratio.max.set=200
ratio.upload.set=20M
# Changing the command triggered when the ratio is reached.
system.method.set = group.seeding.ratio.command, d.close=, d.erase=
# The ip address reported to the tracker.
ip = xxx.xxx.xxx.xxx
#ip = rakshasa.no
# The ip address the listening socket and outgoing connections is
# bound to.
#bind = 127.0.0.1
#bind = rakshasa.no
# Port range to use for listening.
port_range = 6900-6999
# Start opening ports at a random position within the port range.
#port_random = no
# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
#check_hash = no
# Set whetever the client should try to connect to UDP trackers.
#use_udp_trackers = yes
# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa
# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
# encryption = allow_incoming,enable_retry,prefer_plaintext
# Enable peer exchange (for torrents not marked private)
#
# peer_exchange = yes
#
# Do not modify the following parameters unless you know what you're doing.
#
# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 10
# Interval between attempts to check the hash, in milliseconds.
#hash_interval = 100
# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 10
# First and only argument to rtorrent_mail.sh is completed file's name (d.get_name)
system.method.set_key = event.download.finished,notify_me,"execute=~/scripts/rtorrent_mail.sh,$d.get_name="
#===================================================================

I hope this is useful for you.

Friday, 6 January 2012

Restoring OTRS on an Ubuntu Server

Some time ago I relocated our OTRS server from a failing server to a virtual machine under Microsoft Hyper-V. While the change to a virtual machine ran smoothly and I used the details in a previous post to set it up, after a month I noticed some strange errors creeping in to the installation - the nightly log emails had inconsistencies in them. Fortunately I was able to run a full backup of the OTRS installation using the built in backup tool and very shortly thereafter the server fell in a heap. Rebooting it caused a complete failure of the virtual disk. Now, how the hell something like that happens is beyond me. It was like the virtual disk dropped a head or something.... Ridiculous I know, but the fsck I ran basically told me the disk had failed and corruptions crept in to everything on the disk. Realising that I was fighting a bad fight, I decided to create a new virtual machine and transfer the data back across.

The recovery procedure, described here: http://doc.otrs.org/3.0/en/html/restore.html doesn't really cover everything that needs to happen. Here is a short breakdown of the notes that I made while I was running the recovery process:


  • make sure you set the MySQL (or whatever database you use) password to be the same.
  • in fact, make sure you match up all the passwords where possible.
  • Install OTRS first using the Ubuntu install method - which is well described here: http://wiki.otrs.org/index.php?title=Installation_on_Ubuntu_Lucid_Lynx_(10.4) 
    • make sure you run all the right commands, including the cron ones (which I initially forgot - oops!)
  • Run the restore as per the link above and then restart apache and cron.
  • Test your installation and see how it goes.
Since this error, I've written a very simple script that runs the backup and scp's it across to another server I have. This in turn is backed up to my FreeNAS box, hopefully protecting my useful data. Here is the script:

---------------------------------------------------------------------------------------------------
#!/bin/bash
NOW=$(date +"%Y-%m-%d_%H-%M")
/opt/otrs/scripts/backup.pl -d /home/user/backup
scp -r /home/user/backup/$NOW user@server:/home/user/backup/OTRS/
---------------------------------------------------------------------------------------------------

The $NOW variable is configured to match the output of the OTRS backup.pl script and then I simply scp it across to my server. It's date organised and works pretty nicely. rsync might be a nicer way to do it, but this virtual machine only provides OTRS and nothing else so I'll keep it simple. 

If you can use any of this then please do.

AB out.

Wednesday, 20 October 2010

Tips and Tricks: Monitoring with NTOP and IFTOP

For monitoring networks I have an old GX260 Dell desktop in the small form factor. Packed into this little device are a couple of network cards, added on are a wireless NIC and an extra USB network device. The purpose? To slot this in between the router and the network and see what's going backwards and forwards - very useful in the situation where a client is hemorrhaging bandwidth and doesn't know why. I'm running Ubuntu 10.04 LTS on it and it behaves very well.

Two of the main tools I use are ntop and iftop. For those of you not familiar with them, ntop monitors a particular interface and creates some nice webpages to be checked by the user in order to see what's going on through the network. iftop is similar but real time and is available through a console - which is the real appeal for me.

The server in question has two internal NICs, both are 100MB cards and are scripted to come up as a transparent bridge - br0. Basically I monitor that bridge and use one of the other interfaces to see what the server is seeing. Here is the script I use (adapted from elsewhere) to bring the bridge up:

#!/bin/bash
PATH="/sbin:/usr/sbin:/usr/local/sbin";
slaveIfs="1 2 3 4 6 7 8 9 10";
cmd="$1";
[ -z "$cmd" ] && cmd="start";
case "$cmd" in
  start)
    brctl addbr br0;
    brctl stp br0 on;
    brctl addif br0 eth1;
    brctl addif br0 eth2;
    (ifdown eth1 1>/dev/null 2>&1;);
    (ifdown eth2 1>/dev/null 2>&1;);
    ifconfig eth1 0.0.0.0 up;
    ifconfig eth2 0.0.0.0 up;
    ifconfig br0 up ### Adapt to your needs.
    ;;
  stop)
    brctl delif br0 eth1;
    brctl delif br0 eth2;
    ifconfig br0 down;
    brctl delbr br0;
    #ifup eth0; ### Adapt to your needs.
    #ifup eth1; ### Adapt to your needs.
    ;;
  restart,reload)
    $0 stop;
    sleep 3;
    $0 start;
    ;;
esac;

It resides in /etc/init.d and is called (imaginatively) bridge.sh and then has appropriate symlinks to rc2.d.

NTOP
NTOP is reasonably easy to configure on Ubuntu and is quite straightforward to get going - point it at http://localhost:3000 and set your username/password and off you go.

A tip to remember is that in the /etc/default/ntop it's a good idea to uncomment GETOPT="" and change it to read (if your network was 192.168.0.0/24):

GETOPT="--local-subnet=192.168.0.0/24"

and restart NTOP. Why is this important I hear you ask? Well on the br0 interface there is no IP assigned to it so NTOP doesn't automatically figure out what the local network is. By assigning this you can set it up to get proper info on local-remote, remote-remote and local-local traffic. Then leave it to run and see what it tells you.

IFTOP
Ah iftop is such a nice little bit of software. apt-get install it and then run it from the console with iftop -i br0 and it will tell you all sorts of things - data going from here to there and the level of bandwidth being used. I fancy pants it up a bit by creating a shell script and then launching it from there. iftop will use .iftoprc by default and if there isn't one will simply launch with it's own defaults. Here is the shell script I use (again I have adapted this from someone else):

#!/bin/sh

# customisable settings
LOCALNET="192.168.0.0/24"
IFACE="br0" # the bridged interface
CONF="/etc/iftoprc"

/usr/sbin/iftop -p -n -N -i $IFACE -F $LOCALNET -c $CONF

where /etc/iftoprc looks like this:

dns-resolution: yes
port-resolution: yes
show-bars: yes
promiscuous: no
port-display: source-only
#hide-source: yes
#hide-destination: yes
use-bytes: yes
sort: 2s
#line-display: one-line-both
show-totals: yes

Most of these are self-explanatory and I believe you should examine them more closely if you are looking to deploy it. Suffice to say, it gives me the info I want and I'm happy with that setup. So I hope that gives you some food for thought and you can take some of this away with you when you're trying to find out what the hell is chewing up all your bandwidth and download limit!

Monday, 11 January 2010

Review: Linux Mint

I have long been an advocate of Debian GNU/Linux (hereafter referred to as Linux). It's wonderful for servers, stable, with a predictable development cycle. The Ubuntu distribution builds on this with a lovely desktop and wonderful, easy hardware and software management. Mint builds on this again with a polished distribution that I'm finding quite enjoyable to use. You can find Mint here at: www.linuxmint.com It's a regular 700MB download iso and uses Ubuntu repositories. As usual, you have the options of using the included software manager (which is good) or aptitude or apt (my preference).

The machine I'm using for this is a HP/Compaq Presario C300. It's an older laptop, with a Celeron M processor and I've bumped the RAM up to a gig which gives me plenty to play with, even given that the video card steals some RAM. The C300 also has a lovely wide screen with that glossy look I normally despise but find to be very eyeball friendly at the moment. It only has a 60GB hard disk which is completely adequate for my needs. On to the review of Mint...

Given that this distribution is built on Ubuntu there are many lovely features that are underlying it. All the hardware in the notebook was picked up very swiftly and easily. It all worked out of the box. As a little back story - I was running Ubuntu on this notebook but the wireless wouldn't connect to my hidden wireless network. Frustrated because there seemed no answer to this problem, I found via Google a forum note that Mint worked correctly. The developers have apparently fixed this up. So I installed it and enabled things like the encrypted home directory (just to play with). The performance of the device is not noticeably affected by the decryption/encryption of files in my home directory which is nice. Access to all controls is through the Control Centre and I've had no problems with it at all. Automatically detecting devices works beautifully - Mint found and configured my HP2100 laser printer quickly and very easily. This is the kind of thing I love about the new Linux distributions. Long ago I remember writing the lp files to get printers recognised and working. Not much fun at all - but very stable!

Stability is always an issue for me. Being a computer professional, the last thing I want to do is come home and have to fix my own PCs - what a nightmare that always is. Especially given I have a *very* non-standard network doing all kinds of weird things and the last thing I want to do is try to work out whether it's my PC or my network causing things to be unhappy. Mint is wonderfully stable. I've had it running as my day to day work machine, in and out of suspend and hibernate and it's been terrific. It's worked reliably and quickly even with the in and out of suspend/hibernate. I have had problems with this in the past with other Linux distributions but Mint kicked butt. As a work box that needs to do all kinds of weird things and do them reliably, Mint does the job admirably.

On a superficial level, I like the green theme and the backgrounds etc are all very good. I really don't like the browns of Ubuntu and usually the first thing I do is to change the themes and backgrounds. I know I know - very shallow but... I'm still using the default Mint theme. It's nice and it's easy on the eyes. I'd recommend this distribution for the novice user all the way through to the systems admin type person. I don't know that it would suit the hardcore hacker (not being one) but I'm sure someone of that ilk would get by :-) You also have the option of the LTS 5 year supported version the same as Ubuntu. It's a nice little option to have. Otherwise you get the same release cycle as Ubuntu.

In conclusion Mint is definitely worth a look and it's heritage of stability, great software and hardware configuration, and ease of use make it a terrific distribution.

Wednesday, 16 September 2009

Adventures with eeePC: Enter EasyPeasy

Recently I attempted to enable the Advanced Desktop on my eeePC. I'm not *exactly* sure what I broke, but I broke my little netbook good. Damn. I could get it to boot but had no desktop. No icons, no information nothing. Very, very disappointing. So I thought that perhaps it was an opportunity to have a look at a few other things. Hunting for a new netbook operating system found me looking mostly at Linux offerings, with some websites advocating Windows 7. Eventually I found my way to Easy Peasy (http://www.geteasypeasy.com/) which uses Ubuntu 8.04 as its base and builds upon that with a myriad of customisations and clever manipulations of the system. I love Ubunutu - it's basis in Debian means it's rock solid with tonnes of terrific applications. The installation was a bit nervy - I didn't want to brick my netbook. The website has an excellent walk through and after a few USB memory key issues I finally got things going in the right direction.

The interface is great. Speed is great. I still have a grip about Mozilla Firefox though. It seems to pause (and hold up everything else) every now and then. It disrupts my flow and annoys me. With the recent release of Easy Peasy 1.5 I hope that will be fixed. I'm downloading it now so I'll find out very soon I hope. Generally it was been excellent though. All the devices worked perfectly and although I've had a few problems with a bluetooth mouse I've got, it's been fine otherwise. The particular mouse in question is *very* sensitive to the devices it connects to. The addition of the 8GB SD card has made storage a non issue and I have a 160GB external disk with a heap of stuff on it if I require the extra disk space.

I'm installing the updated version now - it's based on Ubuntu 9.04 so I'll post another note about it when it's completed. Let's hope it goes well!

Friday, 14 November 2008

Ubuntu 8.10 Review updates

I've been using 8.10 for a while now at home and at work. Naturally the more demanding of the two has been at work, where I've been working both on ISO9001:2000 documentation and also web page development. Two things have struck me as annoying, and I've found one little solution and one big solution.

The first problem I've had is when I enable the nVidia restricted drivers for the video card in this GX270 OpenOffice has problems with it's rendering. Specifically the menu names, the font name, font style etc all become transparent and I can't read them. When I close a document and the dialogue box for Save/Discard/Cancel comes up I can't read the options. Firefox is unaffected, which is fine, but I spend a fair bit of time in OpenOffice and it's very inconvenient. The fix? Well it's a little one - I disable the restricted drivers and problem solved. I don't use a lot of the extra graphics effects so that's fine.

The other problem is the workspaces control applet in Gnome. There are only 2 workspaces by default and ordinarily you right click on them to add extra workspaces. For some reason this doesn't work all the time. There is a bug report about it I believe. Yesterday I was cranky enough that I re-installed Ubuntu (this was an upgrade machine that I've "tweaked" and so a fresh start was a good option). Voila! The workspaces thing is working again. At home, however, it isn't and I'm not about to re-install that machine too. For the time being I'll suck it up, find the config file and manually change it if I get cranky enough. At home the extra workspaces isn't such an issue, but I do like to have 4 at any given moment.

Apart from that, everything is going extremely well. The darker theme is very soothing to the eyeballs and that's a good things - especially with many hours spent staring at the screen. Well done, good work and keep it Linux Developers!

Tuesday, 11 November 2008

Flexibility, with Dell and Ubuntu

I know I wax rhapsodic about Ubuntu and the general power and wonderfulness that is Linux but I've just had an experience that adds another ingredient to the mix. I have a bit of penchant for older hardware - I maintain a gaming system that is generally no more than a year old before I upgrade it's innards but apart from that system, all my hardware is old stuff. Why bother to buy a new machine to run Linux on it, when a two or three year old box will do exactly what I want it to?

I recently picked up a Dell Precision 380 and an Optiplex GX280. Sweet machines - I'm particularly impressed with the Precision and it makes me wonder what a brand new one would be like. Perhaps I'll have to break with tradition and invest in a new one :-) The Optiplex was purchased on a bit of a whim - only $100 and it's a P4 3.2GHz box with DDR2 RAM etc (I'm using it right now actually). Not bad and it's also a mini desktop (or whatever you call them). Very small, quiet and easy to tuck away. It's the same as the two GX240's I've got. The only bad thing I've found is the CDROM appears to be faulty in some fashion. At any rate, installing Ubuntu 8.10 wasn't happening - disk errors abounded and although the CD itself checked out, it was failing on this system. Rather than piss and moan about it, I pulled the 160GB SATA disk out and popped it into the Precision - all the disk mounting stuff is the same, the cables reached perfectly etc etc and after a short interval I shut the box down, retrieved the disk and threw it into the GX280 again. An hour and a half later, I've customised the hell out of my Ubuntu install (mmm pretty) and it's going great guns - no hardware issues nothing. Sweet!

This is kind of a review of Ubuntu 8.10 too - I really like the new DarkRoom theme and as usual the upgrade process (that I performed on another box) went very smoothly. It runs quite nicely and although I've read elsewhere that 8.10 is slower than other iterations of Ubuntu it appears to run quite snappily for me. Earlier I transferred about 10GB of data over my gigabit network and that gave it a real push - the load hit about 8 at one point :-) But the old hardware and the new operating system pushed on quite happily - although I do hear the fan complaining a bit. With the ambient air temperature around the 28 degrees C plus the work it's doing, it's no wonder really.

Back to the Dell PCs I've got now - I have 6 and many of the parts are interchangeable. Naturally there are exceptions to the rule - the power supplies vary somewhat between the little PCs and the Precision has almost unique innards compared to the others. This is quite alright. I'm very pleased with all of them. I've actually got a reasonably good working installation of Windows Server 2008 Standard on the Precision - Microsoft's TechNet Direct is a terrific resource if you want to stay on top of all the Microsoft software out there. The Precision runs it quite happily and it's gratifying to note that nVidia even has drivers for the Quadro network card that work happily under 64 bit Server 2008. It's a happy little family of Dell PCs, Ubuntu Linux, Windows Server 2008 and my lone Windows Vista/XP gaming box. The cousins in the lounge room - the Xbox (modded naturally) and it's younger brother the 360 talk happily to these machines too and combined it forms a nice little network. If only my power bill wasn't quite so large.....

Wednesday, 22 October 2008

Review: Fluxbuntu on the Dell L400

Readers will remember that some time ago I purchased a Dell L400 Latitude second hand for about $200 bucks. Great little machine, runs a cut down version of XP happily and is all good. For some time now I've been struggling to find a distribution of Linux that I'm happy with to run on this little machine. Orginally I had SuSE running on it, then I tried Puppy Linux, DSL, Vector Linux 5.9 Lite and the lighter version of Ubuntu 8.04. I just wasn't quite happy with any of them. Following a comment made on my blog yesterday I thought I'd give Fluxbuntu a try and see how it goes.

As you can tell from it's name, Fluxbuntu is an Ubuntu derivative, running the Fluxbox window manager. The installation was quite easy (as it usually is with Ubuntu), although it was the more command line version of the install than the flashy graphical installation. This is no problem to me, because unlike many out there, I don't mind a bit of hacking with the command line and I can handle fdisk or cfdisk without trouble. 

Naturally, all the appropriate drivers were supplied for the hardware and the installation ran quite smoothly. It correctly detected and configured X and everything else. On reboot, the system started up and away we go. The boot process was a little slow, but I'm wagering I can pare that down without trouble. 

Fluxbuntu is based on Ubuntu 7.10 and I imagine that when 8.10 is released, they will update the distribution to that version. I expect a straightforward upgrade. Given the dearth of applications provided for Ubuntu and Debian there is of course no difficulty in installing whatever software you are happy with. I don't mind Abiword (which is installed by default) and I'm just starting to play with Kazehakase (the web browser). It started up pretty quickly - not bad for a PIII-700! About the only thing I'm struggling with is our proxy here at work. It can be a finicky thing at times.

As usual, I rebooted the system and test entry into Windows (to make sure it still works). Thankfully it does and Fluxbuntu had correctly set Grub up to allow for the extra partition. I noted that it had updated the kernel (twice) during the first round of updates and grub reflects that. I'll have to edit it later and tidy it up a little bit.

Overall, I'm happy for the moment with Fluxbuntu. I'll play with it for a few days and post an update on how I'm going with it. If you've been using Fluxbuntu for a while and have any tips to share - by all means do so in the comments!

Friday, 20 June 2008

Ubuntu 8.04 Review

As my legion of fans will know I've been a Linux advocate for many years. Back in the old days I started out with Mandrake and Debian. Debian for servers, Mandrake for the desktop flavour of things. I stayed with Mandrake for several years and then switch to SuSE. When this upstart Ubuntu appeared on the scene with it's livecd goodness I gave it a crack - I think it was version 6?

Now with the latest and greatest version on my Dell desktop I've decided to review it's usefulness as a desktop operating system and share my thoughts. My first thought is, I like it. The interface for upgrade/installation is easy as pie to work with, I like the fact you can include encryption for filesystems and overall it's quite polished and nice to drive. The interaction with the windows network here at work is acceptable, I do a lot of terminal server based stuff and that all works a treat. I like the enormous array of software one can install and use and I've found nmap and nessus to be so handy as I probe our network for various weaknesses.

Possibly the only thing I'm not a fan of is the default theme. Brown is just not my colour, but this is a very minor annoyance. I've had no problems at all with the installation, it just works and for me, that's a very important factor. Like a plumber with a leaky tap at home, the last thing I want to do is to be trying to solve my own IT problems in the midst of trying to help others.

All the normal Linux goodness - multiple desktops, excellent shortcut key support, terminals, Firefox 3, Amarok and the like are present and work very well. I'm using it on a P4 2.0GHz Dell GX240 with 512MB of RAM and a baby hard disk (about 20GB) in it. I've pieced this machine together from parts because I like the small form desktop. I find Ubuntu to be much more user friendly than Vista and there is nothing I can do on Vista that can't be done here on Ubuntu. Printing, device detection etc all excellent. I recommend you give it a try. I'll be installing OpenSuSE 11 over the weekend (hopefully) onto a very similar PC I have at home and I'll review it once I'm done.

Omarchy - the new darling of the Linux world

 Omarchy is the buzzword at the moment, with it turning up on Network Chuck's YouTube channel. I came across it via DHH's blog post ...