Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from master #3

Merged
merged 42 commits into from
Oct 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
65ce90e
Adjusting to take file time attribute as parameter
stegenfeldt Mar 21, 2017
a9860f6
FileTime PoSH Probe action added.
stegenfeldt Mar 21, 2017
57ca925
PropertyBag and Discovery scripts done
stegenfeldt Mar 28, 2017
fb54bbf
FileAge folder class added
stegenfeldt Mar 28, 2017
f14d445
FileAge probe action added
stegenfeldt Mar 28, 2017
50791a5
Various compile-time additions
stegenfeldt Mar 28, 2017
3ace5d0
File Age TimedPropertyBag DS created
stegenfeldt Mar 28, 2017
51f9c66
FileAge monitor type added
stegenfeldt Mar 28, 2017
f50f2a6
Discovery (Probe, DS, Discovery) and Monitor created. Builds OK, read…
stegenfeldt Mar 28, 2017
a651789
Installer file updated
stegenfeldt Mar 28, 2017
fd8d820
Fixed a few bugs in FileAgeMonitor
stegenfeldt Mar 28, 2017
18bd7ff
Updated Install-Script, no longer using msi files
stegenfeldt Apr 4, 2017
416aff4
Rebuild for testing of new file mp
stegenfeldt Apr 4, 2017
ca41be4
Fixed a few path issues and some verbose loggings
stegenfeldt Apr 4, 2017
b3befb6
Merge remote-tracking branch 'refs/remotes/origin/develop'
stegenfeldt Apr 4, 2017
9979abb
Updated changelog accordingly
stegenfeldt Apr 4, 2017
c58eb61
Merge pull request #23 from stegenfeldt/feature/file-update-time
stegenfeldt Apr 4, 2017
b9f8f24
Small fix to monitor description
stegenfeldt Apr 4, 2017
03e78f9
Minimised a bit of clutter
stegenfeldt Apr 4, 2017
8eb318a
Fixed a few displaystrings
stegenfeldt Apr 4, 2017
bf96abd
File Age Monitor is fully operational
stegenfeldt Apr 4, 2017
2848b7f
Replaced a few aliases
stegenfeldt Apr 4, 2017
772840d
Merge pull request #24 from stegenfeldt/feature/file-update-time
stegenfeldt Apr 4, 2017
8340672
Updating build configuration to be msbuild compatible
stegenfeldt Apr 4, 2017
c8bcbb0
Script signing script added and script signed.
stegenfeldt Apr 6, 2017
e9c5999
FAM example added
stegenfeldt Apr 6, 2017
366a91b
fixed a few tabs
stegenfeldt Apr 11, 2017
6d2f95f
Fixed a few missing ""
stegenfeldt Jun 26, 2017
43a7610
Update CHANGELOG.md
stegenfeldt Jun 26, 2017
7952a22
Check for empty ServiceUser. Fixes #26.
Aug 29, 2017
886b2d8
Merge pull request #27 from svantegraden/develop
stegenfeldt Sep 5, 2017
e980f4a
Rebuild after merge to fix #26
stegenfeldt Sep 5, 2017
51cbaa7
Merge pull request #1 from stegenfeldt/develop
svantegraden Nov 30, 2017
386443b
Added newline in summaryMessage.
Mar 14, 2018
1154918
Corrected parameter in AlertDescription.
Mar 14, 2018
d3a030f
Implemented support for OnDemandDetection.
Mar 14, 2018
3a4b317
Merge pull request #28 from svantegraden/develop
stegenfeldt Jun 6, 2018
4b866b6
Added ConditionDetection for OnDemandDetection.
Jun 21, 2018
e035f9e
Merge pull request #29 from svantegraden/develop
stegenfeldt Oct 1, 2018
b6fb98e
tiny formatting fix
stegenfeldt Oct 1, 2018
cd31ead
Merge pull request #30 from stegenfeldt/develop
stegenfeldt Oct 1, 2018
5c97c85
DevOps Pipelines added to project to track build status. (#33)
stegenfeldt Oct 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,5 @@ ModelManifest.xml
/Atea.Windows.Server.Monitoring/AteaST.snk
/Atea.Windows.Service.Monitoring/AteaST.snk
/AteaST.snk
VisualStudioAuthoringConsole_x64.msi
_Scripts/VisualStudioAuthoringConsole_x64.msi
34 changes: 33 additions & 1 deletion Atea.Windows.File.Monitoring/Atea.Windows.File.Monitoring.mpproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,16 @@
<Compile Include="HealthModel\Discoveries\FCTFolderDiscovery.mpx">
<SubType>Code</SubType>
</Compile>
<Compile Include="HealthModel\Discoveries\FileAgeFolderDiscovery.mpx">
<SubType>Code</SubType>
</Compile>
<Compile Include="HealthModel\Discoveries\FileMonitoringSeedDiscovery.mpx">
<SubType>Code</SubType>
</Compile>
<Compile Include="HealthModel\Monitors\FileAge.mptg.mpx">
<SubType>Code</SubType>
<DependentUpon>HealthModel\Monitors\FileAge.mptg</DependentUpon>
</Compile>
<Compile Include="HealthModel\Rules\FCTFolderAlertRule.mpx">
<SubType>Code</SubType>
</Compile>
Expand All @@ -67,6 +74,9 @@
<Compile Include="ManagementPack.mpx">
<SubType>Code</SubType>
</Compile>
<Compile Include="ServiceModel\Classes\FileAgeFolder.mpx">
<SubType>Code</SubType>
</Compile>
<Compile Include="ServiceModel\Classes\FileCreationTimeFolder.mpx">
<SubType>Code</SubType>
</Compile>
Expand All @@ -79,12 +89,27 @@
<Compile Include="TypeLibrary\ModuleTypes\DataSources\FCTMonitoringPropertyBagDS.mpx">
<SubType>Code</SubType>
</Compile>
<Compile Include="TypeLibrary\ModuleTypes\DataSources\FileAgeFolderDiscoveryDS.mpx">
<SubType>Code</SubType>
</Compile>
<Compile Include="TypeLibrary\ModuleTypes\DataSources\FileAgePropertyBagDS.mpx">
<SubType>Code</SubType>
</Compile>
<Compile Include="TypeLibrary\ModuleTypes\ProbeActions\FCTpsFolderDiscoveryProbe.mpx">
<SubType>Code</SubType>
</Compile>
<Compile Include="TypeLibrary\ModuleTypes\ProbeActions\FCTvbsPropertyBagProbe.mpx">
<SubType>Code</SubType>
</Compile>
<Compile Include="TypeLibrary\ModuleTypes\ProbeActions\FileAgeFolderDiscoveryProbe.mpx">
<SubType>Code</SubType>
</Compile>
<Compile Include="TypeLibrary\ModuleTypes\ProbeActions\FileAgePoSHProbe.mpx">
<SubType>Code</SubType>
</Compile>
<Compile Include="TypeLibrary\MonitorTypes\FileAgeMonitoryType.mpx">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="HealthModel" />
Expand All @@ -106,9 +131,16 @@
<Folder Include="TypeLibrary\ModuleTypes" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Scripts\AteaFCTPSPropertyBag.ps1" />
<EmbeddedResource Include="Scripts\FileAgePB.ps1" />
<EmbeddedResource Include="Scripts\AteaFileCreationTimePoSHDiscovery.ps1" />
<EmbeddedResource Include="Scripts\FCTvbsPropertyBag.vbs" />
<EmbeddedResource Include="Scripts\FileAgePoSHDiscovery.ps1" />
</ItemGroup>
<ItemGroup>
<Content Include="HealthModel\Monitors\FileAge.mptg">
<SubType>Content</SubType>
<Generator>FragmentGenerator</Generator>
</Content>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<ManagementPackFragment SchemaVersion="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Monitoring>
<Discoveries>
<Discovery ID="Atea.Windows.File.FileAgeFolder.Discovery" Enabled="true" Target="Atea.Windows.File.Monitoring.Seed" ConfirmDelivery="true" Remotable="false" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Atea.Windows.File.FileAgeFolder" />
</DiscoveryTypes>
<DataSource ID="DiscoveryDS" TypeID="Atea.Windows.File.FileAgeFolder.DiscoveryDS">
<MPElement>$MPElement$</MPElement>
<TargetID>$Target/Id$</TargetID>
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</ComputerName>
<IntervalSeconds>14400</IntervalSeconds>
</DataSource>
</Discovery>
</Discoveries>
</Monitoring>
<LanguagePacks>
<LanguagePack ID="ENU" IsDefault="true">
<DisplayStrings>
<DisplayString ElementID="Atea.Windows.File.FileAgeFolder.Discovery">
<Name>Atea FileAge Folder Discovery</Name>
</DisplayString>
</DisplayStrings>
</LanguagePack>
</LanguagePacks>
</ManagementPackFragment>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<PathType>0</PathType>
<AttributeType>0</AttributeType>
</RegistryAttributeDefinition>
<RegistryAttributeDefinition>
<AttributeName>FAgeKeyExist</AttributeName>
<Path>SOFTWARE\Atea\FileAgeMonitoring</Path>
<PathType>0</PathType>
<AttributeType>0</AttributeType>
</RegistryAttributeDefinition>
</RegistryAttributeDefinitions>
<Frequency>14400</Frequency>
<ClassId>$MPElement[Name="Atea.Windows.File.Monitoring.Seed"]$</ClassId>
Expand All @@ -27,15 +33,30 @@
</Settings>
</InstanceSettings>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Values/FCKeyExist</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">true</Value>
</ValueExpression>
</SimpleExpression>
<Or>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Values/FCKeyExist</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">true</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Values/FAgeKeyExist</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">true</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</Or>
</Expression>
</DataSource>
</Discovery>
Expand Down
41 changes: 41 additions & 0 deletions Atea.Windows.File.Monitoring/HealthModel/Monitors/FileAge.mptg
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<TemplateGroup>
<Instances>
<Instance ID="Instance1cb8bbbf42bb4bd8ba0ce5a2d4aaa2da" Type="Microsoft.SystemCenter.Authoring.CodeGeneration.Monitoring.UnitMonitor" Version="1.0.0.0">
<UnitMonitorConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MonitorType>Windows.File.FileAge.MonitorType</MonitorType>
<MonitorConfig>&lt;TimeoutSeconds&gt;300&lt;/TimeoutSeconds&gt;&lt;IntervalSeconds&gt;300&lt;/IntervalSeconds&gt;&lt;FolderFriendlyName&gt;$Target/Property[Type="Atea.Windows.File.FileAgeFolder"]/FriendlyName$&lt;/FolderFriendlyName&gt;&lt;FileAgeAttribute&gt;$Target/Property[Type="Atea.Windows.File.FileAgeFolder"]/FileAgeAttribute$&lt;/FileAgeAttribute&gt;</MonitorConfig>
<MonitorOperationalStates>
<OperationalState>
<OperationalStateId>Healthy</OperationalStateId>
<OperationalStateDisplayName>No Files Found</OperationalStateDisplayName>
<MonitorTypeStateId>Healthy</MonitorTypeStateId>
<HealthState>Success</HealthState>
</OperationalState>
<OperationalState>
<OperationalStateId>Error</OperationalStateId>
<OperationalStateDisplayName>Bad Files Found</OperationalStateDisplayName>
<MonitorTypeStateId>Error</MonitorTypeStateId>
<HealthState>Error</HealthState>
</OperationalState>
</MonitorOperationalStates>
<ParentMonitor>Health!System.Health.AvailabilityState</ParentMonitor>
<Accessibility>Public</Accessibility>
<Id>FileAgeMonitor</Id>
<DisplayName>File Age Monitor</DisplayName>
<Description>This monitor will look for files in a folder, recursively if configured so, and alert if one of more files are found.</Description>
<Target>Atea.Windows.File.FileAgeFolder</Target>
<Enabled>true</Enabled>
<Category>AvailabilityHealth</Category>
<Remotable>true</Remotable>
<Priority>Normal</Priority>
<AlertAutoResolve>true</AlertAutoResolve>
<AlertOnState>Error</AlertOnState>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertName>Files with bad timestamp found</AlertName>
<AlertDescription>$Data/Context/Property[@Name="Summary"]$</AlertDescription>
<ConfirmDelivery>false</ConfirmDelivery>
</UnitMonitorConfig>
</Instance>
</Instances>
</TemplateGroup>
Binary file not shown.
69 changes: 0 additions & 69 deletions Atea.Windows.File.Monitoring/Scripts/AteaFCTPSPropertyBag.ps1

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ param([string]$sourceId, [string]$managedEntityId, [string]$computerName)

$RegistryPath = "hklm:\Software\Atea\FileCreationTime\"
$SubKeys = Get-ChildItem $RegistryPath
$OpsmgrAPI = New-Object -ComObject "MOM.ScriptAPI"
#$OpsmgrAPI.LogScriptEvent("AteaFilCreationPoSHDiscovery.ps1", 242, 4, "Running File Creation Folder discovery with parameters $sourceId, $managedEntityId, $computerName")
$discoveryData = $OpsmgrAPI.CreateDiscoveryData(0, $sourceId, $managedEntityId)
$omApi = New-Object -ComObject "MOM.ScriptAPI"
#$omApi.LogScriptEvent("AteaFilCreationPoSHDiscovery.ps1", 242, 4, "Running File Creation Folder discovery with parameters $sourceId, $managedEntityId, $computerName")
$discoveryData = $omApi.CreateDiscoveryData(0, $sourceId, $managedEntityId)
ForEach ($SubKey in $SubKeys)
{
$FriendlyName = ($SubKey.Name.Substring($SubKey.Name.LastIndexOfAny("\")+1))
Expand All @@ -18,12 +18,12 @@ ForEach ($SubKey in $SubKeys)
$FilePattern = $SubKey.GetValue("FilePattern")
$AgeInMinutes = $SubKey.GetValue("AgeInMinutes")
$Operator = $SubKey.GetValue("Operator")


if (($FolderPath -ne $null) -and ($Recursive -ne $null) -and ($FilePattern -ne $null) -and ($AgeInMinutes -ne $null) -and ($Operator -ne $null))
{
$Operator = $Operator.Trim()

#Add values to property bag for Discovery
$discoveryInstance = $discoveryData.CreateClassInstance("$MPElement[Name='Atea.Windows.File.FileCreationTimeFolder']$")
$discoveryInstance.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", $computerName)
Expand Down
Loading