Linux Service Status Monitoring

Server Scout's service status monitoring helps you keep track of critical services running on your Linux servers. This feature automatically checks the status of essential services and alerts you when they go down, ensuring you can respond quickly to service failures.

Enabling Services Monitoring

The services metric is enabled by default when you install the Server Scout agent. If you need to enable it manually, edit your Server Scout configuration file:

sudo nano /opt/scout-agent/agent.env.yml

Ensure the services section is configured:

metrics:
  services:
    enabled: true

After making changes, restart the Server Scout agent:

sudo systemctl restart serverscout

Default Services Monitored

Server Scout monitors 16 common services by default, automatically detecting which ones are present on your system:

  1. sshd - SSH daemon for remote access
  2. nginx - Nginx web server
  3. httpd - Apache HTTP Server (CentOS/RHEL)
  4. apache2 - Apache HTTP Server (Debian/Ubuntu)
  5. mysql - MySQL database server
  6. mariadb - MariaDB database server
  7. postgresql - PostgreSQL database server
  8. postfix - Postfix mail transfer agent
  9. exim - Exim mail transfer agent
  10. dovecot - Dovecot IMAP/POP3 server
  11. named - BIND DNS server
  12. docker - Docker container platform
  13. fail2ban - Intrusion prevention system
  14. redis - Redis in-memory data store
  15. memcached - Memcached caching system
  16. php-fpm - PHP FastCGI Process Manager

The agent uses systemctl is-active to check each service's status, providing real-time information about whether services are running, stopped, or failed.

Viewing Service Status

Service status information appears prominently on your server's detail page in the Server Scout dashboard. You'll see:

  • Service name and current status (Active, Inactive, Failed)
  • Status indicators with colour-coded badges for quick identification
  • Historical data showing service uptime and downtime patterns
  • Last check timestamp to confirm monitoring is current

Services are grouped logically, making it easy to quickly assess the health of web servers, databases, mail services, and other critical components.

Setting Up Service Alerts

To receive notifications when critical services fail:

  1. Navigate to your server's settings page in the Server Scout dashboard
  2. Click on "Alert Rules" or "Notifications"
  3. Create a new alert rule with these parameters:

- Metric: Services - Condition: Service status equals "failed" or "inactive" - Duration: How long the service must be down before alerting (e.g., 2 minutes) - Services: Select specific services or choose "all monitored services"

  1. Configure notification methods (email, Slack, webhook, etc.)
  2. Save the alert rule

You can create different alert rules for different service categories. For example, set immediate alerts for critical services like SSH or your web server, whilst allowing longer grace periods for less critical services.

Non-systemd Systems

For servers without systemd, Server Scout gracefully falls back to alternative methods:

  • SysV init systems: Uses service status commands
  • Process-based checking: Looks for running processes when service commands aren't available
  • Custom scripts: Supports custom health check scripts for specific services

The agent automatically detects your system's init system and adapts accordingly, ensuring service monitoring works across different Linux distributions and configurations.

Best Practices

  • Regular monitoring: Check your service status dashboard regularly to spot patterns
  • Test alerts: Temporarily stop a non-critical service to verify your alerts work
  • Customise monitoring: Add custom services specific to your applications
  • Document dependencies: Note which services depend on others for faster troubleshooting

Service status monitoring in Server Scout provides essential visibility into your server's health, helping you maintain uptime and respond quickly to issues before they impact your users.

Frequently Asked Questions

How do I enable service monitoring in ServerScout?

Service monitoring is enabled by default when you install the ServerScout agent. If you need to enable it manually, edit /opt/scout-agent/agent.env.yml and ensure the services section shows 'enabled: true' under metrics. Then restart the agent with 'sudo systemctl restart serverscout'.

What services does ServerScout monitor by default?

ServerScout monitors 16 common services including sshd, nginx, apache2/httpd, mysql, mariadb, postgresql, postfix, exim, dovecot, named, docker, fail2ban, redis, memcached, and php-fpm. The agent automatically detects which services are present on your system and monitors only those that exist.

How does ServerScout check service status on Linux?

ServerScout uses 'systemctl is-active' to check each service's status on systemd systems. For non-systemd systems, it falls back to 'service status' commands, process-based checking, or custom health check scripts. The agent automatically detects your init system and adapts accordingly.

How do I set up alerts for failed services?

Navigate to your server's settings page, click on 'Alert Rules', and create a new rule with Metric set to Services and Condition set to 'failed' or 'inactive'. Configure the duration threshold, select specific services or all monitored services, choose notification methods, and save the rule.

Does ServerScout work on non-systemd Linux systems?

Yes, ServerScout works on non-systemd systems by gracefully falling back to alternative methods. It uses SysV init 'service status' commands, process-based checking when service commands aren't available, and supports custom health check scripts for specific services.

Where can I view service status in ServerScout?

Service status information appears on your server's detail page in the ServerScout dashboard. You'll see service names with current status, colour-coded badges, historical uptime/downtime data, and last check timestamps. Services are grouped logically by category for easy assessment.

Can I monitor custom services with ServerScout?

The article mentions that ServerScout supports custom health check scripts for specific services and recommends adding custom services specific to your applications as a best practice. However, the specific configuration steps for custom services are not detailed in this article.

Was this article helpful?