Stand ende Semester 4

This commit is contained in:
Francesco 2018-12-10 17:16:40 +01:00
parent 7638c2a388
commit 3ef0209676
21 changed files with 1133 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonitoringClient", "MonitoringClient\MonitoringClient.csproj", "{ED6D9A70-6FBD-44A8-AA32-EAC5892C84B6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ED6D9A70-6FBD-44A8-AA32-EAC5892C84B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED6D9A70-6FBD-44A8-AA32-EAC5892C84B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED6D9A70-6FBD-44A8-AA32-EAC5892C84B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED6D9A70-6FBD-44A8-AA32-EAC5892C84B6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,181 @@
namespace MonitoringClient {
partial class Form1 {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.txtConnectionString = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.btnLogClear = new System.Windows.Forms.Button();
this.btnLoadData = new System.Windows.Forms.Button();
this.lsvLogEntries = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.SuspendLayout();
//
// txtConnectionString
//
this.txtConnectionString.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtConnectionString.Location = new System.Drawing.Point(131, 6);
this.txtConnectionString.Name = "txtConnectionString";
this.txtConnectionString.Size = new System.Drawing.Size(429, 20);
this.txtConnectionString.TabIndex = 0;
this.txtConnectionString.Text = "Server=localhost;Database=inventory;Uid=root;Pwd=;";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(113, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Datenbankverbindung";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 43);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(117, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Unquitierte Logeinträge";
//
// btnLogClear
//
this.btnLogClear.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnLogClear.Location = new System.Drawing.Point(13, 226);
this.btnLogClear.Name = "btnLogClear";
this.btnLogClear.Size = new System.Drawing.Size(547, 23);
this.btnLogClear.TabIndex = 4;
this.btnLogClear.Text = "markierte Einträge quittieren";
this.btnLogClear.UseVisualStyleBackColor = true;
this.btnLogClear.Click += new System.EventHandler(this.btnLogClear_Click);
//
// btnLoadData
//
this.btnLoadData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnLoadData.Location = new System.Drawing.Point(131, 38);
this.btnLoadData.Name = "btnLoadData";
this.btnLoadData.Size = new System.Drawing.Size(429, 23);
this.btnLoadData.TabIndex = 5;
this.btnLoadData.Text = "Daten laden";
this.btnLoadData.UseVisualStyleBackColor = true;
this.btnLoadData.Click += new System.EventHandler(this.btnLoadData_Click);
//
// lsvLogEntries
//
this.lsvLogEntries.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lsvLogEntries.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2,
this.columnHeader3,
this.columnHeader4,
this.columnHeader5,
this.columnHeader6,
this.columnHeader7});
this.lsvLogEntries.FullRowSelect = true;
this.lsvLogEntries.GridLines = true;
this.lsvLogEntries.HideSelection = false;
this.lsvLogEntries.Location = new System.Drawing.Point(15, 67);
this.lsvLogEntries.Name = "lsvLogEntries";
this.lsvLogEntries.Size = new System.Drawing.Size(545, 153);
this.lsvLogEntries.TabIndex = 6;
this.lsvLogEntries.UseCompatibleStateImageBehavior = false;
this.lsvLogEntries.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
this.columnHeader1.Text = "Id";
//
// columnHeader2
//
this.columnHeader2.Text = "POD";
//
// columnHeader3
//
this.columnHeader3.Text = "Location";
//
// columnHeader4
//
this.columnHeader4.Text = "Hostname";
//
// columnHeader5
//
this.columnHeader5.Text = "Severity";
//
// columnHeader6
//
this.columnHeader6.Text = "Timestamp";
//
// columnHeader7
//
this.columnHeader7.Text = "Message";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(572, 261);
this.Controls.Add(this.lsvLogEntries);
this.Controls.Add(this.btnLoadData);
this.Controls.Add(this.btnLogClear);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtConnectionString);
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Monitoring";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox txtConnectionString;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnLogClear;
private System.Windows.Forms.Button btnLoadData;
private System.Windows.Forms.ListView lsvLogEntries;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.ColumnHeader columnHeader5;
private System.Windows.Forms.ColumnHeader columnHeader6;
private System.Windows.Forms.ColumnHeader columnHeader7;
}
}

View File

