Wednesday, 29 June 2016

VMware vSphere Syslog options - Part 2

VMware vSphere Syslog options - Part 2


To prepare I deployed a VM running Red Hat Enterprise Edition using the new Developer subscription made free by Red Hat for testing purposes. I can subscribe away lab machines and there's no $99 yearly charge anymore. I highly recommend getting hold of this to brush up on Linux skills.

Note: You may hit a console bug where the Redhat lock screen freezes, turn off screensavers and automatic lock screen behaviour in Redhat before you go to use Putty to prevent this. It may be down to particular VMware patches but I've found nothing conclusive yet, it's just annoying when you're in the middle of a Lab and worth avoiding - obviously Production will need a different approach.

This is the main reference I'm following to get this up and running as it contains exactly the outcome I was after:
http://docs.fluentd.org/articles/free-alternative-to-splunk-by-fluentd

You'll need a few Firewall ports open so start with these in the GUI for runtime and permanent:
TCP Port 5601 for Kibana web access
UDP Port 514 for syslog-ng to redirect syslog to fluentd

Note: ensure you've subscribed RHEL to the Update Repository at this point.

Next open a Putty session to the new VM. Check the Java version is ok:

[dufus@syslog5 ~]$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)

Version 7 or higher is needed, so I'm ok with version 8 as shown above.

Prerequisites:
Setup for NTP

Check ulimit value:
ulimit -n
(mine returned 1024 which needs to be changed)

Edit /etc/security/limits.conf
There are some changes required the file permissions to carry this out:
Check permissions on limits.conf file:
stat --format '%a' /etc/security/limits.conf
This gives me "644"
Set permissions to allow editing of limits.conf file:
sudo chmod 777 /etc/security/limits.conf
vi /etc/security/limits.conf

Add these lines to this file (Copy & Paste the whole lot directly into VI if connected with Putty client):
root soft nofile 65536
root hard nofile 65536
* soft nofile 65536
* hard nofile 65536

Set permissions back:
sudo chmod 644 /etc/security/limits.conf

I'm not running a high load environment so that's it for me. Time to reboot to apply before going further.

Note: This is a good time to shut down the VM and take a snapshot until you get the remaining changes successfully implemented.

Now, the article might refer to older versions of Elasticsearch and Kibana, I'm going to use the latest versions currently available so adjust the download links after checking the web page sources listed below:

Elasticsearch

Check the url for the latest version here:
https://www.elastic.co/downloads/elasticsearch

You can install elasticsearch via Yum but it doesn't prepare the right version, you need to match Kibana and Elasticsearch versions.

I found installing Elasticsearch as an RPM was the best option and allowed me to run it as a service much easier:

cd /tmp
curl -O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/rpm/elasticsearch/2.3.3/elasticsearch-2.3.3.rpm
sudo rpm -Uvh elasticsearch-2.3.3.rpm
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service

Done! Now Elasticsearch is running as a service.

Kibana

Check the url for the latest version here:
https://www.elastic.co/downloads/kibana

Now open another putty session and run the following commands, adjusting the filename according to the new version you see available:

curl -O https://download.elastic.co/kibana/kibana/kibana-4.5.1-1.x86_64.rpm
sudo rpm -Uvh kibana-4.5.1-1.x86_64.rpm
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable kibana.service
sudo systemctl start kibana.service

