コード例 #1
0
ファイル: Config.cs プロジェクト: marians20/ComputersScanner
        public static void Seed(string fileName)
        {
            Config cfg = new Config();
            Kpi    kpi;

            var rpm = new ConfigItem(OperatingSystems.Rpm);

            kpi = new Kpi("Software", "dpkg -l");
            kpi.AddFields(new[] { "Name", "Version", "Architecture", "Description" });
            rpm.AddKpi(kpi);

            cfg.Add(rpm);

            var windows = new ConfigItem(OperatingSystems.Windows);

            kpi = new Kpi("OperatingSystem", "Win32_OperatingSystem");
            kpi.AddFields(new[] {
                "Name", "Manufacturer", "OSArchitecture",
                "SystemDirectory", "Caption"
            });
            windows.AddKpi(kpi);

            kpi = new Kpi("ComputerSystem", "Win32_ComputerSystem");
            kpi.AddFields(new[] {
                "Name", "DNSHostName", "Domain", "Manufacturer",
                "NumberOfLogicalProcessors", "TotalPhysicalMemory"
            });
            windows.AddKpi(kpi);

            kpi = new Kpi("Software", "Win32_Product");
            kpi.AddFields(new[] {
                "Name", "Vendor", "Caption", "Version"
            });
            windows.AddKpi(kpi);

            cfg.Add(windows);

            var aptitude = new ConfigItem(OperatingSystems.Aptitude);

            kpi = new Kpi("Software", "dpkg -l");
            kpi.AddFields(new[] { "Name", "Version", "Architecture", "Description" });
            aptitude.AddKpi(kpi);

            cfg.Add(aptitude);

            cfg.Save(fileName);
        }
コード例 #2
0
ファイル: Config.cs プロジェクト: marians20/ComputersScanner
 public void AddKpi(Kpi kpi)
 {
     Kpis.Add(kpi);
 }