missing files for settings
This commit is contained in:
37
src/NOCQ.Application/settings.json
Normal file
37
src/NOCQ.Application/settings.json
Normal 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",
|
||||||
|
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
12
src/NOCQ/Settings/PluginSettings.cs
Normal file
12
src/NOCQ/Settings/PluginSettings.cs
Normal 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;}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
14
src/NOCQ/Settings/RedisSettings.cs
Normal file
14
src/NOCQ/Settings/RedisSettings.cs
Normal 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;}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
13
src/NOCQ/Settings/SettingsFIle.cs
Normal file
13
src/NOCQ/Settings/SettingsFIle.cs
Normal 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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
12
src/NOCQ/Settings/SettingsParser.cs
Normal file
12
src/NOCQ/Settings/SettingsParser.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user