Now that I have a server running selenium tests against a magento-powered ecommerce site and logging those tests to a file, we need to integrate with nagios. First, I installed openSSH on that windows server (via copssh), and copied over the nagios user public key to authorized_keys. Then I wrote this nagios script:

#! /usr/bin/php -q
ini_set( 'max_execution_time', '55' );
ini_set( 'display_errors', false );
define( "STATUS_OK",       0 );
define( "STATUS_WARNING",  1 );
define( "STATUS_CRITICAL", 2 );
define( "STATUS_UNKNOWN",  3 );
$execCommand='ssh WINDOWS_SERVER_IP_GOES_HERE -l nagiosremote "tail -n 1 selenium.txt"';
if ((strpos($status,'OK')===false)||(strpos($FLAG,'ERROR')!==false))
        echo("ERROR: $status $FLAG\n");
        exit( STATUS_CRITICAL );
        echo("OK: time $time, status $status, avg $avg, std $std, FLAG $FLAG, flagCnt $flagCnt, statCnt $statCnt\n");
        exit( STATUS_OK );

Then I defined a check_command, a host, a host_group and a service in nagios and we’re in business!