diff --git a/lib/provider/enums/Icinga_ProviderEnums.psm1 b/lib/provider/enums/Icinga_ProviderEnums.psm1 index 52faa73..3818cfc 100644 --- a/lib/provider/enums/Icinga_ProviderEnums.psm1 +++ b/lib/provider/enums/Icinga_ProviderEnums.psm1 @@ -1,6 +1,6 @@ <################################################################################################## -################# /lib/provider/bios.psm1 ######################################################### +################# /lib/provider/bios ############################################################## ##################################################################################################> [hashtable]$BiosCharacteristics = @{ @@ -71,7 +71,7 @@ } <################################################################################################## -################# /lib/provider/disks.psm1 ######################################################## +################# /lib/provider/disks ############################################################# ##################################################################################################> [hashtable]$DiskCapabilities = @{ @@ -91,7 +91,7 @@ } <################################################################################################## -################# /lib/provider/cpu.psm1 ########################################################## +################# /lib/provider/cpu ############################################################### ##################################################################################################> [hashtable]$CPUArchitecture = @{ @@ -298,7 +298,7 @@ } <################################################################################################## -################# /lib/provider/memory.psm1 ####################################################### +################# /lib/provider/memory ############################################################ ##################################################################################################> [hashtable]$MemoryFormFactor = @{ @@ -379,12 +379,104 @@ 4096= 'Non-volatile'; } +<################################################################################################## +################# /lib/provider/Windows ########################################################### +##################################################################################################> + +[hashtable]$WindowsOSProductSuite = @{ + 1= 'Microsoft Small Business Server was once installed, but may have been upgraded to another version of Windows.'; + 2= 'Windows Server 2008 Enterprise is installed.'; + 4= 'Windows BackOffice components are installed.'; + 8= 'Communication Server is installed.'; + 16= 'Terminal Services is installed.'; + 32= 'Microsoft Small Business Server is installed with the restrictive client license.'; + 64= 'Windows Embedded is installed.'; + 128= 'Datacenter edition is installed.'; + 256= 'Terminal Services is installed, but only one interactive session is supported.'; + 512= 'Windows Home Edition is installed.'; + 1024= 'Web Server Edition is installed.'; + 8192= 'Storage Server Edition is installed.'; + 16384= 'Compute Cluster Edition is installed.'; +} + +[hashtable]$WindowsProductType = @{ + 1= 'Work Station'; + 2= 'Domain Controller'; + 3= 'Server'; +} + +[hashtable]$WindowsOSType = @{ + 0= 'Unknown'; + 1= 'Other'; + 2= 'MACROS'; + 3= 'ATTUNIX'; + 4= 'DGUX'; + 5= 'DECNT'; + 6= 'Digital Unix'; + 7= 'OpenVMS' + 8= 'HPUX'; + 9= 'AIX'; + 10= 'MVS'; + 11= 'OS400'; + 12= 'OS/2'; + 13= 'JavaVM'; + 14= 'MSDOS'; + 15= 'WIN3x'; + 16= 'WIN95'; + 17= 'WIN98'; + 18= 'WINNT'; + 19= 'WINCE'; + 20= 'NCR3000'; + 21= 'NetWare'; + 22= 'OSF'; + 23= 'DC/OS'; + 24= 'Reliant UNIX'; + 25= 'SCO UnixWare'; + 26= 'SCO OpenServer'; + 27= 'Sequent'; + 28= 'IRIX'; + 29= 'Solaris'; + 30= 'SunOS'; + 31= 'U6000'; + 32= 'ASERIES'; + 33= 'TandemNSK'; + 34= 'TandemNT'; + 35= 'BS2000'; + 36= 'LINUX'; + 37= 'Lynx'; + 38= 'XENIX'; + 39= 'VM/ESA'; + 40= 'Interactive UNIX'; + 41= 'BSDUNIX'; + 42= 'FreeBSD'; + 43= 'NetBSD'; + 44= 'GNU Hurd'; + 45= 'OS9'; + 46= 'MACH Kernel'; + 47= 'Inferno'; + 48= 'QNX'; + 49= 'EPOC'; + 50= 'IxWorks'; + 51= 'VxWorks'; + 52= 'MiNT'; + 53= 'BeOS'; + 54= 'HP MPE'; + 55= 'NextStep'; + 56= 'PalmPilot'; + 57= 'Rhapsody'; + 58= 'Windows 2000'; + 59= 'Dedicated'; + 60= 'OS/390'; + 61= 'VSE'; + 62= 'TPF'; +} + [hashtable]$ProviderEnums = @{ - #/lib/provider/bios.psm1 + #/lib/provider/bios BiosCharacteristics = $BiosCharacteristics; - #/lib/provider/disks.psm1 + #/lib/provider/disks DiskCapabilities = $DiskCapabilities; - #/lib/provider/cpu.psm1 + #/lib/provider/cpu CPUArchitecture = $CPUArchitecture; CPUProcessorType = $CPUProcessorType; CPUStatusInfo = $CPUStatusInfo; @@ -392,11 +484,15 @@ CPUConfigManagerErrorCode = $CPUConfigManagerErrorCode; CPUAvailability = $CPUAvailability; CPUPowerManagementCapabilities = $CPUPowerManagementCapabilities; - #/lib/provider/memory.psm1 + #/lib/provider/memory MemoryFormFactor = $MemoryFormFactor; MemoryInterleavePosition = $MemoryInterleavePosition; MemoryMemoryType = $MemoryMemoryType; MemoryTypeDetail = $MemoryTypeDetail; + #/lib/provider/windows + WindowsOSProductSuite = $WindowsOSProductSuite; + WindowsProductType = $WindowsProductType; + WindowsOSType = $WindowsOSType; } Export-ModuleMember -Variable @('ProviderEnums'); \ No newline at end of file diff --git a/lib/provider/memory/Icinga_ProviderMemory.psm1 b/lib/provider/memory/Icinga_ProviderMemory.psm1 index 2631ae6..cbe0a9c 100644 --- a/lib/provider/memory/Icinga_ProviderMemory.psm1 +++ b/lib/provider/memory/Icinga_ProviderMemory.psm1 @@ -1,4 +1,4 @@ -Import-Module $IncludeDir\provider\enums; +Import-Module $IncludeDir\provider\enums\Icinga_ProviderEnums; function Get-IcingaMemory () { <# Collects the most important Memory informations, diff --git a/lib/provider/windows/Icinga_ProviderWindows.psm1 b/lib/provider/windows/Icinga_ProviderWindows.psm1 index 0d40c7d..068ce6d 100644 --- a/lib/provider/windows/Icinga_ProviderWindows.psm1 +++ b/lib/provider/windows/Icinga_ProviderWindows.psm1 @@ -1,11 +1,42 @@ -function Show-IcingaWindowsData() +Import-Module $IncludeDir\provider\enums\Icinga_ProviderEnums; + +function Get-IcingaWindows() { $WindowsInformations = Get-CimInstance Win32_OperatingSystem; $windows_datails = @{}; - foreach($cpu_core in $WindowsInformations.CimInstanceProperties) { - $windows_datails.Add($cpu_core.Name, $cpu_core.Value); - } + $windows_datails.Add( + 'windows', @{ + 'metadata' = @{ + 'Version' = $WindowsInformations.Version; + 'CurrentTimeZone' = $WindowsInformations.CurrentTimeZone; + 'InstallDate' = $WindowsInformations.InstallDate; + 'SystemDevice' = $WindowsInformations.SystemDevice; + 'SystemDirectory' = $WindowsInformations.SystemDirectory; + 'BuildType' = $WindowsInformations.BuildType; + 'BuildNumber' = $WindowsInformations.BuildNumber; + 'OSArchitecture' = $WindowsInformations.OSArchitecture; + 'NumberOfUsers' = $WindowsInformations.NumberOfUsers; + 'OSType' = @{ + 'raw' = $WindowsInformations.OSType; + 'value' = $ProviderEnums.WindowsOSType[[int]$WindowsInformations.OSType]; + }; + 'OSProductSuite' = @{ + 'raw' = $WindowsInformations.OSProductSuite; + 'value' = $ProviderEnums.WindowsOSProductSuite[[int]$WindowsInformations.OSProductSuite]; + }; + 'ProductType' = @{ + 'raw' = $WindowsInformations.ProductType; + 'value' = $ProviderEnums.WindowsProductType[[int]$WindowsInformations.ProductType]; + }; + }; + 'language' = @{ + 'CountryCode' = $WindowsInformations.CountryCode; + 'OSLanguage' = $WindowsInformations.OSLanguage; + 'Locale' = $WindowsInformations.Locale; + } + } + ); return $windows_datails; } \ No newline at end of file diff --git a/lib/provider/windows/Show-IcingaWindowsData.psm1 b/lib/provider/windows/Show-IcingaWindowsData.psm1 new file mode 100644 index 0000000..0d40c7d --- /dev/null +++ b/lib/provider/windows/Show-IcingaWindowsData.psm1 @@ -0,0 +1,11 @@ +function Show-IcingaWindowsData() +{ + $WindowsInformations = Get-CimInstance Win32_OperatingSystem; + + $windows_datails = @{}; + foreach($cpu_core in $WindowsInformations.CimInstanceProperties) { + $windows_datails.Add($cpu_core.Name, $cpu_core.Value); + } + + return $windows_datails; +} \ No newline at end of file