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
"From man's sweat and God's love, beer came into the world."
One of the reasons I created a blog was to post info that Iearned over the years from other websites in one easy location so that people would learn from me as well. This next bit of info definitely falls into that category.
The Libretto 50CT will kernel panic if you try to boot it into Linux. That's because the laptop does not report the right size of it's memory and then Linux tries to use an area that's not there. In order to prevent this from happening you need to add mem=16m (or 32m if you added the extra memory module) to your append line. I tried this with Damn Small Linux, and it worked perfectly.
Another issue with the 50CT is that it will 16-32MB of your hard drive space when it hibernates. This only becomes a problem if you take the drive out and create a new partition for the drive elsewhere. So f you decide to create the partition outside of the Libretto, you need to make sure that you leave 16 or 32MB of empty, unpartitioned space at the END of the drive.
You're going to need a thumbdrive of at least 8GB to do this.
1. Under Windows or Linux, Use Unetbootin to create a bootable thumb drive from your DRBL-Live ISO file
http://unetbootin.sourceforge.net/, http://drbl.sourceforge.net/download/sourceforge/
2. Under Windows or Linux, make a new folder in the root of your thumbdrive called images (ex. F:\images). Copy your Clonezilla image folder into this folder. Remember since this will be under Linux, your folder names should be made with lowercase characters and no spaces to prevent issues.
If you don't have an image yet, you can just make the folder and later you can add the image into it.
3. This next step is easier to deal with in Linux; boot from your DRBL-LIVE CD and plug in your thumbdrive. If you create this file under Windows, you will need to make sure that
you save it in a UNIX (no CR/LF) format or use dos2unix to convert the file (ex - dos2unix /live/image/images/clonezilla-usbmount.sh).
.
In the \images folder, create a file called clonezilla-usbmount.sh. Add the following lines:
# This file is to mount the CD/USB drive's IMAGES folder for cloning use
# This version is intending to be used with the boot option ocs_prerun="bash /live/image/images/clonezilla-usbmount.sh"
# NOTE: This file MUST be in UNIX format; it will error out otherwise# Wipe screen for easier visibility
clear# CD/USB is already mounted as /live, so bind image directory to /home/partimag
echo " "
echo "Mounting CD/USB IMAGES folder dynamically..."
mount --bind /live/image/images /home/partimag
echo " "# Show just mounted folder
mount | grep partimagecho " "
echo " "
echo "Remember to choose SKIP when asked to set up /HOME/PARTIMAG"
read -p "Press any key to continue..."
4. Open the syslinux.cfg file in the root of the thumbdrive, and look for the first ubnentry_ section; it should look like this:
label ubnentry0
menu label DRBL Live
kernel /live/vmlinuz1
append initrd=/live/initrd1.img boot=live union=aufs noprompt vga=785 squashfs ip=frommedia
5. Copy that first section and paste right after it leaving a blank line between the two... This will be your new second section. Change the first line to label ubentry0a. Add the following to the end of the append line:
ocs_prerun="bash /live/image/images/clonezilla-usbmount.sh"
Change the menu label line to read a more appropriate message, so that finally your section looks like this:
label ubnentry0a
menu label DRBL Live with Image-On-USB Support
kernel /live/vmlinuz1
append initrd=/live/initrd1.img boot=live union=aufs noprompt vga=785 squashfs ip=frommedia ocs_prerun="bash /live/image/images/clonezilla-usbmount.sh"
Note -- The append line is a long line that ends with ocs_prerun="bash /live/image/images/clonezilla-usbmount.sh".
6. Save the file and reboot, making sure that you have turned on USB support in the BIOS. Choose the option that shows our USB support and then during the boot process you will eventually see a screen pop up showing you that your image folder was mounted.
When you actually go to push/pull an image, you will need to choose the SKIP option when CloneZilla asks you how to mount your /home/partimag folder, since the script above will mount it for you.
If you don't already have an image on your thumbdrive, you will have to boot the thumb drive into RAM mode in order to dump one onto it. Then, instead of choosing SKIP at the /home/partimag mount screen, choose LOCAL DEV and point CloneZilla to your USB drive's \images folder.
Not impressive. Light malt flavor.