Now the Kibana server is running you can check it on the VM console (if it hasn't locked up!) on http://0.0.0.0:5601


There no data so that's it for now.

Fluentd (td-agent)

Now open a third Putty session and we'll try to install Fluentd and get the configuration file edited and working.

http://docs.fluentd.org/articles/install-by-rpm

curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.sh | sh

The script above executes and installs the td-agent2

Now install the Elasticsearch plugin:

sudo /usr/sbin/td-agent-gem install fluent-plugin-elasticsearch

And next modify the td-agent.conf file (back it up first!):

sudo cp /etc/td-agent/td-agent.conf /etc/td-agent/td-agent.conf.bak
stat --format '%a' /etc/td-agent/td-agent.conf
644
sudo chmod 777 /etc/td-agent/td-agent.conf
vi /etc/td-agent/td-agent.conf

Modify as follows:
Find the section:
<source>
  type forward
</source>
Now insert a few blank lines above this and copy and paste the section below, then you can delete the section above and you're good to go! 

<source>
  @type syslog
  port 42185
  tag syslog
  format /^(?<pid>[^ ]*) (?<time>[^ ]*) (?<host>[^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*) (?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$/
  time_format %Y-%m-%dT%H:%M:%S%z
</source>

<source>
  @type forward
</source>

<match syslog.**>
  @type elasticsearch
  logstash_format true
  flush_interval 10s # for testing
</match>

sudo chmod 644 /etc/td-agent/td-agent.conf
sudo /etc/init.d/td-agent start

Syslog-NG

This section deals with installing Syslog-NG. The inbuilt rsyslog engine I found doesn't preserve the source host address easily so I thought I'd use the more powerful syslog-ng tool instead for this purpose. I hit a problem with a dependency when trying to install syslog-ng but found a suitable binary using www.rpmfind.net so you may need to watch out for this if versions change etc.

Error: Package: syslog-ng-3.5.6-3.el7.x86_64 (epel)
           Requires: libnet.so.1()(64bit)

My solution to getting syslog-ng installed on RHEL 7.2:

cd /tmp
curl -O https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -Uvh epel-release-latest-7.noarch.rpm
yum repolist
curl -O ftp://195.220.108.108/linux/fedora/linux/releases/23/Everything/x86_64/os/Packages/l/libnet-1.1.6-10.fc23.x86_64.rpm
sudo rpm -Uvh libnet-1.1.6-10.fc23.x86_64.rpm
yum -y install syslog-ng
vi /etc/syslog-ng/syslog-ng.conf

Replace the existing contents with the ones below - replace the IP Address with the local IP of the system you are installing to and where Fluentd resides.

@version: 3.7
@include "scl.conf"

    options {
        time-reap(30);
        mark-freq(10);
        keep-hostname(yes);
        chain-hostnames(no);
        };
    source s_network {
        syslog(transport(udp));
        };
    destination d_syslog_udp {
        syslog("192.168.10.104" transport("udp") port(42185));
    };

    log { source(s_network);
          destination(d_syslog_udp);
        };

systemctl stop rsyslog.service
systemctl start syslog-ng.service
systemctl disable rsyslog.service
systemctl enable syslog-ng.service
yum -y remove rsyslog

Now check Kibana and you should see message appear.


The host, ident, message and @timestamp fields should all line up. I found I had to use some online parsers to get the format line in the syslog-ng.conf just right or I would be missing data, or worse get errors in fluentd as follows:

tail -f /var/log/td-agent/td-agent.log

2016-06-02 14:12:32 +0100 [error]: "<167>1 2016-06-02T13:12:30+00:00 bdragon.lab.local Vpxa - - - verbose vpxa[FF88DAC0] [Originator@6876 sub=PropertyProvider opID=HB-host-9@1193-44773711-1e] RecordOp ASSIGN: info.state, session[5270aadd-231b-3521-e317-dbd316cd75e4]52c63ee9-fe3d-d55a-6128-51ec302ec66d. Applied change to temp map." error="invalid time format: value =  2016-06-02T13:12:30+00:00, error_class = ArgumentError, error = invalid strptime format - `%b %d %H:%M:%S'"

The frustrating thing is that the issue above was caused by the "<167>1" and not the format of the date! Even after long hours figuring out the correct format I was still left with an error. The websites below held the key, I'm no Ruby expert but it let me quickly try out different expressions until I arrived at the ones above finally. I've left the full link deliberately to reflect the final expression I tested that worked.

https://fluentular.herokuapp.com/parse?regexp=%5E%28%3F<pid>%5B%5E+%5D*%29+%28%3F<time>%5B%5E+%5D*%29+%28%3F<host>%5B%5E+%5D*%29+%28%3F<ident>%5Ba-zA-Z0-9_%5C%2F%5C.%5C-%5D*%29+%28%3F%3A%5C%5B%28%3F<pid>%5B0-9%5D%2B%29%5C%5D%29%3F%28%3F%3A%5B%5E%5C%3A%5D*%5C%3A%29%3F+*%28%3F<message>.*%29%24&input=<167>1+2016-06-02T12%3A40%3A38%2B00%3A00+bdragon.lab.local+Vpxa+-+-+-+verbose+vpxa%5BFFCA7B70%5D+%5BOriginator%406876+sub%3DVpxaHalCnxHostagent+opID%3DWFU-564af32b%5D+%5BVpxaHalCnxHostagent%3A%3AProcessUpdate%5D+Applying+updates+from+6463+to+6464+%28at+6463%29&time_format=%25Y-%25m-%25dT%25H%3A%25M%3A%25S%25z

http://rubular.com

So, you fire all syslogs out of your ESXi hosts over UDP port 514 to the central RHEL server and it listens for them, syslog-ng forwards them to UDP Port 42185 where Fluentd listens and then onto Elasticsearch via logstash. Easy!! At least you can view the results in a cool web browser and do all the searching you need.

I've not looked at long term storage requirements here so you'll need to monitor disk space and ensure Elasticsearch doesn't run out, best to test this with one or two Hosts in a Lab before sizing and deciding on log retention etc.

It's not a particularly easy combination, it may be possible to use rsyslogd instead of syslog-ng but this is the combination I found to work and enable more powerful searching and indexing of syslog files from VMware. That or just use their Log analyzer product if you prefer!


Tuesday, 14 June 2016

VMware vSphere Syslog options - Part 1

VMware vSphere Syslog options - Part 1


The troubleshooting facilities in VMware vCenter and vSphere are fairly good in my opinion. Through my work I can access a support dump analyzer for ESXi Hosts that provides very useful information. I can crack open the vCenter dump to access specific logs and see what's been going on. I can tail the vmkernel.logs to monitor realtime activity and with the introduction of the Syslog collector service in vCenter look back in time - just add the logs or vCenter VM to the backup schedule and see if a particular problem existed previous to a patch or upgrade.

Where I don't get involved is in deep investigation of issues. Support typically go deeper in their analysis of particular problems and the in built syslog server uses flat logfiles which make tracing a particular fault more difficult.

I heard about a few options in this area and wanted to explore them here and try them out.

Pay versions:

VMware vRealize Log Insight
https://www.vmware.com/products/vrealize-log-insight/
Commercial, free for up to 25 OSI (Operating System Instances) when you own a supported vCenter license but $$ beyond that. This might just do some smaller businesses and from what I've seen is a great product with contents packs to extend monitoring beyond VMware Products. They don't charge for the storage of large amounts of log data. The product is deployed as a virtual appliance.

Splunk
http://www.splunk.com/en_us/products/splunk-enterprise.html
This is the main competitor to VMware's product and has been out there a while with a good knowledge base. They have cloud options and a Splunk Lite. The pricing is per GB of logs, hence you need to know the volume of logs generated but this could spike when experiencing an issue which is not so good! It installs on Windows, Linux, Solaris and Mac OS.

Kiwi Syslog Server
http://www.kiwisyslog.com/products/kiwi-syslog-server/product-overview.aspx
I've used this myself in the past with their CATTools to backup Cisco switches. Cost is a flat fee of €240 and installs on windows only.

Free/Pay versions:

PRTG Free Syslog Server
https://www.paessler.com/free_syslog_server
Well, it's free up to 100 sensors, they estimate  each device will use 5-10 sensors but I'm going to test it with just syslog on an ESXi host to see if I could get 100 ESXi hosts out of it. You want more of course you pay more and it's not free at that point. But it could be just enough for you.....

Free versions:

Syslog-NG
https://www.balabit.com/network-security/syslog-ng
https://syslog-ng.org
https://github.com/balabit/syslog-ng
Well, this is completely free and open source but requires Linux. You can use the VMware virtual management appliance (vMA) to get this up and running. I'm interested to see how much work there is to get it capturing logs from multiple ESXi hosts and then query the product as with most Open Source solutions, they are no easy to use / get working out of the box. But if you're up for a challenge then so am I!!

My ideal is an open source, free product, easy to set up, Kibana web front end with Elastic Search and little to no configuring for vSphere logs!! I can dream right?!

PRTG Free Syslog Server

So this one is interesting. Once installed and loaded up it began discovering my network and picked up everything running on the same subnet. This included vCenter, ESXi, network devices etc. All I was interested in was the syslog server but it's not enabled by default. You have to add a new probe device to the local probe called "Syslog Receiver" and choose the settings if you want them different from the default, mine worked fine as is. Once I configured ESXi from KB2003322 I got a few messages through and could see how it worked.

So it's getting message but how easy is it to retrieve specific message levels. There is a message tab to list all recent ones.
Then you can select a specific severity as shown below. There is some rudimentary text searching.
The historic data tab allows exporting of specific errors to html or csv.

That's as exciting as it gets! 
The trial license stays for 30 days even after putting in the free key, then limiting you to 100 devices. I was able to remove a lot of the discovered entries and sensors to reduce the amount in use. Windows Firewall Rules were added automatically. There was a web interface but I didn't spend too much time with it. 

Kiwi Syslog Server

This one is also Windows based and required .NET 3.5 so add that Feature into Server 2012 R2 if required to allow the install to proceed. After install I pointed ESXi at the new syslog IP and off it went. You can see immediately the new logs hitting the server. 
There is no search or filter really in the main screen. You can schedule archive options as shown to deal with historical records but it just stores things in a flat file much like the VMware equivalent. You can do more filtering of course over what it captures and output it to different "screens" but it's no better than when I last looked at it over 10 years ago....there web interface failed on install so didn't get a look at that. 

Splunk Enterprise

Simple to install. I went with the Enterprise version to see what features it provided. There is a VMware App you can add in but after 10 minutes while this was heading in the direction I wanted I gave up as it appears complex but very powerful, not so easy to get to grips with. Very well worth checking out though....

VMware vRealize Log Insight
Erm, I downloaded the appliance and found that you need a supported version of vCenter to get a free 25 OSI license, but they then say go to the downloads page and click on Read More to get the 5.5 and lower version key which is listed right there?! The OVA deployment was standard, I let DHCP do everything as I was only going to test it for a few minutes. 
Blog entry here from VMware:
Now, how does it stack up? Well I couldn't connect to it at first with the browser, after a few minutes it rebooted and was doing some configuration by itself so I left it alone. Wait until you see this in the console.
Now you'll be able to connect with the web interface


I clicked New Deployment. Once you finish all the initial setup questions you can configure integration. As it's a VMware product for monitoring VMware primarily I know this is going to be easy! 
To start with I just configured my ESXi Host to sent logs to the Log Insight appliance and didn't configure vCenter integration. Just to see what happened. There are content packs for vSAN and more.
I was definitely getting logs in from the host so I decided to configure vCenter integration next.

The VMware specific dashboards are interesting.
And you can drill into these to get the interactive view which is absent in the other products where I tested it. 
So, I'd be fairly happy to give HPE Support access to VMware's Log Insight and be sure it would help them out. PRTG would also tick my box but I'm less sure about Kiwi Syslog Server. Splunk with effort in setting it up would most likely beat all of these but cost is a factor and the slight complexity which when you've limited time for a Lab session isn't workable. I'm sure there's good Blogs out there you can find that would help you set it up correctly and to test it out. 

Syslog-NG

This one troubles me as there doesn't appear to be any web interface or search engines so what's the point!?! I did find some good articles using other open source software so I'm going to give them a try, document the results and add them as my next post so stay tuned. If it works I just need to find a suitable Linux distribution to deploy and see how manageable that becomes over time. 

Disclaimer: I work for HPE as a Consultant.

Friday, 1 April 2016

VMware Web Client Fling

VMware Web Client Fling


This post will be nice and easy! I heard from a colleague that there was a new Web Client out this week. I thought this was to do with the Host Web Client now built into 6.0 Update 2 but no, it's the potential replacement for the awful vCenter Web Client. Finally a HTML 5 version. I know it would be early days and not fully featured but I was curious to see what it was like in my Lab.

Links:
https://blogs.vmware.com/vsphere/2016/03/vsphere-html5-web-client-fling-getting-started.html
https://labs.vmware.com/flings/vsphere-html5-web-client

You deploy an OVF but for the windows version you also download a BAT file. I tried running the script on my workstation but got path errors. Then as I read through the release notes realized it needs to be run on the vCenter server itself. I did this and got path errors again. It creates files but not the ones you're looking for!! Then an updated Blog post out of VMware admitted you need to edit the script to change the path if you installed vCenter somewhere other than the C: drive, like most of us do in the real world!! I edited the following two lines and it 66% worked but still gave an error.

REM Path to javas' keytool
SET KEYTOOL=E:\Program Files\VMware\vCenter Server\jre\bin\keytool.exe

REM Path to vecs binary
SET VECS_CLI=E:\Program Files\VMware\vCenter Server\vmafdd\vecs-cli.exe

C:\temp\ks>server-configure.bat
Generating store.jks file...
Generating webclient.properties file...
Creating ds.properties file...
The system cannot find the path specified.
Done.

There is another Path that needs changing:

E:/ProgramData/VMware/vCenterServer/cfg/store.jks >> %PROPFILE%
echo keystore.jks.path=/etc/vmware/vsphere-client/store.jks >> %PROPFILE%

and further down:

echo Creating ds.properties file...
SET CLIENT_DIR=E:\ProgramData\VMware\vCenterServer\cfg\vsphere-client

Once I had all four of these paths updated from C: to E:, I ran the script using an elevated command prompt and it generated the three files. 

Finally it works(!!):

C:\temp\ks>server-configure.bat
Generating store.jks file...
Generating webclient.properties file...
Creating ds.properties file...
        1 file(s) copied.
Done.

I uploaded the three files into the directory paths you've to create and started up the web service. 

vcsa:~ # /etc/init.d/vsphere-client start
Starting vSphere Client Web Server
vSphere Client Web Server successfully started in 87 seconds

The interface is VERY responsive compared to the current clunky one. 



It's still got a ways to go but I could see myself using this interface whereas I've given up on the current web interface and revert to the C# client wherever possible! I hope it matures quickly and makes it into the next vCenter version. Give it a shot if you get a chance!

Notes [Update]:
URL is https://<ip of web client appliance ip address>:9443/ui
To get at the management interface of the appliance to apply upgrades:
https://<ip of web client appliance ip address>:5480
user: root   pass: monova


Friday, 18 March 2016

The Internet of Things (IOT)

The Internet of Things (IOT)


So, this post will delve a little into the evolution of technology into more areas of our lives. We've now reached a point where we've to consider pushing a firmware update out to the light bulb (Phillip Hue among others!). But what does this all mean when these devices start out specalized but then interconnect with each other? What are the possibilities?!! To find out and also because I'm considering building a home, I travelled last weekend to a big Trade Show in Frankfurt held every two years:
http://light-building.messefrankfurt.com/frankfurt/en/besucher/willkommen.html?nc
This show was massive. I've been to VMworld on a regular basis but think IKEA times 9 or 10 and you'll get an idea of the scale. I arrived at opening time at 9am and was only finishing looking at the third exhibition hall by 1pm, with lots more to get around. I left just before 6pm so spent the entire day looking at various exhibits. So what was it all about?

The exhibition started out by showing lighting as applicable to home, industrial, hotel, commercial and other applicable areas. It was virtually all LED based, from GU10 downlights to streetlights to stadium lights to give you an idea. Besides lighting there was a number of halls dedicated to building automation, again from a house to nursing homes to hospitals to hotels to large commercial buildings of all kinds and scales. Security cameras that can count the number of people passing beneath it, what direction they are going, if they are walking too slow or if they walk the wrong way! Fingerprint entry systems, home automation integration with smartphone apps to control lighting etc.

The stands were many and varied from small to almost half an entire hallway. The range of suppliers and companies represented were from all over the globe. Some specialized in just the reflective part of an LED downlight and nothing else!

So, what has all this to do with computers? Well, KNX is a home automation standard I've been looking at. It's one of the larger ones but by no means the only one out there. Take a light switch. Normally the switch is wired in series with the 240 volt supply into the light, giving you control. With a KNX setup, you wire everything back to a central point. The lights all connect into a KNX actuator. The light switches are wired into a separate 24 volt circuit that is also connected in series to to the KNX actuator. Each light switch is assigned to a unique group. You then use a windows system connecting via USB or Ethernet to program the KNX actuator. ETSS is the windows application that joins the dots. "If I press switch A, turn on light 1 & 2" etc. You can easily reprogram a switch to perform a different function and have a switch at the exit turn off ALL lights and set the alarm on your way out. By separating these two systems you gain a lot of power. You can associates any switch with any light! You can also use presence detection or gesture controlled switches (one where you wave your hand hear, for hygiene reasons in a kitchen/toilet perhaps) to turn on lights. Google KNX and you'll see a raft of manufacturers. The kit isn't cheap, but you can use a binary actuators to turn old / existing light switches into smart switches thereby saving money vs sourcing expensive new intelligent switches.

One issue with most of these systems however is security, KNX Secure is being proposed but the manufacturers aren't currently shipping this feature yet. One guy found a hotel recently that was using android tablets to control the lighting in his room, he plugged his laptop in between the tablet and the port in the wall, ran wireshark and found the communication was unencrypted. He then proceeded to reply lighting commands for his room easily. He worked out that the IP Address of the android device contained his room number and while he didn't try, he could have started messing with lights anywhere in the Hotel! That's the scary version of how this can go wrong. With all the automation in your house keeping tabs on you and making life easier, remember it can be subverted......!

I heard about a new Samsung fridge with a 21" LCD in the door. They want it to be your home hub, showing seasonal recipe's, checking on spoilage and allows you to monitor what is on your shelf remotely! There are intelligent washing machines, they give you information on the amount of energy used and when the wash is finished.

So, you can start today with replacing your bulbs with intelligent led replacements, a media center for all your music, movies and photos. The next step is to start measuring your home, in terms of power, gas, electricity and water usage. Then look at introducing renewables to reduce your footprint. At some point rewiring may be necessary and that opens up moving away from dumb switches to something more interesting. Being able to introduce lighting which adapts to your moods, dimming, colour and color temperature control from the same LED source. Integrating your fire alarm and security system to your lighting will also provide additional benefits. And perhaps a firmware upgrade or two along the way!!!

So, for us technology innovators, this is a interesting era of inviting technology into our homes, and joining them all up to provide a better synergy with our lifestyle. I hope the post gives you some insight into the possibilities.

Links:
http://knxtoday.com
http://www.knx-gebaeudesysteme.de/sto_g/English/_HTML/start.htm
https://www.grahamcluley.com/2016/03/hacking-hotel-gain-control-rooms-lights-curtains/
http://www.theverge.com/2016/1/4/10707894/samsung-smart-refrigerator-connected-fridge-iot-ces-2016
http://www.whirlpool.com/smart-appliances/smart-top-load-washer-dryer/

Thursday, 18 February 2016

Travelling with work - Tips and Tricks

Travelling with work - Tips and Tricks


I've been doing a bit of travelling outside of Ireland with my job lately and thought it might be a good idea to list a few tips for potential travellers if you find yourself suddenly sent abroad!

Firstly I got a good tip from a colleague - get signed up to whatever loyalty programmes you can, Hotel, Car Hire etc and use them when you book to get free uprades and other benefits.

There's always the timing of flights vs project attendance to work out. If you're full time on a project some customers won't mind you turning up mid morning on a Monday and leaving mid afternoon on a Friday to catch flights etc but for the first week or two you're better off travelling on the Sunday and leaving Friday night until you get the lay of the land, see how the project goes and discuss with your Project Manager and customer. See if remote working is possible so you can get home on a Thursday night perhaps and get some washing done while queueing repetitive tasks or compiling reports on Fridays in more comfortable surroundings with less distractions (at least in my case!).

Eating healthily is more of a challenge of course when you're travelling and not cooking for yourself. Picking what you eating and where you eat is often a compromise between convenience and starvation! Check tripadvisor for the top 5 restaurants in your area and get out for a walk every other day to clear the head. Sometimes the customer canteen does breakfast and dinners that are more reasonable than the Hotels and have healthier options than traditional fare elsewhere. Pub grub I found varies and inevitably the local isn't great but if you travel you can find the best places but be warned, they can change hands or have a different commi chef so if you're coming back after a couple of months beware!

Car Hire is interesting as I've gotten 4 different cars so far that my own at home feels wierd every time I drive it now! The sat nav's I've not been impressed with so I purchased a phone holder with a suction cup to attach to the windscreen (got this in the airport at Dixons) and it's been working wonderfully since. Google Maps has a nice drive mode but doesn't feature speed cameras but once you get used to it the recent history is very useful to repeat recent trips. It also shades itself in black at nighttime. Just make sure you have charged your phone, have roaming data and don't forget your phone holder when you hand the car back. One thing that's missing is an ice scraper on cold mornings. I'll have to find a small one I can bring, using the hotel card can cause it to break! The car rental companies should really include it...finally check if it's a petrol or diesel and see if filling up before you bring it back is worth it or if it's nto much differance pay the fee to teh car rental to do it for you. It can depend on milleage so find out.

I found the following one on Amazon:

http://www.amazon.co.uk/Swedish-Ice-Scraper-Original-Yellow/dp/B009SKM7Z4

Watch out for the heating and TV in the Hotel room. The heating is usually on full blast and at nighttime I find it hard to sleep so cooling it down as soon as I get in is important. The TV in my room a few times has a large white standby light but for some reason at 3am one morning it started blinking and woke me up - cue towel now to cover it before I go asleep or find a way to turn it off if you've access to the power socket!

My friend is sensitive to noises so the air conditioner is always a problem but I've not found that myself. I was put beside a stairs and there were 4 flags outside on a stormy night so I asked for earplugs and kindly they moved me to a different room. If you are there for the week that can ruin your stay and you've to work the next day so unless they are full keep an eye out for room numbers at the top of the corridoor which can have everyone muttering past your door and the sound of lifts all night! Once you figure out the room numbering you can catch it at checkin or if you're checking in online sometimes certain hotel chains let you choose your own room, just beware, they don't always honour this when you arrive to get your key!

I prefer to check a bag as this means I can keep a small backpack with my valuables, laptop, kindle etc with me and it's very easy to fit it under the seat in front of me. A spare pair of underwear is recommended, Toiletries you can always get from the Hotel or a local Boots if stuck and your bag goes missing. This means during boarding I'm not competing for overhead locker space to save money and can take my time, it makes for a less stressful experience with Ryanair in particular.

Keep your Passport and car hire details to hand with a written address list (customer address and hotel address) until you get familiar with the route. Also keep your security badge if given one handy because if you leave it at home you're stuck for the week with visitor passes, so when you're finished with it, keep it in the backpack or you WILL forget it one week! I've been in one situation where I forgot my passport and only discovered it after approaching security. Cue one fast taxi trip back home! Use a checklist for travelling, put things on it you may forget at the last minute and keep a bag ready packed with basics you can afford to leave it there.

I've started using Hailo for booking Taxis and it's handy as it sends reminders and tells you where the taxi driver is and when they arrive. I can also do the payment in the app so there no cash and no fuss. Working out when to leave the house can be tricky. Too early and you can end up arriving at the boarding gate two hours early. Too late and you find when you arrive there a huge tour group and a sports club with 80 kids in front of you at check-in! I've been to the airport one week and took 10 minutes to drop my bag and get all the way through security, and the next week it takes 40-50 minutes! Watch out for the 30-40 minute closure of check-in desks, even if it's no fault of your own you'll be stuck!

Bring books, bring movies and do a little study if it's not been too crazy a day. Get that fresh air and practice mindfulness. Book an excursion into the West End and see a show to break up the week if you're close to a City where that is an opportunity. Or a football match. Get active, find out if the Hotel has a Gym or access to a local one, or a swimming pool? Use the stairs instead of the lift and walk to the local restaurants if it's safe to do so! Keep in touch with loved ones, email, text often and count teh days down to returning home, there's nothing like coming in the door and putting your bags down when you're arrived!




Sunday, 14 February 2016

DevOps - How do you like your Unicorns, sir?!

DevOps - How do you like your Unicorns, sir?!


I've been hearing a lot about DevOps lately, about the same as I was hearing about Openstack this time last year. I was wondering if all I was hearing was smoke/fud or if I would be impacted by being out of a job soon?! I saw a slide which depicted Developers as the King on the Chessboard and the way it was presented sounded like there was no more need for Operations/Infrastructure people at all. Everything was code.

What triggered a step up in my knowledge was a piece that The Register did on People & DevOps:

http://www.theregister.co.uk/2016/01/15/devops_people_problem/

In particular I found the comments insightful. People were saying it was a load of baloney and with massive legacy systems and approaches, they couldn't see how it would work. I had previously thought DevOps might be all about the Tools - Puppet, Openstack, Chef, Ansible etc. One blogger I've followed for years is Scott Lowe who had moved from a VMware vSphere Guru to someone who is learning all about these tools. I was fascinated about why though. I'm not a Developer and PowerCli is about as far as I go with coding/scripting.

Scott responded to an email I  send him and made a few very good points, mainly that scratch to word DevOps! It's all about the People / People in the Organization and how they communicate, share, and focus on the Business goals/needs/objectives.

One Book mentioned in the article was "The Phoenix Project" and I only got around to reading it last week:

http://itrevolution.com/books/phoenix-project-devops-book/

And.....it rocks!! I was feeling the pain of the fictional IT Manager with catastrophic failures occurring, deadlines, screaming and frustration at every level until they figured out what was happening and eventually straightened out the mess and got "DevOps" in place. Sounds like fairy dust?!! The Authors use the story to take you through the steps, mistakes and achievements each small change the team makes until you see the value of what this is all about. Now, maybe it won't suit many Organizations, or only the most desperate ones! But this is the book that finally made sense to me. I read one or two other books on "DevOps" but like ITIL (!) they bored me to death. A story on the other hand conveys direction, and I recognized things I've faced (and caused!)  in my IT career in the book which was scary!!

So, this led to other research and I found myself reading "The Goal", a 30 year old book about this very thing but focused on a fictional manufacturing plant:

http://www.amazon.co.uk/gp/product/B002LHRM2O

So along with this I started watching videos from last years DevOps conference:


And THAT led me to the 5 best practice guides (well, 4 PDFs, 1 video): 


And of course I check in with The Register once in a while to read the comments:



I've now over 12 more books ordered via Kindle to read and I've a lot to look at - I already knew about Toyota but want to learn more about Lean, Agile, Scrum, Kanban, CI/CD etc that I'd heard mentioned in the books & videos. I think the most important skill is going to be about dealing with the people part of this process so while I need to get familiar with the tools, this is not a quick fix, it's going to be a journey for me that will take a while to understand. 

The videos from the 2015 conference are particularly interesting as one common thread was how this is a grass roots movement started from the ground up in those Organizations. It didn't get buy in from management until much later and the word "DevOps" was used as a curse word by the detractors. But by starting with only a few instigators and a bit of slack time they begin to chip away at the goal, innovate around them, introduce new tools (sometimes without consent!) to show how it actually helps and start proving to the teams around them that it has value. Real metrics, real delivery, real agility. 

I watched the video about Google introducing automated testing in 2005 as the lack of it was strangling their ability to ship good code and there was a real risk of downtime yet it was a handful of Developers who championed it, not management! Check out the toilet training they did! 

Target are the second largest importer in the USA and offshored all their code. DevOps was brought in by a small handful, it was a hard sell but gradually they got successes and started bringing more of their work onshore. They now hold annual DevOps days internally and invite external speakers to keep the momentum going. How about a Lab that invites teams to code for 2-3 days with a mentor sitting with them to show them how to do it better. It's more like a family event than a Business one! 

The biggest light bulb moment I saw was when people declared the value they experienced no more so when it comes from a previous detractor! And boy do they complain when they move jobs and don't use it anymore! 

Interestingly to me: HP also has experience in this area around Printer Firmware:


That's all I bore you with for now! If you're into troubleshooting, improving outcomes, working smarter instead of faster you might find some of the resources above enlightening, even if DevOps is a world away for you right now. I think as more companies embrace it I hope it will improve the working environments of many and force competitors to step up and the wave this creates will put people back at the center of the Organization they are in, instead of a number on a profit / loss sheet. 

Bon Voyage!

P.S. Unicorns are organizations that are new and have embraced DevOps culture form the get-go. Think Netflix etc. Horses refer to older Orgs - watch the great video on Ticketmaster from the conference to see how even "old" dogs are ready for new tricks! 

Saturday, 30 January 2016

Excel use in IT in 12 minutes!!

Excel use in IT in 12 minutes!!


I thought I'd base this post on Excel as from time to time you end up using it in IT. For consultants we generally pull it out when we're doing inventories for Datacenter Moves, or Discoveries among other things, at least on the delivery end.

I've been working on some Excel this week and started thinking about how the file was laid out and as I do, began making some improvements & changes to make life easier for myself. I thought I'd lay out my process here as it might help someone out or give them ideas on how to develop their own Excel knowledge when they have to dive into it.

Now, I'm no Excel expert but as you use it and try to figure things out you pick up a few things. Also helpful is when you get similar collateral from earlier projects from colleagues. So the longer you're in IT the more of this you have to draw on, if you can remember that it A) Exists, and B) Know where to find it!

I was asked to take part in a discovery exercise for a customer. I had two excel files from other projects, neither of which I worked on but had mature & valuable excel file designs. So once sanitized they could be of value, but which to use?!

The first was more basic, formulaes, pivot tables, lots of data and so on. The second used Macros to generate combinations of data and clean itself out when being used elsewhere. Now the Macro one looked much better, the report worksheets were enticing BUT...I don't know Macros. I could have had access to the guy who generated the original on a call but what if I run into difficulty later on? Choice one: Keep it simple. You can spend hours just trying to get something to work or just have it working. My advice - stick to a template you understand because if you don't, you're on your own. This lets you focus on the data and analysis and not to be fighting Excel all the time when you're in over your head!

So, I chose option A and am glad I did. I could still peek into Excel B for inspiration. Macros are just a way to get things done but formulae can get you there too!

I was given multiple data sources - and I needed to collate all the various worksheets to one master one that brought together key pieces of information.

Source #1: Physical inventory from last year. So this is out of date static data but a good start
Source #2: Discovery Tool output. Valid data within the last 24 hours, excellent source but as I'll explain not as easy to use
Source #3: Application Catalog. They want us to link Apps with Servers. Easy? Not so much!
Source #4: Previous Audit done a few years ago for the Datacenter. If not much has changed could be useful. We got lucky even knowing this existed due to a cracking good program manager on the customer side who had been around a long while.

Never under estimate the people issue, if you get a temporary person on the customer side for this kind of task you will probably never even find out that Source #4 or something like it exists making your job 10 times harder. Also we got a lead for paperwork that might show what servers were retired, again gold for mining to bring other data up to date.

At some point you have to cut off the number of data sources; ip ping sweeps, dns lookups etc the list goes on. Try to get at least two good data sources to correlate as one will never be enough. Two gives you better odds at finding the gaps you don't know about or to prompt questions about kit or subnets that may have been missed. Especially if it's behind a Firewall!

I ended up using the discovery data at the main source, and use the physical inventory to validate it. The discovery is not complete and only shows a fraction of the servers I expected but it's work in progress and using a graph to calculate the difference will be valuable when I speak to management about progress etc. So it will take a while for the discovery tool to get everything, also spend time tuning the output rather than doing it in Excel. We're seeing 500 application lines per server which adds up to 100,000's of excel lines and makes filtering there way too slow to be useful. Dirty in, dirty out; clean in, clean out. Get the Discovery people on your side and do the filtering of data on their side! Do you need a list of windows patches or unix device files for every server?!!

Remember, every time they find new servers you may need to reload that worksheet in your Excel file. Or ask them to supply changes ONLY. Ensure any other worksheets that reference the new data are looking at the full list, so if you start with 50 discovered objects, make sure any lookups reference 1000 lines should they end up finding that many. That way you don't need to update your formulae again. Otherwise you might start accidentally excluding new data if it flows beyond earlier guesses.

Now for the Spreadsheet - here are some headings I ended up with:

Index - list of each worksheet and hyperlinks to them with explanation as to what each is for

Goldmine - this is the worksheet where you gather all the data to give you a total view. Call it what you will!

Source #1 - so here I copy the contents of source #1 after trimming out any fat. Now I have a local copy of the data to look up separate to the original source file. This way I can keep all the data contained in my file without having to link to it and risk breaking anything.

Source #2 - see above
Source #3 - etc
Source #4 - etc

Reports - Using the Calculations worksheet I generated the most interesting graphs to me based on the data I had so far plus later ones I would know I'd need and use, even though the data points were empty at that time. I still had to work out the formulae but once done it's easy to edit later.

Calculations - You can do calculations at the end of any worksheet but it gets messy after a bit as the column widths are based on the data and don't suit the analysis. You can simply just cut and paste the calculations however to a central worksheet. This keep the data sources clean and allows you to keep all calculations grouped so now you can even link one to another easily. I didn't start this way but after all my calcs ended up on my physical inventory data source I decided to migrate them elsewhere to keep that source from becoming messed up any further.

List - Used to create pre-populated drop down lists for any of the other worksheets. I'll hide this later.

Save your file often but also create a new file by copying the old one and incrementing the version number. This protects you against data corruption later. It's like an old style backup. Do this every day and keep the last 1 or 2 versions only. Also kick up the latest copy to Sharepoint or some other backed up repository as a safeguard and to share with colleagues.

Most of the formulae I use are simple lookups and countifs statements; count the number of servers running windows, unix etc. I won't delve onto those here but you can use google which is where I learnt most of the tricks I use today. Take the time to learn this yourself and understand how they work as there's no substitute here for experience. Don't always take the first google result either, later Excel versions have better ranges of formulae so you may find more than one way to get what you need that is simpler and faster. This may break however if the customer wants an export to a much older version. Know your audience!

That's all for now. There's lots more you can do of course but mainly be organized. The worst job I ever gave myself was updating a data source line by line and square by square when I didn't think through how I would incorporate future changes! And as always, enjoy!!