Getting Started
Start server monitoring simply with Servwatch!
This section describes the procedure for adding a monitored server to Servwatch, viewing metric values, and receiving alert notifications.
Screen samples may differ slightly due to updates. Please refer to the text for the general operation.
Plans
Servwatch offers a free plan for developers and a monthly subscription Pro plan.
The free plan is available for individual developers. For business use, please purchase a Pro subscription.
Plans | Servers | Metrics storage | Business Use |
|---|---|---|---|
Developer Plan | Up to 3 servers | Minimum storage | NO |
Pro Plan | Up to 40 servers | Upgrade storage | OK |
Glossary
Servwatch uses the following terms:
Device: Represents a monitored server. Servwatch recognizes the server host name as the device ID.Agent: An agent program that runs on the monitored server. Communicates with the Servwatch cloud using the MQTT protocol.Metrics: A metric values (such as CPU load and service status) sent from the server via the agent.Event: A function that sets a threshold for metrics and notifies alerts. You can set an event for all the metric values that Servwatch collects.
1. Go to Console
Log in to the management console with the account information provided in your email when you sign up online.
Console here: Servwatch Console
The console simply summarizes the availability and alerts firing for your entire server.
Availability: If the agent status of a registered server is healthy, it will be 100%. If the agent is DOWN, the overall availability will decrease. By disabling an individual server, it will be excluded from the availability calculation.
Metrics Store: Indicates the storage capacity for storing metrics. If this storage capacity approaches 100%, old data will be deleted, so it will always remain close to 100%.
Connected: Heartbeat status between agent and servwatch. This is a persistent session via MQTT, which detects agent down and up without any time lag. The ratio of currently connected servers to registered servers is displayed.
Alerts: A predefined event firing state. The event is associated with a metric and notifies you via email or Slack.
2. Create a new device
Servwatch manages the server as a "device".
From the console, click "Server"-> "Add new" to go to the creation page.
Follow the steps in "Automatic registration (usually select this)" to deploy the agent.
Check your server must support systemctl before installing the agent. Follow the agent procedure for details. Please refer:Deploy Server Agent
Execute the script string with root privileges on the terminal of the monitored server. The host name is set automatically, but if you want to set it manually, change the red part and execute.
When setting the host name automatically (normally select this)
sudo curl -fsSL https://m.servwatch.net/agent/setup_servwatch_agent.sh | SERVWATCH_USERID='****' SERVWATCH_DEVICETOKEN='****' shWhen manually setting the host name
sudo curl -fsSL https://m.servwatch.net/agent/setup_servwatch_agent.sh | SERVWATCH_USERID='****' SERVWATCH_DEVICEID='<SET_YOUR_HOSTNAME>' SERVWATCH_DEVICETOKEN='****' sh
Do not include symbols such as. * ~ / In the host name.
You can check if the agent is installed correctly with the following command:
journalctl -u servwatch -fFinally, return to the server management page and wait for a minute, the agent status is
OKorUP, it is registered normally.After about 3 minute, the metric values will be stored in the metrics store.
3. Check metrics
Click "Metrics" from the console to go to the metrics page, you can check the metrics.
Metrics: Select the server you want to check.Range: Specify any time.Reset: Resets the display range. (1hour / 6hour / 12hour / 1day)
The types of metrics are as follows:
CPU Load(sys+user% / idle%)
Memory (used/total bytes)
Disk usage(used%)
Network I/O(tx/rx bytes per sec)
4. Add an event(alert)
Now you can add the monitored server to Servwatch and collect the metrics.
Create an event to set a threshold on the metric value and notify you of an alert.
Click "Event->"Create" from the console to go to the event creation page.
Click the "Create" button when the settings are complete.
Set the following:
Configuration
Description: Set the name of the event (eg sshd is down !!). This setting is embedded in the body of the email notification.Metric: Specify the target server you want to monitor.Enabled: Set to true. If the event is disabled, the notification operation will not be performed.
Condition
Metrics: Enter the metrics for the monitored item. You can also select and enter from the auto-completed list.The metrics can be specified as follows.
cpu:*CPU related metricsmem:*Memory related metricsdisk:*Disk related metricsnetwork:*Network related metricsservice:*Service(Process) check metrics
IF:Specifies a conditional expression that contains a threshold for the metric.THEN:Specify the action when the conditional expression is satisfied.
Notification email address setting
From the console, click the "Settings" navigation to go to the admin page.
Set the notification destination email address in
Alert notification destination 1. Optionally, you can add additional address inAlert notification destination 2Set the notification destination Slack’s incoming webhook URL in
Slack webhook URL.For configuration slack webhook, refer this document: https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks/
Click "Save" to complete the settings.
Sample slack notification are below:
Sample event notification
5. Enable dead notification
After completing all the steps, start the server alive monitoring by enabling the monitoring of the agent (Servwatch agent) running on the server.
Once you have enabled agent monitoring, you do not have to do it every time you add a server.
Go to the "Settings" from the navigation on the console.
Check “Others”-> “Agent settings” →
Dead Notificationis true.Click "Save" to complete the settings.
If the Keepalive communication between the agent and Servwatch is disconnected, the email address set in step 4 will be notified.
Dead notification is enabled by default. Alert notifications may occur even when the server has not been restarted due to a network path problem. In that case, set Dead notification to disabled.
Agent monitoring notifications will be sent to email and Slack (if configured).
Follow these steps to test the dead notification:
In target server, type
systemctl stop servwatchto stop agent.To start agent, type
systemctl start servwatchCheck notify.(eg. Slack)
Agent dead notification(Slack)
6. Add a processs monitoring
To add a service monitor, add the monitored service to the agent settings file on the monitored server and restart the agent.
Navigate to the location of the configuration file.
cd /opt/servwatch-agent/config
Edit configuration file
vim default.json
Add the service name (example: httpd) you want to monitor in the following places.
{ "device_id":"hostname", "user_id":"U000***", "device_token":"************************", "watch_service": "httpd,postfix", // List the services you want to monitor, separated by commas. "iface": "enp1s0", "mount": "/" }
Restarting the agent
systemctl restart servwatch
2. The metric "service: <service name>" is now available in the condition settings when creating the event. The event threshold can be set as OK for operational and NG for critical state.
Click "Event->"Create" from the console to go to the event creation page.
Click the "Create" button when the settings are complete. Below is an example of adding a httpd service monitor as
service:httpd.Description: The name of the event. This will be noticeable in the Slack notification, so be thoughtful.Metrics: Specify the service name you configured in the previous step. In this case,set asservice:httpdIF: Specify the conditions under which the alert will fire. Specify NG when the process is down, and OK when it is up.THEN: Specify the notification destination for the alert.email: Sent to your email
slack: Sent to Slack
both: Sent to email and Slack
Create “httpd DOWN” event whenservice:httpdis DOWN
Sample slack alert is below:
7. Using the API
Servwatch provides a REST API to make your tasks more efficient.
By operating the API, it is possible to set the bulk of the server and import the metric value into the original system.
Please refer to the following for specific usage.
© 2014-2022 SENSINICS,LLC