@ -0,0 +1,67 @@
using System;
using System.Data;
using System.Windows.Forms;
using MonitoringClient.Properties;
using MySql.Data.MySqlClient;
namespace MonitoringClient {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
if (!string.IsNullOrWhiteSpace(Settings.Default.ConnectionString)) {
this.txtConnectionString.Text = Settings.Default.ConnectionString;
}
}
private void btnLoadData_Click(object sender, EventArgs e) {
try {
this.LoadData();
} catch (Exception ex) {
MessageBox.Show("Es ist ein Fehler aufgetreten: " + ex.Message);
}
}
private void LoadData() {
this.lsvLogEntries.Items.Clear();
using (var conn = new MySqlConnection(this.txtConnectionString.Text)) {
conn.Open();
using (var cmd = conn.CreateCommand()) {
cmd.CommandText = "select id, pod, location, hostname, severity, timestamp, message from v_logentries order by timestamp";
using (var reader = cmd.ExecuteReader()) {
while (reader.Read()) {
var item = lsvLogEntries.Items.Add(reader.GetValue(0).ToString());
for (var i = 1; i < 7; i++) {
var data = reader.GetValue(i);
item.SubItems.Add((data == null ? "" : data.ToString()));
}
}
}
}
}
}
private void btnLogClear_Click(object sender, EventArgs e) {
try {
using (var conn = new MySqlConnection(this.txtConnectionString.Text)) {
conn.Open();
foreach (ListViewItem row in this.lsvLogEntries.SelectedItems) {
using (var cmd = conn.CreateCommand()) {
cmd.CommandText = "LogClear";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Id", Convert.ToInt32(row.SubItems[0].Text));
cmd.ExecuteNonQuery();
}
}
}
this.LoadData();
} catch (Exception ex) {
MessageBox.Show("Es ist ein Fehler aufgetreten: " + ex.Message);
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
Settings.Default.ConnectionString = this.txtConnectionString.Text;
Settings.Default.Save();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{ED6D9A70-6FBD-44A8-AA32-EAC5892C84B6}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MonitoringClient</RootNamespace>
<AssemblyName>MonitoringClient</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MySql.Data, Version=6.9.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Lib\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace MonitoringClient {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MonitoringClient")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MonitoringClient")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("14248963-362d-42d5-b0ed-4188a7511e36")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MonitoringClient.Properties {
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MonitoringClient.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,38 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MonitoringClient.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string ConnectionString {
get {
return ((string)(this["ConnectionString"]));
}
set {
this["ConnectionString"] = value;
}
}
}
}

View File

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="MonitoringClient.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="ConnectionString" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="MonitoringClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<MonitoringClient.Properties.Settings>
<setting name="ConnectionString" serializeAs="String">
<value />
</setting>
</MonitoringClient.Properties.Settings>
</userSettings>
</configuration>

202
MySQL/Skript_DDL.sql Normal file
View File

@ -0,0 +1,202 @@
DROP DATABASE IF EXISTS inventarisierungsloesung;
CREATE DATABASE IF NOT EXISTS Inventarisierungsloesung
CHARACTER SET utf8;
USE Inventarisierungsloesung;
CREATE TABLE IF NOT EXISTS Town (
town_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
zip INT UNSIGNED NOT NULL,
town VARCHAR(100));
CREATE TABLE IF NOT EXISTS Address (
address_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
town_fk INT UNSIGNED NOT NULL,
streetname VARCHAR(100) NOT NULL,
streetnumber VARCHAR(25) NOT NULL,
country VARCHAR(45) NOT NULL,
additive VARCHAR(45),
po_Box INT UNSIGNED,
FOREIGN KEY (town_fk) REFERENCES Town(town_id)ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS Person (
person_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
firstname VARCHAR(45) NOT NULL,
lastname VARCHAR(45) NOT NULL);
CREATE Table IF NOT EXISTS Kundenkonto (
kundenkonto_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT);
CREATE Table IF NOT EXISTS Customer (
person_fk INT UNSIGNED NOT NULL,
address_fk INT UNSIGNED NOT NULL,
kundenkonto_fk INT UNSIGNED NOT NULL,
tel VARCHAR(20),
eMail VARCHAR(30),
url VARCHAR(30),
FOREIGN KEY (person_fk) REFERENCES Person(Person_id) ON DELETE CASCADE,
FOREIGN KEY (address_fk) REFERENCES Address(address_id) ON DELETE CASCADE,
FOREIGN KEY (kundenkonto_fk) REFERENCES Kundenkonto(kundenkonto_id) ON DELETE CASCADE);
CREATE TABLE IF NOT EXISTS Location (
location_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
address_fk INT UNSIGNED NOT NULL,
designation VARCHAR(45) NOT NULL,
building INT UNSIGNED NOT NULL,
room INT UNSIGNED NOT NULL,
FOREIGN KEY (address_fk) REFERENCES Address(address_id)ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS Contact (
contact_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
person_fk INT UNSIGNED NOT NULL,
priority ENUM('First Priority','Second Priority','Emergency Contact') NOT NULL,
FOREIGN KEY (person_fk) REFERENCES Person(person_id)ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS PointOfDelivery (
pod_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
customer_person_fk INT UNSIGNED NOT NULL,
contact_person_fk INT UNSIGNED NOT NULL,
location_fk INT UNSIGNED NOT NULL,
designation VARCHAR(45),
timezone TIME NOT NULL,
timeZonePositiv TINYINT NOT NULL,
ntpServerIp VARCHAR(20),
FOREIGN KEY (`customer_person_fk`) REFERENCES `customer`(`person_fk`)ON DELETE CASCADE,
FOREIGN KEY (`contact_person_fk`) REFERENCES `contact`(`contact_id`)ON DELETE CASCADE,
FOREIGN KEY (`location_fk`) REFERENCES `location`(`location_id`) ON DELETE CASCADE
);
CREATE Table IF NOT EXISTS DevicesTypes (
deviceTypes_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
manifacture VARCHAR(255) NOT NULL,
model VARCHAR(255) NOT NULL,
version VARCHAR(255) NOT NULL,
PRIMARY KEY(deviceTypes_id)
);
CREATE Table IF NOT EXISTS Devices (
device_id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
location_fk INT UNSIGNED NOT NULL,
deviceTypes_fk INT UNSIGNED NOT NULL,
inventoryDate DATE NOT NULL,
deactivateDate DATE NOT NULL,
hostname VARCHAR(255),
domain VARCHAR(255),
description VARCHAR(255),
FOREIGN KEY (location_fk) REFERENCES Location(location_id) ON DELETE CASCADE,
FOREIGN KEY (deviceTypes_fk) REFERENCES DevicesTypes(deviceTypes_id) ON DELETE CASCADE
);
CREATE Table IF NOT EXISTS Operatingsystem (
operatingsystem_id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
operatingsystemName VARCHAR(255) NOT NULL,
model VARCHAR(255) NOT NULL,
version VARCHAR(255)
);
CREATE Table IF NOT EXISTS DevicesTypes_has_operatingsystem (
deviceTypes_fk INT UNSIGNED NOT NULL,
operatingsystem_fk INT UNSIGNED NOT NULL,
PRIMARY KEY(deviceTypes_fk,operatingsystem_fk),
FOREIGN KEY (deviceTypes_fk) REFERENCES DevicesTypes(deviceTypes_id) ON DELETE CASCADE,
FOREIGN KEY (operatingsystem_fk) REFERENCES Operatingsystem(operatingsystem_id) ON DELETE CASCADE
);
CREATE Table IF NOT EXISTS Log (
log_id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
device_fk INT UNSIGNED NOT NULL,
timestamp DATETIME NOT NULL,
logMessage VARCHAR(255) NOT NULL,
level ENUM('Low','Middle','High') NOT NULL,
FOREIGN KEY (device_fk) REFERENCES Devices(device_id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS Network (
network_id INT NOT NULL AUTO_INCREMENT,
subnet VARCHAR(15) NOT NULL,
mask VARCHAR(15) NOT NULL,
vlan INT NOT NULL DEFAULT 1,
description VARCHAR(255) NULL,
PRIMARY KEY (network_id));
CREATE TABLE IF NOT EXISTS DeviceTypes (
deviceTypes_id INT NOT NULL AUTO_INCREMENT,
manifacturer VARCHAR(255) NOT NULL,
model VARCHAR(255) NOT NULL,
version VARCHAR(255) NULL,
PRIMARY KEY (deviceTypes_id)
);
CREATE TABLE IF NOT EXISTS Credentials (
credentials_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
benutzername VARCHAR(255) NOT NULL,
passwort VARCHAR(255) NOT NULL,
snmp VARCHAR(255) NOT NULL,
PRIMARY KEY (credentials_id)
);
CREATE TABLE IF NOT EXISTS Interfaces (
interface_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
network_id_fk INT NOT NULL,
devices_id_fk INT UNSIGNED NOT NULL,
ip_adress_v4 VARCHAR(15) NOT NULL,
isFullDuplex BIT(1) NOT NULL DEFAULT 1,
bandwith INT NULL,
description VARCHAR(255) NULL,
PRIMARY KEY (interface_id),
FOREIGN KEY (network_id_fk) REFERENCES Network (network_id)ON DELETE CASCADE,
FOREIGN KEY (devices_id_fk) REFERENCES Devices (device_id)ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS Abrechnung (
abrechnung_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
kundenkonto_fk INT UNSIGNED NOT NULL,
location_fk INT UNSIGNED NOT NULL,
device_fk INT UNSIGNED NOT NULL,
interface_fk INT UNSIGNED NOT NULL,
PRIMARY KEY (abrechnung_id),
FOREIGN KEY (kundenkonto_fk) REFERENCES Kundenkonto (kundenkonto_id)ON DELETE CASCADE,
FOREIGN KEY (location_fk) REFERENCES Location (location_id)ON DELETE CASCADE,
FOREIGN KEY (device_fk) REFERENCES Devices (device_id)ON DELETE CASCADE,
FOREIGN KEY (interface_fk) REFERENCES Interfaces (interface_id)ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS SoftwareDienstleistung (
software_id INT NOT NULL AUTO_INCREMENT,
stundenaufwand INT NOT NULL,
abrechung_fk INT UNSIGNED NOT NULL,
PRIMARY KEY (software_id),
Foreign Key (abrechung_fk) REFERENCES Abrechnung(abrechnung_id) ON DELETE CASCADE);
CREATE TABLE IF NOT EXISTS Produktegruppe (
produktegruppe_id INT NOT NULL AUTO_INCREMENT,
hardware VARCHAR(255),
software VARCHAR(255),
sonstigeArtikel VARCHAR(255),
abrechung_fk INT UNSIGNED NOT NULL,
PRIMARY KEY (produktegruppe_id),
Foreign Key (abrechung_fk) REFERENCES Abrechnung(abrechnung_id)ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS Produkte (
artikelnummer_id INT NOT NULL AUTO_INCREMENT,
artikelname VARCHAR(255) NOT NULL,
preis FLOAT NOT NULL,
produktegruppe_fk INT NOT NULL,
PRIMARY KEY (artikelnummer_id),
Foreign Key (produktegruppe_fk) REFERENCES Produktegruppe(produktegruppe_id)ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS Devices_has_Credentials (
devices_devices_id INT UNSIGNED NOT NULL,
credentials_credentials_id INT UNSIGNED NOT NULL,
PRIMARY KEY (devices_devices_id, credentials_credentials_id),
FOREIGN KEY (devices_devices_id) REFERENCES Devices (device_id) ON DELETE CASCADE,
FOREIGN KEY (credentials_credentials_id) REFERENCES Credentials (credentials_id) ON DELETE CASCADE
);

155
MySQL/Skript_DML.sql Normal file
View File

@ -0,0 +1,155 @@
USE inventarisierungsloesung;
INSERT INTO town(zip, town)
VALUES
('9043', 'Trogen'),
('9999', 'Hobbingen'),
('9000', 'St. Gallen'),
('6000', 'Luzern'),
('8400', 'Winterthur');
INSERT INTO address(town_fk, streetname, streetnumber, country, additive, po_box)
VALUES
(2,'Auenlandstrasse','5b','Auenland', 'Postkasten ist hinter Höhle' , null),
(1,'Befang','5','Schweiz', null , null),
(3,'Zürcherstrasse','300C','Schweiz', null , '203'),
(4,'Löwenstrasse','26','Schweiz', null , '100'),
(5,'Rudolfstrasse','17A','Schweiz', null , '100'),
(3,'Langgass','35A','Schweiz', null , null);
INSERT INTO person(firstname, lastname)
VALUES
('Nina','Schmid'),
('Bilbo','Beutlin'),
('Patrick','Keist'),
('Larissa', 'Fitze'),
('Francesco' , 'Rauseo'),
('Ronny','Wyss'),
('Max','Muster');
INSERT INTO kundenkonto(kundenkonto_id)
VALUES
(1),(2),(3),(4),(5),(6),(7),(8);
INSERT INTO customer(person_fk, address_fk, kundenkonto_fk, tel, eMail, url)
VALUES
(1, 2, 3, '079 666 20 14', 'nina.schmid@test.ch','www.nina.ch'),
(2, 1, 1, 'Dose mit Schnur', 'bilbo@auenland.xx',null),
(3, 3, 2, '078 878 90 43', 'p.keist@hotmail.com',null),
(6, 4, 4, '077 777 77 77', 'ronny@wyss.ch',null);
INSERT INTO contact( person_fk, priority)
VALUES
(2,3),
(1,2),
(3,1),
(4,2),
(5,1);
INSERT INTO location( address_fk, designation, building, room)
VALUES
(1, 'Vertriebszentrum Tabak', 2, 4),
(2, 'Absteige',5,9),
(3, 'Consult & Pepper', 6,9);
INSERT INTO pointofdelivery(customer_person_fk, contact_person_fk, location_fk, designation, timezone, timeZonePositiv, ntpServerIp)
VALUES
(2,2,1,'Auenland','10:00:00',1, '1.1.1.10'),
(1,1,3, 'Consult & Pepper Trogen', '01:00:00', 1 , '178.198.222.68'),
(3,4,2,'ZbW', '01:00:00', 1 , '192.168.1.1');
INSERT INTO Network (network_id, subnet, mask, vlan, description)
VALUES
(1,'10.36.0.0','255.255.0.0',1,'Kunde xy'),
(2,'10.8.0.0','255.255.0.0',1,''),
(3,'172.129.0.0','255.255.255.0',1,'Test'),
(4,'192.168.1.0','255.255.255.0',1,'Labor'),
(5,'192.168.128.0','255.255.255.127',1,'Integration');
INSERT INTO DevicesTypes(manifacture, model, version)
VALUES
('Cisco','Router',''),
('Avaya','PBX',''),
('Nortel','PBX',''),
('Siemens','Telephon',''),
('Cisco','FireWall','');
INSERT INTO Devices (location_fk, deviceTypes_fk, inventoryDate, deactivateDate, hostname, domain, description)
VALUES
(1,1,'2018-12-31','2019-12-31','CiscoR1','ch.zbw','Keller'),
(1,1,'2007-10-29','2008-10-29','CSTA003','ch.zbw','OG6'),
(2,1,'2018-12-10','2018-02-12','TelCo099','ch.aruper','RZ'),
(3,1,'2018-06-06','2019-02-12','CiscoR006','ch.scs','Keller'),
(1,1,'2018-02-01','2020-12-02','Cisco-PRT-032','ch.zbw','Kantine');
INSERT INTO Interfaces (interface_id, network_id_fk, devices_id_fk, ip_adress_v4, isFullDuplex, bandwith, description)
VALUES
(1,3,1,'172.129.1.5',1,10000,''),
(2,3,4,'172.129.1.6',1,10000,''),
(3,1,5,'10.36.0.253',1,10000,''),
(4,5,4,'192.168.128.192',1,10000,''),
(5,3,3,'172.129.5.9',1,100,'');
INSERT INTO operatingsystem (operatingsystem_id, operatingsystemName, model, version)
VALUES
(1,'CISCO IO','Cisco','9.5'),
(2,'AVAYALX','Linux','19.4.0.1'),
(3,'Unify','Debian','9.2'),
(4,'NOOS','RH','0.2.8'),
(5,'Linux','RedHead','17.3');
INSERT INTO DevicesTypes_has_operatingsystem (deviceTypes_fk, operatingsystem_fk)
VALUES
(1,1),
(2,2),
(3,4),
(4,3),
(5,1);
INSERT INTO Log (logMessage, timestamp, level, device_fk)
VALUES
('Loged In',now(),'Low',1),
('Loged Out',now(),'Low',1),
('Loged In',now(),'Low',2),
('Virus detected',now(),'High',3)
;
INSERT INTO Abrechnung (kundenkonto_fk, location_fk, device_fk, interface_fk)
VALUES
(1,1,1,1),
(1,1,1,1);
INSERT INTO SoftwareDienstleistung (stundenaufwand, abrechung_fk)
VALUES
(240,1);
INSERT INTO Produktegruppe (hardware, software, sonstigeArtikel, abrechung_fk)
VALUES
('Hardware','PP','ss',1),
('Hardware','PP','ss',1),
('HH','Software','ss',2),
('HH','SS','sonstigeArtikel',1);
INSERT INTO Produkte (artikelname, preis, produktegruppe_fk)
VALUES
('Laptop',50, 1),
('Bildschirm',150, 1),
('AdobeReader',20, 1),
('Bürostuhl',10, 1);
INSERT INTO Credentials (credentials_id, benutzername,passwort,snmp)
VALUES
(1,'Larissa','1111','snmp1'),
(2,'Patrick','1111','snmp2'),
(3,'Francesco','1111','snmp3'),
(4,'Ronny','1111','snmp4');
INSERT INTO Devices_has_Credentials (Devices_devices_id, credentials_credentials_id)
VALUES
(1,1),
(2,2),
(3,4),
(4,3);

BIN
MySQL/erm.mwb Normal file

Binary file not shown.

BIN
Semesterarbeit_S2.pdf Normal file

Binary file not shown.