@ Override public void internalWrite ( Server server , Query query , ImmutableList < Result > results ) throws Exception { checkFile ( query ) ; List < String > typeNames = getTypeNames ( ) ; for ( Result result : results ) { String [ ] keyString = KeyUtils . getKeyString ( server , query , result , typeNames , null ) . split ( "\\." ) ; if ( isNumeric ( result . getValue ( ) ) && filters . contains ( keyString [ 2 ] ) ) { int thresholdPos = filters . indexOf ( keyString [ 2 ] ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "[" ) ; sb . append ( result . getEpoch ( ) ) ; sb . append ( "] PROCESS_SERVICE_CHECK_RESULT;" ) ; sb . append ( nagiosHost ) ; sb . append ( ";" ) ; if ( prefix != null ) { sb . append ( prefix ) ; } sb . append ( keyString [ 2 ] ) ; if ( suffix != null ) { sb . append ( suffix ) ; } sb . append ( ";" ) ; sb . append ( nagiosCheckValue ( result . getValue ( ) . toString ( ) , thresholds . get ( thresholdPos ) ) ) ; sb . append ( ";" ) ; //Missing the performance information logger . info ( sb . toString ( ) ) ; } } }
The meat of the output . Nagios format ..