Setting Up Basic Monitoring Scenarios

SAYMON platform allows for monitoring using various types of checks, which can be configured via the system web interface.

Monitoring Basic PC Parameters

To monitor the basic parameters of a server or computer (CPU, File System, Memory, and Network IO), follow these steps:

  1. Install the agent on the monitored computer or server.

  2. In the web interface, create an object, such as of the "Host" class.

  3. Open the created object and add the following components to it:

    • Saymon Agent,

    • CPU,

    • File System,

    • Memory,

    • Network IO.

  4. Configure and start the agent.

After some time, information on the basic parameters of the computer will be sent to the server and displayed in the system web interface.

Monitoring Memory Processes

To set up memory process monitoring, follow these steps:

  1. Install, configure, and start the agent on the monitored computer or server.

  2. In the web interface, create an object of the "Process" class.

  3. Open the created object, go to the "Monitoring" section, and perform the following actions:

    • Select the agent installed on the computer;

    • Choose the "Process by name" check;

    • Fill in the required fields.

After some time, information about the monitored process will be sent to the server and displayed in the system web interface.

Monitoring File and Folder Changes

To set up monitoring for changes in files and folders on a server or PC, follow these steps:

  1. Install, configure, and start the agent on the monitored computer or server.

  2. In the web interface, create an object of the "Configuration File" class.

  3. Open the created object, go to the "Monitoring" section, and perform the following actions:

    • Select the agent that you installed on this computer;

    • Choose the "Configuration File/Directory" check;

    • Specify the path to the monitored file/directory.

After some time, information about the monitored file or directory will be sent to the server and displayed in the system web interface.

Checking Web Resource Availability

This type of monitoring verifies not only that the website is operational (200 OK status) but also that access restrictions are in place for sensitive resources such as the database administration panel. In this case, a status of "403 Forbidden" or "404 Not Found" would indicate that the system configuration is correct, while any other status might signal a potential security threat.

To check the availability and response time of a web resource, follow these steps:

  1. Install, configure, and start the agent on the monitored computer or server.

  2. In the web interface of the "Address" class.

  3. Open the created object and in the "Monitoring" section:

    • Select the agent that will perform the check;

    • Choose the "HTTP request" check;

    • Select the "GET" request type;

    • In the "URL" field, specify the address of the website.

After some time, information about the availability and response speed of the monitored resource will be sent to the server and displayed in the system web interface.

Agentless Monitoring of a Web Server

If you cannot install an agent on the server, it is recommended to write a script that will be executed at specified intervals on the server. It should collect the necessary data, and generate a text file with the results in JSON format accessible via a link.

To monitor the parameters of a web server where an agent cannot be installed, you need to:

  1. Write a local script to prepare the data (for example, in the downloads folder: …/downloads/scripts/webserver_stat.sh):

    #!/bin/bash
    # Collect parameters for the web server.
    # Memory usage
    memUsage=$(free -m | grep Mem | perl -pe 's/Mem:\s+\S+\s+(\S+).*/$1/')
    
    # Swap usage
    swapUsage=$(free -m | grep Swap | perl -pe 's/Swap:\s+\S+\s+(\S+).*/$1/')
    
    # CPU load
    cpuUsage=$(uptime | awk '{print $10}' | perl -pe 's/,//')
    
    # Check if a script is running, e.g., webserver_stat.sh
    scriptExec=$(ps -ef | grep webserver_stat.sh | grep -v grep | wc -l)
    
    # Write JSON response
    echo "{"memUsageMB":"$memUsage", "swapUsageMB":"$swapUsage", "cpuUsage
    ":"$cpuUsage", "scriptExec":"$scriptExec"}" > webserver_stat.json
  2. Add the script to the cron job scheduler.

  3. Install, configure, and start at least one agent in the infrastructure.

  4. In the web interface, create an object of the "Info" class.

  5. Open the created object and in the "Monitoring" section:

    • Select the agent that will perform the checks.

    • Choose the "HTTP Request" check.

    • Select the "GET" request.

    • In the "URL" field, specify the address of the JSON file.

After some time, information about the parameters of the web server will be sent to the server and displayed in the system web interface.