| vanessa's profilesensory overloadBlogListsNetwork | Help |
|
5/17/2009 Another returning pleasure
When I got all excited after my previous post telling my husband which of our favourite shows were returning, he asked about the one show that has really grabbed him and that was sadly not on the list, Dexter (mostly because there were no Showtime shows on the list). From what we could previously see, the future of Dexter was in the balance, but I did a bit of googling last night, and it would seem the scales tipped the right way, because, thank goodness, Dexter is returning.
Note: Cross posted from electric bunnies. Permalink 5/16/2009 Fall TV cheat sheet: What's in? What's out?
ABC CBS FOX NBC The CW
Note: Cross posted from electric bunnies. Permalink SpocknessYour results: You are Spock
5/2/2009 Darth Vader Toaster | GeekAlertsI wants one!!!!
5/1/2009 SCOM 2007: Quick and dirty agent health check scriptWe used a script in our MOM environment to notify us on an hourly basis of agents that have not reported in x amount of time. I modified this script this week for SCOM. The script retrieves the agents from the database that are marked as not available by SCOM, and then pings each of them. The ping status is included in the email. Option Explicit Const strMOMSQLServer = "" Const strMOMAdminEmail = "" Const StrFromEmail = "" Const strMailServer = "" Const strMailUser = "" Const strMailPass = "" Const strCustomer = "" Dim objMsg Dim objConf Dim objFlds Dim dataconn Dim rs Dim strBody Dim n Dim strPingStatus Dim objWMIService Dim colPings Dim objPing Dim strAgent Dim strIPAddress Dim colAttrib Dim colGroups set objMsg = CreateObject("CDO.Message") set objConf = CreateObject("CDO.Configuration") Set objFlds = objConf.Fields With objFlds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strMailServer .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = strMailUser .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = strMailPass .Update End With Set dataconn = CreateObject("ADODB.Connection") dataconn.Open "Provider=SQLNCLI;Server=" & strMOMSQLServer & ";Database=OperationsManager;Trusted_Connection=yes;" Set rs = dataconn.execute("SELECT BaseManagedEntity.Path, MT_Computer.NetworkName, MT_Computer.IPAddress, BaseManagedEntity.IsManaged," & _ "ManagedEntityAvailabilityView.IsAvailable, ManagedEntityAvailabilityView.AvailabilityLastModified " & _ "FROM BaseManagedEntity INNER JOIN MT_Computer ON BaseManagedEntity.BaseManagedEntityId = MT_Computer.BaseManagedEntityId " & _ "INNER JOIN ManagedEntityAvailabilityView ON BaseManagedEntity.BaseManagedEntityId = ManagedEntityAvailabilityView.BaseManagedEntityId " & _ "WHERE (BaseManagedEntity.IsManaged = 1) and (IsAvailable = 0) and (IPAddress is not null) " & _ "order by AvailabilityLastModified asc") strBody = "<p>The following agents have not reported in the past hour:</p>"& VbCrLf strBody = strBody & "<table border=""3"" bordercolor=""2A8588""><Caption><b><u>Daily Agent Health Check</b></u></Caption><tr><td><b>Server Name</b></td><td><b>Last contact</b></td><td><b>Ping Status</b></td></tr>"& VbCrLf n = 0 do while Not rs.eof strAgent = rs("NetworkName") strIPAddress = rs("IPAddress") PingStatus(strAgent) strBody = strBody & "<tr><td>" & strAgent & vbTab & "</td><td>" & rs("AvailabilityLastModified") & vbTab & "</td><td>" & strPingStatus & vbTab & "</td></tr>" & VbCrLf n = n + 1 rs.movenext Loop strBody = strBody & "<tr><td colspan=3 align=right><b>Total: "& n &"</b></td></tr></table>" With objMsg Set .Configuration = objConf .To = strMOMAdminEmail .From = StrFromEmail .Subject = strCustomer & " - Server Health check - " & Date() .HTMLBody = strBody .Fields.update .Send End With set dataconn = Nothing set objConf = Nothing set objMsg = Nothing Function PingStatus(strAgent) Set objWMIService = Nothing Set colPings = Nothing Set objPing = Nothing strPingStatus = "Unreachable" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\.\root\cimv2") Set colPings = objWMIService.ExecQuery _ ("SELECT * FROM Win32_PingStatus WHERE Address = '" & strIPAddress & "'") For Each objPing in colPings Select Case objPing.StatusCode Case 0 strPingStatus = "Replied" Exit For Case Else strPingStatus = "<font color=""red"">Unreachable</a>" End Select Next Set objWMIService = Nothing Set colPings = Nothing Set objPing = Nothing End Function Update the following:
And, as always, no real commenting, so feel free to leave a comment should something not make sense. And if you have a better solution, please let me know! Note: Cross posted from electric bunnies. Permalink SCOM 2007 - Quick and dirty disk space scriptI wrote this script recently to extract the percentage free disk space on all servers in a SCOM environment, and email it. set dataconn = CreateObject("ADODB.Connection") dataconn.Open "Provider=SQLNCLI;Server=<SCOM Server>;Database=OperationsManagerDW;Trusted_Connection=yes;" set objMsg = CreateObject("CDO.Message") set objConf = CreateObject("CDO.Configuration") Set objFlds = objConf.Fields With objFlds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "<mail server>" .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "<mail user>" .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "<mail pass>" .Update End With set rs = dataconn.execute("SELECT TOP (100) PERCENT Perf.vPerfDaily.DateTime, vManagedEntity.Path, dbo.vPerformanceRule.CounterName, " & _ "vPerformanceRuleInstance.InstanceName, Perf.vPerfDaily.MaxValue " & _ "FROM Perf.vPerfDaily INNER JOIN vManagedEntity ON Perf.vPerfDaily.ManagedEntityRowId = vManagedEntity.ManagedEntityRowId INNER JOIN " & _ "vPerformanceRuleInstance ON Perf.vPerfDaily.PerformanceRuleInstanceRowId = vPerformanceRuleInstance.PerformanceRuleInstanceRowId INNER JOIN " & _ "vPerformanceRule ON vPerformanceRuleInstance.RuleRowId = vPerformanceRule.RuleRowId WHERE (NOT (dbo.vManagedEntity.Path = N'nul')) " & _ "AND (Perf.vPerfDaily.DateTime = (SELECT MAX(DateTime) AS Expr1 FROM Perf.vPerfDaily AS vPerfDaily_1)) " & _ "AND (vPerformanceRule.ObjectName LIKE N'%logical%') AND (vPerformanceRule.CounterName LIKE N'% Free Space') " & _ "ORDER BY vManagedEntity.Path") if rs.eof then else strBody = "<p><font face=""Arial"" size=""1"">Percentage free space in environment.</font></p>"& vbCRLF strBody = strBody & "<table cellpadding=""1"" cellspacing=""0"" border=""0"" bordercolor=""#C0C0C0"">" & vbCRLF do while not rs.eof if not rs("path") = strComputer then strComputer = rs("path") strBody = strBody & "<tr><td colspan=""3"" bgcolor=""#C0C0C0""><font face=""Arial"" size=""1""><b>" & strComputer &"</b></font></td></tr>" & vbCRLF end if strDrive = rs("instancename") intValue = CInt(rs("maxvalue")) If intValue < 10 Then strValue = "<font face=""Arial"" size=""1"" color=""red""><b>" & intValue &"%</b></font>" Else strValue = "<font face=""Arial"" size=""1"" color=""black""><b>" & intValue &"%</b></font>" End if strBody = strBody & "<tr><td valign=""top""></td><td valign=""top""><font face=""Arial"" size=""1"">" & StrDrive & "</font></td>" & vbCRLF strBody = strBody & "<td valign=""top"">"& strValue &"</td>" & vbCRLF rs.movenext Loop strBody = strBody & "</table>" With objMsg Set .Configuration = objConf .To = "<email addresses, comma seperated>" .From = "<from address>" .Subject = "Daily Report - Disk space - " & Date() .HTMLBody = strBody .Fields.update .Send End With end if dataconn.close Update the fields between the <> and save as a .vbs file. Not a very elegant solution, but far quicker than having to configure the disk space report in SCOM reporting. And, as always, I suck at commenting, so feel free to leave a comment if you get stuck. SQL query was refined using a bored colleague at work with some time to bash through the DB and the following sources:
Note: Cross posted from electric bunnies. Permalink |
|
|