Registered member login:
Register Now
Altirigos » Notification Server and Solutions » Monitor Solution » Creating WMI in Monitor solution

» Current Poll
Vista?
Staying on XP until Windows 7 - 72.03%
103 Votes
Already on Vista - 10.49%
15 Votes
Planning an upgrade to Vista soon - 10.49%
15 Votes
Other (please explain) - 6.99%
10 Votes
Total Votes: 143
You may not vote on this poll.
» Stats
Members: 6,845
Threads: 9,785
Posts: 47,850
Top Poster: Nick (4,800)
Welcome our newest member, suresh
» Online Users: 45
7 members and 38 guests
damadi, jebba, madj42, MikeCusick, skakid, stewfo, stncldmk
Most users online at once 294, 06-30-2007 at 01:24 PM.
» January 2009
S M T W T F S
28293031 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Reply
Old 02-05-2008, 07:02 PM   #1 (permalink)
 
Status: Altiris Admin
Join Date: 08-25-2005
Location: Houston, TX
Posts: 52


Creating WMI in Monitor solution

We are trying to monitor a file for when the file was last modified and alert us if the file has not changed in the last 5 minutes. We are having problems creating the WMI call in a monitor pack to do this for us. Does anyone know or have screen shots of the process and format to create a new WMI call in a new monitoring policy for when a file was last modified or a different way to achieve the same result?
Michael Guilbeaux is offline   Reply With Quote
Old 02-06-2008, 02:21 PM   #2 (permalink)
 
TRYDL's Avatar
 
Status: Super Altiris Admin
Join Date: 03-08-2006
Location: Baltimore, MD
Age: 28
Posts: 307


The below should be able to get a good chunk of your results. I got positive results when I ran this in a test environment.

1) You start off with a new WMI metric. I generally change the polling interval to every 60 seconds for the sake of system performance. The Property settings are as follows:

Namespace: \\.\root\cimv2
Class name: CIM_DataFile
Counter: LastAccessed
Instance: Name="C:\\Dell\\Test\\Test.txt"
Data type: String

Notice the double back slashes. You need to use escape characters when using back slashes in a WQL statement. So if you were reading this, it would be "Select LastAccessed from CIM_DataFile Where Name='C:\\Dell\\Test\\Test.txt'"

I then placed the above new metric into a monitor category with a new category just for testing. No need for detection rules I suppose. Though you probably could do one for file exists.

The policy comes down, the metric is added to those who are monitored, then the blobs are uploaded to the NS based on whatever interval you have set.

Using the following SQL, I was able to get the below results.

Quote:
SELECT
SUBSTRING (REPLACE (ml.Instance, '\\', '\'), CHARINDEX ('=',ml.instance)+1, LEN (ml.instance))
AS 'File Looked For',
CASE
WHEN ml.Value = '' THEN NULL
WHEN SUBSTRING(ml.Value,11,1) = 'T' THEN CONVERT(DATETIME,ml.Value,126)
ELSE CONVERT(DATETIME,SUBSTRING(ml.Value,1,4) + '-' +
SUBSTRING(ml.Value,5,2) + '-' + SUBSTRING(ml.Value,7,2) + 'T' +
SUBSTRING(ml.Value,9,2) + ':' + SUBSTRING(ml.Value,11,2) + ':' +
SUBSTRING(ml.Value,13,2), 126)
END AS 'File Last Modified'
FROM dbo.MonitorMetricLog ml
JOIN dbo.AeXSMMasterMetrics mm
ON mm.Guid = ml.MetricGuid
WHERE mm.[Name] = 'The Name of Your newly created metric'
Results:

"c:\dell\test\test.txt" 2008-02-06 11:18:43.000
"c:\dell\test\test.txt" 2008-02-06 11:28:26.000
"c:\dell\test\test.txt" 2008-02-06 11:33:12.000
"c:\dell\test\test.txt" 2008-02-06 11:39:25.000

HTH
TRYDL is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -4. The time now is 09:46 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
vB.Sponsors
Altirigos