Permalink
Browse files

Config examples: documentation!

  • Loading branch information...
NickCraver committed Jun 2, 2017
1 parent 38eb923 commit efac956a3ed898b79e698e63bf0b5e5cb1dc6635
View
@@ -100,5 +100,6 @@ $RECYCLE.BIN/
.hg
.hgignore
Opserver/config/*.json
!Opserver/config/*.example.json
Opserver/config/*.config
*.StackOverflow.*
@@ -32,14 +32,14 @@ public static MonitorStatus MonitorStatus
if (ExceptionsModule.Stores.Any(s => s.MonitorStatus == MonitorStatus.Critical))
return MonitorStatus.Critical;
if (settings.CriticalCount > 0 && total > settings.CriticalCount)
if (settings.CriticalCount.HasValue && total > settings.CriticalCount)
return MonitorStatus.Critical;
if (settings.CriticalRecentCount > 0 && recent > settings.CriticalRecentCount)
if (settings.CriticalRecentCount.HasValue && recent > settings.CriticalRecentCount)
return MonitorStatus.Critical;
if (settings.WarningCount > 0 && total > settings.WarningCount)
if (settings.WarningCount.HasValue && total > settings.WarningCount)
return MonitorStatus.Warning;
if (settings.WarningRecentCount > 0 && recent > settings.WarningRecentCount)
if (settings.WarningRecentCount.HasValue && recent > settings.WarningRecentCount)
return MonitorStatus.Warning;
return MonitorStatus.Good;
@@ -17,29 +17,29 @@ public class ExceptionsSettings : Settings<ExceptionsSettings>
public List<StackTraceSourceLinkPattern> StackTraceReplacements { get; set; } = new List<StackTraceSourceLinkPattern>();
/// <summary>
/// How many exceptions before the exceptions are highlighted as a warning in the header, 0 (default) is ignored
/// How many exceptions before the exceptions are highlighted as a warning in the header, null (default) is ignored
/// </summary>
public int WarningCount { get; set; }
public int? WarningCount { get; set; }
/// <summary>
/// How many exceptions before the exceptions are highlighted as critical in the header, 0 (default) is ignored
/// How many exceptions before the exceptions are highlighted as critical in the header, null (default) is ignored
/// </summary>
public int CriticalCount { get; set; }
public int? CriticalCount { get; set; }
/// <summary>
/// How many seconds a error is considered "recent"
/// </summary>
public int RecentSeconds { get; set; } = 600;
/// <summary>
/// How many recent exceptions before the exceptions are highlighted as a warning in the header, 0 (default) is ignored
/// How many recent exceptions before the exceptions are highlighted as a warning in the header, null (default) is ignored
/// </summary>
public int WarningRecentCount { get; set; }
public int? WarningRecentCount { get; set; }
/// <summary>
/// How many recent exceptions before the exceptions are highlighted as critical in the header, 0 (default) is ignored
/// How many recent exceptions before the exceptions are highlighted as critical in the header, null (default) is ignored
/// </summary>
public int CriticalRecentCount { get; set; }
public int? CriticalRecentCount { get; set; }
/// <summary>
/// Default maximum timeout in milliseconds before giving up on an sources
@@ -100,7 +100,7 @@ public class StackTraceSourceLinkPattern : ISettingsCollectionItem
/// <summary>
/// A replacement pattern for rendering links from a <see cref="Pattern"/> match.
/// matches via <see cref="System.Text.RegularExpressions.Regex.Replace(string, string, string)"/>.
/// matches via <see cref="Regex.Replace(string, string, string)"/>.
/// </summary>
public string Replacement { get; set; }
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace StackExchange.Opserver
{
@@ -7,7 +7,6 @@ public class PagerDutySettings : Settings<PagerDutySettings>
public override bool Enabled => APIKey.HasValue();
public string APIKey { get; set; }
public string APIBaseUrl { get; set; }
public List<EmailMapping> UserNameMap { get; set; } = new List<EmailMapping>();
public int OnCallToShow { get; set; } = 2;
@@ -58,7 +58,6 @@ public class Instance : ISettingsCollectionItem
/// Regular expressions collection to crawl keys against, to break out Redis DB usage
/// </summary>
public Dictionary<string, string> AnalysisRegexes { get; set; } = new Dictionary<string, string>();
}
}
}
@@ -1,7 +1,10 @@
{
"email": "<Email>",
"apiKey": "<API key>",
/* Configuration for the Cloudflare dashboard */
{
"email": "<Email>", // The login email for the Cloudflare API
"apiKey": "<API key>", // The API key for the Cloudflare API
// The origin data centers
"datacenters": [
// name: The name of the data center to use in the UI
// ranges: The outside ranges of *your* network, these are matches against CloudFlare's A records,
// to indicate where traffic is pointed to in the dashboard.
// maskedRanges: The same function as ranges, but with the first 3 octets masked in the dashboard.
@@ -0,0 +1,60 @@
/* Configuration for the main dashboard */
{
/* Which provider to use for dashboard data
Multiple providers can be used...but things may get crazy when a node is monitored by more than 1 */
"providers": {
/* If using bosun, an API and a key (in recent bosun versions) needs to be provided */
"bosun": {
"host": "https://bosun.ds.stackexchange.com",
"apiKey": "IAmALittleApiKeyShortAndStout"
}
/* If using WMI, a list of nodes to monitor needs to be provided */
//"wmi": {
// "nodes": [ "ny-web01" ], // List of nodes to monitor
// "staticDataTimeoutSeconds": 300, // (Optional) How long to cache static data (node name, hardware, etc.) - defaults to 5 minutes
// "dynamicDataTimeoutSeconds": 5, // (Optional) How long to cache dynamic data (utilizations, etc.) - defaults to 30 seconds
// "historyHours": 2 // (Optional) How long to retain data (in memory) - defaults to 24 hours
//}
/* If using Orion, a host (for links, not API) and a connection string needs to be provided */
//"orion": {
// "host": "orion.ds.stackexchange.com",
// "connectionString": "Data Source=ny-utilsql01;Initial Catalog=SolarWindsOrion;Integrated Security=SSPI;Timeout=10"
//}
},
/* General dashboard UI settings */
"excludePattern": "redis|\\.com", // (Optioal) Regex node name pattern to exclude from the dashboard
"cpuWarningPercent": 50, // How much CPU usage before a node is treated as a warning
"cpuCriticalPercent": 60, // How much CPU usage before a node is treated as critical
"memoryWarningPercent": 90, // How much memory usage before a node is treated as a warning
"memoryCriticalPercent": 95, // How much memory usage before a node is treated as critical
"diskWarningPercent": 85, // How much disk usage before a node is treated as a warning
"diskCriticalPercent": 95, // How much disk usage before a node is treated as critical
// "showVolumePerformance": true, // Whether to show volume performance (columns) on the dashboard - defaults to false
/* (Optional) Specific category settings,for grouping servers and setting specific thresholds on them */
"categories": [
{
"name": "Database Servers", // Name for this group of servers
"pattern": "-sql", // Regex pattern of server names to put in this group
"cpuWarningPercent": 20, // How much CPU usage before a node is treated as a warning (defaults to the setting above if not specified)
"cpuCriticalPercent": 60, // How much CPU usage before a node is treated as critical (defaults to the setting above if not specified)
"memoryWarningPercent": 98, // How much memory usage before a node is treated as a warning (defaults to the setting above if not specified)
"memoryCriticalPercent": 99.2, // How much memory usage before a node is treated as critical (defaults to the setting above if not specified)
"primaryInterfacePattern": "-TEAM$" // (If the provider supports it) Regex pattern of interface names to treat as "primary" (shown in the dashboard aggregates)
},
{
"name": "Web Servers",
"pattern": "-web|-promoweb|-vmweb",
"cpuWarningPercent": 25,
"memoryWarningPercent": 75,
"primaryInterfacePattern": "-TEAM$|-TEAM · Local"
}
],
/* Like categories, per-node overrides for any of the settings above - illustrating 1 setting but all work */
"perNodeSettings": [
{
"pattern": "EDGE\\d+ \\(INAP\\)", // Regex pattern to match against
"primaryInterfacePattern": "GigabitEthernet0/0/0" // Example setting - any of the above (e.g. warning/critical thresoholds) work
}
]
}

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,36 @@
/* Configuration for the Elastic dashboard */
{
// Which security groups can view the dashboard ("*" for everyone)
// "viewGroups": "*",
// Which security groups have permissions to perform actions (removing a server from rotation, etc.)
// "adminGroups": "SysAdmins",
/* The clusters to monitor */
"clusters": [
{
"name": "NY Production", // Name of the cluster (used in the UI before fetching of info is complete)
"refreshIntervalSeconds": 10, // (Optional) How often to poll the cluster - defaults to 120 seconds
// Nodes in this cluster, use "node:port" if not using :9200 for elastic
"nodes": [
"ny-search01",
"ny-search02",
"ny-search03"
]
},
{
"name": "NY Development",
"refreshIntervalSeconds": 20,
"nodes": [
"ny-devsearch01",
"ny-devsearch02"
]
},
{
"name": "NY Dev Logstash",
"refreshIntervalSeconds": 20,
"nodes": [
"ny-devlogstash01",
"ny-devlogstash02"
]
}
]
}

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit efac956

Please sign in to comment.