Home » Articles posted by Anders Bengtsson (Page 46)
Author Archives: Anders Bengtsson
Monitor if a share is accessible
This script will check if a file in a share is accessible, if not, it will generate a local event.
strFile = "\\ntlcs\share\file_check.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strFile) Then
Else
  Const EVENT_WARNING = 2
   Set objShell = CreateObject("Wscript.Shell")
   objShell.LogEvent 2, strFile & " is not accessible."
End If
- Create a new script and paste the script
- Create a new event rule to run the script every X minute as respond
- Create a new event rule to collect event ID 2 and event type of Warning
- Commit configuration change
Monitor file and directory size
This script will monitor file and directory size. It will generate performance data back to the management server. You can view this information under performance view in Operators Console or/and in reports. This first example will monitor the size C:\pagefile.sys
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("c:\pagefile.sys")
CreatePerfData "File","File Size",objFile.Path,objFile.SizeSub CreatePerfData(strObjectName,strCounterName,strInstanceName,numValue)
   Set objPerfData = ScriptContext.CreatePerfData
   objPerfData.ObjectName = strObjectName
   objPerfData.CounterName =strCounterName
   objPerfData.InstanceName = strInstanceName
   objPerfData.Value = numValue
   ScriptContext.Submit objPerfData
End Sub
This example will monitor the size of all subfolders under C:\Â
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\")
Set colSubfolders = objFolder.Subfolders
For Each objSubfolder in colSubfolders
CreatePerfData "File","File Size",objSubfolder.Path,objSubfolder.Size
Next
Sub CreatePerfData(strObjectName,strCounterName,strInstanceName,numValue)
                  Set objPerfData = ScriptContext.CreatePerfData
                  objPerfData.ObjectName = strObjectName
                  objPerfData.CounterName =strCounterName
                  objPerfData.InstanceName = strInstanceName
                  objPerfData.Value = numValue
                  ScriptContext.Submit objPerfData
End Sub
- Insert the script as a new script in Administrator Console
- Create a event rule that run the script every X minute
- Commit configuration change and wait until the script has run
- Open Operator Console, click performance, click you server and choose your new FILE performance objects, click draw graph
There is a guide about how to create performance data reports at momresources.org
Monitor recovery mode
This script will check recovery mode of a MS SQL database. Its pretty simple to modify to check other databases or all databases. This example will check if the Onepoint database is running with SIMPLE recovery mode. If it does, a local event will be generated. You can then create a event rule to collect that event and generate an alert in MOM.
set cn = Nothing
set rs = nothingstrSQLServer = "localhost"
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=" & strSQLServer & ""
strSQLQuery = "select name, databasepropertyex(name, 'recovery') as RECOVERY from sysdatabases WHERE NAME = 'OnePoint'"
Set rs = cn.execute(strSQLQuery)
strDBName = rs("Name")
strMode = rs("Recovery")
If strMode = "SIMPLE" then
 Const EVENT_WARNING = 2
 Set objShell = CreateObject("Wscript.Shell")
 objShell.LogEvent 2, "The " & strDBName & " database is running in simple recovery mode"
End If
- Create a new script and paste this source
- Create a rule that run the script every X minute
- Create a rule that collects and generate alerts on event ID 2 from WSH in the application log.
Updated OpsMgr 2007 Documentation and Active Directory MP
- Defect: AD MP for Windows Server 2000/2003 – local discovery of the Domain Controller fails if targeted DC is using a non-US date/time/number format
- Defect: AD MP for Windows Server 2000 (all locales – under certain conditions)
Documentation
- How to cluster the root management server – The following procedures show how to install Operations Manager 2007 Root Management Servers on a Windows cluster
- Operations Manager 2007 Quick Start Guide – The Quick Start Guide is designed to help you quickly deploy Operations Manager 2007 for evaluation purposes in a test environment.
http://connect.microsoft.com/systemcenterÂ
Â
Â
Â
Microsoft System Center “Service Deskâ€
I run into the Microsoft System Center “Service Desk†timeframe on a wepage
- Beta1: December 2006 (TAP is running)
- Beta 2: end of April 2007
- RC: beginning of July 2007
- RTM: December 2007
There will be a public beta around March 2007 (according to the rumor) Â
There are a couple of screenshots at this and this page. You can find more information about “Automating IT Service Management with System Center” here
FAQ
I have notice a couple of common questions in newsgroups and forums this week.
Rule that will alert you if process X use more that Y % Processor Time
In this example I will montor if iexplorer (Internet Explorer) takes more that 1 % processor time. Maybe not a very common scenario, but it will work to show you how to setup this for other processes and thresholds.
First we need to create a new provider to collect the performance counter, and then an alert that will compare performance data and generates an alert.Â
- Create a new provider in MOM 2005 Administrator Console
Computer: or
Object: Process (use “advanced” to enable this dropdown menu)
Counter %Processor Time
Instance: iexplorer (you might need to start that process before it shows up in the list) - Create a new performance rule to compare performance data (threshold
Provider:
Schedule: Always process data
Criteria: Leave default values
Threshold: “Match when the threshold meet the following condition:” “greater than the following value: 1”
Alert: Generate alert
Alert suppression: Leave default settings
Response: None
Knowledge Base: Optional
General: Input a name and verify that the rule is enabledÂ
That should do it. Note that it can take a couple of minutes before the new rule is active.
Â
How do I see all members of a computer group?
- Start Operator Console
- Click public views
- Click computer groups
- Right-click a computer group and choose view -> computers
Â
Â
Â
New MOM KB articles
Some KBs published during decemberÂ
The SystemCenterDTSPackageTask scheduled task is not completed successfully on a computer that is running MOM 2005 Reporting
http://support.microsoft.com/kb/929390
The MOM agent or the MOM server does not start, and event 9029 is logged in Microsoft Operations Manager 2005
http://support.microsoft.com/kb/883347/en-us
The MOM 2005 service does not start on a MOM Management Server
http://support.microsoft.com/kb/904746/en-us
From SYSLOG to MOM
Admittedly a couple of months old KB article, but I think most of you have some Linux box running with out monitoring.
HOWTO: Configure Microsoft Operation Manager 2000 or 2005 to monitor Unix devices by using Syslog
ADAM Management Pack
Quest has released a free management pack for ADAM.
In summary, the MP provides the following capabilities:
– monitoring the services that ADAM itself is critically dependant on
– monitoring the health of ADAM including replication, LDAP, net logon service, intersite messaging, Windows time service, the key distribution center(KDC)
– collection of critical performance data
– provides replication and topology diagrams
– provides diagnostics
– detect critical events and create alerts to prevent and correct possible ADAM outages
You can download it here
Recent Comments