the Only part that needs to be coded is the conversion of the query to html
Created html report from output
1. add title and date
2. add columns to report
3. add output rows to html table
4. If LastBackupFailed column contains 1 then highlight row in red to indicate failure
5. if BackupStartTime = NULL highlight row in yellow to indicate a warning to check database for backup
6. Save HTML file
Convert sql query output to html
Query
`isql -Usa -Pmy_sa_password_goes_here <<EOF
select @@servername, DBName, BackupInProgress, LastBackupFailed, BackupStartTime, LastTranLogDumpTime
from master, monopendatabase
go
EOF`
Column Names
Server Name DBName, BackupInProgress, LastBackupFailed, BackupStartTime, LastTranLogDumpTime from master, monopendatabase
Output of query
Server1 master 0 0 Feb 17 2013 5:01PM NULL
Server1 sybsystemdb 0 0 NULL NULL
Server1 model 0 0 Feb 17 2013 5:01PM NULL
Server1 tempdb 0 0 NULL NULL
Server1 sybsecurity 0 0 NULL NULL
Server1 sybsystemprocs 0 0 Feb 17 2013 5:02PM NULL
Server1 twist_t_tables2 0 0 Feb 17 2013 6:28PM NULL
Server1 twist_hist 0 0 Feb 17 2013 5:58PM Feb 18 2013 2:15PM
Server1 twist_cswrkr_nts_txt 0 0 Feb 17 2013 5:48PM Feb 18 2013 2:30PM
Server1 twist_t_tables 0 0 Feb 17 2013 6:13PM NULL
Server1 ChangeRequest 0 0 Feb 17 2013 6:14PM NULL
Server1 h_twist 0 0 Feb 17 2013 6:14PM NULL
Server1 twist 0 0 Feb 17 2013 5:02PM Feb 18 2013 2:30PM
Server1 tpcs 0 0 Feb 17 2013 5:00PM Feb 18 2013 2:45PM
Server1 au_arch 0 0 NULL NULL
Server1 cc_broker 0 0 Feb 17 2013 6:29PM Feb 18 2013 2:30PM
Server1 cc_conv 0 0 NULL NULL
Server1 sybpcidb 0 0 NULL NULL
HTML Report Structure
Report Title: Database Backup Report
Date of Report Date Report Run:Current Date
Columns in HTML Table
Server Name DBName, BackupInProgress, LastBackupFailed, BackupStartTime, LastTranLogDumpTime from monopendatabase
Hi,
I have experience in shell scripting and i periodically write this kind of scripts to send email reports. I just have to change the column headings and adjust to your color preference. I can take this up and finish it in few hours.
$30 USD in 1 day
5.0 (1 review)
1.4
1.4
3 freelancers are bidding on average $30 USD for this job