We use AutoIT scripts to pull custom information from our applications and then generate a BBWin report for the linux based Hobbit / Xymon monitoring tool. Use the array $BB_report_array to hold your report values, and the function will format the results to include internal variables for hobbit/xymon.
; Variables
$Date_full = @MON & '/' & @MDAY & '/' & @YEAR & ' ' & @HOUR & ':' & @MIN & ':' & @SEC ; Hobbit Formatted
$BB_status = 'green' ; Default overall error code
$BB_status_message = 'Successful' ; Default error status message
$BB_status_subitem = 'green' ; Default error code for subitem; Set a delay on how often to expect new results
$BB_status_delay = '+24h' ; Delay new results every 24 hours.; Folder
$BB_logfolder = 'c:\Progra~1\BBWin\tmp\'
$BB_executablefolder = 'c:\Progra~1\BBWin\ext\'
$BB_temp = 'c:\Progra~1\BBWin\tmp\task-tmp\'
$BB_report_file = 'report.txt'; Report Array Values
; [x][y] x is the item you want to report on; each item goes on its own line
; [x][0] is for display name
; [x][1] is for variable name -- no spaces, lowercase
; [x][2] is for results; For Example --
; Text that appears on screen in Hobbit
Dim $BB_report_array [5][3]
$BB_report_array[0][0] = 'Calls successfully made'
$BB_report_array[1][0] = 'Calls Answered by Person'
$BB_report_array[2][0] = 'Calls Answered by Answering Machine'
$BB_report_array[3][0] = 'Busy'
$BB_report_array[4][0] = 'Total number of Phone calls to make'; Variable names
$BB_report_array[0][1] = 'successful' ;
$BB_report_array[1][1] = 'answered'
$BB_report_array[2][1] = 'ansmachine'
$BB_report_array[3][1] = 'busy'
$BB_report_array[4][1] = 'totalcalls'
; ...Program goes here...
Func HobbitWrite(); First line of results must be status, (optionally status change delay,) date, then time
; Any lines being used for NCV mappings have to be plain, no HTML code
; Variables should be placed into a HTML COMMENT section for NCV use$BB_report = FileOpen($BB_logfolder & $BB_report_file, 2) ; Open hobbit file
FileWriteLine($BB_report, $BB_status & $BB_status_delay & ' ' & $DATE_full) ; BBWIN info line of Report Status
FileWriteLine($BB_report, '<h3><font color=' & $BB_status & '>' & $BB_status_message & '</font></h3>') ; Status Message
FileWriteLine($BB_report, @CRLF)
FileWriteLine($BB_report, $BB_report_array[4][0] & ': ' & $BB_report_array[4][2]) ; Example -- Total Calls
FileWriteLine($BB_report, @CRLF)
FileWriteLine($BB_report, '<font color=' & $BB_status_subitem & '>' & $BB_report_array[0][0] & ': ' & $BB_report_array[0][2] & '</font>') ; Example -- Successfully called
FileWriteLine($BB_report, @CRLF)
FileWriteLine($BB_report, $BB_report_array[1][0] & ': ' & $BB_report_array[1][2]) ; Example -- Answered
FileWriteLine($BB_report, $BB_report_array[2][0] & ': ' & $BB_report_array[2][2]) ; Example -- Answering Machine
FileWriteLine($BB_report, $BB_report_array[3][0] & ': ' & $BB_report_array[3][2]) ; Example -- BusyFileWriteLine($BB_report, '<!--') ; Varialble Section Start
FileWriteLine($BB_report, $BB_report_array[4][1] & ': ' & $BB_report_array[4][2]) ; Example -- Total Calls
FileWriteLine($BB_report, $BB_report_array[0][1] & ': ' & $BB_report_array[0][2]) ; Example -- Successfully called
FileWriteLine($BB_report, '-->') ; Varialble Section EndFileClose($BB_report) ; Close hobbit file
EndFunc
