Blade ZipKit Package Info
Type: NSH Script
BSA Compatible Version: 8.2.x
More Info: N/A
Created by: richard mcleod
This script will attempt to capture the last reboot time of a host, it was created to work cross-platform (windows/*nix). The script writes the data to a file to be used later*. It is configured to set a server property (LAST_REBOOT_TIME) in BladeLogic showing, you guessed it, the last reboot time of the host. Output formatted as YEAR-MONTH-DAY HOUR:MIN:SECONDS (24hour clock) per Date TYPE on Server property.
Instructions for importing the package:
- Download the attached zip file to your PC.
- Extract the zip file.
- Import the files into your depot using the Depot Import function OR Add a New NSH Script using the file I’ve placed in the ‘individual script’ folder.
- IF you choose to import, it will import to /Depot/Custom_Scripts/last_reboot_time.nsh
- Create a new server property with the following values
- Name: LAST_REBOOT_TIME
- Description: Will report the last reboot time of the server
- Type: Simple – Date
- Editable (checked)
- Used in reports (checked) -- if you want the data to exist in BDSSA
- Right click the depot item you imported earlier, and choose Open, then the Script tab
- Ensure you update Line 15 with a path to your storage //@/something/something/last_reboot_time (The NSH script will attempt to work out of this directory. The @ should allow the file to save on the appserver running the job)
- Check the Parameters tab and ensure there is a parameter called group with the following values
- Name: group
- Accepts Value (checked)
- Value required at runtime (checked)
- Editable (checked)
- Save and Close the depot item
- Right click the Depot Item again and choose NSH Script Job – set up the job with the following values
- Type: 1 using runscript
- Targets: One of your application servers
- Group: /Path/to/SmartGroup/Showing/All Servers/
- Example: /Automation Groups/Last Reboot Time/Available Servers
- Notifications and Schedule at your discretion
If everything is configured correctly you can execute the job and check the job log for progress. Also worth tailing the output file and the error file to ensure its running smoothly. I realize the way the script is setup will cause it run serially which is inefficient but in the past encountered issues with nsh script jobs against large lists of servers, so I’ve started using the paradigm of server group shown in the nsh script. I’ve also created a parallel processor in NSH that I append to the script which lets NSH spawn X amount of threads to run the main code against multiple hosts in parallel, this speeds up NSH scripts immensely but I have not included it in this version of the zipkit.
*Note: This is a community supported package.