Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Server Monitor Laravel Package

spatie/laravel-server-monitor

Monitor the health of your servers from Laravel. Includes built-in checks (disk, memory, processes, etc.), easy custom checks, and notifications via Slack or email when something goes wrong.

View on GitHub
Deep Wiki
Context7

title: Manipulating processes weight: 4

Under the hood Symfony\Component\Process is used to connect to your server and performing the command from your check. You can manipulate this Process right before it is executed.

To do this you must create a class that implements Spatie\ServerMonitor\Manipulators\Manipulator. That interface has only a single method to implement:

public function manipulateProcess(Process $process, Check $check): Process;

Let's take a look at an example implementation. In the code below we're going to change the command and up the timeout if the check is being performed on a certain host.

namespace App\ServerMonitor\Manipulators;

use Spatie\ServerMonitor\Models\Check;
use Symfony\Component\Process\Process;

class MyManipulator implements Manipulator
{
    public function manipulateProcess(Process $process, Check $check): Process
    {
        if ($check->host->name = 'my-host') {
            $manipulatedCommand = "{$process->getCommandLine()} appending extra options";
            
            $process->setCommandLine($manipulatedCommand);
            
            $process->setTimeout(60);
        }
        
        return $process;
    }
}

After creating the class you must specify it's fully qualified name in the process_manipulator key of the server-monitor config file.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai