Recent Posts

Check a process cpu and memory with Nagios

A check plugin for Nagios to monitor processes and their utilization of system resources. https://github.com/thomasweaver/check_cpu_proc This plugin takes in a process name and then uses the command ps to work out how much memory and cpu all the processes of that name are taking up in percentage. It will output performance data for CPU Usage Percentage, Memory Usage Percentage, VSZ, RSS and the number of processes of that name.

Create RRD of requests per second from W3c log

Analysing your Web Server logs be it apache or IIS can be a big task and one well suited for tool such as awstats. Awstats gives you a good overall view of traffic and stats for your site but a stat I always want to look at is requests per second as it has a direct correlation to CPU usage etc. This will give you a more granular view of traffic and is especially useful for capacity management when it comes to API’s.

C++ Eclipse and CURL libraries

I’ve been working on a new C++ project with Eclipse and the CURL libraries and have been getting an undefined reference error. I use Eclipse for all my IDE needs and combined with Eclipse CDT it is great for C++ projects. Whilst testing out the CURL libraries for my new project I encounter a problem with CURL and Eclipse and the g++ linker. When building the project you may get the following errors complaining about an undefined reference:

Nagios Varnish performance plugin

Varnish is a web application accelerator and sits in front of your web server. It speeds up your application by caching some, if not all of the content meaning it reduces the load on your web server and can reduce the load on you backend as less lookups will be needed by the frontend. As varnish is the first thing users hit it is imperative it is working properly and you have statistics on how it is performing.

WCF services and multiple bindings IIS

When you have mutlitple bindings in IIS and have a WCF Service defined you may get the bellow error: “This collection already containes an address with scheme http. There can be at most one address per scheme in this collection.” This happens when you have mutlitple bindings on the IIS Web Site i.e. HTTP and HTTPS. If you have .NET 4.0 installed and are on Server 2008 or later you can add a directive to your web.

Backup Cisco config with Rancid and an unprivileged user

RANCID is a tool for backing up network devices configuration and versioning the backups. It was originally intended to backup Cisco configurations it does this by logging in to the devices using either telnet or ssh and then runs a series of commands. In a default set up it runs multiple commands and captures the output of each command, we don’t need all this information infact we only want to store the configuration and so we only need to grant the user one command “show running-config”.

F5 LTM virtual server Nagios health performance check

A plugin for nagios to check the state of virtual servers on an LTM as well as creating Performance Data output on the amount of connections to each Virtual Server. The plugin is written in PHP and uses SNMP to gather the statuses of each Virtual Server. The plugin currently only supports SNMPv2 and has been tested on Big-IP 10.2 only but should work with other version of Big-IP.

Linux behind NTLM authentication proxy using CNTLM

Sometimes you will find your server sat behind a proxy designed for human traffic rather than server traffic and so requires authentication. Although the NTLM protocol is grossly insecure it still seems to used in a lot of proxies. To get your server to download updates you will need to make your server play nice with this authentication as a lot of software does not support the NTLM protocol. CNTLM solves this issue by adding another proxy layer in front of your software which does not require authentication.

Nagios HP MSA P2000 status and performance monitor

This script is intended to be used with Nagios to monitor a HP P2000 SAN. Below is a description and the file can be downloaded here: All versions can be found here: https://github.com/thomasweaver/check_p2000_api Version 1.2 allowing input of username and password. Great thanks to Jon Witts who added the code which can be found here http://pastebin.com/T1DMYJbu# or download zip below Version 1.3 Adds an extra check to the status check.

Upgrading Cisco switches with K9 image

I recently had to install a new HP c7000 chassis with 16 half height blades. This came with 4 Cisco 3020’s switches in the back, 2 for normal network traffic and 2 for the iSCSI fabric. This was to be placed in a PCI environment and so had to meet PCI requirements. PCI DSS states: 2.3 Encrypt all non-console administrative access using strong cryptography. Use technologies such as SSH, VPN, or SSL/TLS for web-based management and other non-console administrative access So we need to encrypt the management access to the switches, by default the Cisco IOS doesn’t support SSH or HTTPS Encryption.