Summary:
This context provides instructions on how to build, monitor, and troubleshoot Opserver, an open-source monitoring software based on ASP.NET, developed by Stack Exchange.
Abstract
The given context discusses Opserver, a monitoring software used by Stack Exchange to oversee their components. This software is capable of monitoring web servers, Redis servers, SQL servers, and ElasticSearch servers. The article offers instructions on building Opserver, monitoring web servers and MS SQL, setting up dashboard infrastructure information, and monitoring Redis and ElasticSearch servers. Additionally, it provides troubleshooting tips for security settings and SQL instance errors. The article also outlines how to retrieve certain information from SQL Server Management Studio (SSMS), redis-cli, and Opserver's Elastic page. The author, Sean, who works as a software engineer, shares this as part of his notes and invites feedback.
Opinions
Opserver is a useful tool for monitoring various components of a system, including web servers, Redis servers, SQL servers, and ElasticSearch servers.
The article provides detailed steps for setting up and monitoring Opserver, making it a valuable resource for anyone looking to use this tool.
The troubleshooting tips are helpful for resolving issues that may arise during setup or use of Opserver.
The ability to retrieve information from various sources (SSMS, redis-cli, Elastic page) makes Opserver a versatile tool for system monitoring.
The author, Sean, encourages feedback and improvement, indicating a commitment to continuous learning and development.
The article assumes a certain level of technical knowledge, particularly in ASP.NET and SQL Server Management Studio.
The context is written in a professional and detailed manner, with clear instructions and explanations.
[DevOps]Introduction to Opserver
Copy right@A Layman
Introduction
Opserver is a monitoring software based on ASP .NET. It’s an open source project by the team at Stack Exchange, home of Stack Overflow. The team use Opserver to monitor their components.
Let ‘s have a look and see the stack of Stack Exchange. It uses web servers, Redis servers, SQL servers, and ElasticSearch severs. So Opserver has abilities to monitor these components.
Generate SecuritySettings.config in the Config folder. You can edit from SecuritySettings.config.example. You have 2 options:
1.Set security settings provider to default:
First, edit SecuritySettings.config.
Then build the solution and start the Opserver
Copy right@A Layman
You will see the homepage.
Copy right@A Layman
2.Set security settings provider to admin:
Edit SecuritySettings.config.
Then build the solution and start the Opserver. You can log in to the Opserver by using username admin.
Monitor web server and MS SQL
Generate SQLSettings.config in the Config folder. You can edit from SQLSettings.example.config.
defaultConnectionString is required. You don’t have to modify anything.
clusters is optional. You can modify the name of nodes.
instances is optional. You can just give name or you can give connectionString.
For single instance:
Then build the solution and start the Opserver.
Trouble shooting
Maybe you will get this message: ‘Unable to fetch from SQL: Error opening connection to …”
Copy right@A Layman
Solution
Open the SQL Server Configuration Manager on the target machine. You can find it from Start->All programs-> Microsoft SQL Server 2008->Configutation Tools-> SQL Server Configuration Manager
Enable TCP/IP. Right click on TCP/IP and choose enable.
Copy right@A Layman
SQL instance page
Copy right@A Layman
In the Summary block, we can get the server’s name, version, edition, database, and job information…etc.
We can open SQL Server Management Studio (SSMS) and right click on the database, select Property. Then we can retrieve some of these information.
Copy right@A Layman
In the Stats block, we can get CPU utilization, memory utilization, workers, session, and connections.
We can open SQL Server Management Studio (SSMS) and use the following SQL query to get the worker information.
select (select max_workers_count from sys.dm_os_sys_info) as'TotalThreads',sum(active_Workers_count) as'Currentthreads',(select max_workers_count from sys.dm_os_sys_info)-sum(active_Workers_count) as'Availablethreads',sum(runnable_tasks_count) as'WorkersWaitingfor_cpu',sum(work_queue_count) as'Request_Waiting_for_threads'
from sys.dm_os_Schedulers where status='VISIBLE ONLINE'
Copy right@A Layman
And the following query to get the session information.
sp_who2
Copy right@A Layman
Right click on the database, select Activity Monitor. Then we can retrieve I/O wait time from Resource waits.
Copy right@A Layman
Connections page
Copy right@A Layman
In connections page, we can get all connections of the database.
In SQL Server Management Studio (SSMS) and right click on the database, select Report->Standard Report->Activity — All Sessions. We can also get the same information.
Copy right@A Layman
Dashboard — Infrastructure information (WMI)
Opserver can explore more information for us by manipulating the Windows Management Instrumentation (WMI) in the machine.
Generate DashboardSettings.config in the Config folder. You can edit from DashboardSettings.example.config.
Add the name in the nodes of WMI.
Then build the solution and start the Opserver.
In the Dashboard page, we can get the information about CPU utilization, memory utilization, network interfaces, and Windows services information.
Copy right@A Layman
Warning thresholds
You can set thresholds for machines from DashboardSettings.config.
Monitor Redis server
Generate RedisSettings.config in the Config folder. You can edit from RedisSettings.example.config. For single node:
Then build the solution and start the Opserver.
Copy right@A Layman
In the Redis page, we can get the information about:
- Redis replication: is master or slave? how any slaves?
- Memory
- Persistence: is AOF mode enable?
- Keyspace: how many keys in the Redis?
- Clients: how many clients connect to Redis?
redis-cli is a native command. We can retrieve some important information and health condition from redis-cli:
redis-cli
info client
Copy right@A Layman
- Server: the information of redis server
- Clients: the connection information of client side
- Memory: the use condition of memory
- Persistence: RDB and AOF information
- Stats: common statistics information
- Replication: Master/Slave information
- CPU: CPU usage
- Cluster: redis cluster information
- Keyspace
You can get the same information from View INFO as using redis-cli (Exclude cluster, and keyspace):
Copy right@A Layman
Monitor ElasticSearch
Generate ElasticSettings.config in the Config folder. You can edit from ElasticSettings.example.config. For single node:
Then build the solution and start the Opserver.
In the Elastic page, we can get the information about ElasticSearch nodes and index.
Copy right@A Layman
Summary
Thanks for your patient. I am Sean. I work as a software engineer.
This article is my note. Please feel free to give me advice if any mistakes. I am looking forward to your feedback.
If you have create a monitoring service and you have encountered some problems when you do the web deployment, you can see my next article.
Please feel free to clap if this article can help you. Thank you.