A wrapper for grabbing performance info from Nagios plugin

check_procs is an example for a plugin which doesn’t deliver performance data:

./check_procs -a apache2 -w 1: -c 0:
PROCS OK: 33 processes with args ‘apache2’

This can be changed with the following wrapper script:

#!/bin/bash
LINE=`/usr/local/nagios/libexec/check_procs $*`
RC=$?
COUNT=`echo $LINE | awk '{print $3}'`
echo $LINE \| procs=$COUNT
exit $RC

Now you’ll get the number together with the required label:

PROCS OK: 33 processes with args ‘apache2’| procs=33

SeleniumHQ Server on Nagios/Linux Host

These commands are tailored for a nagios installation.

Starting the selenium rc:

java -jar /usr/local/nagios/libexec/selenium/selenium-server.jar -firefoxProfileTemplate /usr/local/nagios/libexec/selenium/ff_selenium/

Sample nagios check command:

 

./check_selenium com.example.tests.someWebsiteCom http://some.website.com*firefox

Schedule:

Currently, login test is every hour.

TF221161: There are conflicting definitions of the following work item fields in the warehouse

This is the error message in the Application Event Log on tfsserver:

 
Log Name:      Application
Source:        TFS Services
Date:          1/10/2011 2:04:39 PM
Event ID:      3300
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      TFSSERVER
Description:
TF53010: The following error has occurred in a Team Foundation component or extension:
Date (UTC): 1/10/2011 7:04:39 PM
Machine: TFSSERVER
Application Domain: TfsJobAgent.exe
Assembly: Microsoft.TeamFoundation.Framework.Server, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727
Service Host:
Process Details:
  Process Name: TFSJobAgent
  Process Id: 1924
  Thread Id: 7972
  Account name: DOMAIN\TFS_Service

 

Detailed Message:
  Adapter: Microsoft.TeamFoundation.WorkItemTracking.WorkItemTrackingWarehouseAdapter
  Team Project Collection: sitename
TF221161: There are conflicting definitions of the following work item fields in the warehouse: Microsoft.VSTS.Common.BusinessValue<->Microsoft.VSTS.Common.BusinessValue (Direct). These conflicting definitions come from different project collections. Work items from project collection sitename will not be updated until the conflict is resolved. You can resolve the conflict by making the definitions of the field the same in all project collections, or marking the field as non-reportable in the project collection sitename. For more information, see the Microsoft Web site (http://go.microsoft.com/fwlink/?LinkId=160807).
Event Xml:
<Event xmlns=”http://schemas.microsoft.com/win/2004/08/events/event“>
  <System>
    <Provider Name=”TFS Services” />
    <EventID Qualifiers=”0″>3300</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime=”2011-01-10T19:04:39.000000000Z” />
    <EventRecordID>23554</EventRecordID>
    <Channel>Application</Channel>
    <Computer>TFSSERVER.DOMAIN.local</Computer>
    <Security />
  </System>
  <EventData>
    <Data>TF53010: The following error has occurred in a Team Foundation component or extension:
Date (UTC): 1/10/2011 7:04:39 PM
Machine: TFSSERVER
Application Domain: TfsJobAgent.exe
Assembly: Microsoft.TeamFoundation.Framework.Server, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727
Service Host:
Process Details:
  Process Name: TFSJobAgent
  Process Id: 1924
  Thread Id: 7972
  Account name: DOMAIN\svcTFS_Service
Detailed Message:
  Adapter: Microsoft.TeamFoundation.WorkItemTracking.WorkItemTrackingWarehouseAdapter
  Team Project Collection: ewholesale
TF221161: There are conflicting definitions of the following work item fields in the warehouse: Microsoft.VSTS.Common.BusinessValue&lt;-&gt;Microsoft.VSTS.Common.BusinessValue (Direct). These conflicting definitions come from different project collections. Work items from project collection ewholesale will not be updated until the conflict is resolved. You can resolve the conflict by making the definitions of the field the same in all project collections, or marking the field as non-reportable in the project collection ewholesale. For more information, see the Microsoft Web site (http://go.microsoft.com/fwlink/?LinkId=160807).</Data>
  </EventData>
</Event>

​ Following this document on MSDN:

http://msdn.microsoft.com/library/ee921480(VS.100).aspx

Open the VS command prompt and run the following:

witadmin listfields /collection:http://xxxxxx:8080/tfs/sitename

Installing RiaServices on a Server

Visual Studio and the Silverlight SDK are two dependancies that are needed for the installation of RiaServices. If you are dep[loying this package to a server with IIS7.5, these dependancies do not need to be installed. To install RiaServices.msi on the server, use the following command:

 

msiexec /i RiaServices.msi SERVER=TRUE

Inserting client-ip into IIS Logs

Since the IIS instances are behind load balancers, the load balancer IP is inserted as the client-ip. To work around this, an IIS module is needed that replaces the client-ip value with the correct value. This is acomplished with two changes. First, the ACE must inject a speacial header value. In this case the header value is X-Client-IP. Second, the arr_helper module has to be installed and configured to replace the client-ip value with the correct value.

The module can be found here:

http://blogs.iis.net/anilr/archive/2009/03/03/client-ip-not-logged-on-content-server-when-using-arr.aspx

The module is installed in:

%PROGRAMFILES%\IIS\ARR Helper\​

The configuration is located in:

%windir%\system32\inetsrv\config\schema\arr_helper_schema.xml

nagios-check-webpage

This is a ruby script that can download a web page. Source here:

http://code.google.com/p/nagios-check-webpage/

Installation:

Prerequisites:

apt-get install ruby rubygems

gem update

apt-get install ruby1.8-dev

gem install hpricot

apt-get install libopenssl-ruby

 

Nagios Check Command:

define command{
        command_name    check-webpage
        command_line    $USER1$/check_webpage.rb -u $HOSTADDRESS$$ARG1$
        }

Uptime and SLA Breakdown

If it’s up…​ A.K.A​ It’s down for…per year​
90%​ n/a​ 876 hours​
95%​ n/a​ 438 hours​
99%​ two 9’s​ 87 hours, 36 minutes​
99.9%​ three 9’s​ 8 hours, 45 minutes​
99.99%​ four 9’s​ 52 minutes, 33.6 seconds​
99.999%​ five 9’s​ 5 minutes, 15.36 seconds​
99.9999%​ six 9’s​ 31.68 seconds