missing files for settings

This commit is contained in:
Norm MacLennan
2014-05-07 16:02:06 -07:00
parent bf7d2ed68d
commit c9803e3f68
5 changed files with 88 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
{
Redis: {
hostname: "127.0.0.1",
port: "6379",
timeout: "1000",
inputQueue: "input",
outputQueue: "output"
},
InputPlugins: [
{
Name: "Email",
Settings: {
Host: "imap.gmail.com",
Username: "something that's not a real email",
Password: "something that's not a real password",
Port: "993",
Folder: "INBOX",
IsSsl: "true",
Frequency: "10000",
ParseRules:[{
Name: "Nagios",
Enabled: "true",
From: "gwyrox@gmail.com",
Source: "Nagios",
System: "(?<=Host: ).*",
Service: "(?<=Service: ).*",
Data: "(?<=Additional Info:[\\n]*).*",
Runbook: "http://google.com",
Severity: "P3",
}]
}
}
]
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Dynamic;
namespace NOCQ
{
public class PluginSettings
{
public string Name {get;set;}
public dynamic Settings {get;set;}
}
}

View File

@@ -0,0 +1,14 @@
using System;
namespace NOCQ.Settings
{
public class RedisSettings
{
public string hostname {get;set;}
public string port {get;set;}
public string timeout{get;set;}
public string inputQueue{get;set;}
public string outputQueue{get;set;}
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Dynamic;
using System.Collections.Generic;
namespace NOCQ.Settings
{
public class SettingsFile
{
public RedisSettings Redis { get; set; }
public IEnumerable<PluginSettings> InputPlugins {get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using System;
namespace NOCQ.Settings
{
public class SettingsParser
{
public static SettingsFile Parse(string json){
return Newtonsoft.Json.JsonConvert.DeserializeObject<SettingsFile>(json);
}
}
}