Archive for August 2014

TSQL: Estimated database restore completion

Here’s a query proving you approximate percentage compeled, and estimated finish time, of any database restores happening on a SQL Server instance… ?View Code TSQLSELECT st.[text], r.percent_complete, DATEADD(SECOND, r.estimated_completion_time/1000, GETDATE()) AS estimated_completion_time, r.total_elapsed_time FROM sys.dm_exec_requests r CROSS APPLY sys.dm_exec_sql_text(r.[sql_handle]) st WHERE [command] = ‘RESTORE DATABASE’; The resultset will look something like below… text percent_complete estimated_completion_time […]

Monitoring fluentd with Nagios

Here’s just a few Nagios command strings you can use to monitor fluentd. I’ve thrown in a check for elasticsearch in case you’re monitoring an EFK system. For checking td-agent. We should have 2 process, parent and child… ?View Code BASH/usr/local/nagios/libexec/check_procs -w 2:2 -C ruby -a td-agent For checking vanilla fluentd. Be aware your version name […]

TSQL: Database Mirroring with Certificates

Here’s some more TSQL for the 70-462 exam. The script shows the actions needed to configure database mirroring using certificates for authentication. Explanatory notes are included but you’re likely to need the training materials for this to make sense. TSQL is not included for the backup/restore parts needed for database mirroring. ?View Code TSQLSELECT * […]