mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Expanded upon Icinga_ProviderWindows.psm1; Minor Changes to other modules regarding structure and comments
This commit is contained in:
parent
a89c85215b
commit
7ca64c27c7
4 changed files with 151 additions and 13 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
<##################################################################################################
|
<##################################################################################################
|
||||||
################# /lib/provider/bios.psm1 #########################################################
|
################# /lib/provider/bios ##############################################################
|
||||||
##################################################################################################>
|
##################################################################################################>
|
||||||
|
|
||||||
[hashtable]$BiosCharacteristics = @{
|
[hashtable]$BiosCharacteristics = @{
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
<##################################################################################################
|
<##################################################################################################
|
||||||
################# /lib/provider/disks.psm1 ########################################################
|
################# /lib/provider/disks #############################################################
|
||||||
##################################################################################################>
|
##################################################################################################>
|
||||||
|
|
||||||
[hashtable]$DiskCapabilities = @{
|
[hashtable]$DiskCapabilities = @{
|
||||||
|
|
@ -91,7 +91,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
<##################################################################################################
|
<##################################################################################################
|
||||||
################# /lib/provider/cpu.psm1 ##########################################################
|
################# /lib/provider/cpu ###############################################################
|
||||||
##################################################################################################>
|
##################################################################################################>
|
||||||
|
|
||||||
[hashtable]$CPUArchitecture = @{
|
[hashtable]$CPUArchitecture = @{
|
||||||
|
|
@ -298,7 +298,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
<##################################################################################################
|
<##################################################################################################
|
||||||
################# /lib/provider/memory.psm1 #######################################################
|
################# /lib/provider/memory ############################################################
|
||||||
##################################################################################################>
|
##################################################################################################>
|
||||||
|
|
||||||
[hashtable]$MemoryFormFactor = @{
|
[hashtable]$MemoryFormFactor = @{
|
||||||
|
|
@ -379,12 +379,104 @@
|
||||||
4096= 'Non-volatile';
|
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 = @{
|
[hashtable]$ProviderEnums = @{
|
||||||
#/lib/provider/bios.psm1
|
#/lib/provider/bios
|
||||||
BiosCharacteristics = $BiosCharacteristics;
|
BiosCharacteristics = $BiosCharacteristics;
|
||||||
#/lib/provider/disks.psm1
|
#/lib/provider/disks
|
||||||
DiskCapabilities = $DiskCapabilities;
|
DiskCapabilities = $DiskCapabilities;
|
||||||
#/lib/provider/cpu.psm1
|
#/lib/provider/cpu
|
||||||
CPUArchitecture = $CPUArchitecture;
|
CPUArchitecture = $CPUArchitecture;
|
||||||
CPUProcessorType = $CPUProcessorType;
|
CPUProcessorType = $CPUProcessorType;
|
||||||
CPUStatusInfo = $CPUStatusInfo;
|
CPUStatusInfo = $CPUStatusInfo;
|
||||||
|
|
@ -392,11 +484,15 @@
|
||||||
CPUConfigManagerErrorCode = $CPUConfigManagerErrorCode;
|
CPUConfigManagerErrorCode = $CPUConfigManagerErrorCode;
|
||||||
CPUAvailability = $CPUAvailability;
|
CPUAvailability = $CPUAvailability;
|
||||||
CPUPowerManagementCapabilities = $CPUPowerManagementCapabilities;
|
CPUPowerManagementCapabilities = $CPUPowerManagementCapabilities;
|
||||||
#/lib/provider/memory.psm1
|
#/lib/provider/memory
|
||||||
MemoryFormFactor = $MemoryFormFactor;
|
MemoryFormFactor = $MemoryFormFactor;
|
||||||
MemoryInterleavePosition = $MemoryInterleavePosition;
|
MemoryInterleavePosition = $MemoryInterleavePosition;
|
||||||
MemoryMemoryType = $MemoryMemoryType;
|
MemoryMemoryType = $MemoryMemoryType;
|
||||||
MemoryTypeDetail = $MemoryTypeDetail;
|
MemoryTypeDetail = $MemoryTypeDetail;
|
||||||
|
#/lib/provider/windows
|
||||||
|
WindowsOSProductSuite = $WindowsOSProductSuite;
|
||||||
|
WindowsProductType = $WindowsProductType;
|
||||||
|
WindowsOSType = $WindowsOSType;
|
||||||
}
|
}
|
||||||
|
|
||||||
Export-ModuleMember -Variable @('ProviderEnums');
|
Export-ModuleMember -Variable @('ProviderEnums');
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
Import-Module $IncludeDir\provider\enums;
|
Import-Module $IncludeDir\provider\enums\Icinga_ProviderEnums;
|
||||||
function Get-IcingaMemory ()
|
function Get-IcingaMemory ()
|
||||||
{
|
{
|
||||||
<# Collects the most important Memory informations,
|
<# Collects the most important Memory informations,
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,42 @@
|
||||||
function Show-IcingaWindowsData()
|
Import-Module $IncludeDir\provider\enums\Icinga_ProviderEnums;
|
||||||
|
|
||||||
|
function Get-IcingaWindows()
|
||||||
{
|
{
|
||||||
$WindowsInformations = Get-CimInstance Win32_OperatingSystem;
|
$WindowsInformations = Get-CimInstance Win32_OperatingSystem;
|
||||||
|
|
||||||
$windows_datails = @{};
|
$windows_datails = @{};
|
||||||
foreach($cpu_core in $WindowsInformations.CimInstanceProperties) {
|
$windows_datails.Add(
|
||||||
$windows_datails.Add($cpu_core.Name, $cpu_core.Value);
|
'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;
|
return $windows_datails;
|
||||||
}
|
}
|
||||||
11
lib/provider/windows/Show-IcingaWindowsData.psm1
Normal file
11
lib/provider/windows/Show-IcingaWindowsData.psm1
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue